Skip to content

Commit 0a9697f

Browse files
authored
Fix unused variable in pdo_sqlite_stmt_set_attribute() (GH-18851)
The indentation is also wrong (using spaces instead of tabs), but this should be fixed in a separate commit.
1 parent 7e59769 commit 0a9697f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pdo_sqlite/sqlite_statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
418418

419419
static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *zval)
420420
{
421-
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
422-
423421
switch (attr) {
424422
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
425423
#if SQLITE_VERSION_NUMBER >= 3041000
@@ -434,6 +432,8 @@ static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval
434432
zend_value_error("explain mode must be one of the Pdo\\Sqlite::EXPLAIN_MODE_* constants");
435433
return 0;
436434
}
435+
436+
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
437437
if (sqlite3_stmt_explain(S->stmt, (int)Z_LVAL_P(zval)) != SQLITE_OK) {
438438
return 0;
439439
}

0 commit comments

Comments
 (0)