JRuby

[PATCH] Derby handling of binary/date/time fields. hsqldb handling of binary fields.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

This patch puts the jdbc_adapter.JdbcDerbySpec class back in sync with the activerecord core. This fixes:

  • Allows ActiveSupport::TimeWithZone times to be assigned to an attribute and saved.
  • Allows saving of DateTime objects to the db.

Also adds tests (for all dbs) to check the reading and writing of date/datetime/time/timewithzone objects.

Code in jdbc_adapter/jdbc_derby.rb is removed as the core activerecord code covers this.

Further changes to allow writing of blobs > 16K to the database (clobs have the same issue at 32K, can be fixed in a similar manner).

Also fixed an issue in derby where quotes were being escaped in hex strings.

Also fixed the hsqldb binary handling, which fell over on low byte values (\000 was 0 instead of 00). Cut out a lot of code in the adapter as the core activerecord code is better (or was just duplicated in the hsqldb code).

Tests showing failure included.
sqlite3 still fails the tests included in this patch.

Activity

Hide
Charles Oliver Nutter added a comment -

Patch provided, get into 0.8.3.

Show
Charles Oliver Nutter added a comment - Patch provided, get into 0.8.3.
Hide
Thomas E Enebo added a comment -

I applied this patch with minor bitrot and then also made it work for sqlite3. Double plus good. Applied in commit be172b1.

Show
Thomas E Enebo added a comment - I applied this patch with minor bitrot and then also made it work for sqlite3. Double plus good. Applied in commit be172b1.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: