[MDEV-19112] WITH clause does not work with information_schema as default database Created: 2019-04-01  Updated: 2019-05-17  Resolved: 2019-04-06

Status: Closed
Project: MariaDB Server
Component/s: Information Schema, Optimizer - CTE
Affects Version/s: 10.3.13, 10.2, 10.3, 10.4
Fix Version/s: 10.2.24, 10.3.15

Type: Bug Priority: Major
Reporter: Valerii Kravchuk Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-19490 show tables fails when selecting the ... Closed
causes MDEV-19504 Segfault in COM_FIELD_LIST for INFORM... Closed

 Description   

I tried to play with simple CTEs in test schema (or without default schema at all):

MariaDB [test]> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t1             |
+----------------+
1 row in set (0.14 sec)
 
MariaDB [test]> with t as (select 1 as t) select * from t;
+---+
| t |
+---+
| 1 |
+---+
1 row in set (0.13 sec)

Everything works as expected and documented in https://mariadb.com/kb/en/library/with/. But as soon as I change default schema to information_schema the same query fails:

MariaDB [test]> use information_schema
Database changed
MariaDB [information_schema]> with t as (select 1 as t) select * from t;
ERROR 1109 (42S02): Unknown table 't' in information_schema
MariaDB [information_schema]> select version();
+----------------------------------------+
| version()                              |
+----------------------------------------+
| 10.3.13-MariaDB-1:10.3.13+maria~bionic |
+----------------------------------------+
1 row in set (0.14 sec)

I do not understand why this happens. It does not seem to be expected or documented.



 Comments   
Comment by Oleksandr Byelkin [ 2019-04-05 ]

OK to push!

Comment by Igor Babaev [ 2019-04-06 ]

A fix for this bug was pushed into 10.2

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