MySQL: don't allocate 1-byte buffers for BLOBs
We set the buffer length to 0 for blobs, as we need to do it for each row, in bindBlobs() (apparently a workaround for MySQL 4.1.8 API). That function was deleting the buffer and reallocating. Change-Id: I4a40ccbd3321467a8429fffd169b06422612ca13 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
549ee216fd
commit
74705ae17b
@ -364,7 +364,7 @@ bool QMYSQLResultPrivate::bindInValues()
|
||||
bind->length = &f.bufLength;
|
||||
bind->is_unsigned = fieldInfo->flags & UNSIGNED_FLAG ? 1 : 0;
|
||||
|
||||
char *field = new char[bind->buffer_length + 1]{};
|
||||
char *field = bind->buffer_length ? new char[bind->buffer_length + 1]{} : nullptr;
|
||||
bind->buffer = f.outField = field;
|
||||
|
||||
++i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user