From 9bd5d54c112c706c4ddd80356444a084dc623225 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Aug 2014 09:33:00 +0200 Subject: [PATCH] correct fix for the old Bug#39955 (warnings in I_S.VARIABLES) old fix only generated a warning for the *first* row in the output --- mysql-test/r/information_schema.result | 27 ++++++++++++++++++++++++++ mysql-test/t/information_schema.test | 2 ++ sql/sql_show.cc | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 6df5b890217..3c0a2982aa8 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1637,6 +1637,33 @@ drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists Warnings: Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1 +select * from information_schema.global_variables where variable_name like 'init%' order by variable_name; +VARIABLE_NAME VARIABLE_VALUE +INIT_CONNECT drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists t1; +drop table if exists t1;drop table if exists +INIT_FILE +INIT_SLAVE +Warnings: +Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row # set global init_connect=""; create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT'; SELECT 1; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index b51555295b3..bc77b2c2a8f 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1358,6 +1358,8 @@ drop table if exists t1;drop table if exists t1;\ drop table if exists t1;drop table if exists t1;\ drop table if exists t1;drop table if exists t1;"; select * from information_schema.global_variables where variable_name='init_connect'; +--replace_regex /at row [123]/at row #/ +select * from information_schema.global_variables where variable_name like 'init%' order by variable_name; set global init_connect=""; # diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 9962075595c..ad60fc86060 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3111,7 +3111,6 @@ static bool show_status_array(THD *thd, const char *wild, break; } table->field[1]->store(pos, (uint32) (end - pos), charset); - thd->count_cuted_fields= CHECK_FIELD_IGNORE; table->field[1]->set_notnull(); mysql_mutex_unlock(&LOCK_global_system_variables); @@ -3121,6 +3120,7 @@ static bool show_status_array(THD *thd, const char *wild, res= TRUE; goto end; } + thd->get_stmt_da()->inc_current_row_for_warning(); } } }