|
@@ -501,9 +501,13 @@ begin
|
|
|
end;
|
|
|
ftUnknown : DatabaseErrorFmt('Unknown or unsupported data type %s of column %s', [FD, FN]);
|
|
|
end; // Case
|
|
|
- // is column declared as NOT NULL ? (table name parameter (3rd) must be not nil)
|
|
|
+ // check if SQLite is compiled with SQLITE_ENABLE_COLUMN_METADATA
|
|
|
+ if Assigned(sqlite3_column_origin_name) then
|
|
|
+ CN := sqlite3_column_origin_name(st,i)
|
|
|
+ else
|
|
|
+ CN := nil;
|
|
|
// check only for physical table columns (not computed)
|
|
|
- CN := sqlite3_column_origin_name(st,i);
|
|
|
+ // is column declared as NOT NULL ? (table name parameter (3rd) must be not nil)
|
|
|
if not (Assigned(CN) and (sqlite3_table_column_metadata(fhandle, sqlite3_column_database_name(st,i), sqlite3_column_table_name(st,i), CN, nil, nil, @NotNull, nil, nil) = SQLITE_OK)) then
|
|
|
NotNull := 0;
|
|
|
FieldDefs.Add(FN, FT, size1, size2, NotNull=1, false, i+1, CP_UTF8);
|