mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
ext/pdo_sqlite: fix minimal version for EXPLAIN feature support. (#18854)
This commit is contained in:
parent
bc7d00ea6d
commit
f129586459
4 changed files with 58 additions and 58 deletions
|
@ -39,7 +39,7 @@ class Sqlite extends \PDO
|
||||||
/** @cvalue PDO_SQLITE_ATTR_EXPLAIN_STATEMENT */
|
/** @cvalue PDO_SQLITE_ATTR_EXPLAIN_STATEMENT */
|
||||||
public const int ATTR_EXPLAIN_STATEMENT = UNKNOWN;
|
public const int ATTR_EXPLAIN_STATEMENT = UNKNOWN;
|
||||||
|
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
public const int EXPLAIN_MODE_PREPARED = 0;
|
public const int EXPLAIN_MODE_PREPARED = 0;
|
||||||
public const int EXPLAIN_MODE_EXPLAIN = 1;
|
public const int EXPLAIN_MODE_EXPLAIN = 1;
|
||||||
public const int EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 2;
|
public const int EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 2;
|
||||||
|
|
8
ext/pdo_sqlite/pdo_sqlite_arginfo.h
generated
8
ext/pdo_sqlite/pdo_sqlite_arginfo.h
generated
|
@ -1,5 +1,5 @@
|
||||||
/* This is a generated file, edit the .stub.php file instead.
|
/* This is a generated file, edit the .stub.php file instead.
|
||||||
* Stub hash: fa489a46c586ae935036f76a992163aeb67246d3 */
|
* Stub hash: c1d4ef325ecb8c8cb312910e8091ca003dc2603a */
|
||||||
|
|
||||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_createAggregate, 0, 3, _IS_BOOL, 0)
|
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_createAggregate, 0, 3, _IS_BOOL, 0)
|
||||||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
||||||
|
@ -121,7 +121,7 @@ static zend_class_entry *register_class_Pdo_Sqlite(zend_class_entry *class_entry
|
||||||
zend_string *const_ATTR_EXPLAIN_STATEMENT_name = zend_string_init_interned("ATTR_EXPLAIN_STATEMENT", sizeof("ATTR_EXPLAIN_STATEMENT") - 1, 1);
|
zend_string *const_ATTR_EXPLAIN_STATEMENT_name = zend_string_init_interned("ATTR_EXPLAIN_STATEMENT", sizeof("ATTR_EXPLAIN_STATEMENT") - 1, 1);
|
||||||
zend_declare_typed_class_constant(class_entry, const_ATTR_EXPLAIN_STATEMENT_name, &const_ATTR_EXPLAIN_STATEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
zend_declare_typed_class_constant(class_entry, const_ATTR_EXPLAIN_STATEMENT_name, &const_ATTR_EXPLAIN_STATEMENT_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
||||||
zend_string_release(const_ATTR_EXPLAIN_STATEMENT_name);
|
zend_string_release(const_ATTR_EXPLAIN_STATEMENT_name);
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
|
|
||||||
zval const_EXPLAIN_MODE_PREPARED_value;
|
zval const_EXPLAIN_MODE_PREPARED_value;
|
||||||
ZVAL_LONG(&const_EXPLAIN_MODE_PREPARED_value, 0);
|
ZVAL_LONG(&const_EXPLAIN_MODE_PREPARED_value, 0);
|
||||||
|
@ -129,7 +129,7 @@ static zend_class_entry *register_class_Pdo_Sqlite(zend_class_entry *class_entry
|
||||||
zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_PREPARED_name, &const_EXPLAIN_MODE_PREPARED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_PREPARED_name, &const_EXPLAIN_MODE_PREPARED_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
||||||
zend_string_release(const_EXPLAIN_MODE_PREPARED_name);
|
zend_string_release(const_EXPLAIN_MODE_PREPARED_name);
|
||||||
#endif
|
#endif
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
|
|
||||||
zval const_EXPLAIN_MODE_EXPLAIN_value;
|
zval const_EXPLAIN_MODE_EXPLAIN_value;
|
||||||
ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_value, 1);
|
ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_value, 1);
|
||||||
|
@ -137,7 +137,7 @@ static zend_class_entry *register_class_Pdo_Sqlite(zend_class_entry *class_entry
|
||||||
zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_name, &const_EXPLAIN_MODE_EXPLAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
zend_declare_typed_class_constant(class_entry, const_EXPLAIN_MODE_EXPLAIN_name, &const_EXPLAIN_MODE_EXPLAIN_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG));
|
||||||
zend_string_release(const_EXPLAIN_MODE_EXPLAIN_name);
|
zend_string_release(const_EXPLAIN_MODE_EXPLAIN_name);
|
||||||
#endif
|
#endif
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
|
|
||||||
zval const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value;
|
zval const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value;
|
||||||
ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, 2);
|
ZVAL_LONG(&const_EXPLAIN_MODE_EXPLAIN_QUERY_PLAN_value, 2);
|
||||||
|
|
|
@ -393,7 +393,7 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
|
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
if (__builtin_available(macOS 14.2, *)) {
|
if (__builtin_available(macOS 14.2, *)) {
|
||||||
#endif
|
#endif
|
||||||
|
@ -420,7 +420,7 @@ static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval
|
||||||
{
|
{
|
||||||
switch (attr) {
|
switch (attr) {
|
||||||
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
|
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
|
||||||
#if SQLITE_VERSION_NUMBER >= 3041000
|
#if SQLITE_VERSION_NUMBER >= 3043000
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
if (__builtin_available(macOS 14.2, *)) {
|
if (__builtin_available(macOS 14.2, *)) {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -59,9 +59,9 @@ try {
|
||||||
|
|
||||||
var_dump($stmts->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite::EXPLAIN_MODE_PREPARED);
|
var_dump($stmts->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite::EXPLAIN_MODE_PREPARED);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
bool(true)
|
bool(true)
|
||||||
array(16) {
|
array(%d) {
|
||||||
[0]=>
|
[0]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
|
@ -71,7 +71,7 @@ array(16) {
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["p2"]=>
|
["p2"]=>
|
||||||
int(14)
|
int(%d)
|
||||||
["p3"]=>
|
["p3"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["p4"]=>
|
["p4"]=>
|
||||||
|
@ -79,7 +79,7 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[1]=>
|
[1]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
|
@ -90,7 +90,7 @@ array(16) {
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
int(3)
|
int(3)
|
||||||
["p2"]=>
|
["p2"]=>
|
||||||
int(7)
|
int(%d)
|
||||||
["p3"]=>
|
["p3"]=>
|
||||||
int(2)
|
int(2)
|
||||||
["p4"]=>
|
["p4"]=>
|
||||||
|
@ -98,12 +98,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[2]=>
|
%A
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(2)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(7) "String8"
|
string(7) "String8"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -117,12 +117,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[3]=>
|
%A
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(3)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(5) "Yield"
|
string(5) "Yield"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -136,12 +136,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[4]=>
|
%A
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(4)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(7) "String8"
|
string(7) "String8"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -155,12 +155,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[5]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(5)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(5) "Yield"
|
string(5) "Yield"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -174,12 +174,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[6]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(6)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(12) "EndCoroutine"
|
string(12) "EndCoroutine"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -193,12 +193,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[7]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(7)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(9) "OpenWrite"
|
string(9) "OpenWrite"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -212,18 +212,18 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[8]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(8)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(5) "Yield"
|
string(5) "Yield"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
int(3)
|
int(3)
|
||||||
["p2"]=>
|
["p2"]=>
|
||||||
int(13)
|
int(%d)
|
||||||
["p3"]=>
|
["p3"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["p4"]=>
|
["p4"]=>
|
||||||
|
@ -231,12 +231,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[9]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(9)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(8) "NewRowid"
|
string(8) "NewRowid"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -250,12 +250,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[10]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(10)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(10) "MakeRecord"
|
string(10) "MakeRecord"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -269,12 +269,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[11]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(11)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(6) "Insert"
|
string(6) "Insert"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -288,18 +288,18 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(57)
|
int(57)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[12]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(12)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(4) "Goto"
|
string(4) "Goto"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["p2"]=>
|
["p2"]=>
|
||||||
int(8)
|
int(%d)
|
||||||
["p3"]=>
|
["p3"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["p4"]=>
|
["p4"]=>
|
||||||
|
@ -307,12 +307,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[13]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(13)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(4) "Halt"
|
string(4) "Halt"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -326,12 +326,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[14]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(14)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(11) "Transaction"
|
string(11) "Transaction"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -345,12 +345,12 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(1)
|
int(1)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
[15]=>
|
[%d]=>
|
||||||
array(8) {
|
array(8) {
|
||||||
["addr"]=>
|
["addr"]=>
|
||||||
int(15)
|
int(%d)
|
||||||
["opcode"]=>
|
["opcode"]=>
|
||||||
string(4) "Goto"
|
string(4) "Goto"
|
||||||
["p1"]=>
|
["p1"]=>
|
||||||
|
@ -364,7 +364,7 @@ array(16) {
|
||||||
["p5"]=>
|
["p5"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["comment"]=>
|
["comment"]=>
|
||||||
NULL
|
%a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool(false)
|
bool(false)
|
||||||
|
@ -376,7 +376,7 @@ array(1) {
|
||||||
["parent"]=>
|
["parent"]=>
|
||||||
int(0)
|
int(0)
|
||||||
["notused"]=>
|
["notused"]=>
|
||||||
int(0)
|
int(%d)
|
||||||
["detail"]=>
|
["detail"]=>
|
||||||
string(17) "SCAN test_explain"
|
string(17) "SCAN test_explain"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue