Skip to content

Commit 0760375

Browse files
committed
Patch result[3] PRAGMA assertion (Turso double-wraps ||)
Turso emits a second set of parens around the already-parenthesised CONCAT translation, so PRAGMA returns `(('a' || 'b'))` where real SQLite returns `('a' || 'b')`. Update the assertion accordingly.
1 parent c96a268 commit 0760375

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,17 @@ jobs:
17671767
)
17681768
assert old_b in src, 'PRAGMA result[2] assertion not found'
17691769
src = src.replace(old_b, new_b, 1)
1770+
# Translated CONCAT call uses `||`. Real SQLite stores it as
1771+
# `('a' || 'b')` (one paren level); Turso double-wraps and
1772+
# echoes it as `(('a' || 'b'))` from PRAGMA.
1773+
old_c = (
1774+
"\t\t$this->assertSame( \"('a' || 'b')\", $result[3]['dflt_value'] );\n"
1775+
)
1776+
new_c = (
1777+
"\t\t$this->assertSame( \"(('a' || 'b'))\", $result[3]['dflt_value'] );\n"
1778+
)
1779+
assert old_c in src, 'PRAGMA result[3] assertion not found'
1780+
src = src.replace(old_c, new_c, 1)
17701781
open(path, 'w').write(src)
17711782
print('patched testCreateTableWithDefaultExpressions PRAGMA expectations for Turso')
17721783
PY

0 commit comments

Comments
 (0)