Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20577] Fix getField context for Windows #771

Merged
merged 2 commits into from Mar 22, 2016

Conversation

garymathews
Copy link
Contributor

  • Bind the ResultSet context to the field call to prevent an invalid pointer
TEST CASE
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'),
    getField = result.field; // INVALID
    // getField = result.field.bind(result); // VALID
Ti.API.info('=== RESULT ===');
Ti.API.info('fieldCount: ' + result.fieldCount);
for (var i = 0, j = result.fieldCount; i < j; i++) {
    Ti.API.info(getField(i));
}
Ti.API.info('==============');
result.close();
booksDB.close();

JIRA Ticket

sgtcoolguy added a commit that referenced this pull request Mar 22, 2016
[TIMOB-20577] Fix getField context for Windows
@sgtcoolguy sgtcoolguy merged commit 0fb5858 into tidev:master Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants