Skip to content

Added missing method Cursor.select_statement?#2473

Open
rammpeter wants to merge 3 commits into
rsim:release80from
rammpeter:rammpeter_add_select_statement
Open

Added missing method Cursor.select_statement?#2473
rammpeter wants to merge 3 commits into
rsim:release80from
rammpeter:rammpeter_add_select_statement

Conversation

@rammpeter
Copy link
Copy Markdown
Contributor

This method was missed for the JDBC implementation of class Cursor

Fixes issue #2470

@jlahtinen
Copy link
Copy Markdown
Contributor

Seems to be working.

I noticed there are fixes in release80 branch but there is no release done that contains those fixes. Is it clear to someone how/when they are released? Will the release contain this fix? What about the currently unnecessary # Workaround for jruby/jruby#6267 etc

@yahonda
Copy link
Copy Markdown
Collaborator

yahonda commented Apr 24, 2026

For awareness: JDBCConnection::Cursor#select_statement? has already been added on master in 0929019b with a simpler implementation:

def select_statement?
  !@raw_result_set.nil?
end

On master this works because an earlier refactor (4d7e9fe8 — "Use createStatement for DDL / PL/SQL in JDBC prepare") changed Cursor#exec to assign @raw_result_set only when @raw_statement.execute returns true (i.e. the first result is a ResultSet), which is JDBC's authoritative SELECT signal. On release80, exec still calls executeQuery unconditionally, so the same one-liner wouldn't distinguish SELECT from DML there — which is why this PR's regex-on-SQL workaround is needed on that branch.

So master doesn't need this change. Whether to merge this PR as-is on release80, or to backport 4d7e9fe8 + 0929019b instead, is a separate release80-only decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants