summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-10-28 13:43:51 +0400
committerAlexander Barkov <bar@mariadb.com>2023-01-19 20:33:03 +0400
commit284ac6f2b73650f138064c97a96c8e1d8846550b (patch)
treeefcc8d98f8635636e09134926346fe23d663d17d /sql/table.cc
parent9924466b3b9b3cdc590106e0036e6fb67d9aa4b0 (diff)
downloadmariadb-git-284ac6f2b73650f138064c97a96c8e1d8846550b.tar.gz
MDEV-27653 long uniques don't work with unicode collations
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index a06834afd8b..2b5787d1511 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1056,6 +1056,18 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share,
}
}
+
+Item_func_hash *TABLE_SHARE::make_long_hash_func(THD *thd,
+ MEM_ROOT *mem_root,
+ List<Item> *field_list)
+ const
+{
+ if (old_long_hash_function())
+ return new (mem_root) Item_func_hash_mariadb_100403(thd, *field_list);
+ return new (mem_root) Item_func_hash(thd, *field_list);
+}
+
+
/** Parse TABLE_SHARE::vcol_defs
unpack_vcol_info_from_frm
@@ -1267,7 +1279,10 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
list_item= new (mem_root) Item_field(thd, keypart->field);
field_list->push_back(list_item, mem_root);
}
- Item_func_hash *hash_item= new(mem_root)Item_func_hash(thd, *field_list);
+
+ Item_func_hash *hash_item= table->s->make_long_hash_func(thd, mem_root,
+ field_list);
+
Virtual_column_info *v= new (mem_root) Virtual_column_info();
field->vcol_info= v;
field->vcol_info->expr= hash_item;