On Dec 9, 4:03 am, Christian MICHON <[email protected]> wrote: > Hi, > > I found a blocking bug (at least for me) when using latest sequel > version with jruby and h2database. > > Basically, all strings when saving records a second time get encoded > in a certain way. I posted the test case on pastie:http://pastie.org/2990685 > > The output using jruby 1.6.5, h2database 1.3.155 and sequel 3.30.0 is: > > {:id=>1, :name=>"John DOE", :enable=>true} > {:id=>1, :name=>"4a6f686e20444f45", :enable=>false} > > The name values should have not changed. When using sequel 3.27.0, I > did not see this behavior and got same names as expected.
>From your pastie, you are using text as a column type. Unfortunately, H2 considers text as a blob/clob type, not as a varchar/string (see http://www.h2database.com/html/datatypes.html), so it is returned as a Sequel::SQL::Blob instance. Switch to using the generic type support. Also, use create_table? instead of your if statement: DB.create_table? :users do primary_key :id String :name TrueClass :enable end Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
