matrixorigin / matrixone

Hyperconverged cloud-edge native database

Home Page:https://docs.matrixorigin.cn/en

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: When querying the statement_info table with the specified statement field, if the statement contains \n newline characters, the corresponding matching rows cannot be retrieved

PHK-20 opened this issue · comments

commented

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

6b7e448

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

"When querying the statement_info table with the specified statement field, if the statement contains \n newline characters, the corresponding matching rows cannot be retrieved."

i need to find the row which statmen_id is '0190065c-d705-72c8-8e76-f378c28171e6' AND request_at >= '2024-06-11 04:56:41'

what i exec sql is

SELECT statement FROM `system`.`statement_info` WHERE 1=1 AND `request_at` >= '2024-06-11 04:56:41' AND system.statement_info.account = '018fe638-b31b-7171-a710-bbd93a161bea' AND sql_source_type IN ('cloud_user_sql','external_sql') AND
statement like '%select * from t1 \\n  limit\\n  10%';

Expected Behavior

No response

Steps to Reproduce

exec sql :

SELECT statement FROM `system`.`statement_info` WHERE 1=1 AND `request_at` >= '2024-06-11 04:56:41' AND system.statement_info.account = '018fe638-b31b-7171-a710-bbd93a161bea' AND sql_source_type IN ('cloud_user_sql','external_sql') AND
statement like '%select * from t1 \\n  limit\\n  10%';

target row:
SELECT statement FROM `system`.`statement_info` WHERE statmen_id = '0190065c-d705-72c8-8e76-f378c28171e6' AND `request_at` >= '2024-06-11 04:56:41

Additional information

No response

commented

another bug case:

target row:

SELECT * FROM `statement_info` WHERE 1=1 AND `request_at` >= '2024-06-11 08:00:00' and statement_id = '01900652-25de-7931-9c03-4f12ad04fedc';

effective sql:

SELECT statement, statement_id FROM `system`.`statement_info` WHERE 1=1 AND `request_at` >= '2024-06-11 08:00:00'AND system.statement_info.account = '018fe13d-c4c4-70f1-bacc-11360c514371' AND sql_source_type IN ('cloud_user_sql','external_sql')  AND statement like '%select * \n  from mo%'

not effective sql:

SELECT statement, statement_id FROM `system`.`statement_info` WHERE 1=1 AND `request_at` >= '2024-06-11 08:00:00'AND system.statement_info.account = '018fe13d-c4c4-70f1-bacc-11360c514371' AND sql_source_type IN ('cloud_user_sql','external_sql')  AND statement like '%select * \n  from mo_%'

There is only one '_' difference between two sql

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看

还在看