diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2023-05-03 15:15:37 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-05-05 12:45:30 +0300 |
commit | 822dfad630221e1bbb5686b9d95c72e9b50f6b36 (patch) | |
tree | c3602955c04863f81014f0e745e9522f08014c99 /sql/sql_show.cc | |
parent | 9c287c0a90fcb6637417bd118f62c78de78f75ee (diff) | |
download | mariadb-git-bb-11.0-MDEV-31022-variant3.tar.gz |
MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_tablebb-11.0-MDEV-31022-variant3
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 field(s)
length is too large.
- one index added by derived_with_keys optimization.
Make it handle multiple indexes.
As a consequence of this, remove TABLE_SHARE::uniques and replace it with
per-index HA_UNIQUE_HASH flag.
- TABLE_SHARE::uniques made sense when it referred to the only index in the
table.
- Now, we need to know which of table indexes should be a unique constraint,
so we indicate that as an index flag.
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.cc | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8879d5f61c1..672e140bf80 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -8840,7 +8840,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 */ |