@@ -108,7 +108,7 @@ |
||
| 108 | 108 | || ($token->type === Token::TYPE_COMMENT) |
| 109 | 109 | ) { |
| 110 | 110 | $lastRaw .= $token->token; |
| 111 | - $lastValue = trim($lastValue) .' '; |
|
| 111 | + $lastValue = trim($lastValue) . ' '; |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ':=' => 8, |
| 108 | 108 | |
| 109 | 109 | // @see Token::FLAG_OPERATOR_SQL |
| 110 | - '(' => 16, ')' => 16, '.' => 16, ',' => 16, ';' => 16, |
|
| 110 | + '(' => 16, ')' => 16, '.' => 16, ',' => 16, ';' => 16, |
|
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -125,67 +125,67 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | // Compatibility mode for Microsoft's SQL server. |
| 127 | 127 | // This is the equivalent of ANSI_QUOTES. |
| 128 | - const COMPAT_MYSQL = 2; |
|
| 128 | + const COMPAT_MYSQL = 2; |
|
| 129 | 129 | |
| 130 | 130 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_allow_invalid_dates |
| 131 | - const ALLOW_INVALID_DATES = 1; |
|
| 131 | + const ALLOW_INVALID_DATES = 1; |
|
| 132 | 132 | |
| 133 | 133 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ansi_quotes |
| 134 | - const ANSI_QUOTES = 2; |
|
| 134 | + const ANSI_QUOTES = 2; |
|
| 135 | 135 | |
| 136 | 136 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_error_for_division_by_zero |
| 137 | - const ERROR_FOR_DIVISION_BY_ZERO = 4; |
|
| 137 | + const ERROR_FOR_DIVISION_BY_ZERO = 4; |
|
| 138 | 138 | |
| 139 | 139 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_high_not_precedence |
| 140 | - const HIGH_NOT_PRECEDENCE = 8; |
|
| 140 | + const HIGH_NOT_PRECEDENCE = 8; |
|
| 141 | 141 | |
| 142 | 142 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ignore_space |
| 143 | - const IGNORE_SPACE = 16; |
|
| 143 | + const IGNORE_SPACE = 16; |
|
| 144 | 144 | |
| 145 | 145 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_create_user |
| 146 | - const NO_AUTO_CREATE_USER = 32; |
|
| 146 | + const NO_AUTO_CREATE_USER = 32; |
|
| 147 | 147 | |
| 148 | 148 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_value_on_zero |
| 149 | - const NO_AUTO_VALUE_ON_ZERO = 64; |
|
| 149 | + const NO_AUTO_VALUE_ON_ZERO = 64; |
|
| 150 | 150 | |
| 151 | 151 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_backslash_escapes |
| 152 | - const NO_BACKSLASH_ESCAPES = 128; |
|
| 152 | + const NO_BACKSLASH_ESCAPES = 128; |
|
| 153 | 153 | |
| 154 | 154 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create |
| 155 | - const NO_DIR_IN_CREATE = 256; |
|
| 155 | + const NO_DIR_IN_CREATE = 256; |
|
| 156 | 156 | |
| 157 | 157 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create |
| 158 | - const NO_ENGINE_SUBSTITUTION = 512; |
|
| 158 | + const NO_ENGINE_SUBSTITUTION = 512; |
|
| 159 | 159 | |
| 160 | 160 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_field_options |
| 161 | - const NO_FIELD_OPTIONS = 1024; |
|
| 161 | + const NO_FIELD_OPTIONS = 1024; |
|
| 162 | 162 | |
| 163 | 163 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_key_options |
| 164 | - const NO_KEY_OPTIONS = 2048; |
|
| 164 | + const NO_KEY_OPTIONS = 2048; |
|
| 165 | 165 | |
| 166 | 166 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_table_options |
| 167 | - const NO_TABLE_OPTIONS = 4096; |
|
| 167 | + const NO_TABLE_OPTIONS = 4096; |
|
| 168 | 168 | |
| 169 | 169 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_unsigned_subtraction |
| 170 | - const NO_UNSIGNED_SUBTRACTION = 8192; |
|
| 170 | + const NO_UNSIGNED_SUBTRACTION = 8192; |
|
| 171 | 171 | |
| 172 | 172 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_date |
| 173 | - const NO_ZERO_DATE = 16384; |
|
| 173 | + const NO_ZERO_DATE = 16384; |
|
| 174 | 174 | |
| 175 | 175 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_in_date |
| 176 | - const NO_ZERO_IN_DATE = 32768; |
|
| 176 | + const NO_ZERO_IN_DATE = 32768; |
|
| 177 | 177 | |
| 178 | 178 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by |
| 179 | - const ONLY_FULL_GROUP_BY = 65536; |
|
| 179 | + const ONLY_FULL_GROUP_BY = 65536; |
|
| 180 | 180 | |
| 181 | 181 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_pipes_as_concat |
| 182 | - const PIPES_AS_CONCAT = 131072; |
|
| 182 | + const PIPES_AS_CONCAT = 131072; |
|
| 183 | 183 | |
| 184 | 184 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_real_as_float |
| 185 | - const REAL_AS_FLOAT = 262144; |
|
| 185 | + const REAL_AS_FLOAT = 262144; |
|
| 186 | 186 | |
| 187 | 187 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_all_tables |
| 188 | - const STRICT_ALL_TABLES = 524288; |
|
| 188 | + const STRICT_ALL_TABLES = 524288; |
|
| 189 | 189 | |
| 190 | 190 | // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_trans_tables |
| 191 | 191 | const STRICT_TRANS_TABLES = 1048576; |
@@ -196,31 +196,31 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | |
| 198 | 198 | // REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE |
| 199 | - const SQL_MODE_ANSI = 393234; |
|
| 199 | + const SQL_MODE_ANSI = 393234; |
|
| 200 | 200 | |
| 201 | 201 | // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, |
| 202 | 202 | // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, |
| 203 | - const SQL_MODE_DB2 = 138258; |
|
| 203 | + const SQL_MODE_DB2 = 138258; |
|
| 204 | 204 | |
| 205 | 205 | // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, |
| 206 | 206 | // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER |
| 207 | - const SQL_MODE_MAXDB = 138290; |
|
| 207 | + const SQL_MODE_MAXDB = 138290; |
|
| 208 | 208 | |
| 209 | 209 | // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, |
| 210 | 210 | // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS |
| 211 | - const SQL_MODE_MSSQL = 138258; |
|
| 211 | + const SQL_MODE_MSSQL = 138258; |
|
| 212 | 212 | |
| 213 | 213 | // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, |
| 214 | 214 | // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER |
| 215 | - const SQL_MODE_ORACLE = 138290; |
|
| 215 | + const SQL_MODE_ORACLE = 138290; |
|
| 216 | 216 | |
| 217 | 217 | // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, |
| 218 | 218 | // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS |
| 219 | - const SQL_MODE_POSTGRESQL = 138258; |
|
| 219 | + const SQL_MODE_POSTGRESQL = 138258; |
|
| 220 | 220 | |
| 221 | 221 | // STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, |
| 222 | 222 | // ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER |
| 223 | - const SQL_MODE_TRADITIONAL = 1622052; |
|
| 223 | + const SQL_MODE_TRADITIONAL = 1622052; |
|
| 224 | 224 | |
| 225 | 225 | // ------------------------------------------------------------------------- |
| 226 | 226 | // Keyword. |
@@ -52,14 +52,14 @@ |
||
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | 54 | public static $CLAUSES = array( |
| 55 | - 'DELETE' => array('DELETE', 2), |
|
| 55 | + 'DELETE' => array('DELETE', 2), |
|
| 56 | 56 | // Used for options. |
| 57 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 58 | - 'FROM' => array('FROM', 3), |
|
| 59 | - 'PARTITION' => array('PARTITION', 3), |
|
| 60 | - 'WHERE' => array('WHERE', 3), |
|
| 61 | - 'ORDER BY' => array('ORDER BY', 3), |
|
| 62 | - 'LIMIT' => array('LIMIT', 3), |
|
| 57 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 58 | + 'FROM' => array('FROM', 3), |
|
| 59 | + 'PARTITION' => array('PARTITION', 3), |
|
| 60 | + 'WHERE' => array('WHERE', 3), |
|
| 61 | + 'ORDER BY' => array('ORDER BY', 3), |
|
| 62 | + 'LIMIT' => array('LIMIT', 3), |
|
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -54,11 +54,11 @@ |
||
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | 56 | public static $CLAUSES = array( |
| 57 | - 'DROP' => array('DROP', 2), |
|
| 57 | + 'DROP' => array('DROP', 2), |
|
| 58 | 58 | // Used for options. |
| 59 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 59 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 60 | 60 | // Used for select expressions. |
| 61 | - 'DROP_' => array('DROP', 1), |
|
| 61 | + 'DROP_' => array('DROP', 1), |
|
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -53,12 +53,12 @@ |
||
| 53 | 53 | * @var array |
| 54 | 54 | */ |
| 55 | 55 | public static $CLAUSES = array( |
| 56 | - 'REPLACE' => array('REPLACE', 2), |
|
| 56 | + 'REPLACE' => array('REPLACE', 2), |
|
| 57 | 57 | // Used for options. |
| 58 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 59 | - 'INTO' => array('FROM', 3), |
|
| 60 | - 'VALUES' => array('VALUES', 1), |
|
| 61 | - 'SET' => array('PARTITION', 3), |
|
| 58 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 59 | + 'INTO' => array('FROM', 3), |
|
| 60 | + 'VALUES' => array('VALUES', 1), |
|
| 61 | + 'SET' => array('PARTITION', 3), |
|
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -83,30 +83,30 @@ |
||
| 83 | 83 | * @var array |
| 84 | 84 | */ |
| 85 | 85 | public static $CLAUSES = array( |
| 86 | - 'SELECT' => array('SELECT', 2), |
|
| 86 | + 'SELECT' => array('SELECT', 2), |
|
| 87 | 87 | // Used for options. |
| 88 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 88 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 89 | 89 | // Used for selected expressions. |
| 90 | - '_SELECT' => array('SELECT', 1), |
|
| 91 | - 'FROM' => array('FROM', 3), |
|
| 92 | - 'PARTITION' => array('PARTITION', 3), |
|
| 93 | - |
|
| 94 | - 'JOIN' => array('JOIN', 1), |
|
| 95 | - 'FULL JOIN' => array('FULL JOIN', 1), |
|
| 96 | - 'INNER JOIN' => array('INNER JOIN', 1), |
|
| 97 | - 'LEFT JOIN' => array('LEFT JOIN', 1), |
|
| 98 | - 'LEFT OUTER JOIN' => array('LEFT OUTER JOIN', 1), |
|
| 99 | - 'RIGHT JOIN' => array('RIGHT JOIN', 1), |
|
| 100 | - 'RIGHT OUTER JOIN' => array('RIGHT OUTER JOIN', 1), |
|
| 101 | - |
|
| 102 | - 'WHERE' => array('WHERE', 3), |
|
| 103 | - 'GROUP BY' => array('GROUP BY', 3), |
|
| 104 | - 'HAVING' => array('HAVING', 3), |
|
| 105 | - 'ORDER BY' => array('ORDER BY', 3), |
|
| 106 | - 'LIMIT' => array('LIMIT', 3), |
|
| 107 | - 'PROCEDURE' => array('PROCEDURE', 3), |
|
| 108 | - 'INTO' => array('INTO', 3), |
|
| 109 | - 'UNION' => array('UNION', 1), |
|
| 90 | + '_SELECT' => array('SELECT', 1), |
|
| 91 | + 'FROM' => array('FROM', 3), |
|
| 92 | + 'PARTITION' => array('PARTITION', 3), |
|
| 93 | + |
|
| 94 | + 'JOIN' => array('JOIN', 1), |
|
| 95 | + 'FULL JOIN' => array('FULL JOIN', 1), |
|
| 96 | + 'INNER JOIN' => array('INNER JOIN', 1), |
|
| 97 | + 'LEFT JOIN' => array('LEFT JOIN', 1), |
|
| 98 | + 'LEFT OUTER JOIN' => array('LEFT OUTER JOIN', 1), |
|
| 99 | + 'RIGHT JOIN' => array('RIGHT JOIN', 1), |
|
| 100 | + 'RIGHT OUTER JOIN' => array('RIGHT OUTER JOIN', 1), |
|
| 101 | + |
|
| 102 | + 'WHERE' => array('WHERE', 3), |
|
| 103 | + 'GROUP BY' => array('GROUP BY', 3), |
|
| 104 | + 'HAVING' => array('HAVING', 3), |
|
| 105 | + 'ORDER BY' => array('ORDER BY', 3), |
|
| 106 | + 'LIMIT' => array('LIMIT', 3), |
|
| 107 | + 'PROCEDURE' => array('PROCEDURE', 3), |
|
| 108 | + 'INTO' => array('INTO', 3), |
|
| 109 | + 'UNION' => array('UNION', 1), |
|
| 110 | 110 | // These are available only when `UNION` is present. |
| 111 | 111 | // 'ORDER BY' => array('ORDER BY', 3), |
| 112 | 112 | // 'LIMIT' => array('LIMIT', 3), |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | * @var array |
| 32 | 32 | */ |
| 33 | 33 | public static $CLAUSES = array( |
| 34 | - 'SET' => array('SET', 3), |
|
| 34 | + 'SET' => array('SET', 3), |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -30,14 +30,14 @@ |
||
| 30 | 30 | * |
| 31 | 31 | * @var int |
| 32 | 32 | */ |
| 33 | - const TYPE_BEGIN = 1; |
|
| 33 | + const TYPE_BEGIN = 1; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * COMMIT and ROLLBACK |
| 37 | 37 | * |
| 38 | 38 | * @var int |
| 39 | 39 | */ |
| 40 | - const TYPE_END = 2; |
|
| 40 | + const TYPE_END = 2; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * The type of this query. |
@@ -57,15 +57,15 @@ |
||
| 57 | 57 | * @var array |
| 58 | 58 | */ |
| 59 | 59 | public static $CLAUSES = array( |
| 60 | - 'UPDATE' => array('UPDATE', 2), |
|
| 60 | + 'UPDATE' => array('UPDATE', 2), |
|
| 61 | 61 | // Used for options. |
| 62 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
| 62 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
| 63 | 63 | // Used for updated tables. |
| 64 | - '_UPDATE' => array('UPDATE', 1), |
|
| 65 | - 'SET' => array('SET', 3), |
|
| 66 | - 'WHERE' => array('WHERE', 3), |
|
| 67 | - 'ORDER BY' => array('ORDER BY', 3), |
|
| 68 | - 'LIMIT' => array('LIMIT', 3), |
|
| 64 | + '_UPDATE' => array('UPDATE', 1), |
|
| 65 | + 'SET' => array('SET', 3), |
|
| 66 | + 'WHERE' => array('WHERE', 3), |
|
| 67 | + 'ORDER BY' => array('ORDER BY', 3), |
|
| 68 | + 'LIMIT' => array('LIMIT', 3), |
|
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | 71 | /** |