Okay, so it does definitely have to do with prepared statements:
jruby-1.6.5.1 :019 > t = Time.now
=> 2012-07-12 11:14:21 -0700
jruby-1.6.5.1 :020 > t.to_f
=> 1342116861.229
jruby-1.6.5.1 :021 > DB[:t].insert :a => t
=> 0
jruby-1.6.5.1 :022 > DB['select * from t'].map {|r| r[:a].to_f }
=> [1342116861.229]
jruby-1.6.5.1 :023 > DB[:t].call(:insert, {:t => t}, :$t)
=> 0
jruby-1.6.5.1 :024 > DB['select * from t'].map {|r| r[:a].to_f }
=> [1342116861.229, 1342116861.0]
I cannot seem to get it to work with 8.2.1.2 either:
jruby-1.6.5.1 :019 > t = Time.now
=> 2012-07-12 11:23:32 -0700
jruby-1.6.5.1 :020 > t.to_f
=> 1342117412.771
jruby-1.6.5.1 :021 > DB[:t].insert :a => t
=> 0
jruby-1.6.5.1 :022 > DB['select * from t'].map {|r| r[:a].to_f }
=> [1342117412.771]
jruby-1.6.5.1 :023 > DB[:t].call(:insert, {:t => t}, :$t)
=> 0
jruby-1.6.5.1 :024 > DB['select * from t'].map {|r| r[:a].to_f }
=> [1342117412.771, 1342117412.0]
jruby-1.6.5.1 :025 >
DB.pool.available_connections.first.getMetaData.getDatabaseProductVersion
=> "10.8.1.2 - (1095077)"
On Thursday, July 12, 2012 10:13:57 AM UTC-7, Jeremy Evans wrote:
>
> On Thursday, July 12, 2012 9:51:32 AM UTC-7, Matt Hauck wrote:
>>
>> Hmm, it appears to have no connection to the prepared statements plugin,
>> but might be related to my version of Derby (10.8.2.2), which I
>> unfortunately cannot update...
>>
>> ruby-1.6.5.1 :016 > DB.create_table(:a) {Time :a}
>>> [09:46:46] DEBUG [MDM.Dev] - (0.025000s) CREATE TABLE "A" ("A" timestamp)
>>> => nil
>>> jruby-1.6.5.1 :017 > t = Time.now
>>> => 2012-07-12 09:46:59 -0700
>>> jruby-1.6.5.1 :018 > t.to_f
>>> => 1342111619.922
>>> jruby-1.6.5.1 :019 > DB[:a].call(:insert, {:t => t}, :$t)
>>> [09:47:39] DEBUG [MDM.Dev] - (0.005000s) PREPARE INSERT INTO "A" VALUES
>>> (?)
>>> [09:47:39] DEBUG [MDM.Dev] - (0.003000s) EXECUTE; [2012-07-12 09:46:59
>>> -0700]
>>> [09:47:39] DEBUG [MDM.Dev] - (0.001000s) SELECT IDENTITY_VAL_LOCAL()
>>> FROM sysibm.sysdummy1
>>> => 30
>>> jruby-1.6.5.1 :020 > DB[:a].get(:a).to_f
>>> [09:48:10] DEBUG [MDM.Dev] - (0.003000s) SELECT "A" FROM "A" FETCH FIRST
>>> 1 ROWS ONLY
>>> => 1342111619.0
>>
>>
> I'm running 10.8.1.2. Maybe Derby broke it in a later version? Can you
> try downgrading to 10.8.1.2 and see if the results are different?
>
> Also, which version of Sequel are you running? If not the latest, try
> upgrading first.
>
> Jeremy
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sequel-talk/-/kCWXiJarfeUJ.
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.