Skip to content

Commit cca9cf2

Browse files
committed
Update ParserInference.php
1 parent 5815d5e commit cca9cf2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/SqlAst/ParserInference.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,16 @@ public function narrowResultType(string $queryString, ConstantArrayType $resultT
108108
$joinType = SchemaJoin::TYPE_INNER;
109109
}
110110

111-
$joinedTable = $this->schemaReflection->getTable($from->getRight()->getTable()->getName());
112-
113-
if ($joinedTable !== null) {
114-
$joins[] = new SchemaJoin(
115-
$joinType,
116-
$joinedTable,
117-
$from->getCondition()
118-
);
111+
if ($from->getRight() instanceof TableReferenceTable) {
112+
$joinedTable = $this->schemaReflection->getTable($from->getRight()->getTable()->getName());
113+
114+
if ($joinedTable !== null) {
115+
$joins[] = new SchemaJoin(
116+
$joinType,
117+
$joinedTable,
118+
$from->getCondition()
119+
);
120+
}
119121
}
120122

121123
if ($from->getLeft() instanceof TableReferenceTable) {

0 commit comments

Comments
 (0)