mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-30706 Different results of selects from view and CTE with same definition
MDEV-30668 Set function aggregated in outer select used in view definition This patch fixes two bugs concerning views whose specifications contain subqueries with set functions aggregated in outer selects. Due to the first bug those such views that have implicit grouping were considered as mergeable. This led to wrong result sets for selects from these views. Due to the second bug the aggregation select was determined incorrectly and this led to bogus error messages. The patch added several test cases for these two bugs and for four other duplicate bugs. The patch also enables view-protocol for many other test cases. Approved by Oleksandr Byelkin <sanja@mariadb.com>
This commit is contained in:
@ -2863,8 +2863,7 @@ struct TABLE_LIST
|
||||
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
|
||||
(alias.str ? alias.str : "<NULL>"),
|
||||
get_unit()));
|
||||
derived_type= ((derived_type & DTYPE_MASK) |
|
||||
DTYPE_TABLE | DTYPE_MERGE);
|
||||
derived_type= (derived_type & DTYPE_MASK) | DTYPE_MERGE;
|
||||
set_check_merged();
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -2878,9 +2877,7 @@ struct TABLE_LIST
|
||||
DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
|
||||
(alias.str ? alias.str : "<NULL>"),
|
||||
get_unit()));
|
||||
derived= get_unit();
|
||||
derived_type= ((derived_type & (derived ? DTYPE_MASK : DTYPE_VIEW)) |
|
||||
DTYPE_TABLE | DTYPE_MATERIALIZE);
|
||||
derived_type= (derived_type & DTYPE_MASK) | DTYPE_MATERIALIZE;
|
||||
set_check_materialized();
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user