@@ -146,6 +146,11 @@ func (q *Quarter) String() string { return fmt.Sprintf("%s(%s)", q.FunctionName(
146146// Type implements the Expression interface.
147147func (q * Quarter ) Type () sql.Type { return types .Int32 }
148148
149+ // IsNullable implements the Expression interface
150+ func (q * Quarter ) IsNullable () bool {
151+ return true
152+ }
153+
149154// CollationCoercibility implements the interface sql.CollationCoercible.
150155func (q * Quarter ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
151156 return sql .Collation_binary , 5
@@ -192,6 +197,11 @@ func (m *Month) String() string { return fmt.Sprintf("%s(%s)", m.FunctionName(),
192197// Type implements the Expression interface.
193198func (m * Month ) Type () sql.Type { return types .Int32 }
194199
200+ // IsNullable implements the Expression interface
201+ func (d * Month ) IsNullable () bool {
202+ return true
203+ }
204+
195205// CollationCoercibility implements the interface sql.CollationCoercible.
196206func (* Month ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
197207 return sql .Collation_binary , 5
@@ -238,6 +248,11 @@ func (d *Day) String() string { return fmt.Sprintf("%s(%s)", d.FunctionName(), d
238248// Type implements the Expression interface.
239249func (d * Day ) Type () sql.Type { return types .Int32 }
240250
251+ // IsNullable implements the Expression interface
252+ func (d * Day ) IsNullable () bool {
253+ return true
254+ }
255+
241256// CollationCoercibility implements the interface sql.CollationCoercible.
242257func (* Day ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
243258 return sql .Collation_binary , 5
@@ -285,6 +300,11 @@ func (d *Weekday) String() string { return fmt.Sprintf("%s(%s)", d.FunctionName(
285300// Type implements the Expression interface.
286301func (d * Weekday ) Type () sql.Type { return types .Int32 }
287302
303+ // IsNullable implements the Expression interface
304+ func (d * Weekday ) IsNullable () bool {
305+ return true
306+ }
307+
288308// CollationCoercibility implements the interface sql.CollationCoercible.
289309func (* Weekday ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
290310 return sql .Collation_binary , 5
@@ -470,6 +490,11 @@ func (d *DayOfWeek) String() string { return fmt.Sprintf("DAYOFWEEK(%s)", d.Chil
470490// Type implements the Expression interface.
471491func (d * DayOfWeek ) Type () sql.Type { return types .Int32 }
472492
493+ // IsNullable implements the Expression interface
494+ func (d * DayOfWeek ) IsNullable () bool {
495+ return true
496+ }
497+
473498// CollationCoercibility implements the interface sql.CollationCoercible.
474499func (* DayOfWeek ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
475500 return sql .Collation_binary , 5
@@ -516,6 +541,11 @@ func (d *DayOfYear) String() string { return fmt.Sprintf("DAYOFYEAR(%s)", d.Chil
516541// Type implements the Expression interface.
517542func (d * DayOfYear ) Type () sql.Type { return types .Int32 }
518543
544+ // IsNullable implements the Expression interface
545+ func (d * DayOfYear ) IsNullable () bool {
546+ return true
547+ }
548+
519549// CollationCoercibility implements the interface sql.CollationCoercible.
520550func (* DayOfYear ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
521551 return sql .Collation_binary , 5
@@ -653,7 +683,7 @@ func (d *YearWeek) Children() []sql.Expression { return []sql.Expression{d.date,
653683
654684// IsNullable implements the Expression interface.
655685func (d * YearWeek ) IsNullable () bool {
656- return d . date . IsNullable ()
686+ return true
657687}
658688
659689// WithChildren implements the Expression interface.
@@ -781,7 +811,7 @@ func (d *Week) Children() []sql.Expression { return []sql.Expression{d.date, d.m
781811
782812// IsNullable implements the Expression interface.
783813func (d * Week ) IsNullable () bool {
784- return d . date . IsNullable ()
814+ return true
785815}
786816
787817// WithChildren implements the Expression interface.
@@ -1288,6 +1318,11 @@ func (d *Date) String() string { return fmt.Sprintf("DATE(%s)", d.Child) }
12881318// Type implements the Expression interface.
12891319func (d * Date ) Type () sql.Type { return types .Date }
12901320
1321+ // IsNullable implements the Expression interface
1322+ func (d * Date ) IsNullable () bool {
1323+ return true
1324+ }
1325+
12911326// CollationCoercibility implements the interface sql.CollationCoercible.
12921327func (* Date ) CollationCoercibility (ctx * sql.Context ) (collation sql.CollationID , coercibility byte ) {
12931328 return sql .Collation_binary , 5
@@ -1370,6 +1405,11 @@ func (dtf *UnaryDatetimeFunc) String() string {
13701405 return fmt .Sprintf ("%s(%s)" , strings .ToUpper (dtf .Name ), dtf .Child .String ())
13711406}
13721407
1408+ // IsNullable implements the Expression interface
1409+ func (dtf * UnaryDatetimeFunc ) IsNullable () bool {
1410+ return true
1411+ }
1412+
13731413// Type implements the Expression interface.
13741414func (dtf * UnaryDatetimeFunc ) Type () sql.Type {
13751415 return dtf .SQLType
@@ -1401,6 +1441,11 @@ func (*DayName) CollationCoercibility(ctx *sql.Context) (collation sql.Collation
14011441 return ctx .GetCollation (), 4
14021442}
14031443
1444+ // IsNullable implements the Expression interface
1445+ func (d * DayName ) IsNullable () bool {
1446+ return true
1447+ }
1448+
14041449func (d * DayName ) Eval (ctx * sql.Context , row sql.Row ) (interface {}, error ) {
14051450 val , err := d .EvalChild (ctx , row )
14061451 if err != nil {
@@ -1487,6 +1532,11 @@ func (*MonthName) CollationCoercibility(ctx *sql.Context) (collation sql.Collati
14871532 return ctx .GetCollation (), 4
14881533}
14891534
1535+ // IsNullable implements the Expression interface
1536+ func (d * MonthName ) IsNullable () bool {
1537+ return true
1538+ }
1539+
14901540func (d * MonthName ) Eval (ctx * sql.Context , row sql.Row ) (interface {}, error ) {
14911541 val , err := d .EvalChild (ctx , row )
14921542 if err != nil {
0 commit comments