Skip to content

Commit e727c21

Browse files
committed
Add CI probe for Turso TEMP table I/O failure shapes
testCreateTemporaryTable and testTemporaryTableHasPriorityOverStandardTable fail under Turso with `I/O error: short read on page N` from the pager. Reproduce the shape directly (without the driver) so we can see whether the trigger is the AUTOINCREMENT, the DEFAULT, the INSERT path, or the same-name temp/permanent collision. Probe output is informational and `continue-on-error` so the job's pass count is unaffected.
1 parent 0760375 commit e727c21

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/phpunit-tests-turso.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,62 @@ jobs:
951951
}
952952
}
953953
954+
- name: Probe Turso TEMP table I/O
955+
continue-on-error: true
956+
env:
957+
LD_PRELOAD: ${{ steps.preload.outputs.value }}
958+
run: |
959+
php <<'PHP'
960+
<?php
961+
// Reproduce the testCreateTemporaryTable failure shape directly,
962+
// varying schema features one at a time so we can see which
963+
// shape Turso fails on.
964+
$cases = [
965+
'plain temp table create+drop' =>
966+
[
967+
"CREATE TEMPORARY TABLE _t1 (id INTEGER, v TEXT)",
968+
"DROP TABLE _t1",
969+
],
970+
'temp table with PRIMARY KEY AUTOINCREMENT, plain' =>
971+
[
972+
"CREATE TEMPORARY TABLE _t2 (id INTEGER PRIMARY KEY AUTOINCREMENT, v TEXT)",
973+
"DROP TABLE _t2",
974+
],
975+
'temp table with NOT NULL DEFAULT' =>
976+
[
977+
"CREATE TEMPORARY TABLE _t3 (id INTEGER PRIMARY KEY AUTOINCREMENT, v TEXT NOT NULL DEFAULT '')",
978+
"DROP TABLE _t3",
979+
],
980+
'temp table create + insert + select + drop' =>
981+
[
982+
"CREATE TEMPORARY TABLE _t4 (id INTEGER PRIMARY KEY AUTOINCREMENT, v TEXT)",
983+
"INSERT INTO _t4 (v) VALUES ('a')",
984+
"SELECT * FROM _t4",
985+
"DROP TABLE _t4",
986+
],
987+
'temp table same name as a real table' =>
988+
[
989+
"CREATE TABLE _t5 (id INTEGER, v TEXT)",
990+
"CREATE TEMPORARY TABLE _t5 (id INTEGER, v TEXT)",
991+
"DROP TABLE _t5",
992+
"DROP TABLE _t5",
993+
],
994+
];
995+
foreach ($cases as $label => $stmts) {
996+
$pdo = new PDO('sqlite::memory:');
997+
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
998+
$err = null;
999+
foreach ($stmts as $i => $s) {
1000+
try { $pdo->exec($s); }
1001+
catch (Throwable $e) {
1002+
$err = "stmt #$i ($s) -> " . $e->getMessage();
1003+
break;
1004+
}
1005+
}
1006+
echo ($err ? "FAIL " : "OK ") . $label . ($err ? " -> $err" : "") . "\n";
1007+
unset($pdo);
1008+
}
1009+
9541010
- name: Install Composer dependencies (root)
9551011
uses: ramsey/composer-install@v3
9561012
with:

0 commit comments

Comments
 (0)