mirror of
https://github.com/github/rails.git
synced 2026-01-08 22:27:59 -05:00
Merge pull request #3371 from yahonda/fix_ora_00932_error
Fix ORA-00932 error when trying to insert 0 to DATE type columns.
This commit is contained in:
@@ -483,7 +483,7 @@ if ActiveRecord::Base.connection.supports_migrations?
|
||||
|
||||
# Do a manual insertion
|
||||
if current_adapter?(:OracleAdapter)
|
||||
Person.connection.execute "insert into people (id, wealth, created_at, updated_at) values (people_seq.nextval, 12345678901234567890.0123456789, 0, 0)"
|
||||
Person.connection.execute "insert into people (id, wealth, created_at, updated_at) values (people_seq.nextval, 12345678901234567890.0123456789, sysdate, sysdate)"
|
||||
elsif current_adapter?(:OpenBaseAdapter) || (current_adapter?(:MysqlAdapter) && Mysql.client_version < 50003) #before mysql 5.0.3 decimals stored as strings
|
||||
Person.connection.execute "insert into people (wealth, created_at, updated_at) values ('12345678901234567890.0123456789', 0, 0)"
|
||||
elsif current_adapter?(:PostgreSQLAdapter)
|
||||
|
||||
Reference in New Issue
Block a user