{ "id": "132454", "key": "TIMOB-17263", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-07-01T12:19:59.000+0000", "priority": null, "labels": [ "db", "execute", "null", "query" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:12.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "{code}\r\nvar db = Ti.Database.open('test');\r\nvar row = db.execute(\"select ? = ? as testfield\", [1,null]);\r\nalert(\"result: \"+row.fieldByName('testfield'));\r\n{code}\r\n\r\nWorks on iOS, \"Uncaught Error: the bind value at index 2 is null\" on Android.", "attachment": [], "flagged": false, "summary": "Can't use null arguments with Titanium.Database.DB.execute on Android", "creator": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK 3.2.1, Titanium Studio 3.2.3, Mac OSX 10.9.3 / Windows 7\r\nDevice: Android 4.2.2", "comment": { "comments": [ { "id": "312041", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Reproduce this problem on Andriod with both Titanium SDK 3.2.1 and 3.30RC\r\nMy test case:\r\n{code}\r\nvar db = Ti.Database.open('mydb1Installed');\r\ndb.execute('DELETE FROM people'); // no need this line for the first time running\r\ndb.execute('CREATE TABLE IF NOT EXISTS people (name TEXT, phone_number TEXT, city TEXT)');\r\n\r\nvar thisName = 'Arthur';\r\nvar thisPhoneNo = '1-617-000-0000';\r\nvar thisCity = 'Mountain View';\r\ndb.execute('INSERT INTO people (name, phone_number, city) VALUES (?, ?, ?)', thisName, thisPhoneNo, thisCity);\r\n\r\nvar personArray = ['Paul','020 7000 0000', null];\r\ndb.execute('INSERT INTO people (name, phone_number, city) VALUES (?, ?, ?)', personArray);\r\n\r\nvar rows = db.execute('SELECT rowid,name,phone_number,city FROM people where city is ?', [null]);\r\n\r\nwhile (rows.isValidRow())\r\n{\r\n Ti.API.info('Person ---> ROWID: ' + rows.fieldByName('rowid') + ', name:' + rows.field(1) + ', phone_number: ' + rows.fieldByName('phone_number') + ', city: ' + rows.field(3));\r\n rows.next();\r\n}\r\ndb.close();\r\nrows.close();\r\n{code}\r\n\r\nBind value can't be set null for Android platform, but works for iOS", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-02T12:29:07.000+0000", "updated": "2014-07-02T12:30:04.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }