summaryrefslogtreecommitdiff
path: root/mysql-test/main/parser.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-11-17 16:59:38 +0200
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:54:11 +0200
commitf16b8590bf37922c6f304b8d04f32e3562eb9386 (patch)
treefd989e1c64cf244ca8304e0f89f485fbeb5a4632 /mysql-test/main/parser.test
parent7b134ffa3debd9bbc703cfc3ea9d42741f50570a (diff)
downloadmariadb-git-f16b8590bf37922c6f304b8d04f32e3562eb9386.tar.gz
MDEV-19682 sql_mode="oracle" does not support sysdate
Diffstat (limited to 'mysql-test/main/parser.test')
-rw-r--r--mysql-test/main/parser.test54
1 files changed, 51 insertions, 3 deletions
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 302cd8fbbb3..816e55435d1 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;
@@ -1900,6 +1900,54 @@ 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 #
+
+--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 ;$$
--echo #
--echo # End of 10.6 tests