mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
This commit is contained in:
parent
9a5a86f293
commit
5cfc7799a3
4 changed files with 41 additions and 1 deletions
BIN
mysql-test/std_data/frm/mdev16518.frm
Normal file
BIN
mysql-test/std_data/frm/mdev16518.frm
Normal file
Binary file not shown.
|
@ -409,3 +409,19 @@ Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when c
|
|||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
# MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
|
||||
#
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
t1
|
||||
SHOW CREATE TABLE t1;
|
||||
ERROR HY000: Incorrect information in file: './test/t1.frm'
|
||||
ALTER TABLE t1;
|
||||
ERROR HY000: Incorrect information in file: './test/t1.frm'
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
|
|
@ -371,3 +371,26 @@ SELECT COLUMN_GET(@aaa, 'price' AS DOUBLE) aaa;
|
|||
--echo #
|
||||
--echo # End of 10.1 tests
|
||||
--echo #
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.2 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
|
||||
--echo #
|
||||
|
||||
--copy_file std_data/frm/mdev16518.frm $MYSQLD_DATADIR/test/t1.frm
|
||||
SHOW TABLES;
|
||||
--replace_result $MYSQLD_DATADIR ./
|
||||
--error ER_NOT_FORM_FILE
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $MYSQLD_DATADIR ./
|
||||
--error ER_NOT_FORM_FILE
|
||||
ALTER TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.frm
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.2 tests
|
||||
--echo #
|
||||
|
|
|
@ -1839,7 +1839,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
|
|||
goto err;
|
||||
vcol_info= new (&share->mem_root) Virtual_column_info();
|
||||
vcol_info_length= uint2korr(vcol_screen_pos + 1);
|
||||
DBUG_ASSERT(vcol_info_length);
|
||||
if (!vcol_info_length) // Expect non-empty expression
|
||||
goto err;
|
||||
vcol_info->stored_in_db= vcol_screen_pos[3];
|
||||
vcol_info->utf8= 0;
|
||||
vcol_screen_pos+= vcol_info_length + MYSQL57_GCOL_HEADER_SIZE;;
|
||||
|
|
Loading…
Reference in a new issue