Skip to content
Merged
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
2 changes: 1 addition & 1 deletion tests/default/DbaInferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__.'/data/runMysqlQuery.php');

// XXX cases which are not yet supported by the PdoQueryReflector
if ('pdo' !== getenv('DBA_REFLECTOR')) {
if ('pdo' !== getenv('DBA_REFLECTOR') && 'pdo-pgsql' !== getenv('DBA_REFLECTOR')) {
yield from $this->gatherAssertTypes(__DIR__.'/data/query-alias.php');
}

Expand Down
10 changes: 9 additions & 1 deletion tests/default/data/pdo-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function aggregateFunctions(PDO $pdo)
assertType('PDOStatement<array{MAX(adaid): int<-32768, 32767>|null, MIN(adaid): int<-32768, 32767>|null, COUNT(adaid): int, AVG(adaid): float|null}>', $stmt);
}

public function placeholderInData(PDO $pdo)
public function placeholderInDataPrepared(PDO $pdo)
{
// double quotes within the query
$query = 'SELECT adaid FROM ada WHERE email LIKE ":gesperrt%"';
Expand All @@ -44,4 +44,12 @@ public function placeholderInData(PDO $pdo)
$stmt->execute();
assertType('PDOStatement<array{adaid: int<-32768, 32767>, 0: int<-32768, 32767>}>', $stmt);
}

public function placeholderInDataQuery(PDO $pdo)
{
// double quotes within the query
$query = 'SELECT adaid FROM ada WHERE email LIKE ":gesperrt%"';
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{adaid: int<-32768, 32767>}>', $stmt);
}
}
4 changes: 0 additions & 4 deletions tests/default/data/pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ public function placeholderInData(PDO $pdo)
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{adaid: int<-32768, 32767>}>', $stmt);

$query = 'SELECT adaid FROM ada WHERE email LIKE ":gesperrt%"';
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{adaid: int<-32768, 32767>}>', $stmt);

$query = "SELECT adaid FROM ada WHERE email LIKE ':gesperrt%'";
$stmt = $pdo->query($query, PDO::FETCH_ASSOC);
assertType('PDOStatement<array{adaid: int<-32768, 32767>}>', $stmt);
Expand Down
1 change: 1 addition & 0 deletions tests/default/data/query-alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class Foo
{
// TODO pgsql: doesn't resolve null?
public function leftJoinQuery(PDO $pdo)
{
$query = 'SELECT a.email, b.adaid FROM ada a LEFT JOIN ada b ON a.adaid=b.adaid';
Expand Down