http://dev.rubyonrails.org/ticket/8054 alexeyv@alexeyv-laptop:~/src/rails/activerecord/test$ ruby -I "connections/native_sqlite3" migration_test.rb Using native SQLite3 Loaded suite migration_test Started ............................FF...... Finished in 24.783783 seconds. 1) Failure: test_native_decimal_insert_manual_vs_automatic(MigrationTest) [migration_test.rb:233]: <#<BigDecimal:b73cc1e0,''0.1234567890 1234567890 0123456789E20'',32(36)>> expected but was <#<BigDecimal:b73c5354,''0.1234567890 12346E20'',16(20)>>. 2) Failure: test_native_types(MigrationTest) [migration_test.rb:282]: <#<BigDecimal:b761bd10,''0.1234567890 1234567890 0123456789E20'',32(36)>> expected but was <#<BigDecimal:b761bc70,''0.1234567890 12346E20'',16(20)>>. -- Alex Verkhovsky --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Alex, On Apr 11, 2007, at 11:38 PM, Alexey Verkhovsky wrote:> http://dev.rubyonrails.org/ticket/8054 > alexeyv@alexeyv-laptop:~/src/rails/activerecord/test$ ruby -I > "connections/native_sqlite3" migration_test.rb > Using native SQLite3 > Loaded suite migration_test > Started > ............................FF...... > Finished in 24.783783 seconds.It looks like both of these are due to BigDecimal being down- converted to Decimal. Alas, the sqlite3 adapter doesn''t seem to support BigDecimal: activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb> def native_database_types #:nodoc: > { > :primary_key => default_primary_key_type, > :string => { :name => "varchar", :limit => 255 }, > :text => { :name => "text" }, > :integer => { :name => "integer" }, > :float => { :name => "float" }, > :decimal => { :name => "decimal" }, > :datetime => { :name => "datetime" }, > :timestamp => { :name => "datetime" }, > :time => { :name => "datetime" }, > :date => { :name => "date" }, > :binary => { :name => "blob" }, > :boolean => { :name => "boolean" } > } > endDoes anyone know if that is a fundamental limitation of SQLite3, or something we can simply add to the adapter? -- Ernie P.> > 1) Failure: > test_native_decimal_insert_manual_vs_automatic(MigrationTest) > [migration_test.rb:233]: > <#<BigDecimal:b73cc1e0,''0.1234567890 1234567890 > 0123456789E20'',32(36)>> expected but was > <#<BigDecimal:b73c5354,''0.1234567890 12346E20'',16(20)>>. > > 2) Failure: > test_native_types(MigrationTest) [migration_test.rb:282]: > <#<BigDecimal:b761bd10,''0.1234567890 1234567890 > 0123456789E20'',32(36)>> expected but was > <#<BigDecimal:b761bc70,''0.1234567890 12346E20'',16(20)>>. > > -- > Alex Verkhovsky > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> It looks like both of these are due to BigDecimal being down- > converted to Decimal. Alas, the sqlite3 adapter doesn''t seem to > support BigDecimal: > > Does anyone know if that is a fundamental limitation of SQLite3, or > something we can simply add to the adapter?SQLite3 has a maximum precision of 16. SQLite2 has no maximum as it stores decimals as strings internally. Roderick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> SQLite3 has a maximum precision of 16.Make that 15 now that I''m double-checking it: sqlite> insert into test (nr) values (1234567890.123456789); sqlite> select * from test; 1234567890.12346 Roderick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Does anyone know if that is a fundamental limitation of SQLite3, or > something we can simply add to the adapter?heh. Explains what this code was for: http://dev.rubyonrails.org/changeset/6437 Reverting that changeset completely causes failure in sqlite2. So I suppose it needs a version-aware special case. Anyone keen to take a stab? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---