Commit a4b042c1 authored by unknown's avatar unknown

Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and sql_notes values

  SQL_WARNINGS and SQL_NOTES were being displayed with SHOW_BOOL, but they
  are system variables that need SHOW_SYS to be used.


mysql-test/r/variables.result:
  Add new results
mysql-test/t/variables.test:
  Add new regression test
sql/set_var.cc:
  Fix display of sql_notes and sql_warnings in SHOW VARIABLES.
parent d8df724a
...@@ -584,3 +584,18 @@ set @@global.character_set_filesystem=default; ...@@ -584,3 +584,18 @@ set @@global.character_set_filesystem=default;
select @@global.character_set_filesystem; select @@global.character_set_filesystem;
@@global.character_set_filesystem @@global.character_set_filesystem
binary binary
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
...@@ -472,4 +472,15 @@ select @@character_set_filesystem; ...@@ -472,4 +472,15 @@ select @@character_set_filesystem;
set @@global.character_set_filesystem=default; set @@global.character_set_filesystem=default;
select @@global.character_set_filesystem; select @@global.character_set_filesystem;
# End of 5.0 tests #
# 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
...@@ -989,8 +989,8 @@ struct show_var_st init_vars[]= { ...@@ -989,8 +989,8 @@ struct show_var_st init_vars[]= {
#endif #endif
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL}, {"sql_notes", (char*) &sys_sql_notes, SHOW_SYS},
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL}, {"sql_warnings", (char*) &sys_sql_warnings, SHOW_SYS},
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
{sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS}, {sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS},
#ifdef HAVE_TZNAME #ifdef HAVE_TZNAME
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment