Skip to content

Commit 93eaf8e

Browse files
committed
Merge branch '5.11.x'
2 parents 0ee3626 + 12287ea commit 93eaf8e

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

psalm-baseline.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@
806806
<code><![CDATA[array<string, array<string, array<string, array<string, array<string, string>|string|null>>|null>>]]></code>
807807
</MixedReturnTypeCoercion>
808808
<PossiblyNullArrayOffset>
809-
<code><![CDATA[$tables[$thisDb]]]></code>
810809
<code><![CDATA[Parser::STATEMENT_PARSERS]]></code>
811810
</PossiblyNullArrayOffset>
812811
<PossiblyUnusedProperty>

src/Statements/SelectStatement.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ public function getAliases(string $database): array
607607
];
608608
}
609609

610+
if ($expr->alias === null || $expr->alias === '') {
611+
continue;
612+
}
613+
610614
if (! isset($tables[$thisDb])) {
611615
$tables[$thisDb] = [];
612616
}

tests/Builder/StatementTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,25 @@ public static function getAliasesProvider(): array
155155
],
156156
],
157157
],
158+
[
159+
'SELECT mytable.a x, o.b y FROM mytable JOIN other o ON o.id = mytable.id',
160+
'shop',
161+
[
162+
'shop' => [
163+
'alias' => null,
164+
'tables' => [
165+
'mytable' => [
166+
'alias' => null,
167+
'columns' => ['a' => 'x'],
168+
],
169+
'other' => [
170+
'alias' => 'o',
171+
'columns' => ['b' => 'y'],
172+
],
173+
],
174+
],
175+
],
176+
],
158177
];
159178
}
160179
}

0 commit comments

Comments
 (0)