diff options
author | Monty <monty@mariadb.org> | 2017-09-21 16:30:24 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-09-21 16:34:48 +0300 |
commit | 0a44ae6528d1fdb2d4a9dab1be7e36931eac8236 (patch) | |
tree | 49cb66b22401072eb4b3f46fef10cc487b5af8c1 | |
parent | 05da63f0483e2e1d2389e9c6829f269db014dfbb (diff) | |
download | mariadb-git-0a44ae6528d1fdb2d4a9dab1be7e36931eac8236.tar.gz |
Fix that FLUSH TABLES FOR EXPORT also works for Aria tables.
- Added missing test case for MyISAM
-rw-r--r-- | mysql-test/r/myisam.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/maria/maria.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/maria/maria.test | 13 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 13 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 2 |
5 files changed, 43 insertions, 1 deletions
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 5b41b35c1ba..78eb374b142 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2569,6 +2569,14 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK DROP TABLE t1; +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)) engine=myisam; +INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), +(6,'0'),(7,'0'); +flush tables test.t1 for export; +insert into t1 values (8,'0'); +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +unlock tables; +drop table t1; show variables like 'myisam_block_size'; Variable_name Value myisam_block_size 1024 diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 88f39827f27..b5fbcbe113d 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2790,3 +2790,11 @@ test.t1 check status OK SET aria_repair_threads=@@global.aria_repair_threads; SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; DROP TABLE t1; +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); +INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), +(6,'0'),(7,'0'); +flush tables test.t1 for export; +insert into t1 values (8,'0'); +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +unlock tables; +drop table t1; diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index 1b930a22c35..e710f32ef80 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -2019,6 +2019,19 @@ SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; DROP TABLE t1; # +# Check FLUSH FOR EXPORT +# + +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); +INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), + (6,'0'),(7,'0'); +flush tables test.t1 for export; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +insert into t1 values (8,'0'); +unlock tables; +drop table t1; + +# # End of test # # Set defaults back diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 572fa55e70f..0da542e499e 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1770,6 +1770,19 @@ OPTIMIZE TABLE t1; DROP TABLE t1; # +# Check FLUSH FOR EXPORT +# + +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)) engine=myisam; +INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), + (6,'0'),(7,'0'); +flush tables test.t1 for export; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +insert into t1 values (8,'0'); +unlock tables; +drop table t1; + +# # Check some variables # show variables like 'myisam_block_size'; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 119a002a11a..868281be572 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -989,7 +989,7 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | CANNOT_ROLLBACK_FLAG | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_REPAIR | - HA_CAN_VIRTUAL_COLUMNS | + HA_CAN_VIRTUAL_COLUMNS | HA_CAN_EXPORT | HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), can_enable_indexes(1), bulk_insert_single_undo(BULK_INSERT_NONE) {} |