Created attachment 1296782 [details] Patch to allow compilation of lua-sql with MariaDB 10.2 Trying to build lua-sql with the new version of MariaDB 10.2 causes the following errors: src/ls_mysql.c: In function 'conn_commit': src/ls_mysql.c:427:21: error: invalid use of void expression lua_pushboolean(L, !mysql_commit(conn->my_conn)); ^ src/ls_mysql.c: In function 'conn_rollback': src/ls_mysql.c:437:21: error: invalid use of void expression lua_pushboolean(L, !mysql_rollback(conn->my_conn)); ^ In file included from src/ls_mysql.c:21:0: src/ls_mysql.c: In function 'luaopen_luasql_mysql': src/ls_mysql.c:605:25: error: expected ')' before 'MYSQL_SERVER_VERSION' lua_pushliteral (L, MYSQL_SERVER_VERSION); ^ In this new version of MariaDB they introduced a new mariadb_version.h header and mysql.h includes this header instead of mysql_version.h. But the mysql_version.h is still present. I'm attaching a simple patch proposal to fix the problem (I'm not sure if it's the best solution) We are tracking all the possible problems regarding this MariaDB upgrade in the bug 1467297. Copr build: https://copr.fedorainfracloud.org/coprs/g/db-sig/mariadb-10.2/package/lua-sql/
So, I think there's actually a subtle *MariaDB* build system bug behind this (and all the other bugs where the problem is stuff from mysql_version.h): https://jira.mariadb.org/browse/MDEV-13370 The mysql.h from *MariaDB itself* - that is, include/mysql.h in the tarball - actually does #include mysql_version.h . The problem is that we're not actually *getting* that mysql.h installed (and ultimately in the mariadb-devel package). Instead we're getting the mysql.h from libmariadb/include/mysql.h . libmariadb/ is in fact mariadb-connector-c included as a subproject. It seems that both libmariadb/include/CMakeLists.txt and include/CMakeLists.txt attempt to install their own mysql.h to the same place, so which one you get is ultimately a race. It looks to me like the build process happens to install the one from libmariadb/include first, and then declines to overwrite it with the one from include/ later, so we're actually ultimately shipping *the wrong mysql.h* - the one we're shipping is really from mariadb-connector-c , it's not MariaDB's own mysql.h . Because the one from mariadb-connector-c is only meant for building *client* applications, it doesn't include all the server symbols; it has its own mariadb_version.h file that doesn't define as much stuff as the server's mysql_version.h does. Until upstream looks at this, I suggest we patch our mariadb package to get the right headers installed. I'll try and find a good way to do this. Once that's done, this kind of build failure *should* go away with no patching required...if I'm right.
So, I did rebuild lua-sql while the mariadb build with the server headers installed was current. We switched it back to the client headers again, so for now lua-sql will again fail to build unless an explicit #include mysql_version.h is added, which doesn't really seem correct. I'm now waiting on upstream's response to MDEV-13370 before making any further changes.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
I think that we can close this bug, right? It seems that Florian Weimer <fweimer> solved the problem on commit 379747177beb31132af65e13c27e8fd491085234
This should be already solved for several weeks.