summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-06-16 12:03:15 +0300
committerMonty <monty@mariadb.org>2018-06-19 16:23:34 +0300
commit831df10981b7851871e1f3b8f04079df0cf5da36 (patch)
treea251a9030404924711ed8c7cdbd5da223e455cc4 /sql/sql_union.cc
parent5ba6cee01255186ea77a69f122d3a15c07f44f6d (diff)
downloadmariadb-git-831df10981b7851871e1f3b8f04079df0cf5da36.tar.gz
Add PART_INDIRECT_KEY_FLAG
This is to mark that a field is indirectly part of a key, which simplifes checking if we need to have this field up to date to evaluate a key. For example: CREATE TABLE t1 (a int, b int as (a) virtual, c int as (b) virtual, index(c)) would mark a and b with PART_INDIRECT_KEY_FLAG. c is marked with PART_KEY_FLAG as before.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 178d7393878..b409790c044 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -185,7 +185,7 @@ select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
table->keys_in_use_for_query.clear_all();
for (uint i=0; i < table->s->fields; i++)
- table->field[i]->flags &= ~PART_KEY_FLAG;
+ table->field[i]->flags &= ~(PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG);
if (create_table)
{
@@ -219,7 +219,7 @@ select_union_recursive::create_result_table(THD *thd_arg,
incr_table->keys_in_use_for_query.clear_all();
for (uint i=0; i < table->s->fields; i++)
- incr_table->field[i]->flags &= ~PART_KEY_FLAG;
+ incr_table->field[i]->flags &= ~(PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG);
TABLE *rec_table= 0;
if (! (rec_table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
@@ -230,7 +230,7 @@ select_union_recursive::create_result_table(THD *thd_arg,
rec_table->keys_in_use_for_query.clear_all();
for (uint i=0; i < table->s->fields; i++)
- rec_table->field[i]->flags &= ~PART_KEY_FLAG;
+ rec_table->field[i]->flags &= ~(PART_KEY_FLAG | PART_INDIRECT_KEY_FLAG);
if (rec_tables.push_back(rec_table))
return true;