Loading dbug/dbug.c +8 −3 Original line number Diff line number Diff line Loading @@ -71,9 +71,7 @@ * */ #ifdef DBUG_OFF #undef DBUG_OFF #endif #include <my_global.h> #include <m_string.h> #include <errno.h> Loading @@ -81,6 +79,10 @@ #include <process.h> #endif #ifndef DBUG_OFF /* * Manifest constants which may be "tuned" if desired. */ Loading Loading @@ -313,6 +315,7 @@ static unsigned long Clock(void); #define ChangeOwner(cs,name) #endif /* ** Macros to allow dbugging with threads */ Loading Loading @@ -2351,3 +2354,5 @@ va_list ap; } #endif /* NO_VARARGS */ #endif mysql-test/r/show_check.result +15 −0 Original line number Diff line number Diff line Loading @@ -695,4 +695,19 @@ Level Code Message Warning 1541 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead show plugin; show plugins; create database `mysqlttest\1`; create table `mysqlttest\1`.`a\b` (a int); show tables from `mysqlttest\1`; Tables_in_mysqlttest\1 a\b show fields from `mysqlttest\1`.`a\b`; Field Type Null Key Default Extra a int(11) YES NULL show columns from `a\b` from `mysqlttest\1`; Field Type Null Key Default Extra a int(11) YES NULL show keys from `mysqlttest\1`.`a\b`; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment drop table `mysqlttest\1`.`a\b`; drop database `mysqlttest\1`; End of 5.1 tests mysql-test/t/show_check.test +13 −0 Original line number Diff line number Diff line Loading @@ -539,4 +539,17 @@ show plugin; show plugins; --enable_result_log # # Bug #19874: SHOW COLUMNS and SHOW KEYS handle identifiers containing # \ incorrectly # create database `mysqlttest\1`; create table `mysqlttest\1`.`a\b` (a int); show tables from `mysqlttest\1`; show fields from `mysqlttest\1`.`a\b`; show columns from `a\b` from `mysqlttest\1`; show keys from `mysqlttest\1`.`a\b`; drop table `mysqlttest\1`.`a\b`; drop database `mysqlttest\1`; --echo End of 5.1 tests sql/mysqld.cc +2 −2 Original line number Diff line number Diff line Loading @@ -7592,10 +7592,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } switch (method-1) { case 0: method_conv= MI_STATS_METHOD_NULLS_EQUAL; method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; break; case 1: method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; method_conv= MI_STATS_METHOD_NULLS_EQUAL; break; case 2: method_conv= MI_STATS_METHOD_IGNORE_NULLS; Loading sql/sql_parse.cc +0 −36 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc); static void decrease_user_connections(USER_CONN *uc); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ static bool check_multi_update_lock(THD *thd); static void remove_escape(char *name); static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables); const char *any_db="*any*"; // Special symbol for check_access Loading Loading @@ -1442,7 +1441,6 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name) } if (lower_case_table_names) my_casedn_str(files_charset_info, tbl_name); remove_escape(table_list->table_name); if (!(table=open_ltable(thd, table_list, TL_READ_NO_INSERT))) DBUG_RETURN(1); Loading Loading @@ -1909,7 +1907,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, general_log_print(thd, command, "%s %s", table_list.table_name, fields); if (lower_case_table_names) my_casedn_str(files_charset_info, table_list.table_name); remove_escape(table_list.table_name); // This can't have wildcards if (check_access(thd,SELECT_ACL,table_list.db,&table_list.grant.privilege, 0, 0, test(table_list.schema_table))) Loading Loading @@ -2299,7 +2296,6 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, DBUG_RETURN(1); } db= lex->select_lex.db; remove_escape(db); // Fix escaped '_' if (check_db_name(db)) { my_error(ER_WRONG_DB_NAME, MYF(0), db); Loading Loading @@ -2338,8 +2334,6 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, lex->query_tables_last= query_tables_last; TABLE_LIST *table_list= (TABLE_LIST*) sel->table_list.first; char *db= table_list->db; remove_escape(db); // Fix escaped '_' remove_escape(table_list->table_name); if (check_access(thd,SELECT_ACL | EXTRA_ACL,db, &table_list->grant.privilege, 0, 0, test(table_list->schema_table))) Loading Loading @@ -6288,36 +6282,6 @@ add_proc_to_list(THD* thd, Item *item) } /* Fix escaping of _, % and \ in database and table names (for ODBC) */ static void remove_escape(char *name) { if (!*name) // For empty DB names return; char *to; #ifdef USE_MB char *strend=name+(uint) strlen(name); #endif for (to=name; *name ; name++) { #ifdef USE_MB int l; if (use_mb(system_charset_info) && (l = my_ismbchar(system_charset_info, name, strend))) { while (l--) *to++ = *name++; name--; continue; } #endif if (*name == '\\' && name[1]) name++; // Skip '\\' *to++= *name; } *to=0; } /**************************************************************************** ** save order by and tables in own lists ****************************************************************************/ Loading Loading
dbug/dbug.c +8 −3 Original line number Diff line number Diff line Loading @@ -71,9 +71,7 @@ * */ #ifdef DBUG_OFF #undef DBUG_OFF #endif #include <my_global.h> #include <m_string.h> #include <errno.h> Loading @@ -81,6 +79,10 @@ #include <process.h> #endif #ifndef DBUG_OFF /* * Manifest constants which may be "tuned" if desired. */ Loading Loading @@ -313,6 +315,7 @@ static unsigned long Clock(void); #define ChangeOwner(cs,name) #endif /* ** Macros to allow dbugging with threads */ Loading Loading @@ -2351,3 +2354,5 @@ va_list ap; } #endif /* NO_VARARGS */ #endif
mysql-test/r/show_check.result +15 −0 Original line number Diff line number Diff line Loading @@ -695,4 +695,19 @@ Level Code Message Warning 1541 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead show plugin; show plugins; create database `mysqlttest\1`; create table `mysqlttest\1`.`a\b` (a int); show tables from `mysqlttest\1`; Tables_in_mysqlttest\1 a\b show fields from `mysqlttest\1`.`a\b`; Field Type Null Key Default Extra a int(11) YES NULL show columns from `a\b` from `mysqlttest\1`; Field Type Null Key Default Extra a int(11) YES NULL show keys from `mysqlttest\1`.`a\b`; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment drop table `mysqlttest\1`.`a\b`; drop database `mysqlttest\1`; End of 5.1 tests
mysql-test/t/show_check.test +13 −0 Original line number Diff line number Diff line Loading @@ -539,4 +539,17 @@ show plugin; show plugins; --enable_result_log # # Bug #19874: SHOW COLUMNS and SHOW KEYS handle identifiers containing # \ incorrectly # create database `mysqlttest\1`; create table `mysqlttest\1`.`a\b` (a int); show tables from `mysqlttest\1`; show fields from `mysqlttest\1`.`a\b`; show columns from `a\b` from `mysqlttest\1`; show keys from `mysqlttest\1`.`a\b`; drop table `mysqlttest\1`.`a\b`; drop database `mysqlttest\1`; --echo End of 5.1 tests
sql/mysqld.cc +2 −2 Original line number Diff line number Diff line Loading @@ -7592,10 +7592,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } switch (method-1) { case 0: method_conv= MI_STATS_METHOD_NULLS_EQUAL; method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; break; case 1: method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; method_conv= MI_STATS_METHOD_NULLS_EQUAL; break; case 2: method_conv= MI_STATS_METHOD_IGNORE_NULLS; Loading
sql/sql_parse.cc +0 −36 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc); static void decrease_user_connections(USER_CONN *uc); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ static bool check_multi_update_lock(THD *thd); static void remove_escape(char *name); static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables); const char *any_db="*any*"; // Special symbol for check_access Loading Loading @@ -1442,7 +1441,6 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name) } if (lower_case_table_names) my_casedn_str(files_charset_info, tbl_name); remove_escape(table_list->table_name); if (!(table=open_ltable(thd, table_list, TL_READ_NO_INSERT))) DBUG_RETURN(1); Loading Loading @@ -1909,7 +1907,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, general_log_print(thd, command, "%s %s", table_list.table_name, fields); if (lower_case_table_names) my_casedn_str(files_charset_info, table_list.table_name); remove_escape(table_list.table_name); // This can't have wildcards if (check_access(thd,SELECT_ACL,table_list.db,&table_list.grant.privilege, 0, 0, test(table_list.schema_table))) Loading Loading @@ -2299,7 +2296,6 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, DBUG_RETURN(1); } db= lex->select_lex.db; remove_escape(db); // Fix escaped '_' if (check_db_name(db)) { my_error(ER_WRONG_DB_NAME, MYF(0), db); Loading Loading @@ -2338,8 +2334,6 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, lex->query_tables_last= query_tables_last; TABLE_LIST *table_list= (TABLE_LIST*) sel->table_list.first; char *db= table_list->db; remove_escape(db); // Fix escaped '_' remove_escape(table_list->table_name); if (check_access(thd,SELECT_ACL | EXTRA_ACL,db, &table_list->grant.privilege, 0, 0, test(table_list->schema_table))) Loading Loading @@ -6288,36 +6282,6 @@ add_proc_to_list(THD* thd, Item *item) } /* Fix escaping of _, % and \ in database and table names (for ODBC) */ static void remove_escape(char *name) { if (!*name) // For empty DB names return; char *to; #ifdef USE_MB char *strend=name+(uint) strlen(name); #endif for (to=name; *name ; name++) { #ifdef USE_MB int l; if (use_mb(system_charset_info) && (l = my_ismbchar(system_charset_info, name, strend))) { while (l--) *to++ = *name++; name--; continue; } #endif if (*name == '\\' && name[1]) name++; // Skip '\\' *to++= *name; } *to=0; } /**************************************************************************** ** save order by and tables in own lists ****************************************************************************/ Loading