mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
ANSI_QUOTES mode) This patch contains a test case only, showing that the bug has been fixed. The issue was related to parsing <"blah">, where the lexical analyser would not properly delimit the start and end of the token. Properly making the token boundaries has been fixed in sql_lex.cc with the patch for bug 25411 : see the Lex_input_stream class. mysql-test/r/parser.result: Test case for Bug#25930, which was fixed by Bug#25411 mysql-test/t/parser.test: Test case for Bug#25930, which was fixed by Bug#25411
This commit is contained in:
@ -273,6 +273,16 @@ create table VAR_SAMP(a int);
|
|||||||
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 'VAR_SAMP(a int)' at line 1
|
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 'VAR_SAMP(a int)' at line 1
|
||||||
create table VAR_SAMP (a int);
|
create table VAR_SAMP (a int);
|
||||||
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 'VAR_SAMP (a int)' at line 1
|
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 'VAR_SAMP (a int)' at line 1
|
||||||
|
DROP TABLE IF EXISTS table_25930_a;
|
||||||
|
DROP TABLE IF EXISTS table_25930_b;
|
||||||
|
SET SQL_MODE = 'ANSI_QUOTES';
|
||||||
|
CREATE TABLE table_25930_a ( "blah" INT );
|
||||||
|
CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
|
||||||
|
desc table_25930_b;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
"blah" - 1 bigint(12) YES NULL
|
||||||
|
DROP TABLE table_25930_a;
|
||||||
|
DROP TABLE table_25930_b;
|
||||||
SET @@sql_mode=@save_sql_mode;
|
SET @@sql_mode=@save_sql_mode;
|
||||||
select pi(3.14);
|
select pi(3.14);
|
||||||
ERROR 42000: Incorrect parameter count in the call to native function 'pi'
|
ERROR 42000: Incorrect parameter count in the call to native function 'pi'
|
||||||
|
@ -363,6 +363,28 @@ create table VAR_SAMP(a int);
|
|||||||
--error ER_PARSE_ERROR
|
--error ER_PARSE_ERROR
|
||||||
create table VAR_SAMP (a int);
|
create table VAR_SAMP (a int);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
|
||||||
|
# ANSI_QUOTES mode)
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS table_25930_a;
|
||||||
|
DROP TABLE IF EXISTS table_25930_b;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
SET SQL_MODE = 'ANSI_QUOTES';
|
||||||
|
CREATE TABLE table_25930_a ( "blah" INT );
|
||||||
|
CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
|
||||||
|
|
||||||
|
# The lexer used to chop the first <">,
|
||||||
|
# not marking the start of the token "blah" correctly.
|
||||||
|
desc table_25930_b;
|
||||||
|
|
||||||
|
DROP TABLE table_25930_a;
|
||||||
|
DROP TABLE table_25930_b;
|
||||||
|
|
||||||
|
|
||||||
SET @@sql_mode=@save_sql_mode;
|
SET @@sql_mode=@save_sql_mode;
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
Reference in New Issue
Block a user