Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: The error message displayed is inaccurate when you drop unique index or drop fulltext index. #1342

Closed
3 tasks done
haitaoguan opened this issue Feb 28, 2023 · 1 comment · Fixed by #1356
Closed
3 tasks done
Assignees
Labels
A-bug Something isn't working

Comments

@haitaoguan
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

mysql> show variables like 'sql_mode';
+---------------+-----------------------------------------------------------------------------+
| Variable_name | Value                                                                       |
+---------------+-----------------------------------------------------------------------------+
| sql_mode      | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_KEY_ERROR |
+---------------+-----------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show create table xxx\G
*************************** 1. row ***************************
       Table: xxx
Create Table: CREATE TABLE `xxx` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(10) DEFAULT NULL,
  UNIQUE KEY `idx_id` (`id`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql> drop index idx_id on xxx;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> set global sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye

mysql> show variables like 'sql_mode';
+---------------+----------------------------------------------------------------+
| Variable_name | Value                                                          |
+---------------+----------------------------------------------------------------+
| sql_mode      | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+----------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> show create table xxx\G
*************************** 1. row ***************************
       Table: xxx
Create Table: CREATE TABLE `xxx` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(10) DEFAULT NULL,
  UNIQUE KEY `idx_id` (`id`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.01 sec)

mysql> drop index idx_id on xxx;
ERROR 2233 (HY000): Be disgraceful to storage engine, operating is forbidden!

The error message is display StoneDB don't support drop unique index or drop fulltext index.However StoneDB support drop unique index or drop fulltext index.The error message maybe display
ERROR 3235 (HY000): Tianmu engine does not support unique index.

Expected behavior

###drop unique index
ERROR 3235 (HY000): Tianmu engine does not support unique index.
###drop fulltext index
ERROR 3236 (HY000): Tianmu engine does not support fulltext index.

How To Reproduce

No response

Environment

build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: f8df638
Last commit time: Date: Mon Feb 27 19:36:39 2023 +0800
Build time: Date: Tue Feb 28 10:02:51 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@haitaoguan haitaoguan added the A-bug Something isn't working label Feb 28, 2023
@haitaoguan
Copy link
Collaborator Author

mysql> show variables like 'sql_mode';
+---------------+-----------------------------------------------------------------------------+
| Variable_name | Value                                                                       |
+---------------+-----------------------------------------------------------------------------+
| sql_mode      | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_KEY_ERROR |
+---------------+-----------------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` int(11) NOT NULL,
  `name` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `idx_name` (`name`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql> drop index idx_name on ttt;
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> set global sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye

mysql> show variables like 'sql_mode';
+---------------+----------------------------------------------------------------+
| Variable_name | Value                                                          |
+---------------+----------------------------------------------------------------+
| sql_mode      | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+----------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` int(11) NOT NULL,
  `name` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `idx_name` (`name`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.01 sec)

mysql> drop index idx_name on ttt;
ERROR 2233 (HY000): Be disgraceful to storage engine, operating is forbidden!

@wisehead wisehead added this to the stonedb_5.7_v1.0.3 milestone Mar 1, 2023
@wisehead wisehead assigned konghaiya and wisehead and unassigned konghaiya Mar 1, 2023
wisehead added a commit to wisehead/stonedb that referenced this issue Mar 7, 2023
@mergify mergify bot closed this as completed in #1356 Mar 8, 2023
mergify bot pushed a commit that referenced this issue Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants