Bug #8045 Parser do not give error in batch mode
Submitted: 20 Jan 2005 13:56 Modified: 2 Jun 2005 18:29
Reporter: Oleksandr Byelkin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 and 4.1 OS:
Assigned to: Assigned Account CPU Architecture:Any

[20 Jan 2005 13:56] Oleksandr Byelkin
Description:
parser  allow following sequence without issuing error (but do not create procedure of course).
In following fragment we have ';' instead of '//' at the end of "create view" statement
(if fix it we get syntax error in "create procedure" as it should be")

you can substitute "create procedure" with any statement with syntax error with same result.

How to repeat:
delimiter //;
create table t1 (a int)//
insert into t1 values (1), (2), (3)//
create view v1 as select * from t1 where a > 1;
create procedure p1
begin
  select * from v1;
end//
[2 Feb 2005 8:09] Antony Curtis
looks like this behaviour was introduced with
client/mysql.cc@1.121.1.7, 2003-04-23 03:28:27+03:00
[3 Feb 2005 10:10] Antony Curtis
This appears to be a bug in the client.

The problem is that for multi-statements, the client does not report the error when it has already received at least one resultset.

The simplest test case:

delimiter //;
select 1; select junk//

The server is correctly sending back an error message.
[24 May 2005 21:43] Patrick Galbraith
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

I was going to work on this bug but it appears that it works correctly now, both in 5.0 and 4.1

mysql> delimiter //;
mysql> select 1; select junk //
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

ERROR 1054 (42S22): Unknown column 'junk' in 'field list'
[2 Jun 2005 18:29] Patrick Galbraith
A duplicate of 

http://bugs.mysql.com/9870
http://bugs.mysql.com/10849