matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[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 #16801

Open PHK-20 opened 5 months ago

PHK-20 commented 5 months ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

6b7e448cbf639778647279ec81e68aca3b0f7cbf

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

PHK-20 commented 5 months ago

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

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

跟like operator 有关,改为s1