Bug #25747 multiple statements sharing a line mess up query / error-message
Submitted: 22 Jan 2007 9:52 Modified: 1 Feb 2007 11:05
Reporter: Yahoo Serious (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.9 OS:Windows (Windows 2000)
Assigned to: Mike Lischke CPU Architecture:Any

[22 Jan 2007 9:52] Yahoo Serious
Description:
If there is some text after the last semicolon on a line, this will disable
execution of the next lines from executing.  It will (correctly) trigger an error-message stating only the first statement is executed.  

However, if the first statement is also on multiple lines:
- it will not get a correct error message on syntax errors (just an 'empty query').
- if positioned on the second statement, it will not execute the first statement (just report an 'empty query'). 

How to repeat:
* Create table with this statement

DROP TABLE IF EXISTS `test`.`t1`;
CREATE TABLE  `test`.`t1` (
  `a` tinyint(4) NOT NULL,
  `b` char(4) collate latin1_bin default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;

* Copy these statements to QueryBrowser (including this comment starting with a Kleene star "*" i.s.o. hash symbol "#") #line 1a
INSERT INTO test.t1 VALUES (1,'a'); INSERT INTO #line 1b
test.t1 VALUES (2,'b'); #line 1c

INSERT INTO test.t1 #line 2a
VALUES (3,'c'); INSERT INTO #line 2b
INSERT INTO test.t1 VALUES (4,'d'); #line 2c

* Put cursor in line 1b and execute
>> Note: no syntax error, just an 'empty query' error

* Put cursor in line 2b and execute
>> Note: an 'empty query' error
* Put cursor in line 2c and execute
>> Note: just an 'empty query' error
(I suppose 2a is not considered here, just the first part of the line 2b)

Suggested fix:
Show an error:
  "Error: the query shares one of its multiple lines with another query.  Nothing will be executed.  Please edit your query lay-out, so different queries are on different lines." 
(and grey all the lines of these 'line-sharing' queries.)
[30 Jan 2007 9:58] Sveta Smirnova
Thank you for the report.

First example executes queries on my machine, so this bug be only partially verified.

Behaviour in second case as described.
[30 Jan 2007 9:59] Sveta Smirnova
I think, it should be duplicate of Bug #25584.
[1 Feb 2007 11:05] Mike Lischke
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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html