From bf3cf7b7013bd17e5b9c568211d5fe1aba33a628 Mon Sep 17 00:00:00 2001 From: Ilya Sevostyanov <1166655+i-sevostyanov@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:42:52 +0400 Subject: [PATCH] fix: add a missing item to the switch in the comparison operation --- internal/sql/expr/comparison/greater_or_equal.go | 2 ++ internal/sql/expr/comparison/greater_than.go | 2 ++ internal/sql/expr/comparison/less_or_equal.go | 2 ++ internal/sql/expr/comparison/less_than.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/internal/sql/expr/comparison/greater_or_equal.go b/internal/sql/expr/comparison/greater_or_equal.go index d57f31f..4e9c391 100644 --- a/internal/sql/expr/comparison/greater_or_equal.go +++ b/internal/sql/expr/comparison/greater_or_equal.go @@ -23,6 +23,8 @@ func GreaterOrEqual(left, right sql.Value) (sql.Value, error) { return greaterOrEqual[float64](left, right), nil case sql.Text: return greaterOrEqual[string](left, right), nil + case sql.Null: + return datatype.NewNull(), nil } } diff --git a/internal/sql/expr/comparison/greater_than.go b/internal/sql/expr/comparison/greater_than.go index 6fafd20..361e980 100644 --- a/internal/sql/expr/comparison/greater_than.go +++ b/internal/sql/expr/comparison/greater_than.go @@ -23,6 +23,8 @@ func GreaterThan(left, right sql.Value) (sql.Value, error) { return greaterThan[float64](left, right), nil case sql.Text: return greaterThan[string](left, right), nil + case sql.Null: + return datatype.NewNull(), nil } } diff --git a/internal/sql/expr/comparison/less_or_equal.go b/internal/sql/expr/comparison/less_or_equal.go index cc84aa4..66c91c9 100644 --- a/internal/sql/expr/comparison/less_or_equal.go +++ b/internal/sql/expr/comparison/less_or_equal.go @@ -23,6 +23,8 @@ func LessOrEqual(left, right sql.Value) (sql.Value, error) { return lessOrEqual[float64](left, right), nil case sql.Text: return lessOrEqual[string](left, right), nil + case sql.Null: + return datatype.NewNull(), nil } } diff --git a/internal/sql/expr/comparison/less_than.go b/internal/sql/expr/comparison/less_than.go index 62ff5dd..673089d 100644 --- a/internal/sql/expr/comparison/less_than.go +++ b/internal/sql/expr/comparison/less_than.go @@ -23,6 +23,8 @@ func LessThan(left, right sql.Value) (sql.Value, error) { return lessThan[float64](left, right), nil case sql.Text: return lessThan[string](left, right), nil + case sql.Null: + return datatype.NewNull(), nil } }