[TIMOB-2961] Blackberry: Database parameter binding incorrect
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-22T14:23:29.000+0000 |
Affected Version/s | BB Preview 2 |
Fix Version/s | Backlog |
Components | BlackBerry |
Labels | blackberry, defect |
Reporter | Dawson Toth |
Assignee | Nolan Wright |
Created | 2011-04-15T03:33:48.000+0000 |
Updated | 2017-03-02T21:44:28.000+0000 |
Description
Problem
The database paramater binding is incorrect on Blackberry. It always binds the parameters to the 0th index, instead of to the "i"th index.
Existing Source
The binding is done in the following function:
private void bindStatementArguments(Statement st, String[] args)
{
for (int i = 0; i < args.length; i++) {
try {
st.bind(i + 1, args[0]);
} catch (DatabaseBindingException e) {
Log.e(TAG, "Exception while binding statement argument with index " + i + ": " + e.getMessage());
} catch (DatabaseException e) {
Log.e(TAG, "Statement object was not prepared for binding: " + e.getMessage());
}
}
}
In the fifth line of that block, notice that st.bind is called on 1+1 and args[0]. args[0] should be args[i].
CLA
A client contributed this fix, accessible through the associated helpdesk ticket below. We may need to get him to sign the CLA, given that this fix came from him.
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/68791">http://developer.appcelerator.com/helpdesk/view/68791
Closing ticket as Blackberry is no longer supported.