Project: titanium
Issue TIMOB-19820: Windows: Ti.Database.ResultSet fieldName() function crashes app 
Run the code below in the Windows Emulator. {code} 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(); {code} RESULTS: {code} [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. (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. (child_process.js:1176:11) at Socket.emit (events.js:107:17) at Pipe.close (net.js:476:12) {code}
Story points: 5