summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2023-05-03 15:15:37 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-05-09 10:12:27 +0300
commitb3edbf25a1f3bb4c8d7e9824096fc0538c04a977 (patch)
tree03ec8f43b0a2a5383ac50d1baeeb74c12632df04 /sql/sql_show.cc
parent63df43a0e830c6b54178574e4f72f21d19ed765e (diff)
downloadmariadb-git-bb-11.0-MDEV-31022-variant4.tar.gz
MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_tablebb-11.0-MDEV-31022-variant4
The code in create_internal_tmp_table() didn't take into account that now temporary (derived) tables may have multiple indexes: - one index due to duplicate removal = In this example created by conversion of big-IN(...) into subquery = this index might be converted into a "unique constraint" if the key length is too large. - one index added by derived_with_keys optimization. Make create_internal_tmp_table() handle multiple indexes. Before this patch, use of a unique constraint was indicated in TABLE_SHARE::uniques. This was ok as unique constraint was the only index in the table. Now it's no longer the case so TABLE_SHARE::uniques is removed and replaced with an in-memory-only flag HA_UNIQUE_HASH. This patch is based on Monty's patch. Co-Author: Monty <monty@mariadb.org>
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 1a99f6f0bae..fa95aa66b0f 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -8841,7 +8841,6 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables)
TMP_TABLE_PARAM *p= table_list->schema_table_param;
TMP_ENGINE_COLUMNDEF *from_recinfo, *to_recinfo;
DBUG_ASSERT(table->s->keys == 0);
- DBUG_ASSERT(table->s->uniques == 0);
uchar *cur= table->field[0]->ptr;
/* first recinfo could be a NULL bitmap, not an actual Field */