Skip to content

pdo_sqlite_getsetattr_explain.phpt test is sensitive to variance #18874

Closed
@NattyNarwhal

Description

@NattyNarwhal

Description

Fails in CI:

========DIFF========
     bool(true)
002- array(16) {
002+ array(17) {
       [0]=>
       array(8) {
         ["addr"]=>
--
         ["p1"]=>
         int(0)
         ["p2"]=>
012-     int(14)
012+     int(15)
         ["p3"]=>
         int(0)
         ["p4"]=>
--
         ["p5"]=>
         int(0)
         ["comment"]=>
020-     NULL
020+     string(11) "Start at 15"
       }
       [1]=>
       array(8) {
--
         ["p1"]=>
         int(3)
         ["p2"]=>
031-     int(7)
031+     int(8)
         ["p3"]=>
         int(2)
         ["p4"]=>
--
         ["addr"]=>
         int(2)
         ["opcode"]=>
046+     string(7) "Explain"
047+     ["p1"]=>
048+     int(2)
049+     ["p2"]=>
050+     int(0)
051+     ["p3"]=>
052+     int(0)
053+     ["p4"]=>
054+     string(20) "SCAN 2 CONSTANT ROWS"
055+     ["p5"]=>
056+     int(0)
057+     ["comment"]=>
058+     NULL
059+   }
060+   [3]=>
061+   array(8) {
062+     ["addr"]=>
063+     int(3)
064+     ["opcode"]=>
         string(7) "String8"
         ["p1"]=>
         int(0)
--
         ["p5"]=>
         int(0)
         ["comment"]=>
058-     NULL
077+     string(19) "r[2]='first insert'"
       }
060-   [3]=>
079+   [4]=>
       array(8) {
         ["addr"]=>
063-     int(3)
082+     int(4)
         ["opcode"]=>
         string(5) "Yield"
         ["p1"]=>
--
         ["comment"]=>
         NULL
       }
079-   [4]=>
098+   [5]=>
       array(8) {
         ["addr"]=>
082-     int(4)
101+     int(5)
         ["opcode"]=>
         string(7) "String8"
         ["p1"]=>
--
         ["p5"]=>
         int(0)
         ["comment"]=>
096-     NULL
115+     string(20) "r[2]='second_insert'"
       }
098-   [5]=>
117+   [6]=>
       array(8) {
         ["addr"]=>
101-     int(5)
120+     int(6)
         ["opcode"]=>
         string(5) "Yield"
         ["p1"]=>
--
         ["comment"]=>
         NULL
       }
117-   [6]=>
136+   [7]=>
       array(8) {
         ["addr"]=>
120-     int(6)
139+     int(7)
         ["opcode"]=>
         string(12) "EndCoroutine"
         ["p1"]=>
--
         ["comment"]=>
         NULL
       }
136-   [7]=>
155+   [8]=>
       array(8) {
         ["addr"]=>
139-     int(7)
158+     int(8)
         ["opcode"]=>
         string(9) "OpenWrite"
         ["p1"]=>
--
         ["p5"]=>
         int(0)
         ["comment"]=>
153-     NULL
172+     string(26) "root=2 iDb=0; test_explain"
       }
155-   [8]=>
174+   [9]=>
       array(8) {
         ["addr"]=>
158-     int(8)
177+     int(9)
         ["opcode"]=>
         string(5) "Yield"
         ["p1"]=>
         int(3)
         ["p2"]=>
164-     int(13)
183+     int(14)
         ["p3"]=>
         int(0)
         ["p4"]=>
--
         ["comment"]=>
         NULL
       }
174-   [9]=>
193+   [10]=>
       array(8) {
         ["addr"]=>
177-     int(9)
196+     int(10)
         ["opcode"]=>
         string(8) "NewRowid"
         ["p1"]=>
--
         ["p5"]=>
         int(0)
         ["comment"]=>
191-     NULL
210+     string(10) "r[1]=rowid"
       }
193-   [10]=>
212+   [11]=>
       array(8) {
         ["addr"]=>
196-     int(10)
215+     int(11)
         ["opcode"]=>
         string(10) "MakeRecord"
         ["p1"]=>
--
         ["p5"]=>
         int(0)
         ["comment"]=>
210-     NULL
229+     string(16) "r[4]=mkrec(r[2])"
       }
212-   [11]=>
231+   [12]=>
       array(8) {
         ["addr"]=>
215-     int(11)
234+     int(12)
         ["opcode"]=>
         string(6) "Insert"
         ["p1"]=>
--
         ["p5"]=>
         int(57)
         ["comment"]=>
229-     NULL
248+     string(21) "intkey=r[1] data=r[4]"
       }
231-   [12]=>
250+   [13]=>
       array(8) {
         ["addr"]=>
234-     int(12)
253+     int(13)
         ["opcode"]=>
         string(4) "Goto"
         ["p1"]=>
         int(0)
         ["p2"]=>
240-     int(8)
259+     int(9)
         ["p3"]=>
         int(0)
         ["p4"]=>
--
         ["comment"]=>
         NULL
       }
250-   [13]=>
269+   [14]=>
       array(8) {
         ["addr"]=>
253-     int(13)
272+     int(14)
         ["opcode"]=>
         string(4) "Halt"
         ["p1"]=>
--
         ["comment"]=>
         NULL
       }
269-   [14]=>
288+   [15]=>
       array(8) {
         ["addr"]=>
272-     int(14)
291+     int(15)
         ["opcode"]=>
         string(11) "Transaction"
         ["p1"]=>
--
         ["p5"]=>
         int(1)
         ["comment"]=>
286-     NULL
305+     string(17) "usesStmtJournal=0"
       }
288-   [15]=>
307+   [16]=>
       array(8) {
         ["addr"]=>
291-     int(15)
310+     int(16)
         ["opcode"]=>
         string(4) "Goto"
         ["p1"]=>
--
         ["parent"]=>
         int(0)
         ["notused"]=>
317-     int(0)
336+     int(216)
         ["detail"]=>
         string(17) "SCAN test_explain"
       }
--
========DONE========
FAIL Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT usage [ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt] 

I suspect relying on the EXPLAIN output is unreliable between SQLite versions (3.49.1 on this system), possibly OSes/architectures (the test is already marked as skip on macOS).

PHP Version

PHP 8.5.0-dev (cli) (built: Jun 18 2025 08:28:09) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies

Operating System

Gentoo/ppc64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions