[MDEV-28343] sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE when schema contains temporary tables Created: 2022-04-18  Updated: 2023-08-12  Resolved: 2023-08-12

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Temporary, Information Schema
Affects Version/s: N/A
Fix Version/s: 11.2.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Problem/Incident
is caused by MDEV-12459 The information_schema tables for get... Closed
Relates
relates to MDEV-28342 sys.create_synonym_db fails when a te... Closed

 Description   

Previous versions have a corner-case problem, sys.create_synonym_db cannot work when a temporary table overshadows a base table with the same name (MDEV-28342).

However, MDEV-12459 extends it to any schema which contains a temporary table, even without overshadowing. This is a regression.

create database db;
use db;
create table t (b int);
create temporary table tmp (a int);
 
call sys.create_synonym_db('db','db_syn');

preview-10.9-MDEV-20119-misc c906db303

mysqltest: At line 6: query 'call sys.create_synonym_db('db','db_syn')' failed: ER_VIEW_SELECT_TMPTABLE (1352): View's SELECT refers to a temporary table 'tmp'



 Comments   
Comment by Anel Husakovic [ 2022-04-27 ]

Hi Monty can you please review https://github.com/MariaDB/server/commit/32274c3e8a46d81ef7a415ed2990434e02e0e11e

Comment by Michael Widenius [ 2023-03-27 ]

ok to push

Comment by Vicențiu Ciorbaru [ 2023-04-04 ]

Since Monty approved this, anel merge this commit in the earliest version where the bug manifests.

Comment by Anel Husakovic [ 2023-04-04 ]

It is related to PR 2189 only.

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