From 59bbe873d48b13eb3b8a912c2187ea94ee165ae9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 3 Nov 2020 19:07:16 +0100 Subject: Revert "MDEV-24033: SIGSEGV in __memcmp_avx2_movbe from queue_insert | SIGSEGV in __memcmp_avx2_movbe from native_compare" This reverts commit 5a0c34e4c2fd951119efb432eedcaa65a1d36606. but keeps the test case --- sql/sql_class.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 84f188b7803..d2b0b40846b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5456,8 +5456,6 @@ struct SORT_FIELD_ATTR { uint length; /* Length of sort field */ uint suffix_length; /* Length suffix (0-4) */ - enum Type { FIXED_SIZE, VARIABLE_SIZE } type; - bool is_variable_sized() { return type == VARIABLE_SIZE; } }; -- cgit v1.2.1 From f6e91552f00daf7f87bffd3a64082dc5673af95c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 11 Nov 2020 15:51:18 +0100 Subject: MDEV-4677 GROUP_CONCAT not showing any output with group_concat_max_len >= 4Gb don't allow group_concat_max_len values >= 4Gb (they never worked anyway) --- sql/sql_class.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index d2b0b40846b..35068245830 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -555,7 +555,6 @@ typedef struct system_variables ulonglong bulk_insert_buff_size; ulonglong join_buff_size; ulonglong sortbuff_size; - ulonglong group_concat_max_len; ulonglong default_regex_flags; ulonglong max_mem_used; @@ -645,6 +644,8 @@ typedef struct system_variables uint32 gtid_domain_id; uint64 gtid_seq_no; + uint group_concat_max_len; + /** Default transaction access mode. READ ONLY (true) or READ WRITE (false). */ -- cgit v1.2.1 From a244be7044534a59199a0f11e856be37ba6f02c8 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 16 Dec 2020 09:11:11 -0800 Subject: MDEV-23406 Signal 8 in maria_create after recursive cte query This bug could cause a crash when executing queries that used mutually recursive CTEs with system variable big_tables set to 1. It happened due to several bugs in the code that handled recursive table references referred mutually recursive CTEs. For each recursive table reference a temporary table is created that contains all rows generated for the corresponding recursive CTE table on the previous step of recursion. This temporary table should be created in the same way as the temporary table created for a regular materialized derived table using the method select_union::create_result_table(). In this case when the temporary table is created it uses the select_union::TMP_TABLE_PARAM structure as the parameter for the table construction. However the code created the temporary table using just the function create_tmp_table() and passed pointers to certain fields of the TMP_TABLE_PARAM structure used for accumulation of rows of the recursive CTE table as parameters for update. This was a mistake because now different temporary tables cannot share some TMP_TABLE_PARAM fields in a general case. Besides, depending on how mutually recursive CTE tables were defined and which of them were referred in the executed query the select_union object allocated for a recursive table reference could be allocated again after the the temporary table had been created. In this case the TMP_TABLE_PARAM object associated with the temporary table created for the recursive table reference contained unassigned fields needed for execution when Aria engine is employed as the engine for temporary tables. This patch ensures that - select_union object is created only once for any recursive table reference - any temporary table created for recursive CTEs uses its own TMP_TABLE_PARAM structure The patch also fixes a problem caused by incomplete cleanup of join tables associated with recursive table references. Approved by Oleksandr Byelkin --- sql/sql_class.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 35068245830..b68e3553a2d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5152,10 +5152,15 @@ class select_union_recursive :public select_union public: /* The temporary table with the new records generated by one iterative step */ TABLE *incr_table; + /* The TMP_TABLE_PARAM structure used to create incr_table */ + TMP_TABLE_PARAM incr_table_param; /* One of tables from the list rec_tables (determined dynamically) */ TABLE *first_rec_table_to_update; - /* The temporary tables used for recursive table references */ - List rec_tables; + /* + The list of all recursive table references to the CTE for whose + specification this select_union_recursive was created + */ + List rec_table_refs; /* The count of how many times cleanup() was called with cleaned==false for the unit specifying the recursive CTE for which this object was created @@ -5165,7 +5170,8 @@ class select_union_recursive :public select_union select_union_recursive(THD *thd_arg): select_union(thd_arg), - incr_table(0), first_rec_table_to_update(0), cleanup_count(0) {}; + incr_table(0), first_rec_table_to_update(0), cleanup_count(0) + { incr_table_param.init(); }; int send_data(List &items); bool create_result_table(THD *thd, List *column_types, -- cgit v1.2.1