Bug #19024- SHOW COUNT(*) WARNINGS not return Errors

  
The server variable warning_count should include the number of warnings, errors and notes according to the manual
parent e89c10e9
...@@ -215,6 +215,7 @@ select @@version; ...@@ -215,6 +215,7 @@ select @@version;
select @@global.version; select @@global.version;
@@global.version @@global.version
# #
End of 4.1 tests
set @first_var= NULL; set @first_var= NULL;
create table t1 select @first_var; create table t1 select @first_var;
show create table t1; show create table t1;
...@@ -301,3 +302,11 @@ select @var; ...@@ -301,3 +302,11 @@ select @var;
@var @var
3 3
drop table t1; drop table t1;
insert into city 'blah';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''blah'' at line 1
SHOW COUNT(*) WARNINGS;
@@session.warning_count
1
SHOW COUNT(*) ERRORS;
@@session.error_count
1
...@@ -144,6 +144,8 @@ select @@version; ...@@ -144,6 +144,8 @@ select @@version;
--replace_column 1 # --replace_column 1 #
select @@global.version; select @@global.version;
--echo End of 4.1 tests
# Bug #6598: problem with cast(NULL as signed integer); # Bug #6598: problem with cast(NULL as signed integer);
# #
...@@ -210,4 +212,10 @@ select @var:=f2 from t1 group by f1 order by f2 desc limit 1; ...@@ -210,4 +212,10 @@ select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
select @var; select @var;
drop table t1; drop table t1;
# End of 4.1 tests #
# Bug#19024 - SHOW COUNT(*) WARNINGS not return Errors
#
--error 1064
insert into city 'blah';
SHOW COUNT(*) WARNINGS;
SHOW COUNT(*) ERRORS;
...@@ -2917,6 +2917,7 @@ static byte *get_warning_count(THD *thd) ...@@ -2917,6 +2917,7 @@ static byte *get_warning_count(THD *thd)
{ {
thd->sys_var_tmp.long_value= thd->sys_var_tmp.long_value=
(thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] + (thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] +
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] +
thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]); thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]);
return (byte*) &thd->sys_var_tmp.long_value; return (byte*) &thd->sys_var_tmp.long_value;
} }
......
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