diff options
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/cte_nonrecursive.result | 17 | ||||
-rw-r--r-- | mysql-test/r/func_analyse.result | 2 | ||||
-rw-r--r-- | mysql-test/r/join.result | 2 | ||||
-rw-r--r-- | mysql-test/r/limit_rows_examined.result | 6 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog_row_minimal.result | 156 | ||||
-rw-r--r-- | mysql-test/r/mysqld--help.result | 2 | ||||
-rw-r--r-- | mysql-test/r/parser.result | 82 | ||||
-rw-r--r-- | mysql-test/r/select.result | 2 | ||||
-rw-r--r-- | mysql-test/r/select_jcl6.result | 2 | ||||
-rw-r--r-- | mysql-test/r/select_pkeycache.result | 2 | ||||
-rw-r--r-- | mysql-test/r/sp-error.result | 8 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect_no_exists_to_in.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect_no_mat.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect_no_opts.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect_no_scache.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect_no_semijoin.result | 6 | ||||
-rw-r--r-- | mysql-test/r/union.result | 25 | ||||
-rw-r--r-- | mysql-test/r/view.result | 6 |
19 files changed, 192 insertions, 156 deletions
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index 3899ee9aebf..295c7546ca0 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -763,3 +763,20 @@ a 30 drop view v1; drop table t1; +# +# Bug mdev-10058: Invalid derived table with WITH clause +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE TABLE t3 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (1),(2),(3); +INSERT INTO t3 VALUES (1),(2),(3); +SELECT * FROM (WITH a AS (SELECT * FROM t1) (t2 NATURAL JOIN t3)); +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 't2 NATURAL JOIN t3))' at line 1 +SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT * FROM t2 NATURAL JOIN t3) AS d1; +a +1 +2 +3 +DROP TABLE t1,t2,t3; diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result index bc8ec445e73..1e78e603bca 100644 --- a/mysql-test/r/func_analyse.result +++ b/mysql-test/r/func_analyse.result @@ -159,7 +159,7 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype 1 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL SELECT * FROM t1 UNION SELECT * FROM t1 PROCEDURE analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and subquery +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 'PROCEDURE analyse()' at line 1 # # MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from create_select, select_paren_derived, select_derived2, query_specification # diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index e7292e8ddce..536fd4ab97f 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1476,7 +1476,7 @@ DROP TABLE t1,t2,t3,t4,t5; # MDEV-4752: Segfault during parsing of illegal query # SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4); -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 ')' 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 'SELECT * FROM t3 JOIN t4)' at line 1 # # MDEV-4959: join of const table with NULL fields # diff --git a/mysql-test/r/limit_rows_examined.result b/mysql-test/r/limit_rows_examined.result index 318039db068..cce8ee5a8e2 100644 --- a/mysql-test/r/limit_rows_examined.result +++ b/mysql-test/r/limit_rows_examined.result @@ -173,10 +173,8 @@ Warning 1931 Query execution was interrupted. The query examined at least 8 rows select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0 UNION select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6; -c1 c2 -bb bb -Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete. +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 'UNION +select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6' at line 2 (select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0) UNION (select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 0) diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result index 6ffaeeafc53..20837aeec24 100644 --- a/mysql-test/r/mysqlbinlog_row_minimal.result +++ b/mysql-test/r/mysqlbinlog_row_minimal.result @@ -14,20 +14,20 @@ FLUSH BINARY LOGS; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 -#<date> server id 1 end_log_pos 249 Start: xxx +#<date> server id 1 end_log_pos 249 CRC32 XXX Start: xxx ROLLBACK/*!*/; # at 249 -#<date> server id 1 end_log_pos 274 Gtid list [] -# at 274 -#<date> server id 1 end_log_pos 314 Binlog checkpoint master-bin.000001 -# at 314 -#<date> server id 1 end_log_pos 352 GTID 0-1-1 ddl +#<date> server id 1 end_log_pos 278 CRC32 XXX Gtid list [] +# at 278 +#<date> server id 1 end_log_pos 322 CRC32 XXX Binlog checkpoint master-bin.000001 +# at 322 +#<date> server id 1 end_log_pos 364 CRC32 XXX GTID 0-1-1 ddl /*!100101 SET @@session.skip_parallel_replication=0*//*!*/; /*!100001 SET @@session.gtid_domain_id=0*//*!*/; /*!100001 SET @@session.server_id=1*//*!*/; /*!100001 SET @@session.gtid_seq_no=1*//*!*/; -# at 352 -#<date> server id 1 end_log_pos 532 Query thread_id=4 exec_time=x error_code=0 +# at 364 +#<date> server id 1 end_log_pos 548 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 use `test`/*!*/; SET TIMESTAMP=X/*!*/; SET @@session.pseudo_thread_id=4/*!*/; @@ -40,23 +40,23 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)) /*!*/; -# at 532 -#<date> server id 1 end_log_pos 570 GTID 0-1-2 ddl +# at 548 +#<date> server id 1 end_log_pos 590 CRC32 XXX GTID 0-1-2 ddl /*!100001 SET @@session.gtid_seq_no=2*//*!*/; -# at 570 -#<date> server id 1 end_log_pos 743 Query thread_id=4 exec_time=x error_code=0 +# at 590 +#<date> server id 1 end_log_pos 767 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) /*!*/; -# at 743 -#<date> server id 1 end_log_pos 781 GTID 0-1-3 +# at 767 +#<date> server id 1 end_log_pos 809 CRC32 XXX GTID 0-1-3 /*!100001 SET @@session.gtid_seq_no=3*//*!*/; BEGIN /*!*/; -# at 781 -#<date> server id 1 end_log_pos 833 Table_map: `test`.`t1` mapped to number 30 -# at 833 -#<date> server id 1 end_log_pos 898 Write_rows: table id 30 flags: STMT_END_F +# at 809 +#<date> server id 1 end_log_pos 865 CRC32 XXX Table_map: `test`.`t1` mapped to number 30 +# at 865 +#<date> server id 1 end_log_pos 934 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -68,20 +68,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 898 -#<date> server id 1 end_log_pos 967 Query thread_id=4 exec_time=x error_code=0 +# at 934 +#<date> server id 1 end_log_pos 1007 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 967 -#<date> server id 1 end_log_pos 1005 GTID 0-1-4 +# at 1007 +#<date> server id 1 end_log_pos 1049 CRC32 XXX GTID 0-1-4 /*!100001 SET @@session.gtid_seq_no=4*//*!*/; BEGIN /*!*/; -# at 1005 -#<date> server id 1 end_log_pos 1057 Table_map: `test`.`t1` mapped to number 30 -# at 1057 -#<date> server id 1 end_log_pos 1121 Write_rows: table id 30 flags: STMT_END_F +# at 1049 +#<date> server id 1 end_log_pos 1105 CRC32 XXX Table_map: `test`.`t1` mapped to number 30 +# at 1105 +#<date> server id 1 end_log_pos 1173 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=11 /* INT meta=0 nullable=0 is_null=0 */ @@ -93,20 +93,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ -# at 1121 -#<date> server id 1 end_log_pos 1190 Query thread_id=4 exec_time=x error_code=0 +# at 1173 +#<date> server id 1 end_log_pos 1246 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1190 -#<date> server id 1 end_log_pos 1228 GTID 0-1-5 +# at 1246 +#<date> server id 1 end_log_pos 1288 CRC32 XXX GTID 0-1-5 /*!100001 SET @@session.gtid_seq_no=5*//*!*/; BEGIN /*!*/; -# at 1228 -#<date> server id 1 end_log_pos 1280 Table_map: `test`.`t1` mapped to number 30 -# at 1280 -#<date> server id 1 end_log_pos 1343 Write_rows: table id 30 flags: STMT_END_F +# at 1288 +#<date> server id 1 end_log_pos 1344 CRC32 XXX Table_map: `test`.`t1` mapped to number 30 +# at 1344 +#<date> server id 1 end_log_pos 1411 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=12 /* INT meta=0 nullable=0 is_null=0 */ @@ -118,20 +118,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1343 -#<date> server id 1 end_log_pos 1412 Query thread_id=4 exec_time=x error_code=0 +# at 1411 +#<date> server id 1 end_log_pos 1484 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1412 -#<date> server id 1 end_log_pos 1450 GTID 0-1-6 +# at 1484 +#<date> server id 1 end_log_pos 1526 CRC32 XXX GTID 0-1-6 /*!100001 SET @@session.gtid_seq_no=6*//*!*/; BEGIN /*!*/; -# at 1450 -#<date> server id 1 end_log_pos 1502 Table_map: `test`.`t1` mapped to number 30 -# at 1502 -#<date> server id 1 end_log_pos 1568 Write_rows: table id 30 flags: STMT_END_F +# at 1526 +#<date> server id 1 end_log_pos 1582 CRC32 XXX Table_map: `test`.`t1` mapped to number 30 +# at 1582 +#<date> server id 1 end_log_pos 1652 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ @@ -143,20 +143,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1568 -#<date> server id 1 end_log_pos 1637 Query thread_id=4 exec_time=x error_code=0 +# at 1652 +#<date> server id 1 end_log_pos 1725 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1637 -#<date> server id 1 end_log_pos 1675 GTID 0-1-7 +# at 1725 +#<date> server id 1 end_log_pos 1767 CRC32 XXX GTID 0-1-7 /*!100001 SET @@session.gtid_seq_no=7*//*!*/; BEGIN /*!*/; -# at 1675 -#<date> server id 1 end_log_pos 1727 Table_map: `test`.`t2` mapped to number 31 -# at 1727 -#<date> server id 1 end_log_pos 1890 Write_rows: table id 31 flags: STMT_END_F +# at 1767 +#<date> server id 1 end_log_pos 1823 CRC32 XXX Table_map: `test`.`t2` mapped to number 31 +# at 1823 +#<date> server id 1 end_log_pos 1990 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F ### INSERT INTO `test`.`t2` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -201,20 +201,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1890 -#<date> server id 1 end_log_pos 1959 Query thread_id=4 exec_time=x error_code=0 +# at 1990 +#<date> server id 1 end_log_pos 2063 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1959 -#<date> server id 1 end_log_pos 1997 GTID 0-1-8 +# at 2063 +#<date> server id 1 end_log_pos 2105 CRC32 XXX GTID 0-1-8 /*!100001 SET @@session.gtid_seq_no=8*//*!*/; BEGIN /*!*/; -# at 1997 -#<date> server id 1 end_log_pos 2049 Table_map: `test`.`t2` mapped to number 31 -# at 2049 -#<date> server id 1 end_log_pos 2119 Update_rows: table id 31 flags: STMT_END_F +# at 2105 +#<date> server id 1 end_log_pos 2161 CRC32 XXX Table_map: `test`.`t2` mapped to number 31 +# at 2161 +#<date> server id 1 end_log_pos 2235 CRC32 XXX Update_rows: table id 31 flags: STMT_END_F ### UPDATE `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -233,20 +233,20 @@ BEGIN ### @5=NULL /* INT meta=0 nullable=1 is_null=1 */ ### SET ### @5=5 /* INT meta=0 nullable=1 is_null=0 */ -# at 2119 -#<date> server id 1 end_log_pos 2188 Query thread_id=4 exec_time=x error_code=0 +# at 2235 +#<date> server id 1 end_log_pos 2308 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2188 -#<date> server id 1 end_log_pos 2226 GTID 0-1-9 +# at 2308 +#<date> server id 1 end_log_pos 2350 CRC32 XXX GTID 0-1-9 /*!100001 SET @@session.gtid_seq_no=9*//*!*/; BEGIN /*!*/; -# at 2226 -#<date> server id 1 end_log_pos 2278 Table_map: `test`.`t1` mapped to number 30 -# at 2278 -#<date> server id 1 end_log_pos 2328 Delete_rows: table id 30 flags: STMT_END_F +# at 2350 +#<date> server id 1 end_log_pos 2406 CRC32 XXX Table_map: `test`.`t1` mapped to number 30 +# at 2406 +#<date> server id 1 end_log_pos 2460 CRC32 XXX Delete_rows: table id 30 flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -259,20 +259,20 @@ BEGIN ### DELETE FROM `test`.`t1` ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ -# at 2328 -#<date> server id 1 end_log_pos 2397 Query thread_id=4 exec_time=x error_code=0 +# at 2460 +#<date> server id 1 end_log_pos 2533 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2397 -#<date> server id 1 end_log_pos 2435 GTID 0-1-10 +# at 2533 +#<date> server id 1 end_log_pos 2575 CRC32 XXX GTID 0-1-10 /*!100001 SET @@session.gtid_seq_no=10*//*!*/; BEGIN /*!*/; -# at 2435 -#<date> server id 1 end_log_pos 2487 Table_map: `test`.`t2` mapped to number 31 -# at 2487 -#<date> server id 1 end_log_pos 2537 Delete_rows: table id 31 flags: STMT_END_F +# at 2575 +#<date> server id 1 end_log_pos 2631 CRC32 XXX Table_map: `test`.`t2` mapped to number 31 +# at 2631 +#<date> server id 1 end_log_pos 2685 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F ### DELETE FROM `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -285,13 +285,13 @@ BEGIN ### DELETE FROM `test`.`t2` ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ -# at 2537 -#<date> server id 1 end_log_pos 2606 Query thread_id=4 exec_time=x error_code=0 +# at 2685 +#<date> server id 1 end_log_pos 2758 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2606 -#<date> server id 1 end_log_pos 2650 Rotate to master-bin.000002 pos: 4 +# at 2758 +#<date> server id 1 end_log_pos 2806 CRC32 XXX Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 9d986c54a9d..9717b358f13 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -1149,7 +1149,7 @@ big-tables FALSE bind-address (No default value) binlog-annotate-row-events FALSE binlog-cache-size 32768 -binlog-checksum NONE +binlog-checksum CRC32 binlog-commit-wait-count 0 binlog-commit-wait-usec 100000 binlog-direct-non-transactional-updates FALSE diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 18a8e13815c..efb9ff07565 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -705,11 +705,12 @@ SELECT 1 FROM t1 UNION SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 PROCEDURE ANALYSE() FOR UPDATE; -ERROR HY000: Incorrect usage of PROCEDURE and subquery +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 'PROCEDURE ANALYSE() FOR UPDATE' at line 4 SELECT 1 FROM DUAL PROCEDURE ANALYSE() UNION SELECT 1 FROM t1; -ERROR HY000: Incorrect usage of UNION and SELECT ... PROCEDURE ANALYSE() +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 'UNION +SELECT 1 FROM t1' at line 2 (SELECT 1 FROM t1) UNION (SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 @@ -720,7 +721,7 @@ FOR UPDATE); UNION (SELECT 1 FROM DUAL WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 PROCEDURE ANALYSE() FOR UPDATE); -ERROR HY000: Incorrect usage of PROCEDURE and subquery +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 'PROCEDURE ANALYSE() FOR UPDATE)' at line 4 # "FOR UPDATE" tests SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1; 1 @@ -739,10 +740,10 @@ Warnings: Warning 1329 No data - zero rows fetched, selected, or processed SELECT 1 INTO @var17727401 FROM DUAL; SELECT 1 INTO @var17727401_1 FROM t1 INTO @var17727401_2; -ERROR HY000: Incorrect usage of INTO and INTO +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 'INTO @var17727401_2' at line 1 SELECT 1 INTO @var17727401_1 FROM DUAL INTO @var17727401_2; -ERROR HY000: Incorrect usage of INTO and INTO +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 'INTO @var17727401_2' at line 2 SELECT 1 INTO @var17727401 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1; Warnings: Warning 1329 No data - zero rows fetched, selected, or processed @@ -754,7 +755,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT 1 INTO @var17727401_1 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1 INTO @var17727401_2; -ERROR HY000: Incorrect usage of INTO and INTO +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 'INTO @var17727401_2' at line 3 SELECT (SELECT 1 FROM t1 INTO @var17727401); 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 'INTO @var17727401)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 INTO @var17727401) a; @@ -762,16 +763,16 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT EXISTS(SELECT 1 FROM t1 INTO @var17727401); 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 'INTO @var17727401)' at line 1 SELECT 1 FROM t1 INTO @var17727401 UNION SELECT 1 FROM t1 INTO t1; -ERROR HY000: Incorrect usage of UNION and INTO +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 'UNION SELECT 1 FROM t1 INTO t1' at line 1 (SELECT 1 FROM t1 INTO @var17727401) UNION (SELECT 1 FROM t1 INTO t1); ERROR HY000: Incorrect usage of UNION and INTO SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401; Warnings: Warning 1329 No data - zero rows fetched, selected, or processed SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE(); -ERROR HY000: Incorrect usage of PROCEDURE and INTO +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 'PROCEDURE ANALYSE()' at line 1 SELECT 1 FROM t1 PROCEDURE ANALYSE() INTO @var17727401; -ERROR HY000: Incorrect usage of PROCEDURE and INTO +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 'INTO @var17727401' at line 1 # ORDER and LIMIT clause combinations (SELECT 1 FROM t1 ORDER BY 1) ORDER BY 1; 1 @@ -817,53 +818,53 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT 1 FROM (SELECT 1 FROM t1 UNION SELECT 1 FROM t1 LIMIT 1 ORDER BY 1) 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 'ORDER BY 1) a' at line 1 SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1' at line 1 SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1); -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1) a; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1) a' at line 1 SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1' at line 1 SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1) a; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1) a' at line 1 SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1' at line 1 SELECT (SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1); -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 UNION SELECT 1 FROM t1) a; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1) a' at line 1 SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1; 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 'ORDER BY 1 UNION SELECT 1 FROM t1' at line 1 SELECT (SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1); 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 'ORDER BY 1 UNION SELECT 1 FROM t1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 ORDER BY 1 UNION SELECT 1 FROM t1) a; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'ORDER BY 1 UNION SELECT 1 FROM t1) a' at line 1 SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 ORDER BY 1' at line 1 SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1); -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 ORDER BY 1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 ORDER BY 1) a; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 ORDER BY 1) a' at line 1 SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 LIMIT 1' at line 1 SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 LIMIT 1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 LIMIT 1) a; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 LIMIT 1) a' at line 1 SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 ORDER BY 1' at line 1 SELECT (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 ORDER BY 1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 LIMIT 1 UNION SELECT 1 FROM t1 ORDER BY 1) a; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1 FROM t1 ORDER BY 1) a' at line 1 SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 LIMIT 1' at line 1 SELECT (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1); -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 LIMIT 1)' at line 1 SELECT 1 FROM (SELECT 1 FROM t1 ORDER BY 1 UNION SELECT 1 FROM t1 LIMIT 1) a; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION SELECT 1 FROM t1 LIMIT 1) a' at line 1 DROP TABLE t1; # # MDEV-8380: Subquery parse error @@ -877,3 +878,22 @@ a 2 1 DROP TABLE t1; +# +# MDEV-10080 Derived tables allow double LIMIT clause +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +SELECT * FROM (SELECT * FROM t1 LIMIT 1 LIMIT 2) t1; +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 'LIMIT 2) t1' at line 1 +DROP TABLE t1; +# +# MDEV-10109 Disallow syntactically INSERT .. SELECT .. {ORDER BY ..| LIMIT ..} .. UNION .. +# +INSERT INTO t1 SELECT 1 ORDER BY 1 UNION SELECT 2; +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 'UNION SELECT 2' at line 1 +INSERT INTO t1 SELECT 1 LIMIT 1 UNION SELECT 2; +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 'UNION SELECT 2' at line 1 +CREATE TABLE t1 AS SELECT 1 ORDER BY 1 UNION SELECT 2; +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 'UNION SELECT 2' at line 1 +CREATE TABLE t1 AS SELECT 1 LIMIT 1 UNION SELECT 2; +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 'UNION SELECT 2' at line 1 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 9dbf6e0c46b..8e516c93a14 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3404,7 +3404,7 @@ f1 f2 f2 NULL a NULL drop table t1,t2; select * from (select * left join t on f1=f2) tt; -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 'on f1=f2) tt' 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 'left join t on f1=f2) tt' at line 1 CREATE TABLE t1 (sku int PRIMARY KEY, pr int); CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); INSERT INTO t1 VALUES diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index 81e52929881..99400a09ac7 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -3415,7 +3415,7 @@ f1 f2 f2 NULL a NULL drop table t1,t2; select * from (select * left join t on f1=f2) tt; -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 'on f1=f2) tt' 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 'left join t on f1=f2) tt' at line 1 CREATE TABLE t1 (sku int PRIMARY KEY, pr int); CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); INSERT INTO t1 VALUES diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index 9dbf6e0c46b..8e516c93a14 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -3404,7 +3404,7 @@ f1 f2 f2 NULL a NULL drop table t1,t2; select * from (select * left join t on f1=f2) tt; -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 'on f1=f2) tt' 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 'left join t on f1=f2) tt' at line 1 CREATE TABLE t1 (sku int PRIMARY KEY, pr int); CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); INSERT INTO t1 VALUES diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index c56597e6e44..447afe3d330 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1227,14 +1227,14 @@ DROP PROCEDURE IF EXISTS bug14702; DROP TABLE IF EXISTS t1; CREATE TABLE t1 (i INT); CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO @a; -ERROR HY000: View's SELECT contains a 'INTO' clause +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 'INTO @a' at line 1 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO DUMPFILE "file"; -ERROR HY000: View's SELECT contains a 'INTO' clause +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 'INTO DUMPFILE "file"' at line 1 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO OUTFILE "file"; -ERROR HY000: View's SELECT contains a 'INTO' clause +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 'INTO OUTFILE "file"' at line 1 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT i FROM t1 PROCEDURE ANALYSE(); -ERROR HY000: View's SELECT contains a 'PROCEDURE' clause +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 'PROCEDURE ANALYSE()' at line 2 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1; ERROR HY000: View's SELECT contains a subquery in the FROM clause CREATE PROCEDURE bug20953(i INT) CREATE VIEW v AS SELECT i; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 1b1198958b8..c973bbe11d5 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1056,7 +1056,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5188,9 +5188,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result index 39d1f64410e..8ad01c0816c 100644 --- a/mysql-test/r/subselect_no_exists_to_in.result +++ b/mysql-test/r/subselect_no_exists_to_in.result @@ -1060,7 +1060,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5190,9 +5190,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 211d3206a7f..6dc3cba5a77 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -1063,7 +1063,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5188,9 +5188,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 6ae9f8aa066..843adafe2b9 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -1059,7 +1059,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5184,9 +5184,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 9a3fcd1de3b..348258f5ee1 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -1062,7 +1062,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5194,9 +5194,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 10cf05649e7..cd28339e4c9 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -1059,7 +1059,7 @@ create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT 1.5)' at line 1 select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' drop table t1; @@ -5184,9 +5184,9 @@ a 1 SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; ERROR 42000: Every derived table must have its own alias SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 ') ON 1' 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 'SELECT 1) ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ')) ON 1' 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 'SELECT 1)) ON 1' at line 1 SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1 SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 12f18d6038d..74eb3e069df 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -124,11 +124,11 @@ ERROR 21000: The used SELECT statements have a different number of columns explain select a,b from t1 union select 1 limit 0; ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 into outfile 'skr' union select a,b from t2; -ERROR HY000: Incorrect usage of UNION and INTO +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 'union select a,b from t2' at line 1 select a,b from t1 order by a union select a,b from t2; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'union select a,b from t2' at line 1 insert into t3 select a from t1 order by a union select a from t2; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'union select a from t2' at line 1 create table t3 select a,b from t1 union select a from t2; ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 union select a from t2; @@ -380,7 +380,7 @@ select found_rows(); found_rows() 4 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION all SELECT * FROM t2 LIMIT 2' at line 1 SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2; a 1 @@ -422,7 +422,7 @@ select found_rows(); found_rows() 5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT * FROM t2' at line 1 SELECT COUNT(*) FROM ( (SELECT * FROM t1 LIMIT 100) UNION SELECT * FROM t2) q; COUNT(*) @@ -435,7 +435,7 @@ a 4 5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT * FROM t2' at line 1 SELECT COUNT(*) FROM ( (SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q; COUNT(*) @@ -447,7 +447,7 @@ a 4 5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT * FROM t2 LIMIT 2' at line 1 SELECT COUNT(*) FROM ( (SELECT * FROM t1 LIMIT 1) UNION SELECT * FROM t2) q; COUNT(*) @@ -468,7 +468,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2) q; COUNT(*) 5 SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2; -ERROR HY000: Incorrect usage of UNION and LIMIT +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 'UNION SELECT * FROM t2' at line 1 SELECT COUNT(*) FROM ( (SELECT * FROM t1 limit 2,2) UNION SELECT * FROM t2) q; COUNT(*) @@ -1569,7 +1569,8 @@ UNION ALL SELECT b, COUNT(*) FROM t2 GROUP BY b WITH ROLLUP ORDER BY a UNION SELECT 1,1; -ERROR HY000: Incorrect usage of UNION and ORDER BY +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 'UNION +SELECT 1,1' at line 4 DROP TABLE t1,t2; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (2), (3); @@ -1647,11 +1648,11 @@ SELECT a FROM t1 UNION SELECT a INTO @v FROM t1; SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1; SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1; SELECT a INTO @v FROM t1 UNION SELECT a FROM t1; -ERROR HY000: Incorrect usage of UNION and INTO +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 'UNION SELECT a FROM t1' at line 1 SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1; -ERROR HY000: Incorrect usage of UNION and INTO +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 'UNION SELECT a FROM t1' at line 1 SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1; -ERROR HY000: Incorrect usage of UNION and INTO +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 'UNION SELECT a FROM t1' at line 1 # Tests fix in parser rule query_expression_body. SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1; SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 3fccd6e54c2..ca1a1dfa48a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -923,12 +923,12 @@ select * from v4; ERROR 21000: Subquery returns more than 1 row drop view v4, v3, v2, v1; create view v1 as select 5 into @w; -ERROR HY000: View's SELECT contains a 'INTO' clause +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 'into @w' at line 1 create view v1 as select 5 into outfile 'ttt'; -ERROR HY000: View's SELECT contains a 'INTO' clause +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 'into outfile 'ttt'' at line 1 create table t1 (a int); create view v1 as select a from t1 procedure analyse(); -ERROR HY000: View's SELECT contains a 'PROCEDURE' clause +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 'procedure analyse()' at line 1 create view v1 as select 1 from (select 1) as d1; ERROR HY000: View's SELECT contains a subquery in the FROM clause drop table t1; |