
jruby: text fields that precede integer fields clobber their values
Reported by Nick | September 10th, 2009 @ 02:20 PM
Either datamapper or data objects has some weird behavior on
jruby.
When an empty text field comes before an integer field in a select,
the integer field is clobbered.
require 'yaml'
require 'rubygems'
require 'dm-core'
class A
include DataMapper::Resource
property :id,Serial
property :txt,Text
end
DataMapper.setup :default,"mysql://root@localhost/testing"
DataMapper.auto_migrate!
A.create :txt=>'no clobbering time'
A.create
puts repository(:default).adapter.query('SELECT txt,id from `as`;').to_yaml
#from jruby
#---
#- !ruby/struct:#<Class:01x40395aaf>
# txt: no clobbering time
# id: 1
#- !ruby/struct:#<Class:01x40395aaf>
# txt:
# id: << ????
#MRI interpreter
#---
#- !ruby/struct:
# txt: !str:Extlib::ByteArray no clobbering time
# id: 1
#- !ruby/struct:
# txt:
# id: 2
Update
It also happens with string properties.
Comments and changes to this ticket
-
Dan Kubb (dkubb) September 10th, 2009 @ 03:39 PM
- State changed from new to unconfirmed
- Assigned user set to Alex Coles
-
Alex Coles September 13th, 2009 @ 11:50 AM
- State changed from unconfirmed to accepted
-
Alex Coles October 3rd, 2009 @ 11:17 AM
I'm not able to reproduce this issue:
--- - !ruby/struct:#<Class:01x1438dbe> txt: no clobbering time id: 1 - !ruby/struct:#<Class:01x1438dbe> txt: id: 2
Can you let me know the versions of the following gems:
- do_mysql - do_jdbc - and JRuby itself(or did you install from source? in which case, please try pulling the latest code and seeing if its still occurring.)
Thanks!
-
Alex Coles October 3rd, 2009 @ 11:22 AM
- State changed from accepted to hold
-
Nick October 5th, 2009 @ 06:45 PM
This was happening using jruby 1.3.
Upgrading to jruby 1.3.1 fixed it.
-
Dan Kubb (dkubb) November 6th, 2009 @ 02:12 AM
- State changed from hold to resolved
Marking this as resolved due to new version of JRuby resolving the problem.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »