From d27132953d608aed019e48ee180821fc87b47556 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 14:21:48 +1000 Subject: [PATCH 1/4] fix debug string in TR::report_disconnect ndb/src/common/transporter/TransporterRegistry.cpp: fix debug string for TR::report_disconnect --- ndb/src/common/transporter/TransporterRegistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index e636766560b..3776bce7452 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1208,7 +1208,7 @@ TransporterRegistry::report_connect(NodeId node_id) void TransporterRegistry::report_disconnect(NodeId node_id, int errnum) { - DBUG_ENTER("TransporterRegistry::report_connect"); + DBUG_ENTER("TransporterRegistry::report_disconnect"); DBUG_PRINT("info",("performStates[%d]=DISCONNECTED",node_id)); performStates[node_id] = DISCONNECTED; reportDisconnect(callbackObj, node_id, errnum); From 8dd1be2d971ba0433392d0c6cfbf658fa26107c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 12:12:47 +0500 Subject: [PATCH 2/4] Fix for bug#11055: information_schema: routines.sql_data_access has wrong value --- mysql-test/r/information_schema.result | 9 +++++++++ mysql-test/t/information_schema.test | 10 ++++++++++ sql/sql_lex.h | 8 ++++++++ sql/sql_show.cc | 7 +++---- sql/structs.h | 2 ++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 38eb1d6a3ae..96f68267cda 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -823,3 +823,12 @@ GRANT SELECT ON *.* TO 'user4'@'localhost' drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost; use test; drop database mysqltest; +create procedure p1 () modifies sql data set @a = 5; +create procedure p2 () set @a = 5; +select sql_data_access from information_schema.routines +where specific_name like 'p%'; +sql_data_access +MODIFIES SQL DATA +CONTAINS SQL +drop procedure p1; +drop procedure p2; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 7302b3e5e58..b687befafc8 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -542,3 +542,13 @@ connection default; drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost; use test; drop database mysqltest; + +# +# Bug #11055 information_schema: routines.sql_data_access has wrong value +# +create procedure p1 () modifies sql data set @a = 5; +create procedure p2 () set @a = 5; +select sql_data_access from information_schema.routines +where specific_name like 'p%'; +drop procedure p1; +drop procedure p2; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8af416f0ce8..052873640c6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -114,6 +114,14 @@ enum enum_sp_data_access SP_MODIFIES_SQL_DATA }; +const LEX_STRING sp_data_access_name[]= +{ + { (char*) STRING_WITH_LEN("") }, + { (char*) STRING_WITH_LEN("CONTAINS SQL") }, + { (char*) STRING_WITH_LEN("NO SQL") }, + { (char*) STRING_WITH_LEN("READS SQL DATA") }, + { (char*) STRING_WITH_LEN("MODIFIES SQL DATA") } +}; #define DERIVED_SUBQUERY 1 #define DERIVED_VIEW 2 diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 68c6d1a8030..ac47c132db2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2645,6 +2645,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, restore_record(table, s->default_values); if (!wild || !wild[0] || !wild_compare(sp_name, wild, 0)) { + int enum_idx= proc_table->field[5]->val_int(); table->field[3]->store(sp_name, strlen(sp_name), cs); get_field(thd->mem_root, proc_table->field[3], &tmp_string); table->field[0]->store(tmp_string.ptr(), tmp_string.length(), cs); @@ -2666,10 +2667,8 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, table->field[10]->store("SQL", 3, cs); get_field(thd->mem_root, proc_table->field[6], &tmp_string); table->field[11]->store(tmp_string.ptr(), tmp_string.length(), cs); - if (proc_table->field[5]->val_int() == SP_CONTAINS_SQL) - { - table->field[12]->store("CONTAINS SQL", 12 , cs); - } + table->field[12]->store(sp_data_access_name[enum_idx].str, + sp_data_access_name[enum_idx].length , cs); get_field(thd->mem_root, proc_table->field[7], &tmp_string); table->field[14]->store(tmp_string.ptr(), tmp_string.length(), cs); bzero((char *)&time, sizeof(time)); diff --git a/sql/structs.h b/sql/structs.h index 8f053f20776..03176b47360 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -20,6 +20,8 @@ struct st_table; class Field; +#define STRING_WITH_LEN(X) X, (sizeof(X)-1) + typedef struct st_lex_string { char *str; From 20eaad0e6e1aa48e60bb417bc6ac9fd4fde5de73 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 12:17:15 +0500 Subject: [PATCH 3/4] a fix (bug #10650: Bit literal case sensitivity). mysys/charset.c: a fix (bug #10650: Bit literal case sensitivity). typo fixed. --- mysql-test/r/select.result | 3 +++ mysql-test/t/select.test | 5 +++++ mysys/charset.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 1c0321ac658..bd2825822a1 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2699,3 +2699,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 372325c4cbd..2558a3aeaeb 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2271,3 +2271,8 @@ EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; DROP TABLE t1,t2; +# +# Bug #10650 +# + +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; diff --git a/mysys/charset.c b/mysys/charset.c index 534a6aa998e..cbd9ba16b4c 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -97,7 +97,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs) /* Special handling of hex and binary strings */ state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) MY_LEX_IDENT_OR_HEX; - state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) MY_LEX_IDENT_OR_BIN; + state_map[(uchar)'b']= state_map[(uchar)'B']= (uchar) MY_LEX_IDENT_OR_BIN; state_map[(uchar)'n']= state_map[(uchar)'N']= (uchar) MY_LEX_IDENT_OR_NCHAR; return 0; } From 5574de167c3f033a6904fb7e0ac47ed684780cdb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2005 13:27:22 +0500 Subject: [PATCH 4/4] Fix for bug#9434 SHOW CREATE DATABASE `information_schema`; added ability to do SHOW CREATE DATABASE `information_schema` --- mysql-test/r/information_schema.result | 3 +++ mysql-test/t/information_schema.test | 5 ++++ sql/sql_show.cc | 37 +++++++++++++++----------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 96f68267cda..c6090bc663d 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -832,3 +832,6 @@ MODIFIES SQL DATA CONTAINS SQL drop procedure p1; drop procedure p2; +show create database information_schema; +Database Create Database +information_schema CREATE DATABASE `information_schema` /*!40100 DEFAULT CHARACTER SET utf8 */ diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index b687befafc8..e03bea5899a 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -552,3 +552,8 @@ select sql_data_access from information_schema.routines where specific_name like 'p%'; drop procedure p1; drop procedure p2; + +# +# Bug #9434 SHOW CREATE DATABASE information_schema; +# +show create database information_schema; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ac47c132db2..aaa34dc4cb7 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -448,25 +448,32 @@ bool mysqld_show_create_db(THD *thd, char *dbname, DBUG_RETURN(TRUE); } #endif - - (void) sprintf(path,"%s/%s",mysql_data_home, dbname); - length=unpack_dirname(path,path); // Convert if not unix - found_libchar= 0; - if (length && path[length-1] == FN_LIBCHAR) + if (!my_strcasecmp(system_charset_info, dbname, + information_schema_name.str)) { - found_libchar= 1; - path[length-1]=0; // remove ending '\' + dbname= information_schema_name.str; + create.default_table_charset= system_charset_info; } - if (access(path,F_OK)) + else { - my_error(ER_BAD_DB_ERROR, MYF(0), dbname); - DBUG_RETURN(TRUE); + (void) sprintf(path,"%s/%s",mysql_data_home, dbname); + length=unpack_dirname(path,path); // Convert if not unix + found_libchar= 0; + if (length && path[length-1] == FN_LIBCHAR) + { + found_libchar= 1; + path[length-1]=0; // remove ending '\' + } + if (access(path,F_OK)) + { + my_error(ER_BAD_DB_ERROR, MYF(0), dbname); + DBUG_RETURN(TRUE); + } + if (found_libchar) + path[length-1]= FN_LIBCHAR; + strmov(path+length, MY_DB_OPT_FILE); + load_db_opt(thd, path, &create); } - if (found_libchar) - path[length-1]= FN_LIBCHAR; - strmov(path+length, MY_DB_OPT_FILE); - load_db_opt(thd, path, &create); - List field_list; field_list.push_back(new Item_empty_string("Database",NAME_LEN)); field_list.push_back(new Item_empty_string("Create Database",1024));