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

Regression: LIKE with escape doesn't work [CORE4158] #4485

Closed
firebird-issue-importer opened this issue Aug 3, 2013 · 8 comments
Closed

Comments

@firebird-issue-importer
Copy link

firebird-issue-importer commented Aug 3, 2013

Submitted by: @mrotteveel

The LIKE escape does not work as it should, the escape clause is ignored.

Testsetup:

CREATE TABLE TAB1 (
ID INT CONSTRAINT PK_TAB1 PRIMARY KEY,
VAL VARCHAR(30)
);

INSERT INTO TAB1 (ID, VAL) VALUES (1, 'abcdef');
INSERT INTO TAB1 (ID, VAL) VALUES (2, 'abc_ef');
INSERT INTO TAB1 (ID, VAL) VALUES (3, 'abc%ef');

Tests:
SELECT VAL FROM TAB1 WHERE VAL LIKE 'abc&%ef' ESCAPE '&'
Expected result: 1 row, with value abc%ef
Actual result: no row

SELECT VAL FROM TAB1 WHERE VAL LIKE 'abc&_ef' ESCAPE '&'
Expected result: 1 row, with value abc_ef
Actual result: no row

Firebird 2.5 and earlier do produce the expected result.

Commits: 9e12865 FirebirdSQL/fbt-repository@a74dfe6

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 3, 2013

Commented by: @mrotteveel

Test is org.firebirdsql.jdbc.escape.TestLikeEscape.testEscapedLike_underscore() and testEscapedLike_percent() in Jaybird trunk

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 4, 2013

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 4, 2013

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 4, 2013

Commented by: @mrotteveel

Interestingly enough, if I add additional testdata with values 'abc&%ef' and 'abc&_ef' it doesn't match those either, so the escape seems to be working partially

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 4, 2013

Commented by: @asfernandes

> Interestingly enough, if I add additional testdata with values 'abc&%ef' and 'abc&_ef' it doesn't match those either, so the escape seems to be working partially

Do you mean before or after my fix?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 4, 2013

Commented by: @mrotteveel

Adriano, this was still with the Alpha 1 build.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 9, 2013

Modified by: Sean Leyne (seanleyne)

summary: LIKE with escape doesn't work => Regression: LIKE with escape doesn't work

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 29, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants