summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/variables.result14
-rw-r--r--mysql-test/t/variables.test11
-rw-r--r--sql/set_var.cc4
3 files changed, 27 insertions, 2 deletions
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 269a9bfdbd9..91e3c63da7e 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -590,4 +590,18 @@ show variables like 'sql_big_selects';
Variable_name Value
sql_big_selects ON
set @@sql_big_selects = @old_sql_big_selects;
+set @@sql_notes = 0, @@sql_warnings = 0;
+show variables like 'sql_notes';
+Variable_name Value
+sql_notes OFF
+show variables like 'sql_warnings';
+Variable_name Value
+sql_warnings OFF
+set @@sql_notes = 1, @@sql_warnings = 1;
+show variables like 'sql_notes';
+Variable_name Value
+sql_notes ON
+show variables like 'sql_warnings';
+Variable_name Value
+sql_warnings ON
End of 5.0 tests
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 5b8db2f8786..c7227df10fe 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -480,4 +480,15 @@ set @@sql_big_selects = 1;
show variables like 'sql_big_selects';
set @@sql_big_selects = @old_sql_big_selects;
+#
+# Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and
+# sql_notes values
+#
+set @@sql_notes = 0, @@sql_warnings = 0;
+show variables like 'sql_notes';
+show variables like 'sql_warnings';
+set @@sql_notes = 1, @@sql_warnings = 1;
+show variables like 'sql_notes';
+show variables like 'sql_warnings';
+
--echo End of 5.0 tests
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 4e8575f3df2..db959cbcfa3 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -996,8 +996,8 @@ struct show_var_st init_vars[]= {
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
{sys_big_selects.name, (char*) &sys_big_selects, SHOW_SYS},
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
- {"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
- {"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
+ {"sql_notes", (char*) &sys_sql_notes, SHOW_SYS},
+ {"sql_warnings", (char*) &sys_sql_warnings, SHOW_SYS},
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
#ifdef HAVE_REPLICATION
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},