Skip to content

Commit f129586

Browse files
authored
ext/pdo_sqlite: fix minimal version for EXPLAIN feature support. (php#18854)
1 parent bc7d00e commit f129586

File tree

4 files changed

+58
-58
lines changed

4 files changed

+58
-58
lines changed

ext/pdo_sqlite/pdo_sqlite.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Sqlite extends \PDO
3939
/** @cvalue PDO_SQLITE_ATTR_EXPLAIN_STATEMENT */
4040
public const int ATTR_EXPLAIN_STATEMENT = UNKNOWN;
4141

42-
#if SQLITE_VERSION_NUMBER >= 3041000
42+
#if SQLITE_VERSION_NUMBER >= 3043000
4343
public const int EXPLAIN_MODE_PREPARED = 0;
4444
public const int EXPLAIN_MODE_EXPLAIN = 1;
4545
public const int EXPLAIN_MODE_EXPLAIN_QUERY_PLAN = 2;

ext/pdo_sqlite/pdo_sqlite_arginfo.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_sqlite/sqlite_statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int pdo_sqlite_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval
393393
}
394394
break;
395395
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
396-
#if SQLITE_VERSION_NUMBER >= 3041000
396+
#if SQLITE_VERSION_NUMBER >= 3043000
397397
#if defined(__APPLE__)
398398
if (__builtin_available(macOS 14.2, *)) {
399399
#endif
@@ -420,7 +420,7 @@ static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval
420420
{
421421
switch (attr) {
422422
case PDO_SQLITE_ATTR_EXPLAIN_STATEMENT:
423-
#if SQLITE_VERSION_NUMBER >= 3041000
423+
#if SQLITE_VERSION_NUMBER >= 3043000
424424
#if defined(__APPLE__)
425425
if (__builtin_available(macOS 14.2, *)) {
426426
#endif

ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ try {
5959

6060
var_dump($stmts->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite::EXPLAIN_MODE_PREPARED);
6161
?>
62-
--EXPECT--
62+
--EXPECTF--
6363
bool(true)
64-
array(16) {
64+
array(%d) {
6565
[0]=>
6666
array(8) {
6767
["addr"]=>
@@ -71,15 +71,15 @@ array(16) {
7171
["p1"]=>
7272
int(0)
7373
["p2"]=>
74-
int(14)
74+
int(%d)
7575
["p3"]=>
7676
int(0)
7777
["p4"]=>
7878
NULL
7979
["p5"]=>
8080
int(0)
8181
["comment"]=>
82-
NULL
82+
%a
8383
}
8484
[1]=>
8585
array(8) {
@@ -90,20 +90,20 @@ array(16) {
9090
["p1"]=>
9191
int(3)
9292
["p2"]=>
93-
int(7)
93+
int(%d)
9494
["p3"]=>
9595
int(2)
9696
["p4"]=>
9797
NULL
9898
["p5"]=>
9999
int(0)
100100
["comment"]=>
101-
NULL
101+
%a
102102
}
103-
[2]=>
103+
%A
104104
array(8) {
105105
["addr"]=>
106-
int(2)
106+
int(%d)
107107
["opcode"]=>
108108
string(7) "String8"
109109
["p1"]=>
@@ -117,12 +117,12 @@ array(16) {
117117
["p5"]=>
118118
int(0)
119119
["comment"]=>
120-
NULL
120+
%a
121121
}
122-
[3]=>
122+
%A
123123
array(8) {
124124
["addr"]=>
125-
int(3)
125+
int(%d)
126126
["opcode"]=>
127127
string(5) "Yield"
128128
["p1"]=>
@@ -136,12 +136,12 @@ array(16) {
136136
["p5"]=>
137137
int(0)
138138
["comment"]=>
139-
NULL
139+
%a
140140
}
141-
[4]=>
141+
%A
142142
array(8) {
143143
["addr"]=>
144-
int(4)
144+
int(%d)
145145
["opcode"]=>
146146
string(7) "String8"
147147
["p1"]=>
@@ -155,12 +155,12 @@ array(16) {
155155
["p5"]=>
156156
int(0)
157157
["comment"]=>
158-
NULL
158+
%a
159159
}
160-
[5]=>
160+
[%d]=>
161161
array(8) {
162162
["addr"]=>
163-
int(5)
163+
int(%d)
164164
["opcode"]=>
165165
string(5) "Yield"
166166
["p1"]=>
@@ -174,12 +174,12 @@ array(16) {
174174
["p5"]=>
175175
int(0)
176176
["comment"]=>
177-
NULL
177+
%a
178178
}
179-
[6]=>
179+
[%d]=>
180180
array(8) {
181181
["addr"]=>
182-
int(6)
182+
int(%d)
183183
["opcode"]=>
184184
string(12) "EndCoroutine"
185185
["p1"]=>
@@ -193,12 +193,12 @@ array(16) {
193193
["p5"]=>
194194
int(0)
195195
["comment"]=>
196-
NULL
196+
%a
197197
}
198-
[7]=>
198+
[%d]=>
199199
array(8) {
200200
["addr"]=>
201-
int(7)
201+
int(%d)
202202
["opcode"]=>
203203
string(9) "OpenWrite"
204204
["p1"]=>
@@ -212,31 +212,31 @@ array(16) {
212212
["p5"]=>
213213
int(0)
214214
["comment"]=>
215-
NULL
215+
%a
216216
}
217-
[8]=>
217+
[%d]=>
218218
array(8) {
219219
["addr"]=>
220-
int(8)
220+
int(%d)
221221
["opcode"]=>
222222
string(5) "Yield"
223223
["p1"]=>
224224
int(3)
225225
["p2"]=>
226-
int(13)
226+
int(%d)
227227
["p3"]=>
228228
int(0)
229229
["p4"]=>
230230
NULL
231231
["p5"]=>
232232
int(0)
233233
["comment"]=>
234-
NULL
234+
%a
235235
}
236-
[9]=>
236+
[%d]=>
237237
array(8) {
238238
["addr"]=>
239-
int(9)
239+
int(%d)
240240
["opcode"]=>
241241
string(8) "NewRowid"
242242
["p1"]=>
@@ -250,12 +250,12 @@ array(16) {
250250
["p5"]=>
251251
int(0)
252252
["comment"]=>
253-
NULL
253+
%a
254254
}
255-
[10]=>
255+
[%d]=>
256256
array(8) {
257257
["addr"]=>
258-
int(10)
258+
int(%d)
259259
["opcode"]=>
260260
string(10) "MakeRecord"
261261
["p1"]=>
@@ -269,12 +269,12 @@ array(16) {
269269
["p5"]=>
270270
int(0)
271271
["comment"]=>
272-
NULL
272+
%a
273273
}
274-
[11]=>
274+
[%d]=>
275275
array(8) {
276276
["addr"]=>
277-
int(11)
277+
int(%d)
278278
["opcode"]=>
279279
string(6) "Insert"
280280
["p1"]=>
@@ -288,31 +288,31 @@ array(16) {
288288
["p5"]=>
289289
int(57)
290290
["comment"]=>
291-
NULL
291+
%a
292292
}
293-
[12]=>
293+
[%d]=>
294294
array(8) {
295295
["addr"]=>
296-
int(12)
296+
int(%d)
297297
["opcode"]=>
298298
string(4) "Goto"
299299
["p1"]=>
300300
int(0)
301301
["p2"]=>
302-
int(8)
302+
int(%d)
303303
["p3"]=>
304304
int(0)
305305
["p4"]=>
306306
NULL
307307
["p5"]=>
308308
int(0)
309309
["comment"]=>
310-
NULL
310+
%a
311311
}
312-
[13]=>
312+
[%d]=>
313313
array(8) {
314314
["addr"]=>
315-
int(13)
315+
int(%d)
316316
["opcode"]=>
317317
string(4) "Halt"
318318
["p1"]=>
@@ -326,12 +326,12 @@ array(16) {
326326
["p5"]=>
327327
int(0)
328328
["comment"]=>
329-
NULL
329+
%a
330330
}
331-
[14]=>
331+
[%d]=>
332332
array(8) {
333333
["addr"]=>
334-
int(14)
334+
int(%d)
335335
["opcode"]=>
336336
string(11) "Transaction"
337337
["p1"]=>
@@ -345,12 +345,12 @@ array(16) {
345345
["p5"]=>
346346
int(1)
347347
["comment"]=>
348-
NULL
348+
%a
349349
}
350-
[15]=>
350+
[%d]=>
351351
array(8) {
352352
["addr"]=>
353-
int(15)
353+
int(%d)
354354
["opcode"]=>
355355
string(4) "Goto"
356356
["p1"]=>
@@ -364,7 +364,7 @@ array(16) {
364364
["p5"]=>
365365
int(0)
366366
["comment"]=>
367-
NULL
367+
%a
368368
}
369369
}
370370
bool(false)
@@ -376,7 +376,7 @@ array(1) {
376376
["parent"]=>
377377
int(0)
378378
["notused"]=>
379-
int(0)
379+
int(%d)
380380
["detail"]=>
381381
string(17) "SCAN test_explain"
382382
}

0 commit comments

Comments
 (0)