Bug 348203 - PostgreSQL uses case-sensitive search for LIKE SQL operator, Kexi's default is case-insensitive
Summary: PostgreSQL uses case-sensitive search for LIKE SQL operator, Kexi's default i...
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: KexiDB (show other bugs)
Version: 2.9.4
Platform: Other Linux
: NOR normal
Target Milestone: 2.9.5
Assignee: Jarosław Staniek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-25 12:51 UTC by Roman Shtemberko
Modified: 2015-07-02 21:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.9.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Shtemberko 2015-05-25 12:51:27 UTC
Make LIKE to be case-insensitive (iLIKE) for PostgreSQL.
MySQL and SQLite is using case-insensitive LIKE by default.

Reproducible: Always
Comment 1 Jarosław Staniek 2015-05-30 19:48:42 UTC
Changing summary to note that it's really a bug.
Comment 2 Jarosław Staniek 2015-05-30 19:50:39 UTC
The risk in this bug is that if user copies a query from a mysql or sqlite-based kexi project to a postgresql-based one, the results differ if LIKE is used.
Comment 3 Jarosław Staniek 2015-05-30 19:52:16 UTC
Applies to "NOT LIKE" operator too.
Comment 4 Jarosław Staniek 2015-05-31 20:57:29 UTC
Git commit 03b43ccbfd65c17362003047e7fec8ecef3c3bb7 by Jaroslaw Staniek.
Committed on 31/05/2015 at 20:01.
Pushed by staniek into branch 'calligra/2.9'.

Consistency: use ILIKE/NOT ILIKE operator instead of LIKE for PostgreSQL

This fixes the issue "PostgreSQL uses case-sensitive search for LIKE
SQL operator, Kexi's default is case-insensitive"

The approach isn't generic enough for other expressions (the context
of connection could be better) but it's already much better than ignoring
differences between servers
REVIEW:123952
FIXED-IN:2.9.5

M  +1    -0    kexi/kexidb/drivers/pqxx/pqxxdriver.cpp
M  +12   -12   kexi/plugins/queries/kexiquerydesignerguieditor.cpp
M  +1    -1    kexi/widget/tableview/kexicomboboxpopup.cpp
M  +3    -3    libs/db/connection.cpp
M  +1    -0    libs/db/driver.cpp
M  +5    -0    libs/db/driver_p.h
M  +32   -27   libs/db/expression.cpp
M  +16   -12   libs/db/expression.h
M  +2    -2    libs/db/parser/parser_p.cpp

http://commits.kde.org/calligra/03b43ccbfd65c17362003047e7fec8ecef3c3bb7
Comment 5 Jarosław Staniek 2015-07-02 21:11:52 UTC
Git commit 928b7a69672f7f9660aafeab5f5af1dd0d171ed0 by Jaroslaw Staniek.
Committed on 02/07/2015 at 21:08.
Pushed by staniek into branch 'master'.

Allow to use driver in token-to-string conversions + fix LIKE operator for PostgreSQL

Based on calligra 2.9 03b43ccbfd65c173620:
Consistency: use ILIKE/NOT ILIKE operator instead of LIKE for PostgreSQL

This fixes the issue "PostgreSQL uses case-sensitive search for LIKE
SQL operator, Kexi's default is case-insensitive"

"The approach isn't generic enough for other expressions (the context
of connection could be better) but it's already much better than ignoring
differences between servers"

M  +45   -45   autotests/ExpressionsTest.cpp
M  +1    -0    src/KDbDriver_p.cpp
M  +5    -0    src/KDbDriver_p.h
M  +1    -0    src/drivers/postgresql/PostgresqlDriver.cpp
M  +7    -5    src/expression/KDbBinaryExpression.cpp
M  +6    -3    src/expression/KDbConstExpression.cpp
M  +15   -8    src/expression/KDbExpression.cpp
M  +4    -2    src/expression/KDbExpression.h
M  +29   -19   src/expression/KDbExpressionData.h
M  +5    -3    src/expression/KDbFunctionExpression.cpp
M  +11   -5    src/expression/KDbNArgExpression.cpp
M  +5    -2    src/expression/KDbQueryParameterExpression.cpp
M  +8    -5    src/expression/KDbUnaryExpression.cpp
M  +5    -2    src/expression/KDbVariableExpression.cpp
M  +2    -2    src/parser/KDbParser_p.cpp
M  +18   -8    src/parser/generate_parser_code.sh
M  +11   -5    src/parser/generated/KDbToken.cpp
M  +7    -3    src/parser/generated/KDbToken.h

http://commits.kde.org/kdb/928b7a69672f7f9660aafeab5f5af1dd0d171ed0