Commit 53cf1921 authored by unknown's avatar unknown

Bug#25146 Some warnings/errors not shown when using --show-warnings

 - Additional patch to fix compiler warnings


client/mysql.cc:
  Initialize warnings to 0 to avid compiler warning
  Call 'print_warnings' also when error occured
mysql-test/r/mysql.result:
  Change test to make is possible to see that second set of warnings
  are from second invocation of mysql
mysql-test/t/mysql.test:
  Change test to make is possible to see that second set of warnings
  are from second invocation of mysql
parent 835dcc09
...@@ -2166,7 +2166,7 @@ com_go(String *buffer,char *line __attribute__((unused))) ...@@ -2166,7 +2166,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
{ {
char buff[200], time_buff[32], *pos; char buff[200], time_buff[32], *pos;
MYSQL_RES *result; MYSQL_RES *result;
ulong timer, warnings; ulong timer, warnings= 0;
uint error= 0; uint error= 0;
int err= 0; int err= 0;
...@@ -2316,7 +2316,8 @@ com_go(String *buffer,char *line __attribute__((unused))) ...@@ -2316,7 +2316,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
end: end:
if (show_warnings == 1 && warnings >= 1) /* Show warnings if any */ /* Show warnings if any or error occured */
if (show_warnings == 1 && (warnings >= 1 || error))
print_warnings(); print_warnings();
if (!error && !status.batch && if (!error && !status.batch &&
......
...@@ -184,7 +184,7 @@ End of 5.0 tests ...@@ -184,7 +184,7 @@ End of 5.0 tests
WARNING: --server-arg option not supported in this configuration. WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent' Warning (Code 1286): Unknown table engine 'nonexistent'
Warning (Code 1266): Using storage engine MyISAM for table 't2' Warning (Code 1266): Using storage engine MyISAM for table 't2'
Warning (Code 1286): Unknown table engine 'nonexistent' Warning (Code 1286): Unknown table engine 'nonexistent2'
Warning (Code 1266): Using storage engine MyISAM for table 't2' Warning (Code 1266): Using storage engine MyISAM for table 't2'
Error (Code 1050): Table 't2' already exists Error (Code 1050): Table 't2' already exists
drop tables t1, t2; drop tables t1, t2;
......
...@@ -312,7 +312,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql; ...@@ -312,7 +312,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
# This should fail, with warnings as well # This should fail, with warnings as well
--error 1 --error 1
--exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent" --exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent2"
drop tables t1, t2; drop tables t1, t2;
......
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