Skip to content

Commit 34c3482

Browse files
github-actions[bot]claude
authored andcommitted
(fix): CI — testTransformations: preserve placeholders in transformed SQL
The transformation rewrote the prepared SQL to "SELECT 1", but SQL.php's getDocument still calls bindValue(':_uid', $id) (and ':_tenant' for sharedTables). PDO throws HY093 because the rewritten query has no placeholders. Wrap the original query as a derived table with WHERE 1=0 instead. The inner query keeps the :_uid / :_tenant placeholders so the bindValue calls match, while the outer WHERE forces zero rows so isEmpty() still asserts the trigger was applied. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4c291dd commit 34c3482

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/e2e/Adapter/Scopes/CollectionTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ public function testTransformations(): void
16711671
]));
16721672

16731673
$database->before(Database::EVENT_DOCUMENT_READ, 'test', function (string $query) {
1674-
return "SELECT 1";
1674+
return "SELECT * FROM ({$query}) AS sub_q WHERE 1 = 0";
16751675
});
16761676

16771677
try {

0 commit comments

Comments
 (0)