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: create database name with backtick, unable to write data normally #1389

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 database `mcol-5434`;
Query OK, 1 row affected (0.00 sec)

mysql> use `mcol-5434`;
Database changed

mysql> create table st1(d int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into st1 values(42);
Query OK, 1 row affected (0.00 sec)

mysql> select * from st1;
Empty set (0.00 sec)

Expected behavior

mysql> select * from st1;
+------+
| d    |
+------+
|   42 |
+------+
1 row in set (0.00 sec)

How To Reproduce

No response

Environment

root@ub01:/stonedb57/install/bin# ./mysqld --version
./mysqld  Ver 5.7.36-StoneDB-v1.0.3 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: f5cd1f9bb
        Last commit time: Date:   Tue Mar 7 10:50:50 2023 +0800
        Build time: Date: Fri Mar 10 20:14:28 CST 2023

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

RingsC commented 1 year ago

FIY: https://stackoverflow.com/questions/61095778/drop-database-having-exclamation-and-backtick,

hustjieke commented 1 year ago

In Server version: 5.7.36-StoneDB-v1.0.3.3c18cccf5, the data can be read normally.

mysql> create database `mcol-5434`;
Query OK, 1 row affected (0.00 sec)

mysql> use `mcol-5434`;
Database changed
mysql>  create table st1(d int);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into st1 values(42);
Query OK, 1 row affected (0.04 sec)

mysql> select * from st1;
+------+
| d    |
+------+
|   42 |
+------+
1 row in set (0.01 sec)

Can you check it again ? @davidshiz

davidshiz commented 1 year ago

Ver 5.7.36-StoneDB-v1.0.3.f8cf62b also has this problem @hustjieke