HHH-18765 - fix error in the booleanarray_to_string auxiliary function for Oracle

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2024-10-30 00:13:04 +01:00 committed by Christian Beikov
parent 62b6ed5cae
commit 7e1a740605
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ public class OracleUserDefinedTypeExporter extends StandardUserDefinedTypeExport
);
final String valueExpression = determineValueExpression( "t.value", elementSqlTypeCode, elementDdlTypeCode, elementType );
final String jsonElementType = determineJsonElementType( elementSqlTypeCode, elementDdlTypeCode, elementType );
final boolean isBooleanType = elementType.equalsIgnoreCase( "boolean" );
return new String[] {
"create or replace type " + arrayTypeName + " as varying array(" + arrayLength + ") of " + elementType,
"create or replace function " + arrayTypeName + "_cmp(a in " + arrayTypeName +
@ -251,7 +252,7 @@ public class OracleUserDefinedTypeExporter extends StandardUserDefinedTypeExport
"for i in 1 .. arr.count loop " +
"if arr(i) is not null then " +
"if length(res)<>0 then res:=res||sep; end if; " +
"res:=res||arr(i); " +
(!isBooleanType ? "res:=res||arr(i); " : "if arr(i) then res:=res||'true'; else res:=res||'false'; end if; ") +
"elsif nullVal is not null then " +
"if length(res)<>0 then res:=res||sep; end if; " +
"res:=res||nullVal; " +