Skip to content

Commit 3fe091f

Browse files
yahondaclaude
andcommitted
Fix Oracle 23c compatibility for BOOLEAN type and error messages
Oracle 23c reports BOOLEAN parameters as "BOOLEAN" in ALL_ARGUMENTS instead of "PL/SQL BOOLEAN". Normalize the data_type when reading argument metadata so all downstream boolean handling (parameter binding, overload resolution) continues to work. Also update test regex for ORA-00942 which now includes schema and table name in the error message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 51acb7c commit 3fe091f

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/plsql/procedure.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ def get_argument_metadata_below_18c #:nodoc:
126126
data_type, in_out, data_length, data_precision, data_scale, char_used,
127127
char_length, type_owner, type_name, type_subname, defaulted = r
128128

129+
# Oracle 23c reports BOOLEAN as "BOOLEAN" instead of "PL/SQL BOOLEAN"
130+
data_type = "PL/SQL BOOLEAN" if data_type == "BOOLEAN"
131+
129132
@overloaded ||= !overload.nil?
130133
# if not overloaded then store arguments at key 0
131134
overload ||= 0
@@ -235,6 +238,9 @@ def get_argument_metadata_from_18c #:nodoc:
235238
data_type, in_out, data_length, data_precision, data_scale, char_used,
236239
char_length, type_owner, type_name, type_package, type_object_type, defaulted = r
237240

241+
# Oracle 23c reports BOOLEAN as "BOOLEAN" instead of "PL/SQL BOOLEAN"
242+
data_type = "PL/SQL BOOLEAN" if data_type == "BOOLEAN"
243+
238244
@overloaded ||= !overload.nil?
239245
# if not overloaded then store arguments at key 0
240246
overload ||= 0

spec/plsql/connection_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,15 @@
441441
@conn.exec "CREATE GLOBAL TEMPORARY TABLE #{tmp_table} (dummy CHAR(1))"
442442
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.not_to raise_error
443443
@conn.drop_all_ruby_temporary_tables
444-
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view does not exist/)
444+
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view.*does not exist/)
445445
end
446446

447447
it "should drop current session ruby temporary tables" do
448448
tmp_table = "ruby_#{@conn.session_id}_222_333"
449449
@conn.exec "CREATE GLOBAL TEMPORARY TABLE #{tmp_table} (dummy CHAR(1))"
450450
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.not_to raise_error
451451
@conn.drop_session_ruby_temporary_tables
452-
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view does not exist/)
452+
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view.*does not exist/)
453453
end
454454

455455
it "should not drop other session ruby temporary tables" do
@@ -483,7 +483,7 @@ def reconnect_connection
483483
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.not_to raise_error
484484
@conn.logoff
485485
reconnect_connection
486-
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view does not exist/)
486+
expect { @conn.select_first("SELECT * FROM #{tmp_table}") }.to raise_error(/table or view.*does not exist/)
487487
end
488488

489489
it "should rollback any uncommited transactions" do

0 commit comments

Comments
 (0)