[FIX](literal) fix expression literal error #29157

This commit is contained in:
amory
2023-12-28 23:08:01 +08:00
committed by GitHub
parent a90304c208
commit feebe3e6fb
3 changed files with 35 additions and 1 deletions

View File

@ -278,8 +278,10 @@ public enum ExpressionFunctions {
LiteralExpr[] exprs;
if (argType.isStringType()) {
exprs = new StringLiteral[args.size()];
} else if (argType.isFixedPointType()) {
} else if (argType.isIntegerType()) {
exprs = new IntLiteral[args.size()];
} else if (argType.isLargeIntType()) {
exprs = new LargeIntLiteral[args.size()];
} else if (argType.isDateType()) {
exprs = new DateLiteral[args.size()];
} else if (argType.isDecimalV2() || argType.isDecimalV3()) {

View File

@ -0,0 +1,10 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --
[1]
-- !sql --
[1, null]
-- !sql --
[1, null, 18446744073709551615]

View File

@ -0,0 +1,22 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
suite("literal_largeint") {
qt_sql "select array(cast(1 as LargeInt))"
qt_sql "select array(cast(1 as LargeInt), NULL)"
qt_sql "select array(cast(1 as LargeInt), NULL, cast(18446744073709551615 as LargeInt))"
}