mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-13354: Server crashes in find_field_in_tables upon PS with window function and subquery
When creating an Item_direct_view_ref we were setting the Name_resolution_context based on TABLE_LIST::view member variable. However, for derived tables this member is NULL. To not set a wrong context, if TABLE_LIST::view is empty, use THD::lex instead.
This commit is contained in:
@ -2025,3 +2025,14 @@ FROM t1
|
||||
ORDER BY a;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-13354: Server crashes in find_field_in_tables upon PS with window function and subquery
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (i INT, a char);
|
||||
INSERT INTO t1 VALUES (1, 'a'),(2, 'b');
|
||||
PREPARE stmt FROM "SELECT row_number() over (partition by i order by i), i FROM (SELECT * from t1) as sq";
|
||||
EXECUTE stmt;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user