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: ALTER table DROP primary key is forbidden #1034

Closed
2 of 3 tasks
davidshiz opened this issue Nov 30, 2022 · 4 comments · Fixed by #1055
Closed
2 of 3 tasks

bug: ALTER table DROP primary key is forbidden #1034

davidshiz opened this issue Nov 30, 2022 · 4 comments · Fixed by #1055
Assignees
Labels
A-bug Something isn't working prio: normal Medium priority

Comments

@davidshiz
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> create table t1 (id int primary key);
Query OK, 0 rows affected (0.41 sec)

mysql> alter table t1 drop primary key;
ERROR 2233 (HY000): Be disgraceful to storage engine, operating is forbidden!

Expected behavior

mysql> create table t1 (id int primary key);
Query OK, 0 rows affected (0.01 sec)

mysql> alter table t1 drop primary key;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

How To Reproduce

create table t1 (id int primary key);
alter table t1 drop primary key;

Environment

[root@HAST04 ~]# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
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: 7f69d33
        Last commit time: Date:   Tue Nov 22 06:31:04 2022 +0000
        Build time: Date: Tue Nov 22 16:53:27 CST 2022
[root@HAST04 ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"

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

  • Yes, I will!
@davidshiz davidshiz added the A-bug Something isn't working label Nov 30, 2022
@hustjieke hustjieke added the prio: normal Medium priority label Nov 30, 2022
@adofsauron
Copy link
Collaborator

ACK

@adofsauron
Copy link
Collaborator

Execution stack for alarm:

lALPGTO6nex-H-3NB1XNDas_3499_1877

(gdb) bt
#0  THD::send_statement_status (this=0x7f0c18006f20) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_class.cc:4799
#1  0x00000000023a6a1b in dispatch_command (thd=0x7f0c18006f20, com_data=0x7f0dfeabd730, command=COM_QUERY) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:1912
#2  0x00000000023a4445 in do_command (thd=0x7f0c18006f20) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/sql_parse.cc:1034
#3  0x00000000024d5ad9 in handle_connection (arg=0x878fe70) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/sql/conn_handler/connection_handler_per_thread.cc:313
#4  0x0000000002ba2e22 in pfs_spawn_thread (arg=0x8169180) at /home/jenkins/workspace/stonedb5.7-zsl-centos7.9-75-133/storage/perfschema/pfs.cc:2197
#5  0x00007f0e0946d1ca in start_thread () from /lib64/libpthread.so.0
#6  0x00007f0e067bfe73 in clone () from /lib64/libc.so.6

@adofsauron
Copy link
Collaborator

Self-test completed, repairable

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

mysql> alter table t1 drop primary key;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` int(11) NOT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

@adofsauron
Copy link
Collaborator

Only one problem is handled at a time. This problem is about deleting the primary key. Other problems are not recorded in this ISSUE

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 prio: normal Medium priority
Projects
Development

Successfully merging a pull request may close this issue.

5 participants