Skip to content

Commit

Permalink
MySQL: we can't distinguish a fake 0 default in 4.x
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Dec 5, 2007
1 parent 3a622d0 commit e7dab3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion activerecord/test/defaults_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def test_mysql_integer_not_null_defaults

assert_equal 0, klass.columns_hash['zero'].default
assert !klass.columns_hash['zero'].null
assert_equal nil, klass.columns_hash['omit'].default
# 0 in MySQL 4, nil in 5.
assert [0, nil].include?(klass.columns_hash['omit'].default)
assert !klass.columns_hash['omit'].null

assert_raise(ActiveRecord::StatementInvalid) { klass.create! }
Expand Down

0 comments on commit e7dab3b

Please sign in to comment.