Skip to content

Commit a3bedc3

Browse files
committed
Adding a comment explaining future cleanup work for the FK analyzer rule
1 parent fdce37c commit a3bedc3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sql/analyzer/apply_foreign_keys.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,14 @@ func getForeignKeyRefActions(ctx *sql.Context, a *Analyzer, tbl sql.ForeignKeyTa
382382
if err != nil {
383383
return nil, err
384384
}
385+
386+
// TODO: Foreign key information is not fully added to the plan node until these FK rules in the analyzer,
387+
// but it should be added during the binding phase, in planbuilder. Because this information is added
388+
// late, we have to do extra work here to resolve the schema defaults, which normally would happen
389+
// during binding. This extra FK information also doesn't get its exec indexes fixed up, so we have to
390+
// manually do that here. Moving all the FK information into the binding, planbuilder, phase would
391+
// clean this up. We should also fix assignExecIndexes to find all these FK schema references and fix
392+
// their exec indexes.
385393
childTblSch, err := resolveSchemaDefaults(ctx, a.Catalog, childTbl)
386394
if err != nil {
387395
return nil, err

0 commit comments

Comments
 (0)