View | Details | Raw Unified | Return to bug 227813
Collapse All | Expand All

(-)databases/qt4-mysql-plugin/Makefile (-1 / +1 lines)
Lines 1-7 Link Here
1
# Created by: Kay Lehmann <kay_lehmann@web.de>
1
# Created by: Kay Lehmann <kay_lehmann@web.de>
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTREVISION=	3
4
PORTREVISION=	4
5
5
6
COMMENT=	Qt MySQL database plugin
6
COMMENT=	Qt MySQL database plugin
7
DB=		mysql
7
DB=		mysql
(-)databases/qt4-mysql-plugin/files/patch-src_sql_drivers_mysql_qsql__mysql.cpp (+74 lines)
Line 0 Link Here
1
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html 
2
3
Incompatible Change: The my_bool type is no longer used in MySQL 
4
source code. Any third-party code that used this type to represent 
5
C boolean variables should use the bool or int C type instead.
6
7
Note
8
The change from my_bool to bool means that the mysql.h header file 
9
now requires a C++ or C99 compiler to compile.
10
11
(Bug #25597667)
12
13
--- src/sql/drivers/mysql/qsql_mysql.cpp.orig	2015-05-07 14:14:48 UTC
14
+++ src/sql/drivers/mysql/qsql_mysql.cpp
15
@@ -74,6 +74,14 @@ Q_DECLARE_METATYPE(MYSQL_STMT*)
16
 #  define Q_CLIENT_MULTI_STATEMENTS 0
17
 #endif
18
 
19
+// MYSQL 8.0.1 no longer uses the my_bool type:
20
+// https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
21
+#if MYSQL_VERSION_ID >= 80001
22
+typedef bool mysql_bool;
23
+#else
24
+typedef my_bool mysql_bool;
25
+#endif
26
+
27
 QT_BEGIN_NAMESPACE
28
 
29
 class QMYSQLDriverPrivate
30
@@ -194,7 +202,7 @@ class QMYSQLResultPrivate : public QObject (public)
31
               myField(0), type(QVariant::Invalid)
32
         {}
33
         char *outField;
34
-        my_bool nullIndicator;
35
+        mysql_bool nullIndicator;
36
         ulong bufLength;
37
         MYSQL_FIELD *myField;
38
         QVariant::Type type;
39
@@ -930,7 +938,7 @@ bool QMYSQLResult::exec()
40
     MYSQL_BIND* currBind;
41
     QVector<MYSQL_TIME *> timeVector;
42
     QVector<QByteArray> stringVector;
43
-    QVector<my_bool> nullVector;
44
+    QVector<mysql_bool> nullVector;
45
 
46
     const QVector<QVariant> values = boundValues();
47
 
48
@@ -951,7 +959,7 @@ bool QMYSQLResult::exec()
49
 
50
             currBind = &d->outBinds[i];
51
 
52
-            nullVector[i] = static_cast<my_bool>(val.isNull());
53
+            nullVector[i] = static_cast<mysql_bool>(val.isNull());
54
             currBind->is_null = &nullVector[i];
55
             currBind->length = 0;
56
             currBind->is_unsigned = 0;
57
@@ -1048,7 +1056,7 @@ bool QMYSQLResult::exec()
58
     d->rowsAffected = mysql_stmt_affected_rows(d->stmt);
59
 
60
     if (isSelect()) {
61
-        my_bool update_max_length = true;
62
+        mysql_bool update_max_length = true;
63
 
64
         r = mysql_stmt_bind_result(d->stmt, d->inBinds);
65
         if (r != 0) {
66
@@ -1245,7 +1253,7 @@ bool QMYSQLDriver::open(const QString& db,
67
     const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
68
     QString unixSocket;
69
 #if MYSQL_VERSION_ID >= 50000
70
-    my_bool reconnect=false;
71
+    mysql_bool reconnect=false;
72
 #endif
73
 
74
     // extract the real options from the string
(-)databases/qt5-sqldrivers-mysql/Makefile (+1 lines)
Lines 1-4 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
PORTREVISION=	1
2
3
3
DB=		MYSQL
4
DB=		MYSQL
4
DB_DESC=	MySQL
5
DB_DESC=	MySQL
(-)databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp (+74 lines)
Line 0 Link Here
1
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
2
3
Incompatible Change: The my_bool type is no longer used in MySQL
4
source code. Any third-party code that used this type to represent
5
C boolean variables should use the bool or int C type instead.
6
7
Note
8
The change from my_bool to bool means that the mysql.h header file
9
now requires a C++ or C99 compiler to compile.
10
11
(Bug #25597667)
12
13
--- src/plugins/sqldrivers/mysql/qsql_mysql.cpp.orig	2018-04-29 07:25:09 UTC
14
+++ src/plugins/sqldrivers/mysql/qsql_mysql.cpp
15
@@ -74,6 +74,14 @@ Q_DECLARE_METATYPE(MYSQL_STMT*)
16
 #  define Q_CLIENT_MULTI_STATEMENTS 0
17
 #endif
18
19
+// MYSQL 8.0.1 no longer uses the my_bool type:
20
+// https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
21
+#if MYSQL_VERSION_ID >= 80001
22
+typedef bool mysql_bool;
23
+#else
24
+typedef my_bool mysql_bool;
25
+#endif
26
+
27
 QT_BEGIN_NAMESPACE
28
29
 class QMYSQLDriverPrivate : public QSqlDriverPrivate
30
@@ -232,7 +240,7 @@ class QMYSQLResultPrivate: public QSqlResultPrivate (p
31
               myField(0), type(QVariant::Invalid)
32
         {}
33
         char *outField;
34
-        my_bool nullIndicator;
35
+        mysql_bool nullIndicator;
36
         ulong bufLength;
37
         MYSQL_FIELD *myField;
38
         QVariant::Type type;
39
@@ -983,7 +991,7 @@ bool QMYSQLResult::exec()
40
     MYSQL_BIND* currBind;
41
     QVector<MYSQL_TIME *> timeVector;
42
     QVector<QByteArray> stringVector;
43
-    QVector<my_bool> nullVector;
44
+    QVector<mysql_bool> nullVector;
45
46
     const QVector<QVariant> values = boundValues();
47
48
@@ -1004,7 +1012,7 @@ bool QMYSQLResult::exec()
49
50
             currBind = &d->outBinds[i];
51
52
-            nullVector[i] = static_cast<my_bool>(val.isNull());
53
+            nullVector[i] = static_cast<mysql_bool>(val.isNull());
54
             currBind->is_null = &nullVector[i];
55
             currBind->length = 0;
56
             currBind->is_unsigned = 0;
57
@@ -1101,7 +1109,7 @@ bool QMYSQLResult::exec()
58
     d->rowsAffected = mysql_stmt_affected_rows(d->stmt);
59
60
     if (isSelect()) {
61
-        my_bool update_max_length = true;
62
+        mysql_bool update_max_length = true;
63
64
         r = mysql_stmt_bind_result(d->stmt, d->inBinds);
65
         if (r != 0) {
66
@@ -1312,7 +1320,7 @@ bool QMYSQLDriver::open(const QString& db,
67
     QString sslCAPath;
68
     QString sslCipher;
69
 #if MYSQL_VERSION_ID >= 50000
70
-    my_bool reconnect=false;
71
+    mysql_bool reconnect=false;
72
     uint connectTimeout = 0;
73
     uint readTimeout = 0;
74
     uint writeTimeout = 0;

Return to bug 227813