Hi, I just downloaded rails trunk to roll up my sleeves for a patch. After reading the docs on dev.rubyonrails.org for patch writing I downloaded the rails trunk and setup my database to include activerecord_unittest and activerecord_unittest2, set the connection file to connect with the correct user and password, and ran the tests for the mysql adapter. I get 418 errors (before changing anything but the connection). Mostly (mabye all) are ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''type'' doesn''t have a default value: INSERT INTO projects (`name`, `id`) VALUES (''Active Record'', 1) #with different insert statements What have I done wrong? This has certainly made writing a patch (a very simple one) a seemingly daunting task. Any help to overcome this is greatly appreciated. Cheers Daniel _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 22 Jul 2006, at 7:58 am, Daniel N wrote:> ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''type'' > doesn''t have a default value: INSERT INTO projects (`name`, `id`) > VALUES (''Active Record'', 1) #with different insert statementsAre you running MySQL 5? Someone else reported a similar-sounding problem last year: http://lists.rubyonrails.org/pipermail/rails-core/2005-November/ 000305.html Chris
On 7/22/06, Chris Mear <chris@feedmechocolate.com> wrote:> > On 22 Jul 2006, at 7:58 am, Daniel N wrote: > > > ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''type'' > > doesn''t have a default value: INSERT INTO projects (`name`, `id`) > > VALUES (''Active Record'', 1) #with different insert statements > > Are you running MySQL 5? > > Someone else reported a similar-sounding problem last year: > > http://lists.rubyonrails.org/pipermail/rails-core/2005-November/ > 000305.html > > Chris > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-coreYes. 5.0.15. I applied the fix suggested on the wordpress site, and It worked. Well except 1 failure that I''ll go and track down. Thanx very much for you help :) _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 22/07/06, Daniel N <has.sox@gmail.com> wrote:> On 7/22/06, Chris Mear <chris@feedmechocolate.com> wrote: > > On 22 Jul 2006, at 7:58 am, Daniel N wrote: > > > > > ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''type'' > > > doesn''t have a default value: INSERT INTO projects (`name`, `id`) > > > VALUES (''Active Record'', 1) #with different insert statements > > > > Are you running MySQL 5? > > > > Someone else reported a similar-sounding problem last year: > > > > > http://lists.rubyonrails.org/pipermail/rails-core/2005-November/ > > 000305.html > > > > Chris > > > > > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > Yes. 5.0.15. I applied the fix suggested on the wordpress site, and It > worked. > > Well except 1 failure that I''ll go and track down. > > Thanx very much for you help :)It seems to me this isn''t really a fix. The columns should either allow nulls, have a default value or have a value in the fixtures. Turning off strict mode to get around a valid constraint in the schema seems a strange thing to have to do. I''ll look into changing the mysql test schema to see if it can be fixed to work in strict mode, unless anyone vehemently objects. Tom
Tom Ward wrote:> I''ll look into changing the > mysql test schema to see if it can be fixed to work in strict mode, > unless anyone vehemently objects.As promised, here''s a patch against the schema allowing the activerecord test suite to be run in strict mode on mysql 5.0. I''ll submit this as soon as trac start accepting new tickets again. Feel free to give it a go in the meantime. Tom _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 7/23/06, Tom Ward <tom@popdog.net> wrote:> > Tom Ward wrote: > > > I''ll look into changing the > > mysql test schema to see if it can be fixed to work in strict mode, > > unless anyone vehemently objects. > > As promised, here''s a patch against the schema allowing the > activerecord test suite to be run in strict mode on mysql 5.0. I''ll > submit this as soon as trac start accepting new tickets again. Feel > free to give it a go in the meantime. > > Tom > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > Tom,Thanx for the effort to get this going. Unfortunately the diff file attached has nothing it it. Cheers _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 23/07/06, Daniel N <has.sox@gmail.com> wrote:> Tom, > > Thanx for the effort to get this going. > > Unfortunately the diff file attached has nothing it it. > > CheersWell spotted ;) Try this one. Tom _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core