[Interest] Problem using mariadb client lib (LGPL) when compiling Qt5

Bo Thorsen bo at fioniasoftware.dk
Wed Dec 19 12:58:21 CET 2012


Hi Petric,

Den 19-12-2012 07:55, Petric Frank skrev:
> i tried to compile Qt5 (platform: Windows) using mingw with mysql plugin enabled.
>
> But it fails telling that the preprocessor variable MAX_BIGINT_WIDTH is not defined.
>
> The last lines of the compile output looks like this:
> ------------------------------ cut ---------------------------------
> C:\qt-5.0.0-beta2\qtbase\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
> DQT_CORE_LIB -IC:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\plugins\sqldrivers\mysql -I"C:\mariadb_client-1.0.0-win32\mariadbclient\include" -I"..\..\..\..\include" -I"..\..\..\..
> \include\QtSql" -I"..\..\..\..\include\QtSql\5.0.0" -I"..\..\..\..\include\QtSql\5.0.0\QtSql" -I"..\..\..\..\include\QtCore" -I"tmp\moc\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -D
> __GNUC__ -DWIN32 C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql\qsql_mysql.cpp -o tmp\moc\debug_shared\qsql_mysql.moc
> g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wall -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -
> DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -IC:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\plugins\sqldrivers\mysql -I"C:\mariadb_client-1.0.0-
> win32\mariadbclient\include" -I"..\..\..\..\include" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql\5.0.0" -I"..\..\..\..\include\QtSql\5.0.0\QtSql" -I"..\..\..\..\include\QtCore" -I"tmp\moc\de
> bug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qsql_mysql.o C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql\qsql_mysql.cpp
> C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql\qsql_mysql.cpp: In member function 'bool QMYSQLResultPrivate::bindInValues()':
> C:\qt-everywhere-opensource-src-5.0.0-beta2\qtbase\src\sql\drivers\mysql\qsql_mysql.cpp:386:37: error: 'MAX_BIGINT_WIDTH' was not declared in this scope
> mingw32-make[11]: *** [tmp/obj/debug_shared/qsql_mysql.o] Error 1
> mingw32-make[11]: Leaving directory `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql'
> mingw32-make[10]: *** [debug-all] Error 2
> mingw32-make[10]: Leaving directory `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql'
> mingw32-make[9]: *** [all] Error 2
> mingw32-make[9]: Leaving directory `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers/mysql'
> mingw32-make[8]: *** [sub-mysql-make_first] Error 2
> mingw32-make[8]: Leaving directory `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers'
> mingw32-make[7]: *** [all] Error 2
> mingw32-make[7]: Leaving directory `C:/qt-5.0.0-beta2/qtbase/src/plugins/sqldrivers'
> mingw32-make[6]: *** [sub-sqldrivers-make_first] Error 2
> ------------------------------ cut ---------------------------------
>
> Inspecting the include file mysql_com.h from both mysql (Oracle) and mariadb that the first contains the definitions whereas the latter not.
>
> I haven't checked this by compiling Qt 4.8.1, but viewing in the sources this will also a problem there.
>
> Any hints on how to (legally) solve this issue ?

The MariaDB C library has been diverging from the MySQL C library. At 
some point I guess someone will contribute a driver for Qt.

But until then, you have to use the MySQL plugin and compile it against 
MySQL. It will work without problems with a MariaDB.

Slightly annoying and confusing, yes. But it's a usable workaround for 
now. I don't know if there is enough optimizations available when using 
the MariaDB library directly, for anyone to do the effort of maintaining 
a separate plugin.

Also, it's not without problems to have a MariaDB plugin. Because it 
would be a bit confusing that both the MySQL and MariaDB plugin can talk 
to MariaDB. But the MariaDB plugin can't (I think, but I'm not sure) 
talk to MySQL.

Legally, there are no issues here. It's only a code and maintenance problem.

Bo Thorsen.

-- 
Fionia Software - Qt experts for hire.




More information about the Interest mailing list