Issue Details (XML | Word | Printable)

Key: ACTIVERECORD_JDBC-112
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Nick Sieger
Reporter: Gregor Schmidt
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
activerecord-jdbc

Schema reflection does not handle longtext columns correctly

Created: 04/May/10 08:40 PM   Updated: 25/Sep/10 07:08 PM   Resolved: 25/Sep/10 07:08 PM
Component/s: MySQL
Affects Version/s: 0.9.5
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

File Attachments: 1. Text File 0001-config-does-not-exist-in-current-versions-of-AR.patch (0.9 kB) 04/May/10 08:57 PM - Gregor Schmidt
2. Text File 0002-Tests-schema-dumping-of-longtext-columns-in-MySQL.patch (2 kB) 04/May/10 08:40 PM - Gregor Schmidt
3. Text File 0003-porting-implementation-of-activerecord-to-fix-schema.patch (2 kB) 04/May/10 08:40 PM - Gregor Schmidt

Environment:

Mac OS X 10.5
Server version: 5.1.45 MySQL Community Server (GPL)

JRuby 1.5.0.RC2
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.5)
activerecord-jdbcmysql-adapter (0.9.5)
jdbc-mysql (5.0.4)

Ruby 1.8.7
activerecord (2.3.5)
mysql (2.8.1)


Tags: mysql schema patch


 Description  « Hide

While trying to run the redmine test suite, I observed the following behaviour. While all migrations work and all test pass successfully, the creation of db/schema.rb was faulty. While MRI produced the following line:

t.text "text", :limit => 2147483647

JRuby ommited the limit parameter

t.text "text"

resulting in a much to small column width in the test database.

http://github.com/finnlabs/activerecord-jdbc-adapter/commit/bfd62eaf6349ec586dd0b82fffdac6864b6d76ff exposes this behaviour in a test case for AR-JDBC. It passes on MRI but fails on the current master of AR-JDBC

http://github.com/finnlabs/activerecord-jdbc-adapter/commit/1e0b4e8f431f555c6de762d933738c9c21cf75f8 contains a proposed fix. I am sure, there might be better implementation strategies, but this one worked for me.

With the help of http://github.com/finnlabs/activerecord-jdbc-adapter/commit/9461fd7f8844e5c55286be59920a85fda0926b1a I made the MySQL test run on MRI. They seem to be broken ATM.

I have also added the patch files, for your convenience.



Gregor Schmidt added a comment - 04/May/10 08:57 PM

Sorry, the fix to test/simple.rb was based on an older version of the git repo (0.9.4).

The rest remains unchanged.


Nick Sieger added a comment - 25/Sep/10 07:08 PM

Already picked some of these changes up – but I added the tests in 4fa401de.