diff --git a/tests/rules/QueryPlanAnalyzerRuleTest.php b/tests/rules/QueryPlanAnalyzerRuleTest.php index 2023d7e2e..ff32aa527 100644 --- a/tests/rules/QueryPlanAnalyzerRuleTest.php +++ b/tests/rules/QueryPlanAnalyzerRuleTest.php @@ -82,6 +82,11 @@ public function testNotUsingIndex(): void 28, $tip, ], + [ + "Query is not using an index on table 'ada'.".$proposal, + 56, + $tip, + ], ]); } } diff --git a/tests/rules/data/query-plan-analyzer.php b/tests/rules/data/query-plan-analyzer.php index 9d861a15b..98be5dd60 100644 --- a/tests/rules/data/query-plan-analyzer.php +++ b/tests/rules/data/query-plan-analyzer.php @@ -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]); + } }