mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-27195 SIGSEGV in Table_scope_and_contents_source_st::vers_check_system_fields
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.
This commit is contained in:
parent
3b33593f80
commit
a5ef74e7eb
4 changed files with 28 additions and 2 deletions
1
mysql-test/main/ctype_utf8mb4_unicode_ci_def.opt
Normal file
1
mysql-test/main/ctype_utf8mb4_unicode_ci_def.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--character-set-server=utf8mb4,latin1 --collation-server=utf8mb4_unicode_ci
|
11
mysql-test/main/ctype_utf8mb4_unicode_ci_def.result
Normal file
11
mysql-test/main/ctype_utf8mb4_unicode_ci_def.result
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Start of 10.3 tests
|
||||
#
|
||||
#
|
||||
# MDEV-27195 SIGSEGV in Table_scope_and_contents_source_st::vers_check_system_fields
|
||||
#
|
||||
CREATE TABLE t1 ENGINE=MyISAM WITH SYSTEM VERSIONING AS SELECT 0;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
15
mysql-test/main/ctype_utf8mb4_unicode_ci_def.test
Normal file
15
mysql-test/main/ctype_utf8mb4_unicode_ci_def.test
Normal file
|
@ -0,0 +1,15 @@
|
|||
--echo #
|
||||
--echo # Start of 10.3 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-27195 SIGSEGV in Table_scope_and_contents_source_st::vers_check_system_fields
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 ENGINE=MyISAM WITH SYSTEM VERSIONING AS SELECT 0;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue