Skip to content

Commit dca626b

Browse files
author
James Cor
committed
more stuff
1 parent f0765b0 commit dca626b

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

sql/expression/comparison.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ func (c *comparison) IsValueExpression() bool {
207207
if !ok {
208208
return false
209209
}
210+
if _, ok := c.LeftChild.Type().(sql.ValueType); !ok {
211+
return false
212+
}
213+
if _, ok := c.RightChild.Type().(sql.ValueType); !ok {
214+
return false
215+
}
210216
return l.IsValueExpression() && r.IsValueExpression()
211217
}
212218

sql/expression/literal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (lit *Literal) EvalValue(ctx *sql.Context, row sql.ValueRow) (sql.Value, er
141141
return lit.val2, nil
142142
}
143143

144-
// IsValueRowIter implements the ValueExpression interface.
144+
// IsValueExpression implements the ValueExpression interface.
145145
func (lit *Literal) IsValueExpression() bool {
146146
return types.IsInteger(lit.Typ)
147147
}

sql/types/datetime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,6 @@ func ConvertValueToDatetime(ctx *sql.Context, v sql.Value) (time.Time, error) {
701701
}
702702
return res, err
703703
default:
704-
return zeroTime, sql.ErrInvalidBaseType.New(v.Typ.String(), "number")
704+
return zeroTime, sql.ErrInvalidBaseType.New(v.Typ.String(), "datetime")
705705
}
706706
}

sql/types/decimal.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ func (t DecimalType_) DecimalValueStringFixed(v decimal.Decimal) string {
411411
}
412412
}
413413

414-
// TODO: Should this take in precision and scale?
415414
func ConvertValueToDecimal(ctx *sql.Context, v sql.Value) (decimal.Decimal, error) {
416415
switch v.Typ {
417416
case sqltypes.Int8:

0 commit comments

Comments
 (0)