incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Commented] (CB-309) Support placeholders in WebSQL storage shim SQL query strings
Date Mon, 25 Jun 2012 17:27:42 GMT


Joe Bowser commented on CB-309:

Confirmed that this is still an issue on Android 4.0.4.  Since we should be using localStorage,
we'll keep the priority minor.
> Support placeholders in WebSQL storage shim SQL query strings
> -------------------------------------------------------------
>                 Key: CB-309
>                 URL:
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: Android, CordovaJS
>    Affects Versions: 1.4.0, 1.5.0
>         Environment: Android 2.3 emulator
>            Reporter: Filip Maj
>            Assignee: Joe Bowser
>            Priority: Minor
>             Fix For: 1.9.0
> Migrated from an issue that existed on Probably needs
investigation/confirmation still. The placeholder {{?}} tokens in SQL query strings, which
get properly interpolated into whatever types you pass in to the arguments array, when used
in our Android polyfill on certain Android devices, does not work as expected.
> {code}
> function getAutoCompleteData(response, term){
>   var db = window.openDatabase("data", "1.0", "data", 1000000);
>   App.term = term;
>   db.transaction(autocompleteDB, autocompleteDbError, autocompleteDbSuccess);
> }
> function autocompleteDB(tx) {
>   tx.executeSql("SELECT * FROM auto where name like '%?%'", 
>   [App.term], success,error);
> }
> {code}
> Returns error:
> {code}
> I/System.out(356): Storage.executeSql(): Error=bind or column index out of range: handle
> {code}
> I checked source code for 1.3.0 and found what it just has no support for placeholders.
> ----
> Simon then asked: What version of Android are you using? Most versions of PhoneGap/Cordova
are using the built in websql functionality.
> ----
> Response: This not depend of Android version. I just checked source code here
in function executeSql and found that is uses placeholders only for isDDL querys.
> isDDL true only for CREATE, TRUNCATE, DROP, ALTER. My query uses SELECT ;)
> ----
> Simon then asked: What I am saying to you is that code is not executed for most versions
of Android including 2.1, 2.2, 2.3, 4.0. For some Android versions 3.X there is a bug where
window.openDatabase() fails so we are forced to fall back on the code we wrote in
Otherwise we are able to take advantage of the built in websql functionality in the WebView.
> So I ask again, what version of Android are you running on?
> ----
> Response: Ok. Android 2.3. Tested in android emulator. If '?' replaced by App.term value
- everything works as expected.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message