@@ -131,77 +131,77 @@ abstract class Context
131131
132132 // Compatibility mode for Microsoft's SQL server.
133133 // This is the equivalent of ANSI_QUOTES.
134- const COMPAT_MYSQL = 2 ;
134+ const SQL_MODE_COMPAT_MYSQL = 2 ;
135135
136136 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_allow_invalid_dates
137- const ALLOW_INVALID_DATES = 1 ;
137+ const SQL_MODE_ALLOW_INVALID_DATES = 1 ;
138138
139139 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ansi_quotes
140- const ANSI_QUOTES = 2 ;
140+ const SQL_MODE_ANSI_QUOTES = 2 ;
141141
142142 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_error_for_division_by_zero
143- const ERROR_FOR_DIVISION_BY_ZERO = 4 ;
143+ const SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO = 4 ;
144144
145145 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_high_not_precedence
146- const HIGH_NOT_PRECEDENCE = 8 ;
146+ const SQL_MODE_HIGH_NOT_PRECEDENCE = 8 ;
147147
148148 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ignore_space
149- const IGNORE_SPACE = 16 ;
149+ const SQL_MODE_IGNORE_SPACE = 16 ;
150150
151151 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_create_user
152- const NO_AUTO_CREATE_USER = 32 ;
152+ const SQL_MODE_NO_AUTO_CREATE_USER = 32 ;
153153
154154 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_value_on_zero
155- const NO_AUTO_VALUE_ON_ZERO = 64 ;
155+ const SQL_MODE_NO_AUTO_VALUE_ON_ZERO = 64 ;
156156
157157 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_backslash_escapes
158- const NO_BACKSLASH_ESCAPES = 128 ;
158+ const SQL_MODE_NO_BACKSLASH_ESCAPES = 128 ;
159159
160160 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create
161- const NO_DIR_IN_CREATE = 256 ;
161+ const SQL_MODE_NO_DIR_IN_CREATE = 256 ;
162162
163163 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create
164- const NO_ENGINE_SUBSTITUTION = 512 ;
164+ const SQL_MODE_NO_ENGINE_SUBSTITUTION = 512 ;
165165
166166 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_field_options
167- const NO_FIELD_OPTIONS = 1024 ;
167+ const SQL_MODE_NO_FIELD_OPTIONS = 1024 ;
168168
169169 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_key_options
170- const NO_KEY_OPTIONS = 2048 ;
170+ const SQL_MODE_NO_KEY_OPTIONS = 2048 ;
171171
172172 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_table_options
173- const NO_TABLE_OPTIONS = 4096 ;
173+ const SQL_MODE_NO_TABLE_OPTIONS = 4096 ;
174174
175175 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_unsigned_subtraction
176- const NO_UNSIGNED_SUBTRACTION = 8192 ;
176+ const SQL_MODE_NO_UNSIGNED_SUBTRACTION = 8192 ;
177177
178178 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_date
179- const NO_ZERO_DATE = 16384 ;
179+ const SQL_MODE_NO_ZERO_DATE = 16384 ;
180180
181181 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_in_date
182- const NO_ZERO_IN_DATE = 32768 ;
182+ const SQL_MODE_NO_ZERO_IN_DATE = 32768 ;
183183
184184 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by
185- const ONLY_FULL_GROUP_BY = 65536 ;
185+ const SQL_MODE_ONLY_FULL_GROUP_BY = 65536 ;
186186
187187 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_pipes_as_concat
188- const PIPES_AS_CONCAT = 131072 ;
188+ const SQL_MODE_PIPES_AS_CONCAT = 131072 ;
189189
190190 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_real_as_float
191- const REAL_AS_FLOAT = 262144 ;
191+ const SQL_MODE_REAL_AS_FLOAT = 262144 ;
192192
193193 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_all_tables
194- const STRICT_ALL_TABLES = 524288 ;
194+ const SQL_MODE_STRICT_ALL_TABLES = 524288 ;
195195
196196 // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_trans_tables
197- const STRICT_TRANS_TABLES = 1048576 ;
197+ const SQL_MODE_STRICT_TRANS_TABLES = 1048576 ;
198198
199199 // Custom modes.
200200
201201 // The table and column names and any other field that must be escaped will
202202 // not be.
203203 // Reserved keywords are being escaped regardless this mode is used or not.
204- const NO_ENCLOSING_QUOTES = 1073741824 ;
204+ const SQL_MODE_NO_ENCLOSING_QUOTES = 1073741824 ;
205205
206206 /*
207207 * Combination SQL Modes
@@ -514,7 +514,7 @@ public static function setMode($mode = '')
514514 }
515515 $ mode = explode (', ' , $ mode );
516516 foreach ($ mode as $ m ) {
517- static ::$ MODE |= constant ('static:: ' . $ m );
517+ static ::$ MODE |= constant ('static::SQL_MODE_ ' . $ m );
518518 }
519519 }
520520
@@ -536,13 +536,13 @@ public static function escape($str, $quote = '`')
536536 return $ str ;
537537 }
538538
539- if ((static ::$ MODE & self ::NO_ENCLOSING_QUOTES )
539+ if ((static ::$ MODE & self ::SQL_MODE_NO_ENCLOSING_QUOTES )
540540 && (!static ::isKeyword ($ str , true ))
541541 ) {
542542 return $ str ;
543543 }
544544
545- if (static ::$ MODE & self ::ANSI_QUOTES ) {
545+ if (static ::$ MODE & self ::SQL_MODE_ANSI_QUOTES ) {
546546 $ quote = '" ' ;
547547 }
548548
0 commit comments