1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-30151 parse error 1=2 not between/in

This patch fixes the problem by adding a new rule booleat_test.
This makes the grammar clearer and less conflicting.

Additionally, fixing %prec in this grammar branch:

-        | boolean_test IS NULL_SYM %prec PREC_BELOW_NOT
+        | boolean_test IS NULL_SYM %prec IS

to have consistently "%prec IS" in all grammar branches starting
with "boolean_test IS ...".
It's not clear why these three rules needed different %prec before the fix:

- boolean_test IS TRUE
- boolean_test IS UNKNOWN
- boolean_test IS NULL
This commit is contained in:
Alexander Barkov
2022-12-12 17:45:48 +04:00
parent b1043ea0ed
commit 895673dae5
4 changed files with 130 additions and 30 deletions

View File

@ -1673,4 +1673,25 @@ EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc';
SET @@sql_mode=@save_sql_mode;
--echo #
--echo # MDEV-30151 parse error 1=2 not between/in
--echo #
SELECT 1=2 NOT IN (3,4);
SELECT 1=2 NOT BETWEEN 3 AND 4;
CREATE TABLE t1 ( f INT AS ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 ( f INT, CHECK ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) );
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE VIEW v1 AS SELECT 1 IN ( 2 NOT BETWEEN 3 AND 4 );
SHOW CREATE VIEW v1;
DROP VIEW v1;
--echo #
--echo # End of 10.3 tests
--echo #