From 62e88b779cb3cd563c64952a33294024631eb937 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Jun 2007 17:47:02 +0500 Subject: Bug#28007 Wrong default value for I_S.PARTITIONS.PARTITION_COMMENT The value of the PARTITION_COMMENT column is an empty string if there is no partition comment. mysql-test/r/information_schema_part.result: result fix mysql-test/r/ndb_dd_alter.result: result fix mysql-test/r/ndb_dd_backuprestore.result: result fix mysql-test/r/ndb_partition_range.result: result fix sql/sql_show.cc: The value of the PARTITION_COMMENT column is an empty string if there is no partition comment. --- sql/sql_show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 9aa444aa4c0..08caf6817e1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4044,7 +4044,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, table->field[22]->store(part_elem->part_comment, strlen(part_elem->part_comment), cs); else - table->field[22]->store(STRING_WITH_LEN("default"), cs); + table->field[22]->store(STRING_WITH_LEN(""), cs); if (part_elem->nodegroup_id != UNDEF_NODEGROUP) table->field[23]->store((longlong) part_elem->nodegroup_id, TRUE); else -- cgit v1.2.1 From 4c2f2ac5e7601d0f9b229b40005049861209c290 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Jun 2007 18:17:51 +0500 Subject: Bug#27684 undocumented difference between SHOW ENGINES and I_S.ENGINES Changed SHOW ENGINES to work in the same way as I_S.ENGINES. For this: removed the functions mysqld_show_storage_engines and show_handlerton, and made SHOW ENGINES work via the common function iter_schema_engines. There in no test case because an engine (except of MyISAM) may be not compiled or disabled which may affect the test result. sql/sql_parse.cc: Changed SHOW ENGINES to work in the same way as I_S.ENGINES. sql/sql_show.cc: Changed SHOW ENGINES to work in the same way as I_S.ENGINES. For this: removed the functions mysqld_show_storage_engines and show_handlerton, and made SHOW ENGINES work via the common function iter_schema_engines. --- sql/sql_show.cc | 61 +++++---------------------------------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 08caf6817e1..bf86555641a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -79,58 +79,6 @@ append_algorithm(TABLE_LIST *table, String *buff); ** List all table types supported ***************************************************************************/ -static my_bool show_handlerton(THD *thd, plugin_ref plugin, - void *arg) -{ - handlerton *default_type= (handlerton *) arg; - Protocol *protocol= thd->protocol; - handlerton *hton= plugin_data(plugin, handlerton *); - - if (!(hton->flags & HTON_HIDDEN)) - { - protocol->prepare_for_resend(); - protocol->store(plugin_name(plugin)->str, plugin_name(plugin)->length, - system_charset_info); - const char *option_name= show_comp_option_name[(int) hton->state]; - - if (hton->state == SHOW_OPTION_YES && default_type == hton) - option_name= "DEFAULT"; - protocol->store(option_name, system_charset_info); - protocol->store(plugin_decl(plugin)->descr, system_charset_info); - protocol->store(hton->commit ? "YES" : "NO", system_charset_info); - protocol->store(hton->prepare ? "YES" : "NO", system_charset_info); - protocol->store(hton->savepoint_set ? "YES" : "NO", system_charset_info); - - return protocol->write() ? 1 : 0; - } - return 0; -} - -bool mysqld_show_storage_engines(THD *thd) -{ - List field_list; - Protocol *protocol= thd->protocol; - DBUG_ENTER("mysqld_show_storage_engines"); - - field_list.push_back(new Item_empty_string("Engine",10)); - field_list.push_back(new Item_empty_string("Support",10)); - field_list.push_back(new Item_empty_string("Comment",80)); - field_list.push_back(new Item_empty_string("Transactions",3)); - field_list.push_back(new Item_empty_string("XA",3)); - field_list.push_back(new Item_empty_string("Savepoints",3)); - - if (protocol->send_fields(&field_list, - Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) - DBUG_RETURN(TRUE); - - if (plugin_foreach(thd, show_handlerton, - MYSQL_STORAGE_ENGINE_PLUGIN, ha_default_handlerton(thd))) - DBUG_RETURN(TRUE); - - send_eof(thd); - DBUG_RETURN(FALSE); -} - static int make_version_string(char *buf, int buf_length, uint version) { return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff); @@ -3319,16 +3267,17 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin, if (!(wild && wild[0] && wild_case_compare(scs, name->str,wild))) { - LEX_STRING state[2]= {{ C_STRING_WITH_LEN("ENABLED") }, - { C_STRING_WITH_LEN("DISABLED") }}; LEX_STRING yesno[2]= {{ C_STRING_WITH_LEN("NO") }, { C_STRING_WITH_LEN("YES") }}; LEX_STRING *tmp; + const char *option_name= show_comp_option_name[(int) hton->state]; restore_record(table, s->default_values); table->field[0]->store(name->str, name->length, scs); - tmp= &state[test(hton->state)]; - table->field[1]->store(tmp->str, tmp->length, scs); + if (hton->state == SHOW_OPTION_YES && + hton == thd->variables.table_type) + option_name= "DEFAULT"; + table->field[1]->store(option_name, strlen(option_name), scs); table->field[2]->store(plugin_decl(plugin)->descr, strlen(plugin_decl(plugin)->descr), scs); tmp= &yesno[test(hton->commit)]; -- cgit v1.2.1 From f65930a9e21dc1e9bdf51579158fc6988c433586 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Jun 2007 16:05:43 +0500 Subject: compilation error fix mysql-test/include/have_archive.inc: test fix(according to new 'support' column values) mysql-test/include/have_blackhole.inc: test fix(according to new 'support' column values) mysql-test/include/have_csv.inc: test fix(according to new 'support' column values) mysql-test/include/have_exampledb.inc: test fix(according to new 'support' column values) mysql-test/include/have_federated_db.inc: test fix(according to new 'support' column values) mysql-test/include/have_innodb.inc: test fix(according to new 'support' column values) mysql-test/include/have_multi_ndb.inc: test fix(according to new 'support' column values) mysql-test/include/have_ndb.inc: test fix(according to new 'support' column values) mysql-test/r/information_schema.result: result fix --- sql/sql_show.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bf86555641a..81c66b8c835 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3259,6 +3259,7 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin, handlerton *hton= plugin_data(plugin, handlerton *); const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS; CHARSET_INFO *scs= system_charset_info; + handlerton *default_type= ha_default_handlerton(thd); DBUG_ENTER("iter_schema_engines"); if (!(hton->flags & HTON_HIDDEN)) @@ -3274,8 +3275,7 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin, restore_record(table, s->default_values); table->field[0]->store(name->str, name->length, scs); - if (hton->state == SHOW_OPTION_YES && - hton == thd->variables.table_type) + if (hton->state == SHOW_OPTION_YES && default_type == hton) option_name= "DEFAULT"; table->field[1]->store(option_name, strlen(option_name), scs); table->field[2]->store(plugin_decl(plugin)->descr, -- cgit v1.2.1 From ce4e9f7580c02d1e7c5587bccb3a2a2ed7b0cc69 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Jun 2007 16:52:37 +0500 Subject: Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong IS_UPDATABLE flag is set to 'yes' when the view has at least one updatable column and the algorithm is not 'temporary'. mysql-test/r/information_schema.result: test result mysql-test/r/view.result: test result mysql-test/t/information_schema.test: test case mysql-test/t/view.test: test case sql/sql_show.cc: IS_UPDATABLE flag is set to 'yes' when the view has at least one updatable column and the algorithm is not 'temporary'. --- sql/sql_show.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 16ed20cd479..a0db458be78 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3158,6 +3158,7 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, DBUG_ENTER("get_schema_views_record"); char definer[USER_HOST_BUFF_SIZE]; uint definer_len; + bool updatable_view; if (tables->view) { @@ -3195,7 +3196,34 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, else table->field[4]->store(STRING_WITH_LEN("NONE"), cs); - if (tables->updatable_view) + updatable_view= 0; + if (tables->algorithm != VIEW_ALGORITHM_TMPTABLE) + { + /* + We should use tables->view->select_lex.item_list here and + can not use Field_iterator_view because the view always uses + temporary algorithm during opening for I_S and + TABLE_LIST fields 'field_translation' & 'field_translation_end' + are uninitialized is this case. + */ + List *fields= &tables->view->select_lex.item_list; + List_iterator it(*fields); + Item *item; + Item_field *field; + /* + chech that at least one coulmn in view is updatable + */ + while ((item= it++)) + { + if ((field= item->filed_for_view_update()) && field->field && + !field->field->table->pos_in_table_list->schema_table) + { + updatable_view= 1; + break; + } + } + } + if (updatable_view) table->field[5]->store(STRING_WITH_LEN("YES"), cs); else table->field[5]->store(STRING_WITH_LEN("NO"), cs); -- cgit v1.2.1 From 71aa571d09a0823dcf0b1528f6f0103a7adfcf72 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 9 Jun 2007 17:46:09 +0500 Subject: Bug#28149 overflow in some "SHOW STATUS"-variables changed bytes_received, bytes_sent status variables to longlong sql/mysqld.cc: changed bytes_received, bytes_sent status variables to longlong sql/sql_class.h: changed bytes_received, bytes_sent status variables to longlong sql/sql_show.cc: changed bytes_received, bytes_sent status variables to longlong sql/structs.h: changed bytes_received, bytes_sent status variables to longlong --- sql/sql_show.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a0db458be78..902b298e423 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1463,6 +1463,8 @@ static bool show_status_array(THD *thd, const char *wild, case SHOW_LONG_CONST: end= int10_to_str(*(long*) value, buff, 10); break; + case SHOW_LONGLONG_STATUS: + value= ((char *) status_var + (ulonglong) value); case SHOW_LONGLONG: end= longlong10_to_str(*(longlong*) value, buff, 10); break; -- cgit v1.2.1