Skip to content
Permalink
Browse files
MDEV-18625 ASAN unknown-crash in my_copy_fix_mb / ha_mroonga::storage…
…_inplace_alter_table_add_column

disable inplace alter for adding stored generated columns.

This fixes mroonga/storage.column_generated_stored_add_column failures
in ASAN_OPTIONS="abort_on_error=1" runs

Also, add a test case that shows the bug without ASAN.
  • Loading branch information
vuvova committed Mar 6, 2019
1 parent c155946 commit 5f105e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
@@ -14525,6 +14525,7 @@ enum_alter_inplace_result ha_mroonga::wrapper_check_if_supported_inplace_alter(
Alter_inplace_info::ALTER_COLUMN_NULLABLE |
Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE |
Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE |
Alter_inplace_info::ADD_STORED_GENERATED_COLUMN |
Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
)
)
@@ -14643,7 +14644,6 @@ enum_alter_inplace_result ha_mroonga::storage_check_if_supported_inplace_alter(
Alter_inplace_info::DROP_UNIQUE_INDEX |
MRN_ALTER_INPLACE_INFO_ADD_VIRTUAL_COLUMN |
MRN_ALTER_INPLACE_INFO_ADD_STORED_BASE_COLUMN |
MRN_ALTER_INPLACE_INFO_ADD_STORED_GENERATED_COLUMN |
Alter_inplace_info::DROP_COLUMN |
Alter_inplace_info::ALTER_COLUMN_NAME;
if (ha_alter_info->handler_flags & explicitly_unsupported_flags) {
@@ -1,9 +1,10 @@
DROP TABLE IF EXISTS logs;
set names utf8mb4;
CREATE TABLE logs (
id INT,
record JSON
) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;
INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
INSERT INTO logs(id, record) VALUES (1, json_object('message', repeat('☹', 253)));
ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';
INSERT INTO logs(id, record) VALUES (2, '{"level": "info", "message": "restart"}');
@@ -18,16 +18,15 @@
--source ../../include/mroonga/skip_mariadb_10_1_or_earlier.inc
--source ../../include/mroonga/have_mroonga.inc

--disable_warnings
DROP TABLE IF EXISTS logs;
--enable_warnings
set names utf8mb4;

CREATE TABLE logs (
id INT,
record JSON
) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4;

INSERT INTO logs(id, record) VALUES (1, '{"level": "info", "message": "start"}');
INSERT INTO logs(id, record) VALUES (1, json_object('message', repeat('☹', 253)));

ALTER TABLE logs ADD COLUMN message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) STORED;
ALTER TABLE logs ADD FULLTEXT INDEX(message) comment 'tokenizer "TokenBigramSplitSymbolAlphaDigit"';

0 comments on commit 5f105e7

Please sign in to comment.