(relation ast.TableExpr, fromClause *ast.List, databaseName string)
| 242 | } |
| 243 | |
| 244 | func resolveDMLTargetTable(relation ast.TableExpr, fromClause *ast.List, databaseName string) (*TableReference, error) { |
| 245 | table, err := tableReferenceFromTableExpr(relation, databaseName, defaultSchema) |
| 246 | if err != nil || table == nil { |
| 247 | return table, err |
| 248 | } |
| 249 | if fromClause != nil && table.Database == databaseName && table.Schema == defaultSchema { |
| 250 | if physical := findPhysicalTableForAlias(fromClause, table); physical != nil { |
| 251 | return physical, nil |
| 252 | } |
| 253 | } |
| 254 | return table, nil |
| 255 | } |
| 256 | |
| 257 | func tableReferenceFromTableExpr(expr ast.TableExpr, defaultDatabase, defaultSchema string) (*TableReference, error) { |
| 258 | ref, ok := expr.(*ast.TableRef) |
no test coverage detected