Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2328] Android: Database - ResultSet.fieldCount method on iOS (as per APIDOCs) but property on Android

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2014-05-02T20:22:10.000+0000
Affected Version/sRelease 1.6.0, Release 1.8.0.1, Release 3.0.0
Fix Version/sn/a
ComponentsTiAPI
Labelsapi, parity, qe-port
ReporterDeniss Fedotovs
AssigneeHieu Pham
Created2011-04-15T03:16:52.000+0000
Updated2017-03-23T18:04:19.000+0000

Description

1. Run this code on both iOS/Android and make sure there's no error on both platforms.
var win = Ti.UI.createWindow();
win.open();
 
var db = Titanium.Database.open('testdb');
 
db.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)');
 
db.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',1,'Name 1');
db.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',2,'Name 2');
db.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',3,'Name 3');
db.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',4,'Name 4');
 
var rows = db.execute('SELECT * FROM DATABASETEST');
 
Ti.API.info("fieldCount: " + rows.getFieldCount());
Ti.API.info("fieldCount: " + rows.fieldCount);
 
rows.close();
db.close();

Comments

  1. Mike Murry 2011-04-15

    Issue persists in Mobile SDK 1.5.1 as well.

  2. Stephen Tramer 2011-04-15

    Looks like we need to API scrub the database module.

  3. Marc Kurtz 2011-04-26

  4. Arthur Evans 2012-08-13

    There are multiple reports of this, so it's clearly a very problematic parity issue for folks. We need to choose whether this should be a method or a property and fix it.
  5. Junaid Younus 2012-08-23

    Tested on a Samsung Galaxy S2 and on the iOS simulator using TiSDK 2.2.0v20120821095711, issue still valid.
  6. Hieu Pham 2012-08-27

    fieldCount should be a read-only property across all platforms. We will modify iOS current behavior and update the doc. Appropriate uses of fieldCount: 1. x.fieldCount. 2. x.getFieldCount().
  7. Anshu Mittal 2012-08-29

    Verified on: SDK:2.2.0.v20120828153312 Studio:2.1.2.201208281351 Devices: LG-p970(v 2.2.2)
  8. Sabil Rahim 2012-12-11

    We need to revisit this issue as the original fix for this breaks almost all of our existing modules, which led to reverting the fix in PR [3575](https://github.com/appcelerator/titanium_mobile/pull/3575)
  9. Lee Morris 2017-03-23

    Closing ticket as duplicate with reference to the linked issues above.

JSON Source