matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[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

Open PHK-20 opened this issue 1 year ago • 6 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

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 avatar Jun 11 '24 09:06 PHK-20

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

PHK-20 avatar Jun 11 '24 10:06 PHK-20

还在看

YANGGMM avatar Jun 15 '24 10:06 YANGGMM

还在看

YANGGMM avatar Jun 20 '24 11:06 YANGGMM

还在看

YANGGMM avatar Jun 25 '24 11:06 YANGGMM

还在看

YANGGMM avatar Jun 28 '24 10:06 YANGGMM

还在看

YANGGMM avatar Jul 03 '24 10:07 YANGGMM

还在看

YANGGMM avatar Jul 08 '24 11:07 YANGGMM

还在看

YANGGMM avatar Jul 11 '24 11:07 YANGGMM

还在看

YANGGMM avatar Jul 16 '24 10:07 YANGGMM

还在看

YANGGMM avatar Jul 16 '24 10:07 YANGGMM

还在看

YANGGMM avatar Jul 19 '24 10:07 YANGGMM

还在看

YANGGMM avatar Jul 24 '24 11:07 YANGGMM

还在看

YANGGMM avatar Jul 29 '24 10:07 YANGGMM

还在看

YANGGMM avatar Aug 01 '24 10:08 YANGGMM

还在看

YANGGMM avatar Aug 06 '24 11:08 YANGGMM

还在看

YANGGMM avatar Aug 09 '24 10:08 YANGGMM

还在看

YANGGMM avatar Aug 14 '24 10:08 YANGGMM

还在看

YANGGMM avatar Aug 19 '24 12:08 YANGGMM

跟like operator 有关,改为s1

YANGGMM avatar Aug 22 '24 03:08 YANGGMM

Is this a "like" wrong result bug? Wrong result is automatically s-1.

fengttt avatar Apr 25 '25 01:04 fengttt

Does not repro. I checked a simple case with '\n' and like '%xxx_%', '%xxx%'; seems the result is OK.

fengttt avatar May 13 '25 05:05 fengttt