Skip to content

Commit

Permalink
[CALCITE-6780] AbstractSqlTester fails to build query for expression …
Browse files Browse the repository at this point in the history
…TRIM(string)
  • Loading branch information
ILuffZhe committed Jan 17, 2025
1 parent a2e891c commit 0f28a4a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ ExInst<CalciteException> illegalArgumentForTableFunctionCall(String a0,
@BaseMessage("Illegal arguments: The length of the keys array {0,number,#} is not equal to the length of the values array {1,number,#} in MAP_FROM_ARRAYS function")
ExInst<CalciteException> illegalArgumentsInMapFromArraysFunc(int arg0, int arg1);

@BaseMessage("Invalid argument ''{0}'' for TRIM function: the length in trim character must be 1")
@BaseMessage("Invalid argument ''{0}'': the length of the string describing the trimmed character must be 1")
ExInst<CalciteException> trimError(String seek);

@BaseMessage("Invalid types for arithmetic: {0} {1} {2}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ IllegalMapValuesWithNullKey=Illegal arguments for 'MAP_VALUES' function: using a
InvalidPrecisionForDecimalType=DECIMAL precision {0,number,#} must be between 1 and {1,number,#}
InvalidScaleForDecimalType=DECIMAL scale {0,number,#} must be between {1,number,#} and {2,number,#}
IllegalArgumentsInMapFromArraysFunc=Illegal arguments: The length of the keys array {0,number,#} is not equal to the length of the values array {1,number,#} in MAP_FROM_ARRAYS function
TrimError=Invalid argument ''{0}'' for TRIM function: the length in trim character must be 1
TrimError=Invalid argument ''{0}'': the length of the string describing the trimmed character must be 1
InvalidTypesForArithmetic=Invalid types for arithmetic: {0} {1} {2}
InvalidTypesForComparison=Invalid types for comparison: {0} {1} {2}
CannotConvert=Cannot convert {0} to {1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11717,10 +11717,12 @@ void assertSubFunReturns(boolean binary, String s, int start,
// SQL:2003 6.29.9 and SQL:2016 6.30.11: trim string must have length=1.
// Failure occurs at runtime.
f.checkFails("trim('xy' from 'abcde')",
"Invalid argument 'xy' for TRIM function: the length in trim character must be 1",
"Invalid argument 'xy': the length of the string describing "
+ "the trimmed character must be 1",
true);
f.checkFails("trim('' from 'abcde')",
"Invalid argument '' for TRIM function: the length in trim character must be 1",
"Invalid argument '': the length of the string describing "
+ "the trimmed character must be 1",
true);

final Consumer<SqlOperatorFixture> consumer = f1 -> {
Expand Down

0 comments on commit 0f28a4a

Please sign in to comment.