Ticket #6633 (new defect)
callback function not getting called when no match found for criteria in select query with use of dojox.sql.DECRYPT
| Reported by: | guest | Owned by: | BradNeuberg |
|---|---|---|---|
| Priority: | normal | Milestone: | future |
| Component: | Storage/Flash | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I have Google Gears installed on my machine and trying to store data on local machine in encrypted format
I am using dojox.sql.ENCRYPT/DECRYPT for encryption/decryption flow
I have created MY_DATA_STORE table as follows
var myTable="MY_DATA_STORE";
dojox.sql("CREATE TABLE IF NOT EXISTS " + myTable+ "( "
+ " namespace TEXT, " + " key TEXT, " + " value TEXT " + ")"
);
I have Inserted one record in this table with encrypted data for column whose name is 'key' using dojox.sql.ENCRYPT as follows
var myTable="MY_DATA_STORE";
var mynamespace="testnamespace";
var mykey="mykey1";
var data="This is data for mykey1"
dojox.sql("INSERT INTO "+myTable+" VALUES (?, ?, ENCRYPT(?))",mynamespacee, mykey, data,
"mypassword",
function(results, error, errorMsg){
if(error){
alert("Error in record insertion: "+errorMsg);
}else{
alert("Record insertion done successfully");
}
}
});
I can retrieve the above data using dojox.sql.DECRYPT and specifying key="mykey1" in select query as follows
var myTable="MY_DATA_STORE";
var mynamespace="testnamespace"; var mykey="mykey1";
dojox.sql("SELECT namespace,key,DECRYPT(value) FROM " + myTable+ " where namespace='"+mynamespace+"' and key='"+mykey+"'",
"mypassword", function(results, error, errorMsg){
alert("Inside callback handler function.This alert is not shown");
if(error){
alert(Error in getting required data");
}else{
var resultData=results[0].value; alert("Received Data is:"+resultData);
}
});
Now Issue is that in above select query if I specify any key other than "mykey1", then there is no record in "MY_DATA_STORE" table matching with this key. Hence Ideally callbackhandler function should get invoked and there should be no data in first parameter "results" of callback handler function.
However my observation is that under this scenario, the callback handler function never gets invoked I can not even see alert statement which is first line of callback handler function as follows
alert("Inside callback handler function.This alert is not shown");
I am using dojo 1.0 version.
Thanks