Reduce the scope of variables in bindInValues()
The scope of the variables 'bind', 'field', 'i' can be reduced if the variable 'meta' is a null pointer. So declare the variables when the variable 'meta' is valid. Change-Id: I599406c034168dd73799c69dfb9c5e676861cdf2 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
1fcc882d7c
commit
29fca29d1c
@ -317,15 +317,14 @@ void QMYSQLResultPrivate::bindBlobs()
|
|||||||
|
|
||||||
bool QMYSQLResultPrivate::bindInValues()
|
bool QMYSQLResultPrivate::bindInValues()
|
||||||
{
|
{
|
||||||
MYSQL_BIND *bind;
|
|
||||||
char *field;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
if (!meta)
|
if (!meta)
|
||||||
meta = mysql_stmt_result_metadata(stmt);
|
meta = mysql_stmt_result_metadata(stmt);
|
||||||
if (!meta)
|
if (!meta)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
MYSQL_BIND *bind;
|
||||||
|
char *field;
|
||||||
|
int i = 0;
|
||||||
fields.resize(mysql_num_fields(meta));
|
fields.resize(mysql_num_fields(meta));
|
||||||
|
|
||||||
inBinds = new MYSQL_BIND[fields.size()];
|
inBinds = new MYSQL_BIND[fields.size()];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user