Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
Description
If I set sql_mode=IGNORE_SPACE, messages about syntax errors report wrong line numbers:
SET sql_mode=IGNORE_SPACE; |
DROP PROCEDURE IF EXISTS p1; |
DELIMITER $$
|
CREATE PROCEDURE p1() |
BEGIN
|
SELECT 1+1; |
syntax error;
|
END; |
$$
|
DELIMITER ;
|
ERROR 1064 (42000): You have an error in your SQL syntax ... near 'error...' at line 3
|
Notice, the line number 3 is wrong. The syntax error is actually on the line 4.
If I change to sql_mode=DEFAULT, it correctly reports 'at line 4':
SET sql_mode=DEFAULT; |
DROP PROCEDURE IF EXISTS p1; |
DELIMITER $$
|
CREATE PROCEDURE p1() |
BEGIN
|
SELECT 1+1; |
syntax error;
|
END; |
$$
|
DELIMITER ;
|
ERROR 1064 (42000): You have an error in your SQL syntax ... near 'error...' at line 4
|