summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin <sachin.setiya@mariadb.com>2019-01-09 14:04:36 +0530
committerSachin <sachin.setiya@mariadb.com>2019-01-09 14:13:56 +0530
commit4424602452c06c6b7d4403ad36d8fc8687e297f5 (patch)
tree405bd95796f56e5f94b1b491d348029ab8814839
parent3724a5b5f477df5c562a86024776ec7513193b11 (diff)
downloadmariadb-git-10.4-blob-index-optimizer.tar.gz
-rw-r--r--include/my_base.h1
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/sql_select.cc6
3 files changed, 6 insertions, 5 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 8a8237ce8b2..5dc55564827 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -317,6 +317,7 @@ enum ha_base_keytype {
#define HA_BIT_PART 1024
#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
+#define LONG_UNIQUE_KEYPART 4096 /* internal, flag for long unique keyparts */
/* optionbits for database */
#define HA_OPTION_PACK_RECORD 1U
diff --git a/sql/handler.cc b/sql/handler.cc
index 6dcac49629e..1d905d92da8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2879,7 +2879,7 @@ int read_long_unique_index(TABLE *table, uint index, const uchar *key)
KEY_PART_INFO *key_part;
Field *field;
//Copy key to table->record , So that we can get long_unique_key
- re_setup_keyinfo_hash(key_info);
+ setup_keyinfo_hash(key_info);
key_part= key_info->key_part;
for (uint i= 0; i < key_info->user_defined_key_parts; i++)
{
@@ -2888,7 +2888,7 @@ int read_long_unique_index(TABLE *table, uint index, const uchar *key)
field->set_notnull();
key_part++;
}
- setup_keyinfo_hash(key_info);
+ re_setup_keyinfo_hash(key_info);
field= key_info->key_part->field;
table->update_virtual_field(field);
return check_duplicate_long_entry_key(table, table->file, table->record[0], index);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 0e06ea9a717..ae9773f53c2 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6060,7 +6060,7 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array, KEY_FIELD *key_field)
uint key_parts= form->actual_n_key_parts(keyinfo);
if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH)
{
- re_setup_keyinfo_hash(keyinfo);
+ setup_keyinfo_hash(keyinfo);
key_parts= keyinfo->user_defined_key_parts;
}
for (uint part=0 ; part < key_parts ; part++)
@@ -6071,13 +6071,13 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array, KEY_FIELD *key_field)
if (add_keyuse(keyuse_array, key_field, key, part))
{
if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH)
- setup_keyinfo_hash(keyinfo);
+ re_setup_keyinfo_hash(keyinfo);
return TRUE;
}
}
}
if (keyinfo->algorithm == HA_KEY_ALG_LONG_HASH)
- setup_keyinfo_hash(keyinfo);
+ re_setup_keyinfo_hash(keyinfo);
}
if (field->hash_join_is_possible() &&
(key_field->optimize & KEY_OPTIMIZE_EQ) &&