-
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]: PROD环境,对订阅库表执行增加联合主键操作报错[21S01][1136] Column count doesn't match value count at row 1 #14846
Comments
我也试了下,在 MO Cloud 生产环境(即 MO v1.1.1)的普通租户下,是可以执行:1)对一个没有主键的表添加联合主键;2)创建一张带有联合主键的表。从现象上看,sys 租户创建不了(或者说 dump/root用户创建不了),这很奇怪,我们居然有逻辑区分了它们的语法支持。 |
The upgrade of the mo_indexes table under the system tenant failed during version update。 在版本更新过程中,sys租户下的mo_indexes表升级失败,对mo_indexes扩展的列 |
Log Link: here Download Log File: Explore-logs-2024-03-14 20_33_37.txt
|
However, I don't understand why "IfEmpty" query failed. COLUMN NAME tablesmysql> SELECT COLUMN_NAME, COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA ="mo_catalog" AND TABLE_NAME ="mo_indexes" GROUP BY COLUMN_NAME;
+------------------+----------+
| column_name | count(*) |
+------------------+----------+
| __mo_cpkey_col | 35 |
| column_name | 35 |
| comment | 35 |
| database_id | 35 |
| hidden | 35 |
| id | 35 |
| index_table_name | 35 |
| is_visible | 35 |
| name | 35 |
| options | 35 |
| ordinal_position | 35 |
| table_id | 35 |
| type | 35 |
| algo | 34 |<-------
| algo_params | 34 |<-------
| algo_table_type | 34 |<-------
+------------------+----------+
mysql> select attname, count(*) from mo_catalog.mo_columns where att_database ="mo_catalog" and att_relname ="mo_indexes" group by attname ;
+------------------+----------+
| attname | count(*) |
+------------------+----------+
| __mo_cpkey_col | 35 |
| __mo_rowid | 35 |
| column_name | 35 |
| comment | 35 |
| database_id | 35 |
| hidden | 35 |
| id | 35 |
| index_table_name | 35 |
| is_visible | 35 |
| name | 35 |
| options | 35 |
| ordinal_position | 35 |
| table_id | 35 |
| type | 35 |
| algo | 34 |<-------
| algo_params | 34 |<-------
| algo_table_type | 34 |<-------
+------------------+----------+
17 rows in set (0.34 sec)
However, that column is not present in the table: mysql> desc mo_catalog.mo_indexes;
+------------------+---------------------+------+------+---------+-------+---------+
| Field | Type | Null | Key | Default | Extra | Comment |
+------------------+---------------------+------+------+---------+-------+---------+
| id | BIGINT UNSIGNED(64) | NO | PRI | NULL | | |
| table_id | BIGINT UNSIGNED(64) | NO | | NULL | | |
| database_id | BIGINT UNSIGNED(64) | NO | | NULL | | |
| name | VARCHAR(64) | NO | | NULL | | |
| type | VARCHAR(11) | NO | | NULL | | |
| is_visible | TINYINT(8) | NO | | NULL | | |
| hidden | TINYINT(8) | NO | | NULL | | |
| comment | VARCHAR(2048) | NO | | NULL | | |
| column_name | VARCHAR(256) | NO | PRI | NULL | | |
| ordinal_position | INT UNSIGNED(32) | NO | | NULL | | |
| options | TEXT(0) | YES | | NULL | | |
| index_table_name | VARCHAR(5000) | YES | | NULL | | |
+------------------+---------------------+------+------+---------+-------+---------+
12 rows in set (0.37 sec)
|
The issue has been submitted to PR, please verify and test it @tianyahui-python @daviszhen @LiSong0214 |
等待升级到qa 验证。。。 |
The issue is fixed in 1.1-dev branch. mysql> select git_version();
+---------------+
| git_version() |
+---------------+
| afb4934ae |
+---------------+
1 row in set (0.18 sec)
mysql> mysql> desc mo_catalog.mo_;
+------------------+---------------------+------+------+---------+-------+---------+
| Field | Type | Null | Key | Default | Extra | Comment |
+------------------+---------------------+------+------+---------+-------+---------+
| id | BIGINT UNSIGNED(64) | NO | PRI | NULL | | |
| table_id | BIGINT UNSIGNED(64) | NO | | NULL | | |
| database_id | BIGINT UNSIGNED(64) | NO | | NULL | | |
| name | VARCHAR(64) | NO | | NULL | | |
| type | VARCHAR(11) | NO | | NULL | | |
| algo | VARCHAR(11) | YES | | NULL | | |
| algo_table_type | VARCHAR(11) | YES | | NULL | | |
| algo_params | VARCHAR(2048) | YES | | NULL | | |
| is_visible | TINYINT(8) | NO | | NULL | | |
| hidden | TINYINT(8) | NO | | NULL | | |
| comment | VARCHAR(2048) | NO | | NULL | | |
| column_name | VARCHAR(256) | NO | PRI | NULL | | |
| ordinal_position | INT UNSIGNED(32) | NO | | NULL | | |
| options | TEXT(0) | YES | | NULL | | |
| index_table_name | VARCHAR(5000) | YES | | NULL | | |
+------------------+---------------------+------+------+---------+-------+---------+
15 rows in set (0.50 sec)
mysql> SELECT COLUMN_NAME, COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA ="mo_catalog" AND TABLE_NAME ="mo_indexes" GROUP BY COLUMN_NAME;
+------------------+----------+
| column_name | count(*) |
+------------------+----------+
| __mo_cpkey_col | 36 |
| algo | 36 |
| algo_params | 36 |
| algo_table_type | 36 |
| column_name | 36 |
| comment | 36 |
| database_id | 36 |
| hidden | 36 |
| id | 36 |
| index_table_name | 36 |
| is_visible | 36 |
| name | 36 |
| options | 36 |
| ordinal_position | 36 |
| table_id | 36 |
| type | 36 |
+------------------+----------+
16 rows in set (0.36 sec)
mysql>
|
fixed |
fixed |
Is there an existing issue for the same bug?
Branch Name
v1.1.1
Commit ID
9d61683
Other Environment Information
Actual Behavior
alter table mo_sample_data_tpch_sf10.partsupp add PRIMARY KEY (PS_PARTKEY, PS_SUPPKEY);
alter table mo_sample_data_tpch_sf10.LINEITEM add PRIMARY KEY (L_ORDERKEY, L_LINENUMBER);
alter table mo_sample_data_tpch_sf1.partsupp add PRIMARY KEY (PS_PARTKEY, PS_SUPPKEY);
alter table mo_sample_data_tpch_sf1.LINEITEM add PRIMARY KEY (L_ORDERKEY, L_LINENUMBER);
报错
[21S01][1136] Column count doesn't match value count at row 1
Expected Behavior
正常添加联合主键
Steps to Reproduce
Additional information
No response
The text was updated successfully, but these errors were encountered: