Skip to content
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: SELECT...WHERE column_2 like '%_a\\\%', returns incorrect result set #1162

Closed
2 of 3 tasks
davidshiz opened this issue Dec 28, 2022 · 2 comments · Fixed by #1171
Closed
2 of 3 tasks

bug: SELECT...WHERE column_2 like '%_a\\\%', returns incorrect result set #1162

davidshiz opened this issue Dec 28, 2022 · 2 comments · Fixed by #1171
Assignees
Labels
A-bug Something isn't working prio: high High priority

Comments

@davidshiz
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

mysql> select * from st2 where column_2 like '%_a\\\%';
+------+----------+----------+
| id   | column_2 | column_3 |
+------+----------+----------+
|    1 | _a\\     | 111111   |
+------+----------+----------+
1 row in set (0.00 sec)

Expected behavior

mysql> select * from st2 where column_2 like '%_a\\\%';
+------+----------+----------+
| id   | column_2 | column_3 |
+------+----------+----------+
|    1 | _a\\     | 111111   |
|    4 | _a\      | _12%     |
+------+----------+----------+
2 rows in set (0.00 sec)

How To Reproduce

create table st2(id int ,column_2 varchar(10),column_3 varchar(10));
insert into st2 values(1,'_a\\\\','111111');
insert into st2 values(2,'12%','%12%');
insert into st2 values(3,'a_a','a%');
insert into st2 values(4,'_a\\','_12%');
insert into st2 values(5,'\\a','\\\\_a%12%');

select * from st2 where column_2 like '%_a\\\%';

Environment

root@ub01:~# /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
        Branch name: stonedb-5.7-dev
        Last commit ID: 863cebc58
        Last commit time: Date:   Wed Dec 7 14:16:34 2022 +0800
        Build time: Date: Mon Dec 19 14:29:02 CST 2022
root@ub01:~# cat /etc/issue
Ubuntu 20.04.5 LTS \n \l

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@davidshiz davidshiz added the A-bug Something isn't working label Dec 28, 2022
@davidshiz
Copy link
Collaborator Author

davidshiz commented Dec 28, 2022

similar problem

tianmu:

mysql> select * from st2 where column_2 like '%?_a?\%' escape '?';
Empty set (0.00 sec)

innodb:

mysql> select * from st2 where column_2 like '%?_a?\%' escape '?';
+------+----------+----------+
| id   | column_2 | column_3 |
+------+----------+----------+
|    1 | _a\\     | 111111   |
|    4 | _a\      | _12%     |
+------+----------+----------+
2 rows in set (0.00 sec)

@konghaiya
Copy link
Collaborator

ACK

konghaiya added a commit to konghaiya/stonedb that referenced this issue Dec 29, 2022
…neatom#1157)

1. Handle the result set error caused by character transfer(stoneatom#1157)(stoneatom#1162)
2. Handle the result set problem caused by ESCAPE keyword(stoneatom#1162)
@hustjieke hustjieke added the prio: high High priority label Dec 30, 2022
@hustjieke hustjieke moved this to In Progress in StoneDB for MySQL 5.7 Dec 30, 2022
konghaiya added a commit to konghaiya/stonedb that referenced this issue Dec 30, 2022
…neatom#1157)

1. Handle the result set error caused by character transfer(stoneatom#1157)(stoneatom#1162)
2. Handle the result set problem caused by ESCAPE keyword(stoneatom#1162)
konghaiya added a commit to konghaiya/stonedb that referenced this issue Dec 30, 2022
…neatom#1157)

1. Handle the result set error caused by character transfer(stoneatom#1157)(stoneatom#1162)
2. Handle the result set problem caused by ESCAPE keyword(stoneatom#1162)
@mergify mergify bot closed this as completed in #1171 Jan 3, 2023
mergify bot pushed a commit that referenced this issue Jan 3, 2023
1. Handle the result set error caused by character transfer(#1157)(#1162)
2. Handle the result set problem caused by ESCAPE keyword(#1162)
@github-project-automation github-project-automation bot moved this from In Progress to Done in StoneDB for MySQL 5.7 Jan 3, 2023
konghaiya added a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…neatom#1157)

1. Handle the result set error caused by character transfer(stoneatom#1157)(stoneatom#1162)
2. Handle the result set problem caused by ESCAPE keyword(stoneatom#1162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working prio: high High priority
Projects
Development

Successfully merging a pull request may close this issue.

4 participants