Skip to content

Commit 3043db1

Browse files
yahondaclaude
andcommitted
Add debug output for XMLType investigation
Temporary debug output to understand what data_type Oracle 23c reports for XMLType parameters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1050356 commit 3043db1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ jobs:
8484
bundle install --jobs 4 --retry 3
8585
- name: Run RSpec
8686
run: |
87-
RUBYOPT="-w --debug-frozen-string-literal" bundle exec rspec
87+
RUBY_PLSQL_DEBUG=1 RUBYOPT="-w --debug-frozen-string-literal" bundle exec rspec

lib/plsql/procedure_call.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ def initialize(procedure, args = [], options = {})
1717
end
1818

1919
def exec
20-
# puts "DEBUG: sql = #{@sql.gsub("\n","<br/>\n")}"
20+
if ENV["RUBY_PLSQL_DEBUG"]
21+
$stderr.puts "DEBUG: sql = #{@sql}"
22+
$stderr.puts "DEBUG: bind_values = #{@bind_values.inspect}"
23+
$stderr.puts "DEBUG: bind_metadata = #{@bind_metadata.inspect}"
24+
end
2125
@cursor = @schema.connection.parse(@sql)
2226

2327
@bind_values.each do |arg, value|
@@ -225,6 +229,7 @@ def construct_sql(args)
225229
def add_argument(argument, value, argument_metadata = nil)
226230
argument_metadata ||= arguments[argument]
227231
raise ArgumentError, "Wrong argument #{argument.inspect} passed to PL/SQL procedure" unless argument_metadata
232+
$stderr.puts "DEBUG add_argument: #{argument} data_type=#{argument_metadata[:data_type]} type_name=#{argument_metadata[:type_name]} sql_type_name=#{argument_metadata[:sql_type_name]}" if ENV["RUBY_PLSQL_DEBUG"]
228233
case argument_metadata[:data_type]
229234
when "PL/SQL RECORD"
230235
add_record_declaration(argument, argument_metadata)

0 commit comments

Comments
 (0)