You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the fix is that pg::Cursor#next_row should first return if last_row? before doing anything else.
$:» cat x.rb
#!/usr/bin/env ruby
require 'rdbi'
require 'rdbi-driver-postgresql'
puts 'ruby ' + RUBY_VERSION
Gem.loaded_specs.each do |name, gem|
puts name + ' ' + gem.version.to_s
end
puts
conn_args = { :database => ARGV.shift,
:user => ARGV.shift,
:password => ARGV.shift }
RDBI.connect(:PostgreSQL, conn_args) do |dbh|
res = dbh.execute("SELECT true");
puts res.to_a
end
$:» ruby x.rb postgres me me
ruby 2.0.0
epoxy 0.3.1
typelib 0.1.0
rdbi 1.1.0
bigdecimal 1.2.0
pg 0.9.0
methlab 0.1.0
rdbi-driver-postgresql 0.9.1
/home/me/.gem/ruby/2.0.0/gems/rdbi-driver-postgresql-0.9.1/lib/rdbi/driver/postgresql.rb:148:in `[]': Index 1 is out of range (IndexError)
from /home/me/.gem/ruby/2.0.0/gems/rdbi-driver-postgresql-0.9.1/lib/rdbi/driver/postgresql.rb:148:in `next_row'
from /home/me/.gem/ruby/2.0.0/gems/rdbi-1.1.0/lib/rdbi/result.rb:249:in `fetch'
from /home/me/.gem/ruby/2.0.0/gems/rdbi-1.1.0/lib/rdbi/result.rb:129:in `each'
from x.rb:18:in `to_a'
from x.rb:18:in `block in <main>'
from /home/me/.gem/ruby/2.0.0/gems/rdbi-1.1.0/lib/rdbi.rb:39:in `connect'
from x.rb:16:in `<main>'
The text was updated successfully, but these errors were encountered:
I believe the fix is that pg::Cursor#next_row should first
return if last_row?
before doing anything else.The text was updated successfully, but these errors were encountered: