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]: Error occurs when querying system tables #15331
Comments
two issus:
for issue 1: the db "test" is not exist on the account dump, so it cannot be retrive by account dump(account id 0). select mo_table_size(reldatabase, relname) from mo_catalog.mo_tables where relkind IN ('r','e','cluster') and mo_catalog.mo_tables.account_id = ( select current_account_id() as cur_acc_id). |
for issue 2, seems it is related to tables mysql> SELECT reldatabase, relname AS `name`, if (role_name IS NULL, '-', role_name) AS `owner`, mo_tables.created_time AS created FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='test' Order by name;
+-------------+---------------------+--------------+---------------------+
| reldatabase | name | owner | created |
+-------------+---------------------+--------------+---------------------+
| test | ecbase_card | accountadmin | 2024-01-19 08:42:31 |
| test | realname_order_info | accountadmin | 2024-01-19 08:42:31 |
| test | t1 | accountadmin | 2023-11-13 09:35:43 |
| test | t2 | accountadmin | 2024-04-02 01:41:01 |
| test | t3 | accountadmin | 2024-04-02 02:05:05 |
| test | t4 | accountadmin | 2024-04-02 02:05:50 |
| test | t5 | accountadmin | 2024-04-02 02:06:05 |
| test | your_table | accountadmin | 2024-02-04 15:34:26 |
+-------------+---------------------+--------------+---------------------+
8 rows in set (0.07 sec) without these two tables, things go fine. mysql> SELECT reldatabase, relname, mo_table_rows(reldatabase, relname) AS `rows`, mo_table_size(reldatabase, relname) AS `size`, if (role_name IS NULL, '-', role_name) AS `owner`, mo_tables.created_time AS created FROM mo_catalog.mo_tables LEFT JOIN mo_catalog.mo_role ON mo_catalog.mo_tables.owner=role_id WHERE relkind IN ('r','e','cluster') AND reldatabase='test' and relname not in ("ecbase_card","realname_order_info") Order by relname;
+-------------+------------+------+------+--------------+---------------------+
| reldatabase | relname | rows | size | owner | created |
+-------------+------------+------+------+--------------+---------------------+
| test | t1 | 3 | 716 | accountadmin | 2023-11-13 09:35:43 |
| test | t2 | 0 | 0 | accountadmin | 2024-04-02 01:41:01 |
| test | t3 | 0 | 0 | accountadmin | 2024-04-02 02:05:05 |
| test | t4 | 0 | 0 | accountadmin | 2024-04-02 02:05:50 |
| test | t5 | 0 | 0 | accountadmin | 2024-04-02 02:06:05 |
| test | your_table | 0 | 0 | accountadmin | 2024-02-04 15:34:26 |
+-------------+------------+------+------+--------------+---------------------+
6 rows in set (0.07 sec) |
db mysql> select reldatabase, relname, mo_table_size(reldatabase, relname) from mo_catalog.mo_tables where relkind in ('e', 'r', 'cluster') and reldatabase = "mysql" and relname not in ("db", "procs_priv", "tables_priv");
+-------------+--------------+-------------------------------------+
| reldatabase | relname | mo_table_size(reldatabase, relname) |
+-------------+--------------+-------------------------------------+
| mysql | role_edges | 0 |
| mysql | user | 0 |
| mysql | columns_priv | 0 |
+-------------+--------------+-------------------------------------+ all these excluded tables have secondary key. |
so the another question: why the |
|
found that the constaint has empty index table name is pushed by TN. | for table |
#15403 只是忽视了该错误,避免 更深的原因可能与 commit 到 tn 的 constraint 数据 中的 index 信息完整性有关。之前没有发现,是因为该 index name 信息未被消费,升级到 112 后, 验证方式:
没有错误就是修复了。 |
dump账号执行:
dump不带 and account_id = (select current_account_id() as acc) 过滤条件会执行出错 |
暂无业务使用dump账户去执行该SQL,如果有需求,需要产品设计 |
Is there an existing issue for the same bug?
Branch Name
1.1.2
Commit ID
v1.1.2-1519f8e5c-2024-04-02
Other Environment Information
Actual Behavior
Run the following SQL with user account:
Run the following SQL with dump:
Expected Behavior
SQL succeeds
Steps to Reproduce
Additional information
Cloud prod
The text was updated successfully, but these errors were encountered: