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 crash when create unique index #1828

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 (f1 varchar(5));
Query OK, 0 rows affected (0.02 sec)

mysql> insert into t1 values ('w'), ('w');
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> create unique index index_t1 on t1(f1(4));
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?

hustjieke commented 1 year ago

In 5.7, return unique index not support.

mysql> create unique index index_t1 on t1(f1(4));
ERROR 3235 (HY000): Tianmu engine does not support unique index.