Bug 405347 - selecting by aspect ratio: abs function in sqlite lowercase, in mariadb uppercase
Summary: selecting by aspect ratio: abs function in sqlite lowercase, in mariadb upper...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (show other bugs)
Version: 6.0.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-11 11:28 UTC by Jürgen Blumenschein
Modified: 2019-03-12 06:53 UTC (History)
2 users (show)

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


Attachments
attachment-1801-0.html (3.31 KB, text/html)
2019-03-12 06:53 UTC, Jürgen Blumenschein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jürgen Blumenschein 2019-03-11 11:28:27 UTC
For a long time I tried on sunday selecting by aspect ratio, which
worked fine on my notebook with sqlite but not on the desktop with
mariadb.
The console said that the query was wrong.
I found out, that there is difference in the sql dialects:
the absolute function in sqlite is "abs( number )" in lowercase letters
in mariadb it's "ABS( number )" in uppercase.
Could it be fixed please?
Comment 1 Maik Qualmann 2019-03-11 12:25:03 UTC
The problem is not necessarily the lowercase letters. The CAST(... AS REAL) is the problem. The data type REAL is not supported by MySQL in the CAST. Depending on the database, we need different SQL queries here. I'll watch it tonight.

Maik
Comment 2 Maik Qualmann 2019-03-11 19:07:30 UTC
Git commit b3a3598a28c0e744920bf831296109af3338d3c8 by Maik Qualmann.
Committed on 11/03/2019 at 19:04.
Pushed by mqualmann into branch 'master'.

fix unknown data type REAL  for MySQL in the CAST function
testet with SQLite and MariaDB-10.2.22
FIXED-IN: 6.1.0

M  +2    -1    NEWS
M  +6    -6    core/libs/database/item/query/itemquerybuilder.cpp

https://commits.kde.org/digikam/b3a3598a28c0e744920bf831296109af3338d3c8
Comment 3 Jürgen Blumenschein 2019-03-12 06:53:33 UTC
Created attachment 118735 [details]
attachment-1801-0.html

  Thanks a lot,

I patched and compiled the 6.0.0 and all worked fine.

Jürgen

Zitat von Maik Qualmann <bugzilla_noreply@kde.org>:

> https://bugs.kde.org/show_bug.cgi?id=405347
>
> Maik Qualmann <metzpinguin@gmail.com> changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Status|REPORTED                    |RESOLVED
>   Version Fixed In|                            |6.1.0
>      Latest Commit|                            |https://commits.kde.org/dig
>                   |                            |ikam/b3a3598a28c0e744920bf8
>                   |                            |31296109af3338d3c8
>         Resolution|---                         |FIXED
>
> --- Comment #2 from Maik Qualmann <metzpinguin@gmail.com> ---
> Git commit b3a3598a28c0e744920bf831296109af3338d3c8 by Maik Qualmann.
> Committed on 11/03/2019 at 19:04.
> Pushed by mqualmann into branch 'master'.
>
> fix unknown data type REAL  for MySQL in the CAST function
> testet with SQLite and MariaDB-10.2.22
> FIXED-IN: 6.1.0
>
> M  +2    -1    NEWS
> M  +6    -6    core/libs/database/item/query/itemquerybuilder.cpp
> https://commits.kde.org/digikam/b3a3598a28c0e744920bf831296109af3338d3c8
  Jürgen Blumenschein, eMail: blumenschein@dokom.net
Homepage: http://members.dokom.net/blumenschein
Am Quartus 17
D-44149 Dortmund
Tel.: +49 231 7217321, Handy: +49 176 5591 4562
public key:
http://members.dokom.net/blumenscheinJuergen_Blumenschein_(0xC9358EBB)_public_key.asc