Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions mysql-test/main/parser.result
Original file line number Diff line number Diff line change
Expand Up @@ -2269,3 +2269,42 @@ $$
#
# End of 10.6 tests
#
#
# MDEV-17677 : Keywords are parsed as identifiers when followed by a dot
#
test for Nd (should work)
SELECT.1;
.1
0.1
SELECT.123+0;
.123+0
0.123
SELECT.5 * 2;
.5 * 2
1.0
test for Mn
SELECT.́1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.�\00811' at line 1
SELECT.̈abc;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.̈abc' at line 1
test for Mc
SELECT.ःtest;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.ःtest' at line 1
test for Pc
SELECT.‿a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.‿a' at line 1
test for Cf
SELECT.‎abc;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.‎abc' at line 1
test for Middle-dot and underscore
SELECT.·123;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT.·123' at line 1
ٍSELECT._1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '�\008DSELECT._1' at line 1
still work as identifier
CREATE TABLE `SELECT` (a INT);
INSERT INTO `SELECT` VALUES (5);
SELECT `SELECT`.a FROM `SELECT`;
a
5
DROP TABLE `SELECT`;
43 changes: 43 additions & 0 deletions mysql-test/main/parser.test
Original file line number Diff line number Diff line change
Expand Up @@ -2067,3 +2067,46 @@ DELIMITER ;$$
--echo #
--echo # End of 10.6 tests
--echo #

--echo #
--echo # MDEV-17677 : Keywords are parsed as identifiers when followed by a dot
--echo #

--echo test for Nd (should work)
SELECT.1;
SELECT.123+0;
SELECT.5 * 2;

--character_set utf8mb4
--echo test for Mn
--error ER_PARSE_ERROR
SELECT.́1;

--error ER_PARSE_ERROR
SELECT.̈abc;


-- echo test for Mc
--error ER_PARSE_ERROR
SELECT.ःtest;

--echo test for Pc
--error ER_PARSE_ERROR
SELECT.‿a;

--echo test for Cf
--error ER_PARSE_ERROR
SELECT.‎abc;

--echo test for Middle-dot and underscore
--error ER_PARSE_ERROR
SELECT.·123;
--error ER_PARSE_ERROR
ٍSELECT._1;

--echo still work as identifier
CREATE TABLE `SELECT` (a INT);
INSERT INTO `SELECT` VALUES (5);
SELECT `SELECT`.a FROM `SELECT`;
DROP TABLE `SELECT`;

2 changes: 1 addition & 1 deletion mysql-test/suite/funcs_1/r/innodb_trig_0407.result
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.trg3' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger db_drop3.t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger mysql.trg3;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/funcs_1/r/memory_trig_0407.result
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.trg3' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger db_drop3.t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger mysql.trg3;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/funcs_1/r/myisam_trig_0407.result
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
set new.f1 = 'Trigger 3.5.4.3';
Drop trigger t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.trg3' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger db_drop3.t1.433.trg3;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.433.trg3' at line 1
Drop trigger mysql.trg3;
Expand Down
4 changes: 2 additions & 2 deletions sql/sql_lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ int Lex_input_stream::scan_ident_middle(THD *thd, Lex_ident_cli_st *str,
yylineno++;
}
}
if (start == get_ptr() && c == '.' && ident_map[(uchar) yyPeek()])
if (start == get_ptr() && c == '.' && ident_map[(uchar) yyPeek()] && !my_isdigit(cs, yyPeek()))
next_state= MY_LEX_IDENT_SEP;
else
{ // '(' must follow directly if function
Expand Down Expand Up @@ -12439,4 +12439,4 @@ bool SELECT_LEX_UNIT::is_derived_eliminated() const
if (!derived->table)
return true;
return derived->table->map & outer_select()->join->eliminated_tables;
}
}