Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19820] Windows: Ti.Database.ResultSet fieldName() function crashes app

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-10-30T06:45:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsWindows
Labelsdatabase
ReporterFeon Sua Xin Miao
AssigneeGary Mathews
Created2015-10-28T23:10:47.000+0000
Updated2015-11-04T18:28:29.000+0000

Description

Run the code below in the Windows Emulator.
var booksDB = Ti.Database.open('booksDB');
booksDB.execute('CREATE TABLE IF NOT EXISTS books(id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, author TEXT)');
booksDB.execute('REPLACE INTO books (title,author) VALUES (?,?)', ('Great Expectations', 'Charles Dickens'));
var result = booksDB.execute('SELECT * FROM books');
Ti.API.info('=== RESULT ===');
Ti.API.info(result.fieldCount);
for (var i = 0, j = result.fieldCount; i < j; i++) {
  Ti.API.info(result.fieldName(i));
}
Ti.API.info('==============');
result.close();
booksDB.close();
RESULTS:
[INFO]  Installing and launching the application
[INFO]  Project built successfully in 25s 336ms

[INFO]  Connected to app
-- Start application log -----------------------------------------------------
[INFO]  === RESULT ===
[INFO]  3
[INFO]  Disconnected from app
-- End application log -------------------------------------------------------

[ERROR] The remote procedure call failed.
[ERROR] Error: The remote procedure call failed.
    at ChildProcess.<anonymous> (C:\ProgramData\Titanium\mobilesdk\win32\5.1.0.v20151026164636\node_modules\windowslib\lib\emulator.js:287:15)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1008:16)
    at Socket.<anonymous> (child_process.js:1176:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:476:12)

Comments

  1. Gary Mathews 2015-10-30

    PR: https://github.com/appcelerator/titanium_mobile_windows/pull/458
  2. Ewan Harris 2015-11-04

    Verified using: Windows 10 Pro Appc Core: 5.1.0-42 Appc NPM: 4.2.1 Ti SDK: 5.1.0.v20151104073721 Using the code provided in the description the app no longer crashes Closing ticket

JSON Source