summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2021-12-22 13:12:40 +0400
committerAlexander Barkov <bar@mariadb.com>2021-12-22 13:12:40 +0400
commita5ef74e7eb4bab09c9bda4fcd7fab12302526ea4 (patch)
tree7195b963353558aa74df1e3a52f826444a7a30e0 /sql/handler.cc
parent3b33593f80442214640eefb2ce75c34698c8043b (diff)
downloadmariadb-git-bb-10.3-bar-MDEV-27195.tar.gz
MDEV-27195 SIGSEGV in Table_scope_and_contents_source_st::vers_check_system_fieldsbb-10.3-bar-MDEV-27195
The old code erroneously used default_charset_info to compare field names. default_charset_info can point to any arbitrary collation, including ucs2*, utf16*, utf32*, including those that do not support strcasecmp(). my_charset_utf8mb4_unicode_ci, which is used in this scenario: CREATE TABLE t1 ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 0; does not support strcasecmp(). Fixing the code to use Lex_ident::streq(), which uses system_charset_info instead of default_charset_info.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 11a387fb4e3..f8702c27a39 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -7264,8 +7264,7 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields(
{
List_iterator<Create_field> dup_it(alter_info->create_list);
for (Create_field *dup= dup_it++; !is_dup && dup != f; dup= dup_it++)
- is_dup= my_strcasecmp(default_charset_info,
- dup->field_name.str, f->field_name.str) == 0;
+ is_dup= Lex_ident(dup->field_name).streq(f->field_name);
}
if (!(f->flags & VERS_UPDATE_UNVERSIONED_FLAG) && !is_dup)