I''m trying to write a patch for Rails. The ActiveRecord RUNNING_UNIT_TESTS file says that I have to load the MySQL .sql file from test/fixtures/db_defintions, but there is no mysql.sql. There is a connection.rb, but no mention of it in the Rakefile or in the RUNNING_UNIT_TESTS file. How do I load the MySQL fixtures? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Nov-26 10:45 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
On 26 Nov 2007, at 10:30, Hongli Lai wrote:> > I''m trying to write a patch for Rails. The ActiveRecord > RUNNING_UNIT_TESTS file says that I have to load the MySQL .sql file > from test/fixtures/db_defintions, but there is no mysql.sql. There is > a connection.rb, but no mention of it in the Rakefile or in the > RUNNING_UNIT_TESTS file. How do I load the MySQL fixtures? >Unless this has changed recently I never had to do that. I just created the activerecord_unittest and activerecord_unittest2 databases and gave the rails user access to them and I was good to go Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hongli Lai
2007-Nov-26 11:32 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
On Nov 26, 11:45 am, Frederick Cheung <frederick.che...@gmail.com> wrote:> Unless this has changed recently I never had to do that. I just > created the activerecord_unittest and activerecord_unittest2 databases > and gave the rails user access to them and I was good to go > > FredThat didn''t work for me. I created the databases but got this error: http://pastebin.com/f1f641395 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hmm Frederick is right, that''s all I''ve had to do. If you read the latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ activerecord/RUNNING_UNIT_TESTS) and the connection settings for running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ activerecord/test/connections/native_mysql/connection.rb), you pretty much create the ''activerecord_unittest'' and ''activerecord_unittest2'' databases and grant the ''rails'' user all privileges and you''re good to go. What steps have you done? Perhaps that''d help us to find out what your problem is. Cheers, Chu Yeow On Nov 26, 7:32 pm, Hongli Lai <hongli...@gmail.com> wrote:> On Nov 26, 11:45 am, Frederick Cheung <frederick.che...@gmail.com> > wrote: > > > Unless this has changed recently I never had to do that. I just > > created the activerecord_unittest and activerecord_unittest2 databases > > and gave the rails user access to them and I was good to go > > > Fred > > That didn''t work for me. I created the databases but got this error:http://pastebin.com/f1f641395--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
E. James O''Kelly
2007-Dec-03 17:18 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
I am having the same problem. I created the rails user I created the two databases: mysqladmin -uroot create activerecord_unittest mysqladmin -uroot create activerecord_unittest I granted permissions: mysql -uroot GRANT ALL PRIVILEGES ON activerecord_unittest.* to ''rails''@''localhost''; GRANT ALL PRIVILEGES ON activerecord_unittest2.* to ''rails''@''localhost''; I run the test: rake test_mysql And I get the exact same error. On Dec 1, 10:30 pm, chuyeow <chuy...@gmail.com> wrote:> Hmm Frederick is right, that''s all I''ve had to do. If you read the > latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ > activerecord/RUNNING_UNIT_TESTS) and the connection settings for > running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ > activerecord/test/connections/native_mysql/connection.rb), you pretty > much create the ''activerecord_unittest'' and ''activerecord_unittest2'' > databases and grant the ''rails'' user all privileges and you''re good to > go. > > What steps have you done? Perhaps that''d help us to find out what your > problem is. > > Cheers, > Chu Yeow > > On Nov 26, 7:32 pm, Hongli Lai <hongli...@gmail.com> wrote: > > > On Nov 26, 11:45 am, Frederick Cheung <frederick.che...@gmail.com> > > wrote: > > > > Unless this has changed recently I never had to do that. I just > > > created the activerecord_unittest and activerecord_unittest2 databases > > > and gave the rails user access to them and I was good to go > > > > Fred > > > That didn''t work for me. I created the databases but got this error:http://pastebin.com/f1f641395--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
E. James O''Kelly
2007-Dec-03 17:23 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
the second was mysqladmin -uroot create activerecord_unittest2 On Dec 3, 9:18 am, "E. James O''Kelly" <e.james.oke...@gmail.com> wrote:> I am having the same problem. > > I created the rails user > I created the two databases: > mysqladmin -uroot create activerecord_unittest > mysqladmin -uroot create activerecord_unittest > I granted permissions: > mysql -uroot > GRANT ALL PRIVILEGES ON activerecord_unittest.* to > ''rails''@''localhost''; > GRANT ALL PRIVILEGES ON activerecord_unittest2.* to > ''rails''@''localhost''; > > I run the test: > raketest_mysql > > And I get the exact same error. > > On Dec 1, 10:30 pm, chuyeow <chuy...@gmail.com> wrote: > > > Hmm Frederick is right, that''s all I''ve had to do. If you read the > > latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ > > activerecord/RUNNING_UNIT_TESTS) and the connection settings for > > running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ > > activerecord/test/connections/native_mysql/connection.rb), you pretty > > much create the ''activerecord_unittest'' and ''activerecord_unittest2'' > > databases and grant the ''rails'' user all privileges and you''re good to > > go. > > > What steps have you done? Perhaps that''d help us to find out what your > > problem is. > > > Cheers, > > Chu Yeow > > > On Nov 26, 7:32 pm, Hongli Lai <hongli...@gmail.com> wrote: > > > > On Nov 26, 11:45 am, Frederick Cheung <frederick.che...@gmail.com> > > > wrote: > > > > > Unless this has changed recently I never had to do that. I just > > > > created the activerecord_unittest and activerecord_unittest2 databases > > > > and gave the rails user access to them and I was good to go > > > > > Fred > > > > That didn''t work for me. I created the databases but got this error:http://pastebin.com/f1f641395--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hmm could be due to this reported bug: http://dev.rubyonrails.org/ticket/10348 Try doing these steps first like the reporter suggests: rake mysql:build_databases rake test_mysql TEST=aaa_create_tables_test.rb Cheers, Chu Yeow On Dec 4, 1:23 am, "E. James O''Kelly" <e.james.oke...@gmail.com> wrote:> the second was > mysqladmin -uroot create activerecord_unittest2 > > On Dec 3, 9:18 am, "E. James O''Kelly" <e.james.oke...@gmail.com> > wrote: > > > I am having the same problem. > > > I created the rails user > > I created the two databases: > > mysqladmin -uroot create activerecord_unittest > > mysqladmin -uroot create activerecord_unittest > > I granted permissions: > > mysql -uroot > > GRANT ALL PRIVILEGES ON activerecord_unittest.* to > > ''rails''@''localhost''; > > GRANT ALL PRIVILEGES ON activerecord_unittest2.* to > > ''rails''@''localhost''; > > > I run the test: > > raketest_mysql > > > And I get the exact same error. > > > On Dec 1, 10:30 pm, chuyeow <chuy...@gmail.com> wrote: > > > > Hmm Frederick is right, that''s all I''ve had to do. If you read the > > > latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ > > > activerecord/RUNNING_UNIT_TESTS) and the connection settings for > > > running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ > > > activerecord/test/connections/native_mysql/connection.rb), you pretty > > > much create the ''activerecord_unittest'' and ''activerecord_unittest2'' > > > databases and grant the ''rails'' user all privileges and you''re good to > > > go. > > > > What steps have you done? Perhaps that''d help us to find out what your > > > problem is. > > > > Cheers, > > > Chu Yeow > > > > On Nov 26, 7:32 pm, Hongli Lai <hongli...@gmail.com> wrote: > > > > > On Nov 26, 11:45 am, Frederick Cheung <frederick.che...@gmail.com> > > > > wrote: > > > > > > Unless this has changed recently I never had to do that. I just > > > > > created the activerecord_unittest and activerecord_unittest2 databases > > > > > and gave the rails user access to them and I was good to go > > > > > > Fred > > > > > That didn''t work for me. I created the databases but got this error:http://pastebin.com/f1f641395--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hongli Lai
2007-Dec-04 12:25 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
On Dec 2, 7:30 am, chuyeow <chuy...@gmail.com> wrote:> Hmm Frederick is right, that''s all I''ve had to do. If you read the > latest RUNNING_UNIT_TESTS (http://dev.rubyonrails.org/browser/trunk/ > activerecord/RUNNING_UNIT_TESTS) and the connection settings for > running tests on MySQL (http://dev.rubyonrails.org/browser/trunk/ > activerecord/test/connections/native_mysql/connection.rb), you pretty > much create the ''activerecord_unittest'' and ''activerecord_unittest2'' > databases and grant the ''rails'' user all privileges and you''re good to > go. > > What steps have you done? Perhaps that''d help us to find out what your > problem is.I''ve done exactly what the file says. 1. I created the databases activerecord_unittest and activerecord_unittest2. 2. I added a user account for MySQL, as specified in connection.rb. 3. I granted ALL PRIVILEGES to that account to the created databases. 4. rake test_mysql 5. See the test fail. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hongli Lai
2007-Dec-04 12:35 UTC
Re: Cannot load MySQL fixtures for ActiveRecord unit tests
On Dec 4, 2:12 am, chuyeow <chuy...@gmail.com> wrote:> Hmm could be due to this reported bug:http://dev.rubyonrails.org/ticket/10348 > > Try doing these steps first like the reporter suggests: > rake mysql:build_databases > rake test_mysql TEST=aaa_create_tables_test.rb > > Cheers, > Chu YeowYes this fixed my problem. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---