Skip to content

Commit 08e39d7

Browse files
committed
When the type of a column is unrecognized, assign the type 'text' to this column.
Explanation: SQLite allows column types to be (almost) arbitrary strings. While the SQL-IDE allows only a fixed set of types when creating tables within the SQL-IDE, it is still possible to have tables with 'exotic' types by importing them. This results in an undefined column type. When you run a select-query on such a table, the application 'crashes' at line 502 of ResultsetPresenter.ts and no result table is shown. Suggested Solution: If the column type is unrecognized, let it default to the type 'text'.
1 parent cf866b5 commit 08e39d7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/client/compiler/parser/SQLTable.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export class Column {
4747
type = new SQLDerivedType(<SQLBaseType>type, parameterValues);
4848
}
4949

50+
// If type is unrecognized default to type text.
51+
if (!type) {
52+
type = SQLBaseType.getBaseType('text');
53+
}
54+
5055
let column = new Column(cs.name, type, table, cs.isPrimaryKey, !cs.isPrimaryKey, cs.defaultValue, cs.isAutoIncrement);
5156
column.notNull = cs.notNull;
5257

@@ -102,4 +107,4 @@ export class Table {
102107
return tables;
103108
}
104109

105-
}
110+
}

0 commit comments

Comments
 (0)