stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
862 stars 139 forks source link

bug: mysqld crashed when alter table #1806

Open davidshiz opened 1 year ago

davidshiz commented 1 year ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem

mysql> CREATE TABLE t1(c1 INT PRIMARY KEY, c2 CHAR(1), c3 INT);
Query OK, 0 rows affected (0.03 sec)

mysql> ALTER TABLE t1 ADD INDEX (c2);
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/stonedb/build/install8/tmp/mysql.sock' (111)
ERROR:
Can't connect to the server

Expected behavior

No response

How To Reproduce

No response

Environment

root@test-stonedb-debugversion80:~# /stonedb/build/install8/bin/mysqld --version
/stonedb/build/install8/bin/mysqld  Ver 8.0.30-debug for Linux on x86_64 (Source distribution)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-8.0-dev
        Branch name: stonedb-8.0-dev
        Last commit ID: d376a14ae
        Last commit time: Date:   Wed May 10 20:31:35 2023 +0800
        Build time: Date: Tue May 16 12:57:45 UTC 2023

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

RingsC commented 1 year ago

It should issue one of these error messages.

#define ER_TIANMU_NOT_SUPPORTED_SECONDARY_INDEX 3234
#define ER_TIANMU_NOT_SUPPORTED_UNIQUE_INDEX 3235
#define ER_TIANMU_NOT_SUPPORTED_FULLTEXT_INDEX 3236
#define ER_TIANMU_NOT_SUPPORTED_GEOMETRY 3237
#define ER_TIANMU_NOT_SUPPORTED_ENUM 3238
#define ER_TIANMU_NOT_SUPPORTED_SET 3239
#define ER_TIANMU_NOT_SUPPORTED_TRIGGER 3240
#define ER_TIANMU_NOT_SUPPORTED_FOREIGN_KEY 3241
#define ER_TIANMU_NOT_SUPPORTED_PARTITION 3242
#define ER_TIANMU_NOT_FOUND_INDEX 3243
RingsC commented 1 year ago
Copyright (c) 2021, 2022 StoneAtom Group Holding Limited
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> drop database test; 
Query OK, 2 rows affected (0.00 sec)

mysql> create database test; 
Query OK, 1 row affected (0.00 sec)

mysql> use test;
Database changed
mysql> CREATE TABLE t1(c1 INT PRIMARY KEY, c2 CHAR(1), c3 INT);
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER TABLE t1 ADD INDEX (c2);
ERROR 3234 (HY000): Tianmu engine does not support secondary index.
mysql> 

it will issue a error message to indicate "Tianmu engine does not support secondary index".