[MDEV-10096] Behaviour of SQL_NO_CACHE in derived tables is not consistent Created: 2016-05-21  Updated: 2018-06-15

Status: Open
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-8909 union parser cleanup Closed

 Description   

This script (notice sql_no_cache is used as a column name rather than an option):

CREATE OR REPLACE TABLE t1 (sql_no_cache INT);
SELECT * FROM (SELECT 1 UNION SELECT SQL_NO_CACHE FROM t1) AS t1;

returns:

+------+
| 1    |
+------+
|    1 |
+------+

This script:

CREATE OR REPLACE TABLE t1 (sql_no_cache INT);
SELECT * FROM (SELECT SQL_NO_CACHE FROM t1) AS t1;

returns

ERROR 1234 (42000): Incorrect usage/placement of 'SQL_NO_CACHE'

Looks wrong. It should return the result.



 Comments   
Comment by Alexander Barkov [ 2016-05-21 ]

This query:

SELECT 1 FROM t1 UNION SELECT SQL_NO_CACHE FROM t1;

also returns:

ERROR 1234 (42000): Incorrect usage/placement of 'SQL_NO_CACHE'

It should be a syntax error instead.

Comment by Alexander Barkov [ 2018-06-15 ]

Let's fix in 10.4, in the new grammar being added by MDEV-11953.

Generated at Thu Feb 08 07:39:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.