Add support for typical scalar SQL functions returning a single value based on arguments. https://community.kde.org/Kexi/Plugins/Queries/SQL_Functions#Typical_Scalar_Functions Reproducible: Always
Git commit d09d012b470df192214524326a3b8444c51daac6 by Jaroslaw Staniek. Committed on 12/09/2015 at 22:22. Pushed by staniek into branch 'kexi-functions-352631-staniek'. calligradb: Add support for 22 typical scalar SQL functions With minor exceptions these functions now work with SQLite, MySQL, PostgreSQL: *abs(X) *ceiling(X) *char(X1,X2,...,XN) *coalesce(X,Y,...) *floor(X) *greatest(X,Y,...) & alias max(X,Y,...) *hex(X) *ifnull(X,Y) *instr(X,Y) *least(X,Y,...) & alias min(X,Y,...) *length(X) *lower(X) *ltrim(X) & ltrim(X,Y) *nullif(X,Y) *random() & random(X,Y) *replace(X,Y,Z) *round(X) & round(X,Y) *rtrim(X) & rtrim(X,Y) *soundex(X) *trim(X) & trim(X,Y) *unicode(X) *upper(X) In many cases substitute functions are used to make the result work in a portable way. The implementation of function parser supports: * checking number of arguments * checking types of arguments, sometimes "any number" or "any text or BLOB" * checking compatibility of arguments in function * checking relation of value of arguments in function, e.g. value of the first argument smaller than second's * checking NULL arguments in function; then most often the result is NULL * argument overloading or optional arguments, e.g. round(X) and round(X,Y) * displaying of human-readable error messages when the above constraints are not met, for example "Three arguments required" or "Function does not accept any arguments" * easy extensibility using just a few lines of code Note: no extra i18n added; will be added in a KDb port M +21 -0 kexi/kexidb/drivers/mysql/mysqldriver.cpp M +20 -0 kexi/kexidb/drivers/mysql/mysqldriver.h M +5 -0 kexi/kexidb/drivers/pqxx/pqxxconnection.cpp M +34 -0 kexi/kexidb/drivers/pqxx/pqxxdriver.cpp M +29 -0 kexi/kexidb/drivers/pqxx/pqxxdriver.h M +54 -1 libs/db/driver.cpp M +50 -1 libs/db/driver.h M +5 -1 libs/db/driver_p.h M +1 -0 libs/db/drivers/sqlite/CMakeLists.txt M +6 -1 libs/db/drivers/sqlite/sqliteconnection.cpp M +1 -1 libs/db/drivers/sqlite/sqliteconnection.h M +64 -1 libs/db/drivers/sqlite/sqlitedriver.cpp M +31 -1 libs/db/drivers/sqlite/sqlitedriver.h A +114 -0 libs/db/drivers/sqlite/sqlitefunctions.cpp [License: Public Domain LGPL (v2+)] A +30 -0 libs/db/drivers/sqlite/sqlitefunctions.h [License: LGPL (v2+)] M +983 -55 libs/db/expression.cpp M +18 -0 libs/db/expression.h http://commits.kde.org/calligra/d09d012b470df192214524326a3b8444c51daac6