incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (Created) (JIRA)" <>
Subject [jira] [Created] (CB-309) Support placeholders in WebSQL storage shim SQL query strings
Date Sat, 10 Mar 2012 21:28:57 GMT
Support placeholders in WebSQL storage shim SQL query strings

                 Key: CB-309
             Project: Apache Callback
          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

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.

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);

Returns error:

I/System.out(356): Storage.executeSql(): Error=bind or column index out of range: handle 0x562508

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