Skip to content

Commit a4b1770

Browse files
andfxkares
authored andcommitted
Do not pre-fetch the primary key if multiple primary keys exist
1 parent 4005425 commit a4b1770

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/arjdbc/oracle/adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def select(sql, name = nil, binds = [])
508508
def prefetch_primary_key?(table_name = nil)
509509
return true if table_name.nil?
510510
table_name = table_name.to_s
511-
columns(table_name).detect { |column| column.primary }
511+
columns(table_name).count { |column| column.primary } == 1
512512
end
513513

514514
# @override

0 commit comments

Comments
 (0)