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 |