@@ -392,22 +392,22 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
392
392
ZVAL_TRUE (val );
393
393
}
394
394
break ;
395
- case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT :
395
+ case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT :
396
396
#if SQLITE_VERSION_NUMBER >= 3041000
397
397
#if defined(__APPLE__ )
398
- if (__builtin_available (macOS 14.2 , * )) {
398
+ if (__builtin_available (macOS 14.2 , * )) {
399
399
#endif
400
- ZVAL_LONG (val , (zend_long )sqlite3_stmt_isexplain (S -> stmt ));
401
- return 1 ;
400
+ ZVAL_LONG (val , (zend_long )sqlite3_stmt_isexplain (S -> stmt ));
401
+ return 1 ;
402
402
#if defined(__APPLE__ )
403
- } else {
404
- zend_value_error ("explain statement unsupported" );
405
- return 0 ;
406
- }
403
+ } else {
404
+ zend_value_error ("explain statement unsupported" );
405
+ return 0 ;
406
+ }
407
407
#endif
408
408
#else
409
- zend_value_error ("explain statement unsupported" );
410
- return 0 ;
409
+ zend_value_error ("explain statement unsupported" );
410
+ return 0 ;
411
411
#endif
412
412
default :
413
413
return 0 ;
@@ -419,41 +419,41 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
419
419
static int pdo_sqlite_stmt_set_attribute (pdo_stmt_t * stmt , zend_long attr , zval * zval )
420
420
{
421
421
switch (attr ) {
422
- case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT :
422
+ case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT :
423
423
#if SQLITE_VERSION_NUMBER >= 3041000
424
424
#if defined(__APPLE__ )
425
- if (__builtin_available (macOS 14.2 , * )) {
425
+ if (__builtin_available (macOS 14.2 , * )) {
426
426
#endif
427
- if (Z_TYPE_P (zval ) != IS_LONG ) {
428
- zend_type_error ("explain mode must be of type int, %s given" , zend_zval_value_name (zval ));
429
- return 0 ;
430
- }
431
- if (Z_LVAL_P (zval ) < 0 || Z_LVAL_P (zval ) > 2 ) {
432
- zend_value_error ("explain mode must be one of the Pdo\\Sqlite::EXPLAIN_MODE_* constants" );
433
- return 0 ;
434
- }
435
-
436
- pdo_sqlite_stmt * S = (pdo_sqlite_stmt * )stmt -> driver_data ;
437
- if (sqlite3_stmt_explain (S -> stmt , (int )Z_LVAL_P (zval )) != SQLITE_OK ) {
438
- return 0 ;
439
- }
440
-
441
- return 1 ;
427
+ if (Z_TYPE_P (zval ) != IS_LONG ) {
428
+ zend_type_error ("explain mode must be of type int, %s given" , zend_zval_value_name (zval ));
429
+ return 0 ;
430
+ }
431
+ if (Z_LVAL_P (zval ) < 0 || Z_LVAL_P (zval ) > 2 ) {
432
+ zend_value_error ("explain mode must be one of the Pdo\\Sqlite::EXPLAIN_MODE_* constants" );
433
+ return 0 ;
434
+ }
435
+
436
+ pdo_sqlite_stmt * S = (pdo_sqlite_stmt * )stmt -> driver_data ;
437
+ if (sqlite3_stmt_explain (S -> stmt , (int )Z_LVAL_P (zval )) != SQLITE_OK ) {
438
+ return 0 ;
439
+ }
440
+
441
+ return 1 ;
442
442
#if defined(__APPLE__ )
443
- } else {
444
- zend_value_error ("explain statement unsupported" );
445
- return 0 ;
446
- }
443
+ } else {
444
+ zend_value_error ("explain statement unsupported" );
445
+ return 0 ;
446
+ }
447
447
#endif
448
448
#else
449
- zend_value_error ("explain statement unsupported" );
450
- return 0 ;
449
+ zend_value_error ("explain statement unsupported" );
450
+ return 0 ;
451
451
#endif
452
452
default :
453
453
return 0 ;
454
- }
454
+ }
455
455
456
- return 1 ;
456
+ return 1 ;
457
457
}
458
458
459
459
const struct pdo_stmt_methods sqlite_stmt_methods = {
0 commit comments