Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: compile issue on mysql > 8 #3520

Open
grandinj opened this issue Oct 30, 2024 · 1 comment
Open

[Bug]: compile issue on mysql > 8 #3520

grandinj opened this issue Oct 30, 2024 · 1 comment
Assignees
Labels

Comments

@grandinj
Copy link
Contributor

What happened?

Does not compile on latest Ubuntu

Version

Self compiled

Operating system

Linux

Steps to reproduce

compile produces output like

/home/noel/codelite/sdk/databaselayer/./include/wx/dblayer/include/../include/MysqlPreparedStatementParameter.h:65:3: error: ‘my_bool’ does not name a type; did you mean ‘bool’?
   65 |   my_bool m_bIsNull;

Which is fixable like this:

diff --git a/sdk/databaselayer/include/wx/dblayer/include/MysqlInterface.h b/sdk/databaselayer/include/wx/dblayer/include/MysqlInterface.h
index 747c84ca8..95c6cce0c 100644
--- a/sdk/databaselayer/include/wx/dblayer/include/MysqlInterface.h
+++ b/sdk/databaselayer/include/wx/dblayer/include/MysqlInterface.h
@@ -16,6 +16,12 @@
 
 #include "mysql.h"
 
+// MySQL dropped the my_bool typedef in version 8.0.1
+// https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html#mysqld-8-0-1-compiling
+#if MYSQL_VERSION_ID > 80000
+    typedef bool my_bool;
+#endif
+
 typedef void (STDCALL *MysqlServerEndType)(void);
 typedef MYSQL* (STDCALL *MysqlInitType)(MYSQL*);
 typedef MYSQL* (STDCALL *MysqlRealConnectType)(MYSQL*, const char*, const char*,
diff --git a/sdk/databaselayer/include/wx/dblayer/include/MysqlPreparedStatementParameter.h b/sdk/databaselayer/include/wx/dblayer/include/MysqlPreparedStatementParameter.h
index c6296d604..8af58d7aa 100644
--- a/sdk/databaselayer/include/wx/dblayer/include/MysqlPreparedStatementParameter.h
+++ b/sdk/databaselayer/include/wx/dblayer/include/MysqlPreparedStatementParameter.h
@@ -20,6 +20,12 @@
 #include "DatabaseErrorReporter.h"
 #include "DatabaseStringConverter.h"
 
+// MySQL dropped the my_bool typedef in version 8.0.1
+// https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html#mysqld-8-0-1-compiling
+#if MYSQL_VERSION_ID > 80000
+    typedef bool my_bool;
+#endif
+
 typedef struct bind_data {
   wxString strValue;
   int nValue;

Relevant log output

No response

@Jarod42
Copy link
Contributor

Jarod42 commented Oct 30, 2024

As a note, I have found https://github.com/mtangoo/wxDatabase which seems to be the successor of DatabaseLayer, but it seems not ready to be replaced as-is (as submodule).

Extra note, MySql support is optional (for Database Explorer plugin) and can be disable in CMake with -DWITH_MYSQL=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants