[MDEV-25091] CREATE TABLE: field references qualified by a wrong table name succeed Created: 2021-03-09  Updated: 2021-06-21  Resolved: 2021-04-23

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table, Server
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.38, 10.3.29, 10.4.19, 10.5.10

Type: Bug Priority: Major
Reporter: Aleksey Midenkov Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-25672 table alias from previous statement i... Closed
causes MDEV-25673 MariaDB fail to execute CONVERT TO CH... Closed
Relates
relates to MDEV-12483 Add foreign keys support for partitio... Stalled

 Description   

Reproduce

--error ER_BAD_FIELD_ERROR
create table t1 (x int, y int generated always as (t2.x));
--error ER_BAD_FIELD_ERROR
create table t1 (x int, check (t2.x > 0));
--error ER_BAD_FIELD_ERROR
create table t1 (x int, z int default t2.x);

Result

The above commands don't fail. The resulting table misses "t2" qualifier in expressions.

Expected

The above CREATE TABLE commands fail.



 Comments   
Comment by Nikita Malyavin [ 2021-03-26 ]

oktopush�

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