@@ -303,17 +303,7 @@ func (a AddColumn) WithExpressions(exprs ...sql.Expression) (sql.Node, error) {
303303
304304// Resolved implements the Resolvable interface.
305305func (a * AddColumn ) Resolved () bool {
306- if ! (a .ddlNode .Resolved () && a .Table .Resolved () && a .column .Default .Resolved ()) {
307- return false
308- }
309-
310- for _ , col := range a .targetSch {
311- if ! col .Default .Resolved () {
312- return false
313- }
314- }
315-
316- return true
306+ return a .ddlNode .Resolved () && a .Table .Resolved () && a .column .Default .Resolved () && a .targetSch .Resolved ()
317307}
318308
319309// WithTargetSchema implements sql.SchemaTarget
@@ -544,17 +534,7 @@ func (d *DropColumn) Schema() sql.Schema {
544534}
545535
546536func (d * DropColumn ) Resolved () bool {
547- if ! d .Table .Resolved () && ! d .ddlNode .Resolved () {
548- return false
549- }
550-
551- for _ , col := range d .targetSchema {
552- if ! col .Default .Resolved () {
553- return false
554- }
555- }
556-
557- return true
537+ return d .Table .Resolved () && d .ddlNode .Resolved () && d .targetSchema .Resolved ()
558538}
559539
560540func (d * DropColumn ) Children () []sql.Node {
@@ -667,17 +647,7 @@ func (r *RenameColumn) DebugString() string {
667647}
668648
669649func (r * RenameColumn ) Resolved () bool {
670- if ! r .Table .Resolved () && r .ddlNode .Resolved () {
671- return false
672- }
673-
674- for _ , col := range r .targetSchema {
675- if ! col .Default .Resolved () {
676- return false
677- }
678- }
679-
680- return true
650+ return r .Table .Resolved () && r .ddlNode .Resolved () && r .targetSchema .Resolved ()
681651}
682652
683653func (r * RenameColumn ) Schema () sql.Schema {
@@ -838,17 +808,7 @@ func (m ModifyColumn) WithExpressions(exprs ...sql.Expression) (sql.Node, error)
838808
839809// Resolved implements the Resolvable interface.
840810func (m * ModifyColumn ) Resolved () bool {
841- if ! (m .Table .Resolved () && m .column .Default .Resolved () && m .ddlNode .Resolved ()) {
842- return false
843- }
844-
845- for _ , col := range m .targetSchema {
846- if ! col .Default .Resolved () {
847- return false
848- }
849- }
850-
851- return true
811+ return m .Table .Resolved () && m .column .Default .Resolved () && m .ddlNode .Resolved () && m .targetSchema .Resolved ()
852812}
853813
854814func (m * ModifyColumn ) ValidateDefaultPosition (tblSch sql.Schema ) error {
0 commit comments