diff options
author | unknown <mattiasj@mattiasj-laptop.(none)> | 2007-10-23 22:04:09 +0200 |
---|---|---|
committer | unknown <mattiasj@mattiasj-laptop.(none)> | 2007-10-23 22:04:09 +0200 |
commit | fe784fac00494c1d48f0c245d0d4c23bfb717680 (patch) | |
tree | ae6b358b3da64df8da7e63c711904dafb7200838 /sql/table.cc | |
parent | 82e6e6fb665e8f1c6d60559ebed0c9ecf115fecd (diff) | |
download | mariadb-git-fe784fac00494c1d48f0c245d0d4c23bfb717680.tar.gz |
Bug #30695: An apostrophe ' in the comment of the ADD PARTITION
causes the Server to crash.
Accessing partitioned table with an apostrophe in partition options
like DATA DIRECTORY, INDEX DIRECTORY or COMMENT causes server crash.
Partition options were saved in .frm file without escaping.
When accessing such table it is not possible to properly restore
partition information.
Crashed because there was no check for partition info parser failure.
Fixed by escaping quoted text in the partition info when writing it to
the frm-file and added a check that it was able to parse the partition
info before using it
NOTE: If the comment is written by an earlier version of the server,
the corrupted frm-file is not fixed, but left corrupted, you have to
manually drop the table and recreate it.
mysql-test/r/partition.result:
bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
testresult
mysql-test/t/partition.test:
bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
testcase
sql/sql_partition.cc:
Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
Crashes when there is an non escaped apostrophe in the partition options
fixed by escaping quoted text before writing to the frm-file
sql/table.cc:
Bug #30695 An apostrophe ' in the comment of the ADD PARTITION
causes the Server to crash
problem was using a null poiter without check -> crash.
added a check that the previus call succeded
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index ccddbf8134b..7cf5eeaaad6 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1782,7 +1782,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, outparam, is_create_table, share->default_part_db_type, &work_part_info_used); - outparam->part_info->is_auto_partitioned= share->auto_partitioned; + if (!tmp) + outparam->part_info->is_auto_partitioned= share->auto_partitioned; DBUG_PRINT("info", ("autopartitioned: %u", share->auto_partitioned)); /* we should perform the fix_partition_func in either local or caller's arena depending on work_part_info_used value |