-
Notifications
You must be signed in to change notification settings - Fork 276
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
cannot find table name with error ERROR 1064 (HY000): SQL parser error: table "tt" does not exist
when lower_case_table_names
is set to 0
, but select
works normally
#15482
Comments
aronchen@momac matrixone % cat ./etc/launch/cn.toml
service-type = "CN"
data-dir = "./mo-data"
[log]
level = "info"
[cn]
uuid = "dd1dccb4-4d3c-41f8-b482-5251dc7a41bf"
port-base = 18000
[cn.frontend]
lowerCaseTableNames = "0"
aronchen@momac matrixone % mo_ctl get_branch
2024-04-12 11:18:06.418 UTC+0800 [INFO] Try get mo branch
2024-04-12 11:18:06.474 UTC+0800 [INFO] Get branch succeeded, current branch: 1.1-dev
aronchen@momac matrixone % mo_ctl get_cid
2024-04-12 11:18:08.490 UTC+0800 [INFO] Try get mo commit id
commit e0d9dad9a82214ce72f024c5c02aa46fb4fc4ab1
Author: iamlinjunhong <49111204+iamlinjunhong@users.noreply.github.com>
Date: Thu Apr 11 23:44:45 2024 +0800
modify defaultMaxLockRowCount to reduce deadlocks (#15472)
modify defaultMaxLockRowCount to reduce deadlocks
Approved by: @zhangxu19830126, @sukki37
2024-04-12 11:18:08.545 UTC+0800 [INFO] Get commit id succeeded
aronchen@momac matrixone % mo_ctl restart
2024-04-12 11:18:13.339 UTC+0800 [INFO] No mo-service is running
2024-04-12 11:18:13.366 UTC+0800 [INFO] No need to stop mo-service
2024-04-12 11:18:13.394 UTC+0800 [INFO] Stop succeeded
2024-04-12 11:18:13.421 UTC+0800 [INFO] Wait for 2 seconds
2024-04-12 11:18:15.569 UTC+0800 [INFO] No mo-service is running
2024-04-12 11:18:15.635 UTC+0800 [INFO] GO memory limit(Mi): 14745
2024-04-12 11:18:15.688 UTC+0800 [INFO] Starting mo-service: cd /data/mo/1.1-dev/matrixone/ && GOMEMLIMIT=14745MiB /data/mo/1.1-dev/matrixone/mo-service -daemon -debug-http :9876 -launch /data/mo/1.1-dev/matrixone/etc/launch/launch.toml >/data/mo/1.1-dev/matrixone/logs/stdout-20240412_111815.log 2>/data/mo/1.1-dev/matrixone/logs/stderr-20240412_111815.log
2024-04-12 11:18:15.855 UTC+0800 [INFO] Wait for 2 seconds
2024-04-12 11:18:18.003 UTC+0800 [INFO] At least one mo-service is running. Process info:
501 53039 1 0 11:18AM ?? 0:00.12 /data/mo/1.1-dev/matrixone/mo-service -daemon -debug-http :9876 -launch /data/mo/1.1-dev/matrixone/etc/launch/launch.toml
2024-04-12 11:18:18.030 UTC+0800 [INFO] List of pid(s):
53039
2024-04-12 11:18:18.059 UTC+0800 [INFO] Start succeeded
aronchen@momac matrixone % mo_ctl connect
2024-04-12 11:44:13.716 UTC+0800 [INFO] Checking connectivity
2024-04-12 11:44:13.787 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 453
Server version: 8.0.30-MatrixOne-v1.1.2 MatrixOne
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like "%lower%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | off |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> create database if not exists test;
Query OK, 1 row affected (0.01 sec)
mysql> use test;
Database changed
mysql> drop table if exists Tt;
Query OK, 0 rows affected (0.01 sec)
mysql> drop table if exists TT;
Query OK, 0 rows affected (0.00 sec)
mysql> create table Tt (Aa int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into Tt values (1), (2), (3);
Query OK, 3 rows affected (0.00 sec)
mysql> select Aa from Tt;
+------+
| Aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> create table TT (c1 int);
Query OK, 0 rows affected (0.01 sec)
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| Tt |
| TT |
+----------------+
2 rows in set (0.00 sec)
mysql> alter table TT add column c2 int; -- should work
ERROR 1064 (HY000): SQL parser error: table "tt" does not exist
mysql> alter table `TT` add column c3 int; -- should work as well
ERROR 1064 (HY000): SQL parser error: table "tt" does not exist
mysql> select * from TT;
Empty set (0.00 sec)
mysql> select * from `TT`;
Empty set (0.00 sec)
mysql> select * from Tt;
+------+
| Aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.01 sec)
mysql> select * from `Tt`;
+------+
| Aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> select git_version();
+---------------+
| git_version() |
+---------------+
| e0d9dad9a |
+---------------+
1 row in set (0.01 sec) |
bug of parser |
可以对一下MySQL, 感觉第二个 create table TT 在已经有table Tt的情况就不应该新建成功了。不然当大小写配置更改之后,都不知道找哪个表了。 |
alter table
cannot find table name with error ERROR 1064 (HY000): SQL parser error: table "tt" does not exist
when lower_case_table_names
is set to , but select
works normallyalter table
cannot find table name with error ERROR 1064 (HY000): SQL parser error: table "tt" does not exist
when lower_case_table_names
is set to 0
, but select
works normally
由于大小写配置问题比较复杂, 该问题暂时无法解决,后期需要做一下统筹 |
由于大小写配置问题比较复杂, 该问题暂时无法解决,后期需要做一下统筹 |
1 similar comment
由于大小写配置问题比较复杂, 该问题暂时无法解决,后期需要做一下统筹 |
后期处理 |
3 similar comments
后期处理 |
后期处理 |
后期处理 |
not working on it |
曹凯帮忙处理吧 |
待修复 |
working on it |
修复已merge,麻烦验证下 @aronchanisme |
After refactor, the conf |
Both
github@test0:/data/mo/main/matrixone$ mo_ctl connect
2024-07-10 16:56:58.311 UTC+0800 [INFO] Checking connectivity
2024-07-10 16:56:58.383 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4804
Server version: 8.0.30-MatrixOne-v6738 MatrixOne
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| emis |
| information_schema |
| mo_catalog |
| mo_debug |
| mo_task |
| mysql |
| system |
| system_metrics |
+--------------------+
8 rows in set (0.01 sec)
mysql> select git_version();
+---------------+
| git_version() |
+---------------+
| 6d7ffce38 |
+---------------+
1 row in set (0.00 sec)
mysql> system mo_ctl get_branch
2024-07-10 16:57:10.528 UTC+0800 [INFO] Try get mo branch
2024-07-10 16:57:10.579 UTC+0800 [INFO] Get branch succeeded, current branch: 1.2-dev
mysql> system mo_ctl get_cid
2024-07-10 16:57:12.775 UTC+0800 [INFO] Try get mo commit id
commit 6d7ffce38b83e2b0828c072c97c687de7386d105
Author: XuPeng-SH <xupeng3112@163.com>
Date: Wed Jul 10 15:59:50 2024 +0800
1.2 optimize flush and merge prints (#17437)
1.2 optimize flush and merge prints
Approved by: @triump2020, @sukki37
2024-07-10 16:57:12.823 UTC+0800 [INFO] Get commit id succeeded
mysql> show variables like "%lower%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | off |
| lower_case_table_names | 1 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> set global lower_case_table_names = 0;
Query OK, 0 rows affected (0.04 sec)
mysql> exit
Bye
^[[A2024-07-10 16:57:37.142 UTC+0800 [INFO] Connect succeeded and finished. Bye
github@test0:/data/mo/main/matrixone$ mo_ctl connect
2024-07-10 16:57:38.485 UTC+0800 [INFO] Checking connectivity
2024-07-10 16:57:38.555 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4812
Server version: 8.0.30-MatrixOne-v6738 MatrixOne
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like "%lower%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | off |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> create database if not exists test;
Query OK, 1 row affected (0.02 sec)
mysql> use test;
Database changed
mysql> drop table if exists Tt;
Query OK, 0 rows affected (0.01 sec)
mysql> drop table if exists TT;
Query OK, 0 rows affected (0.01 sec)
mysql> create table Tt (Aa int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into Tt values (1), (2), (3);
Query OK, 3 rows affected (0.01 sec)
mysql> select Aa from Tt;
+------+
| Aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> create table TT (c1 int);
Query OK, 0 rows affected (0.02 sec)
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| TT |
| Tt |
+----------------+
2 rows in set (0.01 sec)
mysql> alter table TT add column c2 int; -- should work
Query OK, 0 rows affected (0.05 sec)
mysql> alter table `TT` add column c3 int; -- should work as well
Query OK, 0 rows affected (0.03 sec)
mysql> desc TT;
+-------+---------+------+------+---------+-------+---------+
| Field | Type | Null | Key | Default | Extra | Comment |
+-------+---------+------+------+---------+-------+---------+
| c1 | INT(32) | YES | | null | | |
| c2 | INT(32) | YES | | null | | |
| c3 | INT(32) | YES | | null | | |
+-------+---------+------+------+---------+-------+---------+
3 rows in set (0.02 sec)
mysql> select * from TT;
Empty set (0.00 sec)
mysql> select * from `TT`;
Empty set (0.00 sec)
mysql> select * from Tt;
+------+
| aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.01 sec)
mysql> select * from `Tt`;
+------+
| aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
github@test0:/data/mo/main/matrixone$ mo_ctl connect
2024-07-10 16:53:54.130 UTC+0800 [INFO] Checking connectivity
2024-07-10 16:53:54.208 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 209
Server version: 8.0.30-MatrixOne-v6642 MatrixOne
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> system mo_ctl get_cid
2024-07-10 16:53:56.315 UTC+0800 [INFO] Try get mo commit id
commit e6ad64ec2adf00e3045d12b54b6aecc7f19ec0d1
Author: reusee <reusee@gmail.com>
Date: Wed Jul 10 16:48:29 2024 +0800
malloc: add allocated and inuse objects metrics to MetricsAllocator (#17355)
add allocated and inuse objects metrics to MetricsAllocator
Approved by: @fengttt, @aptend
2024-07-10 16:53:56.376 UTC+0800 [INFO] Get commit id succeeded
mysql> select git_version();
+---------------+
| git_version() |
+---------------+
| e6ad64ec2 |
+---------------+
1 row in set (0.00 sec)
mysql> show variables like "%lower%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | off |
| lower_case_table_names | 1 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> set global lower_case_table_names = 0;
Query OK, 0 rows affected (0.03 sec)
mysql> exit
Bye
2024-07-10 16:54:20.013 UTC+0800 [INFO] Connect succeeded and finished. Bye
github@test0:/data/mo/main/matrixone$ mo_ctl connect
2024-07-10 16:54:21.035 UTC+0800 [INFO] Checking connectivity
2024-07-10 16:54:21.103 UTC+0800 [INFO] Ok, connecting for user ...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 212
Server version: 8.0.30-MatrixOne-v6642 MatrixOne
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like "%lower%";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | off |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.00 sec)
mysql> create database if not exists test;
Query OK, 1 row affected (0.02 sec)
mysql> use test;
Database changed
mysql> drop table if exists Tt;
Query OK, 0 rows affected (0.01 sec)
mysql> drop table if exists TT;
Query OK, 0 rows affected (0.00 sec)
mysql> create table Tt (Aa int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into Tt values (1), (2), (3);
Query OK, 3 rows affected (0.01 sec)
mysql> select Aa from Tt;
+------+
| Aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> create table TT (c1 int);
Query OK, 0 rows affected (0.02 sec)
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| TT |
| Tt |
+----------------+
2 rows in set (0.01 sec)
mysql> alter table TT add column c2 int; -- should work
Query OK, 0 rows affected (0.04 sec)
mysql> alter table `TT` add column c3 int; -- should work as well
Query OK, 0 rows affected (0.03 sec)
mysql> select * from TT;
Empty set (0.01 sec)
mysql> select * from `TT`;
Empty set (0.01 sec)
mysql> select * from Tt;
+------+
| aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.01 sec)
mysql> select * from `Tt`;
+------+
| aa |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec) |
@ck89119 pls kindly help add a bvt case and then get back to me, thx |
Closing this thread |
Is there an existing issue for the same bug?
Branch Name
main
Commit ID
b7f90bd
Other Environment Information
Actual Behavior
alter table
cannot find table name with errorERROR 1064 (HY000): SQL parser error: table "tt" does not exist
whenlower_case_table_names
is set to0
, butselect
works normallyExpected Behavior
These 2
alter table
statements should work instead of throwing errors.Steps to Reproduce
Step_1. set
lower_case_table_names
to"0"
viaset global
sql commandRe-login mo before step 2.
Below are deprecated:
set
lower_case_table_names
to"0"
via conf file under etc/launch/cn.tomlStep_2. Execute below sql statements.
Additional information
No response
The text was updated successfully, but these errors were encountered: