Kexi: Make <SELECT "a" + "b"> SQL queries work and fix <SELECT "a" || "b">
ClosedPublic

Authored by staniek on Jan 27 2016, 12:04 PM.

Details

Summary
  • <SELECT "a" + "b"> parses in Kexi>=2.9.7 but results in invalid (boolean) type/value
  • for convenience, if either argument is of text type, operator "+" is now assumed to be identical to operator ||
  • also fix SELECT "a" || "b" for MySQL (using CONCAT() is needed)

https://phabricator.kde.org/T677
BUG:358636
FIXED-IN:2.9.11

Test Plan

Try test queries from the project attached at https://bugs.kde.org/show_bug.cgi?id=358636.
Try other queries that use text columns instead of string constants.

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
staniek updated this revision to Diff 2117.Jan 27 2016, 12:04 PM
staniek retitled this revision from to Kexi: Make <SELECT "a" + "b"> SQL queries work and fix <SELECT "a" || "b">.
staniek updated this object.
staniek edited the test plan for this revision. (Show Details)
staniek added reviewers: piggz, wicik.
staniek added a subscriber: Kexi-Devel-list.
Restricted Application added projects: KEXI, Calligra: 3.0. · View Herald TranscriptJan 27 2016, 12:04 PM
piggz edited edge metadata.Jan 29 2016, 7:18 PM

Any tests for this feature?

@piggz Yes please see the "Test Plan" section above :)

piggz added a comment.Jan 29 2016, 7:37 PM

i meant an auto-test

In D867#17130, @piggz wrote:

i meant an auto-test

Yes, after porting to KDb it will be easy to add some. In KDb SQL autotests can use plain text files:

autotests/parser/data/statements.txt

piggz accepted this revision.Jan 29 2016, 7:42 PM
piggz edited edge metadata.
This revision is now accepted and ready to land.Jan 29 2016, 7:42 PM
This revision was automatically updated to reflect the committed changes.