Closed mdotmoment11 closed 8 years ago
I will accept patch.
I am receiving the same error with a similar stack trace. I can reproduce the error by trying to convert a mysql table with a time column that can be null and has a value of null. I have created a sample schema to assist anyone working on this bug (http://cl.ly/0Z193Q1c1z262H3Z2p3x/content). I am using the most recent mysql2postgres code on github.
-->mysql2psql /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_writer.rb:112:in
process_row': undefined method hour' for nil:NilClass (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
each_with_index'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_writer.rb:109:in each' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_writer.rb:109:in
each_with_index'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_writer.rb:109:in process_row' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_file_writer.rb:129:in
write_contents'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/mysql_reader.rb:191:in paginated_read' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/mysql_reader.rb:187:in
upto'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/mysql_reader.rb:187:in paginated_read' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/postgres_file_writer.rb:127:in
write_contents'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/converter.rb:33:in convert' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/converter.rb:31:in
each'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql/converter.rb:31:in convert' from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/../lib/mysql2psql.rb:31:in
convert'
from /usr/lib/ruby/gems/1.8/gems/mysql2psql-0.1.0/bin/mysql2psql:7
from /usr/bin/mysql2psql:19:in `load'
from /usr/bin/mysql2psql:19
Closing as an old issue, that would seem to be out of date.
Feel free to re-open and update with comments aganst the master
branch.
In the middle of loading a table, the script threw this:
Loading mat_event... 520000 of 1351268 rows loaded. [ETA: 2010/09/28 11:08 (00h:01m:52s)]mysql2psql:360:in'
block in process_row': undefined method
hour' for nil:NilClass (NoMethodError) from mysql2psql:357:ineach' from mysql2psql:357:in
each_with_index' from mysql2psql:357:inprocess_row' from mysql2psql:637:in
block in write_contents' from mysql2psql:241:inblock in paginated_read' from mysql2psql:237:in
upto' from mysql2psql:237:inpaginated_read' from mysql2psql:635:in
write_contents' from mysql2psql:692:inblock in convert' from mysql2psql:691:in
each' from mysql2psql:691:inconvert' from mysql2psql:750:in
Not sure what to make of it. Line 360 of that script looks pretty straightforward.
Thanks for the help.