Skip to content

Commit fb4cb6c

Browse files
committed
Return raw results from execute instead of an ActiveRecord::Result
1 parent 49d47df commit fb4cb6c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/arjdbc/abstract/database_statements.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ def convert_legacy_binds_to_attributes(binds)
107107
def raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: false)
108108
log(sql, name, async: async) do
109109
with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
110-
# We sometimes return an ActiveRecord::Result and sometimes a raw, so force to raw
111-
result = conn.execute(sql)
112-
result.is_a?(ActiveRecord::Result) ? result.to_a : result
110+
conn.execute(sql)
113111
end
114112
end
115113
end

src/java/arjdbc/jdbc/RubyJdbcConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ public IRubyObject execute(final ThreadContext context, final IRubyObject sql) {
793793
// Unfortunately the result set gets closed when getMoreResults()
794794
// is called, so we have to process the result sets as we get them
795795
// this shouldn't be an issue in most cases since we're only getting 1 result set anyways
796-
result = mapExecuteResult(context, connection, resultSet);
796+
//result = mapExecuteResult(context, connection, resultSet);
797+
result = mapToRawResult(context, connection, resultSet, false);
797798
resultSet.close();
798799
} else {
799800
result = context.runtime.newFixnum(updateCount);

0 commit comments

Comments
 (0)