diff options
Diffstat (limited to 'mysql-test/main/parser.test')
-rw-r--r-- | mysql-test/main/parser.test | 81 |
1 files changed, 78 insertions, 3 deletions
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test index 873949c7332..cbd3274113a 100644 --- a/mysql-test/main/parser.test +++ b/mysql-test/main/parser.test @@ -158,8 +158,8 @@ create table SUM(a int); create table SUM (a int); drop table SUM; ---error ER_PARSE_ERROR create table SYSDATE(a int); +DROP TABLE SYSDATE; create table SYSDATE (a int); drop table SYSDATE; @@ -332,10 +332,10 @@ create table SUM(a int); --error ER_PARSE_ERROR create table SUM (a int); ---error ER_PARSE_ERROR create table SYSDATE(a int); ---error ER_PARSE_ERROR +DROP TABLE SYSDATE; create table SYSDATE (a int); +DROP TABLE SYSDATE; create table SYSTEM_USER(a int); drop table SYSTEM_USER; @@ -885,6 +885,7 @@ SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 FOR UPDATE; --echo # "INTO" clause tests +--enable_prepare_warnings SELECT 1 FROM t1 INTO @var17727401; SELECT 1 FROM DUAL INTO @var17727401; SELECT 1 INTO @var17727401; @@ -924,6 +925,7 @@ SELECT 1 FROM t1 INTO @var17727401 UNION SELECT 1 FROM t1 INTO t1; SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401; +--disable_prepare_warnings --error ER_PARSE_ERROR SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE(); @@ -1929,3 +1931,76 @@ SELECT CAST(1 AS ACTION); --echo # --echo # End of 10.5 tests --echo # + +--echo # +--echo # Start of 10.6 tests +--echo # + +--echo # +--echo # MDEV-25510 Assertion `sel->select_lock == +--echo # st_select_lex::select_lock_type::NONE' failed in Lex_select_lock::set_to +--echo # + +--error ER_NO_SUCH_TABLE +(SELECT x FROM t WINDOW w1 AS () FOR UPDATE) LIMIT 1; +create table t1 (x int); +insert into t1 values (1),(2); +explain extended (SELECT x FROM t1 WINDOW w1 as () FOR UPDATE) LIMIT 1; +explain extended (SELECT x FROM t1 FOR UPDATE) LIMIT 1; +drop table t1; +--echo # +--echo # MDEV-19682 sql_mode="oracle" does not support sysdate +--echo # + +--enable_prepare_warnings + +--error ER_BAD_FIELD_ERROR +SELECT sysdate LIKE '____-__-__ __:__:__'; +--error ER_BAD_FIELD_ERROR +SELECT sysdate = sysdate(); +--error ER_BAD_FIELD_ERROR +SELECT sysdate = sysdate(0); + +CREATE DATABASE sysdate; +DROP DATABASE sysdate; + +CREATE TABLE sysdate (a INT); +DROP TABLE sysdate; + +CREATE TABLE t1 (sysdate INT); +DROP TABLE t1; + +DELIMITER $$; +CREATE FUNCTION sysdate() RETURNS INT +BEGIN + RETURN 1; +END; +$$ +DELIMITER ;$$ +DROP FUNCTION sysdate; + +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE sysdate INT DEFAULT 10; + SELECT sysdate; +END; +$$ +DELIMITER ;$$ + +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE a INT DEFAULT 0; +sysdate: + WHILE a DO + SELECT 1; + LEAVE sysdate; + END WHILE ; +END; +$$ +DELIMITER ;$$ + +--disable_prepare_warnings + +--echo # +--echo # End of 10.6 tests +--echo # |