-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: The error message displayed is inaccurate when you drop unique …
- Loading branch information
Showing
4 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
DROP DATABASE IF EXISTS drop_index_test; | ||
CREATE DATABASE drop_index_test; | ||
USE drop_index_test; | ||
CREATE TABLE t1 ( | ||
id int(11) DEFAULT NULL, | ||
name varchar(10) DEFAULT NULL, | ||
UNIQUE KEY idx_id (id) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE t2 ( | ||
`id` int(11) NOT NULL, | ||
`name` text, | ||
PRIMARY KEY (`id`), | ||
FULLTEXT KEY `idx_name` (`name`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE `t3` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`first_name` varchar(10) NOT NULL, | ||
`last_name` text NOT NULL, | ||
`sex` varchar(5) NOT NULL, | ||
`score` int(11) NOT NULL, | ||
`copy_id` int(11) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `idx_uk` (`copy_id`), | ||
KEY `idx_firstname` (`first_name`), | ||
FULLTEXT KEY `idx_lastname` (`last_name`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
set session sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
Warnings: | ||
Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. | ||
drop index idx_id on t1; | ||
ERROR HY000: Tianmu engine does not support unique index. | ||
drop index idx_name on t2; | ||
ERROR HY000: Tianmu engine does not support fulltext index. | ||
drop index idx_firstname on t3; | ||
ERROR HY000: Tianmu engine does not support secondary index. | ||
drop index idx_lastname on t3; | ||
ERROR HY000: Tianmu engine does not support fulltext index. | ||
drop index idx_uk on t3; | ||
ERROR HY000: Tianmu engine does not support unique index. | ||
DROP DATABASE drop_index_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_KEY_ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS drop_index_test; | ||
--enable_warnings | ||
|
||
CREATE DATABASE drop_index_test; | ||
|
||
USE drop_index_test; | ||
|
||
CREATE TABLE t1 ( | ||
id int(11) DEFAULT NULL, | ||
name varchar(10) DEFAULT NULL, | ||
UNIQUE KEY idx_id (id) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
|
||
CREATE TABLE t2 ( | ||
`id` int(11) NOT NULL, | ||
`name` text, | ||
PRIMARY KEY (`id`), | ||
FULLTEXT KEY `idx_name` (`name`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
|
||
CREATE TABLE `t3` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`first_name` varchar(10) NOT NULL, | ||
`last_name` text NOT NULL, | ||
`sex` varchar(5) NOT NULL, | ||
`score` int(11) NOT NULL, | ||
`copy_id` int(11) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `idx_uk` (`copy_id`), | ||
KEY `idx_firstname` (`first_name`), | ||
FULLTEXT KEY `idx_lastname` (`last_name`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
|
||
set session sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
|
||
--error ER_TIANMU_NOT_SUPPORTED_UNIQUE_INDEX | ||
drop index idx_id on t1; | ||
|
||
--error ER_TIANMU_NOT_SUPPORTED_FULLTEXT_INDEX | ||
drop index idx_name on t2; | ||
|
||
--error ER_TIANMU_NOT_SUPPORTED_SECONDARY_INDEX | ||
drop index idx_firstname on t3; | ||
|
||
--error ER_TIANMU_NOT_SUPPORTED_FULLTEXT_INDEX | ||
drop index idx_lastname on t3; | ||
|
||
--error ER_TIANMU_NOT_SUPPORTED_UNIQUE_INDEX | ||
drop index idx_uk on t3; | ||
|
||
DROP DATABASE drop_index_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters