summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-05 20:14:55 +0100
committerSergei Golubchik <serg@mariadb.org>2019-03-06 15:28:27 +0100
commit5f105e756b50930252fa1e630605b19448d5e736 (patch)
tree0881c8ef9014da4c64053307c62bbcd40f235bb6
parentc155946c90307ba448af8b4b5161f35b8af9d31d (diff)
downloadmariadb-git-5f105e756b50930252fa1e630605b19448d5e736.tar.gz
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.
-rw-r--r--storage/mroonga/ha_mroonga.cpp2
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result3
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test5
3 files changed, 5 insertions, 5 deletions
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index bf0c1eab3e3..98afb14c5cf 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -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) {
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result
index 20213f0cbf8..924c3134a3e 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/column_generated_stored_add_column.result
@@ -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"}');
diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test
index 8561688db3a..deae021d540 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test
+++ b/storage/mroonga/mysql-test/mroonga/storage/t/column_generated_stored_add_column.test
@@ -18,9 +18,7 @@
--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,
@@ -28,6 +26,7 @@ CREATE TABLE logs (
) 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"';