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
What happens is, @buffer_row in Vertica::Query is initialized (correctly) to [] in #initialize, appended to in the first #handle_data_row call, and replaced with nil in handle_command_complete. Then, for some reason, we get a data row afterwards, and that tries to call #buffer_row with a nil@buffer.
I was able to work around this by
diff --git a/lib/vertica/query.rb b/lib/vertica/query.rb
index ce0c7fd..f3ed77a 100644
--- a/lib/vertica/query.rb+++ b/lib/vertica/query.rb@@ -104,6 +104,7 @@ class Vertica::Query
end
def buffer_row(row)
+ @buffer ||= []
@buffer << row
end
but I don't think this is necessarily the best solution. However, in the absence of a better idea, I think not crashing when data comes back in an unexpected order is desirable.
The text was updated successfully, but these errors were encountered:
I don't know why, off hand, but I see the following sequence of events after doing an
INSERT INTO .... SELECT ....
:What happens is,
@buffer_row
inVertica::Query
is initialized (correctly) to[]
in#initialize
, appended to in the first#handle_data_row
call, and replaced withnil
inhandle_command_complete
. Then, for some reason, we get a data row afterwards, and that tries to call#buffer_row
with anil
@buffer
.I was able to work around this by
but I don't think this is necessarily the best solution. However, in the absence of a better idea, I think not crashing when data comes back in an unexpected order is desirable.
The text was updated successfully, but these errors were encountered: