Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2235] Ti.Database.ResultSet.fieldName() mangles the database column names

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:29.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M04
ComponentsiOS
Labelsdatabase, defect, ios, iphone
ReporterNathaniel McCallum
AssigneeReggie Seagraves
Created2011-04-15T03:14:23.000+0000
Updated2011-04-17T01:58:29.000+0000

Description

CREATE TABLE foo (myColumn INT);

var rs = db.execute("SELECT myColumn FROM foo");
alert(rs.fieldName(0));

On android, the output is 'myColumn'.
On iphone, the output is 'mycolumn'. This is wrong.

The root cause is logic which provides case-insensitive matching for rs.fieldByName('mycolumn'). This behavior is correct, but the rs.fieldName(0) behavior is not (on iphone only).

I've already fixed this in my titanium branch. I've created a merge request here: http://github.com/appcelerator/titanium_mobile/pull/11">http://github.com/appcelerator/titanium_mobile/pull/11

Comments

  1. Jeff Haynie 2011-04-15

    (from [555db6980b222bb3a24074e4d1fad28564f3c885]) [#2235 state:open] (Requires test before sending to QA) don't mange sql column names for ResultSet.fieldName(), but still preserve case insensitive search for ResultSet.fieldByName()
    http://github.com/appcelerator/titanium_mobile/commit/555db6980b222bb3a24074e4d1fad28564f3c885"> http://github.com/appcelerator/titanium_mobile/commit/555db6980b222...

  2. Don Thorp 2011-04-15

    Merge complete. Assigning to Blain for test.

  3. Blain Hamon 2011-04-15

    Didn't we fix this? Shouldn't it be fixed-in-qa?

  4. Nathaniel McCallum 2011-04-15

    yup.

  5. Stephen Tramer 2011-04-15

    iPod 3GT 4.2.1, 1.5.0.a899d42

JSON Source