blob: d76cd1b67365cae87a88feac5e149cbd8cec7cc3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
--- src/plugins/sqldrivers/mysql/qsql_mysql.cpp.orig 2020-10-27 08:02:11 UTC
+++ src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -352,11 +360,11 @@ void QMYSQLResultPrivate::bindBlobs()
for(i = 0; i < fields.count(); ++i) {
fieldInfo = fields.at(i).myField;
- if (qIsBlob(inBinds[i].buffer_type) && meta && fieldInfo) {
+ if (qIsBlob(inBinds[i].buffer_type) && meta && fieldInfo && fieldInfo->max_length) {
bind = &inBinds[i];
bind->buffer_length = fieldInfo->max_length;
delete[] static_cast<char*>(bind->buffer);
- bind->buffer = new char[fieldInfo->max_length];
+ bind->buffer = new char[bind->buffer_length];
fields[i].outField = static_cast<char*>(bind->buffer);
}
}
|