{ "id": "64012", "key": "TIMOB-3380", "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": [ { "id": "15940", "description": "2014 Sprint 07 SDK", "name": "2014 Sprint 07 SDK", "archived": true, "released": true, "releaseDate": "2014-04-11" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-04-08T23:11:48.000+0000", "created": "2011-04-15T03:43:34.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "exalture", "module_database", "qe-closed-3.3.0", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-05-05T11:17:56.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "On android, when running the following select statement: \"PRAGMA user_version=5;\" the user_version is never updated. The same statement works fine when manually ran through sqlite3.\r\n\r\nI've looked into the code in TiDatabaseProxy.java and it seems that any pragma statements are automatically put through the rawQuery function, which shouldn't be used for queries that insert data.\r\n\r\nSeems that the fix for ticket TIMOB-2147 probably introduced this issue.\r\n\r\nI've attached a patch that I think should fix the issue, although I've not tested it yet as I don't have a proper build environment set up for titanium mobile.", "attachment": [ { "id": "18312", "filename": "titanium_pragma_fix.patch", "author": { "name": "grambo", "key": "grambo", "displayName": "Grambo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:34.000+0000", "size": 1044, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: PRAGMA statements that set data don't work", "creator": { "name": "grambo", "key": "grambo", "displayName": "Grambo", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "grambo", "key": "grambo", "displayName": "Grambo", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "254518", "author": { "name": "mark.ruys@in2sports.net", "key": "mark.ruys@in2sports.net", "displayName": "Mark Ruys", "active": true, "timeZone": "Europe/Berlin" }, "body": "This is not an iOS, but Android issue. Attached patch seems to work.", "updateAuthor": { "name": "mark.ruys@in2sports.net", "key": "mark.ruys@in2sports.net", "displayName": "Mark Ruys", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-05-29T09:33:43.000+0000", "updated": "2013-05-29T09:33:43.000+0000" }, { "id": "298990", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Execute PRAGMA statements using execSQL if it has =\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/5540", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-27T16:56:58.000+0000", "updated": "2014-03-27T16:56:58.000+0000" }, { "id": "300215", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Test case\nAfter executing the code, TITLE should have value 5\n\n var db = Ti.Database.open('mydb');\n\tdb.execute(\"PRAGMA user_version=5;\");\n\tvar user_version = db.execute(\"PRAGMA user_version;\");\n\tif(user_version.getRowCount()){\n\t\tdo{\n\t\tTi.API.info(\"##### TITLE: \"+user_version.field(0));\n\t\tvar user_version = user_version.next();\n\t\tTi.API.info('## Next: '+user_version);\n\t\t}while( user_version );\n\t}", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-04-08T16:37:46.000+0000", "updated": "2014-04-08T16:37:46.000+0000" }, { "id": "303460", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified with:\r\nAppc-Studio:3.3.0.201405011408\r\nsdk:3.3.0.v20140502133323\r\nacs:1.0.14\r\nalloy:1.4.0-dev\r\nnpm:1.3.2\r\ntitanium:3.3.0-dev\r\ntitanium-code-processor:1.1.1\r\nxcode:5.1.1\r\nDevice:Iphone5(7.1),LG-P970(V4.0.4)", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-05T09:56:54.000+0000", "updated": "2014-05-05T09:56:54.000+0000" }, { "id": "303465", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Used the above mentioned test code and getting the expected output.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-05T11:17:56.000+0000", "updated": "2014-05-05T11:17:56.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }