{ "id": "171611", "key": "ALOY-1617", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2018-05-09T14:19:14.000+0000", "created": "2018-05-03T20:35:27.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-05-09T19:59:59.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "When using databinding with collectionmodel then i get sql.js error on ANDROID when \r\ncolumns are not declared. \r\nIOS works fine - with or without declaration of columns in model-js file. (attached)\r\n\r\nIf i declare columns - Android-app doesn't show sql.js error (attached - screenshot from GenyMotion and Huawei 9 pro device", "attachment": [ { "id": "65121", "filename": "genymotion.png", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T20:13:52.000+0000", "size": 314218, "mimeType": "image/png" }, { "id": "65120", "filename": "huawei.png", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T20:13:35.000+0000", "size": 329077, "mimeType": "image/png" }, { "id": "65119", "filename": "Oplevelser.js", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T20:08:46.000+0000", "size": 784, "mimeType": "application/javascript" } ], "flagged": false, "summary": "SQL: Error on Android when using SQL data-binding without declaring columns", "creator": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacBook Pro, Atom-Editor with Titanium Plugin", "closedSprints": [ { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437361", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there, thanks for reporting this! Before checking the issue: \r\n- Is there are reason a developer would create a table without any columns? I don't see any real world use cases for this right now. Thats probably why this did not pop up earlier.\r\n- Which Titanium SDK version, Alloy version and Android version do you use?\r\n- What is the actual error log?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-04T08:05:46.000+0000", "updated": "2018-05-04T08:10:41.000+0000" }, { "id": "437362", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hey reason for creating a table without columns - when filling collection with data from XML-feed. Only thing necessary was the idattribute.\r\nDid follow guide her: https://medium.com/all-titanium/enhancing-titanium-how-to-set-up-collections-with-databinding-39573cd30911 Works like a charm on ios - but took some time to find the right brick (adding of a columns) to make it work right on android.\r\nAnd the column i added has nothing to do with my data, so you can write anything you want. - as long as it its there :)\r\nRegards Joe", "updateAuthor": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-04T08:11:37.000+0000", "updated": "2018-05-04T08:11:37.000+0000" }, { "id": "437364", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*SDK:* 7.1.0. GA\r\n*ALLOY* .. hmm console: alloy --version doesnt work atm :)\r\n*ANDROID:* 8.0.0 (Device) 7.0 (GenyMotion)\r\n*Showstopper:*\r\n\r\n[ERROR] \b\b \bSQLiteLog: (1) near \")\": syntax error\r\n[ERROR] \b\b \bTiDB: (main) [363,363] Error executing sql: near \")\": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS Oplevelser ( )\r\n[ERROR] \b\b \bTiDB: android.database.sqlite.SQLiteException: near \")\": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS Oplevelser ( )\r\n[ERROR] \b\b \bTiDB: at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)\r\n[ERROR] \b\b \bTiDB: at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)\r\n[ERROR] \b\b \bTiDB: at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)\r\n[ERROR] \b\b \bTiDB: at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)\r\naso. aso..\r\n", "updateAuthor": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-04T08:25:54.000+0000", "updated": "2018-05-04T08:35:39.000+0000" }, { "id": "437378", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Okay, this looks indeed like an Android SDK issue then. Probably it needs to be {{CREATE TABLE IF NOT EXISTS Oplevelser}} instead of {{CREATE TABLE IF NOT EXISTS Oplevelser ( )}}. We will have an engineer looking into this, but cannot promise any time frame right now. As the SDK is open source, you can also take a look and submit a pull request.\r\n\r\nP.S.: It's {{alloy -v}}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-04T15:15:23.000+0000", "updated": "2018-05-04T15:16:55.000+0000" }, { "id": "437379", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/alloy/pull/895\r\n\r\nAlthough the error is on Android, I think we should fix this in Alloy, since we are using empty column parenthesis `( )` when no columns are specified. iOS may filter this out, but Android complains for a good reason. I did not validate the fix so far, so feedback is welcome!\r\n\r\nYou can replace the file from Github in your local Alloy installation. Please make a backup before and try it out!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-04T15:28:55.000+0000", "updated": "2018-05-04T15:28:55.000+0000" }, { "id": "437495", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jkniesek] Can you please validate that using alloy@master resolves the issue? [~fmiao] Is there a way to install alloy@master from npm instead of manually patching the local files? And can you do the version bump? Thanks everyone!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-09T08:44:21.000+0000", "updated": "2018-05-09T08:44:21.000+0000" }, { "id": "437498", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~hknoechel] {{\\[sudo\\] npm install -g git://github.com/appcelerator/alloy.git}} works to pull from master branch\r\n", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-05-09T09:15:01.000+0000", "updated": "2018-05-09T09:15:01.000+0000" }, { "id": "437516", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Although the PR is merged, it still crashes - and that for a good reason. It is technically invalid to create an SQL table without columns. Read more here:\r\n\r\n- https://www.w3schools.com/sql/sql_create_table.asp\r\n- https://stackoverflow.com/questions/32961327/create-a-blank-table-with-no-column\r\n- http://sqlfiddle.com/#!9/edd78f (Demo)\r\n\r\nThe only reason iOS does not fail is because the underlaying API is able to ignore that, although it shouldn't. So we would likely change iOS in the future to reject it as well. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-09T14:19:14.000+0000", "updated": "2018-05-09T14:19:14.000+0000" }, { "id": "437531", "author": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Good idea. Thanks for all those great answers :) Code Strong !", "updateAuthor": { "name": "jkniesek", "key": "jkniesek", "displayName": "Joe Kniesek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-09T19:59:59.000+0000", "updated": "2018-05-09T19:59:59.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }