Skip to content

Commit 4e5470a

Browse files
yahondaclaude
andcommitted
Fix BOOLEAN normalization for record fields and collection elements
Oracle 23c also reports BOOLEAN as "BOOLEAN" in ALL_PLSQL_TYPE_ATTRS and ALL_PLSQL_COLL_TYPES / ALL_COLL_TYPES metadata. Normalize these to "PL/SQL BOOLEAN" in get_field_definitions and get_element_definition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent df17564 commit 4e5470a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/plsql/procedure.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ def get_field_definitions(argument_metadata) # :nodoc:
365365

366366
attr_no, attr_name, attr_type_owner, attr_type_name, attr_type_package, attr_length, attr_precision, attr_scale, attr_char_used = r
367367

368+
# Oracle 23c reports BOOLEAN as "BOOLEAN" instead of "PL/SQL BOOLEAN"
369+
attr_type_name = "PL/SQL BOOLEAN" if attr_type_name == "BOOLEAN"
370+
368371
fields[attr_name.downcase.to_sym] = {
369372
position: attr_no.to_i,
370373
data_type: attr_type_owner == nil ? attr_type_name : get_composite_type(attr_type_owner, attr_type_name, attr_type_package),
@@ -427,6 +430,9 @@ def get_element_definition(argument_metadata) # :nodoc:
427430

428431
elem_type_owner, elem_type_name, elem_type_package, elem_length, elem_precision, elem_scale, elem_char_used, index_by = r
429432

433+
# Oracle 23c reports BOOLEAN as "BOOLEAN" instead of "PL/SQL BOOLEAN"
434+
elem_type_name = "PL/SQL BOOLEAN" if elem_type_name == "BOOLEAN"
435+
430436
if index_by == "VARCHAR2"
431437
raise ArgumentError, "Index-by Varchar-Table (associative array) #{argument_metadata[:type_name]} is not supported"
432438
end
@@ -464,6 +470,9 @@ def get_element_definition(argument_metadata) # :nodoc:
464470
)
465471
elem_type_owner, elem_type_name, elem_length, elem_precision, elem_scale, elem_char_used = r
466472

473+
# Oracle 23c reports BOOLEAN as "BOOLEAN" instead of "PL/SQL BOOLEAN"
474+
elem_type_name = "PL/SQL BOOLEAN" if elem_type_name == "BOOLEAN"
475+
467476
element_metadata = {
468477
position: 1,
469478
data_type: elem_type_owner == nil ? elem_type_name : "OBJECT",

0 commit comments

Comments
 (0)