hugoloza / gwt-mobile-webkit

Automatically exported from code.google.com/p/gwt-mobile-webkit
2 stars 0 forks source link

performing a select statement with a single parameter does not seem to work #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
whenever I try to invoke something like

        Object[] arguments = {1};
        tx.executeSql("select * from foo where bar = ?", arguments, callback);

I get an error when running against Safari 4.0.3 (5531.9) of this

"number of '?'s in statement string does not match argument count"

I've tried passing in 2, 3, 4 arguments instead and no joy.

I was going to try patch your DatabaseTest.java to demonstrate the issue, 
but I've not yet figured out how to run your test case as I can't check out a 
proper version of your source code with the build tools etc :)

Original issue reported on code.google.com by james.st...@gmail.com on 17 Aug 2009 at 10:43

GoogleCodeExporter commented 9 years ago
Definitely seems like a bug to me.

TestCases on this are hard, because in HostedMode no HTML5 features are 
present, not even on the Mac (which 
is an issue of its own I guess).

Will try this out for myself to see what's going on.

Original comment by bguijt on 17 Aug 2009 at 12:43

GoogleCodeExporter commented 9 years ago
Yeah! I've been using trunk of GWT which has OOPHM which works fine when 
running a
GWT application against Safari; though I've not yet figured out how to get a
GWTTestCase to use OOPHM

Original comment by james.st...@gmail.com on 17 Aug 2009 at 12:50

GoogleCodeExporter commented 9 years ago
Tried this piece of code in the 'HelloDatabase' sample:

Object[] args = {1};
tx.executeSql("INSERT INTO clickcount (clicked) VALUES (?)", args);

and it just works as expected...

However, during testing (by running the HelloDatabase sample) I came across 
some other bugs (in launch 
scripts, in sample) which are fixed right now.

Marking this issue 'fixed' anyway due to mentioned bugs which were (I guess) 
masking the real problem.

Original comment by bguijt on 21 Aug 2009 at 12:25

GoogleCodeExporter commented 9 years ago
So this seems to work fine for selects & insert/updates when using GWT 1.7 
against
the generated JavaScript. Though it seems to barf when using GWT trunk with 
OOPHM
plugin for Safari 4 - so its probably a GWT bug :) Sorry for the noise!

Original comment by james.st...@gmail.com on 21 Aug 2009 at 7:57

GoogleCodeExporter commented 9 years ago
Well, in that case, I guess it is still interesting to keep an eye on this 
issue. But a GWT bug it is!

Original comment by bguijt on 21 Aug 2009 at 9:04

GoogleCodeExporter commented 9 years ago
One other thing: You tested this in OOPHM - did a GWT 2.0 compiled version work 
properly?

Original comment by bguijt on 21 Aug 2009 at 9:47