Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2961] Blackberry: Database parameter binding incorrect

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-06-22T14:23:29.000+0000
Affected Version/sBB Preview 2
Fix Version/sBacklog
ComponentsBlackBerry
Labelsblackberry, defect
ReporterDawson Toth
AssigneeNolan Wright
Created2011-04-15T03:33:48.000+0000
Updated2017-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

Comments

  1. Lee Morris 2017-03-02

    Closing ticket as Blackberry is no longer supported.

JSON Source