mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-19186: Assertion `field->table == table' failed in create_tmp_table
Temporary table is defined with the view field in HAVING. Item_direct_view_ref for this field is dropped and that causes error. To fix it Item_direct_view_ref::remove_item_direct_ref() is added.
This commit is contained in:
@ -1318,3 +1318,25 @@ HAVING (1 NOT IN (SELECT COUNT(t1.c1) FROM (v1, t1)));
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19186: temporary table defined with view field in HAVING
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (pk INT, x VARCHAR(10));
|
||||
INSERT INTO t1 VALUES (1,'y'),(2,'s'),(3,'aaa');
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
|
||||
CREATE TABLE t2 (pk INT, x VARCHAR(10));
|
||||
INSERT INTO t2 VALUES (1,'aa'),(2,'t'),(3,'bb');
|
||||
|
||||
CREATE TABLE tmp1
|
||||
SELECT v1.pk
|
||||
FROM t2,v1
|
||||
WHERE v1.x = t2.x
|
||||
GROUP BY v1.pk
|
||||
HAVING (v1.pk = 1);
|
||||
|
||||
DROP TABLE t1,t2,tmp1;
|
||||
DROP VIEW v1;
|
||||
|
Reference in New Issue
Block a user