{ "id": "80679", "key": "TIMOB-5881", "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": "16096", "description": "2014 Sprint 09", "name": "2014 Sprint 09", "archived": true, "released": true, "releaseDate": "2014-05-08" }, { "id": "16097", "description": "2014 Sprint 09 SDK", "name": "2014 Sprint 09 SDK", "archived": true, "released": true, "releaseDate": "2014-05-08" }, { "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-05-02T20:33:12.000+0000", "created": "2011-09-27T16:25:12.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_api", "parity", "qe-closed-3.3.0", "qe-testadded", "tbs-2.1.0" ], "versions": [], "issuelinks": [ { "id": "14280", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "62960", "key": "TIMOB-2328", "fields": { "summary": "Android: Database - ResultSet.fieldCount method on iOS (as per APIDOCs) but property on Android", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "37234", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "62960", "key": "TIMOB-2328", "fields": { "summary": "Android: Database - ResultSet.fieldCount method on iOS (as per APIDOCs) but property on Android", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "37237", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "129916", "key": "MOD-1712", "fields": { "summary": "EncDB iOS: Change fieldCount from method to property", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "37235", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "107799", "key": "ALOY-459", "fields": { "summary": "Remove rs.fieldCount vs. rs.fieldCount() in sql.js", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-05-08T06:52:09.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "{{resultset.fieldCount}} on Android\r\n\r\nand\r\n\r\n{{resultset.fieldCount()}} on iPhone\r\n\r\nCan we have some parity please? At this point, you'll probably have to support fieldCount as both a function and a property on both platforms, to avoid breaking existing code.\r\n\r\nh3. This code will run on iOS, but fail on Android\r\n{code:JavaScript|title:app.js}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar db = Titanium.Database.open('mydb');\r\n\r\ndb.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)');\r\n\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',1,'Name 1');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',2,'Name 2');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',3,'Name 3');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',4,'Name 4');\r\n\r\nvar rows = db.execute('SELECT * FROM DATABASETEST');\r\n\r\nTi.API.info(rows.fieldCount());\r\n\r\nrows.close();\r\ndb.close();\r\n\r\n{code}\r\n\r\nh3. This code will run on Android, but fail on iOS\r\n{code:JavaScript|title:app.js}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar db = Titanium.Database.open('mydb');\r\n\r\ndb.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)');\r\n\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',1,'Name 1');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',2,'Name 2');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',3,'Name 3');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',4,'Name 4');\r\n\r\nvar rows = db.execute('SELECT * FROM DATABASETEST');\r\n\r\nTi.API.info(rows.fieldCount);\r\n\r\nrows.close();\r\ndb.close();\r\n{code}\r\n\r\nThis makes the code harder to write since developers but call a different code depending on the platform they are running. Also, there is a very subtle difference between the two, this makes this kind of error very easy to overlook. There should be a common way (either function or property) to access this information on all platforms.", "attachment": [], "flagged": false, "summary": "Ti API: DB result set: fieldCount is a property on Android, function on iPhone", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [ { "id": "112223", "key": "TIMOB-13387", "fields": { "summary": "Specification: Define/consolidate/deprecate Titanium.Database.ResultSet.fieldCount", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium Studio 1.0.2.201107130739\r\nTitanium SDK 1.7.2, 1.7.3.v.xxxxxx, 1.8.0.v.xxxxx", "closedSprints": [ { "id": 50, "state": "closed", "name": "2014 Sprint 09 Tooling", "startDate": "2014-04-28T15:43:24.381Z", "endDate": "2014-05-10T03:44:00.000Z", "completeDate": "2014-05-12T13:36:16.254Z", "originBoardId": 113 } ], "comment": { "comments": [ { "id": "169879", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you for raising this ticket. I am afraid we need all the information listed in the [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist] in order to accept a ticket.\r\n\r\nIn this instance, we need a complete code sample showing the issue.\r\n\r\nOnce this ticket is complete, we can move it to the main project.\r\n\r\nThank you", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T12:08:39.000+0000", "updated": "2011-10-20T12:08:39.000+0000" }, { "id": "170508", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Thanks, Christian, for adding the sample code. Matthew, does this ticket now have what you need?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2011-10-26T10:03:12.000+0000", "updated": "2011-10-26T10:03:12.000+0000" }, { "id": "170510", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Shawn,\r\n\r\nWe do request that sample code have at least one window to indicate the completeness of the code (that it can be run as a single app.js)", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-26T10:06:28.000+0000", "updated": "2011-10-26T10:06:28.000+0000" }, { "id": "183799", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "The description of this ticket is pretty straight forward, even without sample code. In order to supply a true testcase that runs on its own, I'd have to supply a database also, which I can't submit in text.\r\n\r\nDo you really need anything else to take a look at fieldCount ?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-21T08:31:24.000+0000", "updated": "2012-02-21T08:31:24.000+0000" }, { "id": "211479", "author": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "body": "would just like to add, resultset.getFieldCount() works for both, though is documented as android only?", "updateAuthor": { "name": "paul h", "key": "paul h", "displayName": "Paul Hamilton", "active": true, "timeZone": "America/Havana" }, "created": "2012-08-05T16:58:30.000+0000", "updated": "2012-08-05T16:58:30.000+0000" }, { "id": "303332", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "fieldCount will only be supported as a read only property beginning Release 3.3.0 of the SDK\r\nPull pending\r\nhttps://github.com/appcelerator/titanium_mobile/pull/5657", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-02T20:19:36.000+0000", "updated": "2014-05-02T20:23:19.000+0000" }, { "id": "303334", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Vishal, does that mean that the iOS fieldCount() function is being removed, and that the fieldCount property will exist in both Android and iOS?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2014-05-02T20:28:34.000+0000", "updated": "2014-05-02T20:28:34.000+0000" }, { "id": "303368", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@[~bitshftr]\r\nYes fieldCount() method has been removed. fieldCount is a read only property now on all supported platforms (ios, android,blackberry). \r\n\r\nrs.fieldCount - Supported\r\nrs.getFieldCount() - Supported\r\nrs.fieldCount() - Unsupported", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-05-02T22:38:57.000+0000", "updated": "2014-05-02T22:38:57.000+0000" }, { "id": "303980", "author": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment - \r\nAppc-Studio:3.3.0.201405011408 \r\nsdk:3.3.0.v20140507163312 \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:Iphone5s(v7.1.1),Nexus7(v4.4.2)\r\nResult - fieldCount() method has been removed. fieldCount is a read only property on ios and android. Tested the code with \"Ti.API.info(rows.fieldCount)\" mentioned above and its working fine. Hence closing this issue.", "updateAuthor": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-08T06:49:09.000+0000", "updated": "2014-05-08T06:49:09.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }