Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/rules/QueryPlanAnalyzerRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public function testNotUsingIndex(): void
28,
$tip,
],
[
"Query is not using an index on table 'ada'.".$proposal,
56,
$tip,
],
]);
}
}
6 changes: 6 additions & 0 deletions tests/rules/data/query-plan-analyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ public function writes(PDO $pdo, int $adaid): void
$pdo->query('REPLACE INTO `ada` SET email="test" WHERE adaid = '.$adaid);
$pdo->query('DELETE FROM `ada` WHERE adaid = '.$adaid);
}

public function bug385(PDO $pdo, string $email): void
{
$stmt = $pdo->query('SELECT * FROM `ada` WHERE email = ?');
$stmt->execute([$email]);
}
}