File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -160,18 +160,19 @@ final class StatementAuthorizer {
160
160
return SQLITE_OK
161
161
162
162
case SQLITE_FUNCTION:
163
- guard let cString2 = cString2 else { return SQLITE_OK }
164
-
165
- // SQLite does not report ALTER TABLE DROP COLUMN with the
166
- // SQLITE_ALTER_TABLE action code. So we need to find another way
167
- // to set the `invalidatesDatabaseSchemaCache` flag for such
163
+ // SQLite 3.37.2 does not report ALTER TABLE DROP COLUMN with the
164
+ // SQLITE_ALTER_TABLE action code. SQLite 3.38 does.
165
+ //
166
+ // Until SQLite 3.38, we need to find another way to set the
167
+ // `invalidatesDatabaseSchemaCache` flag for such
168
168
// statement, and it is SQLITE_FUNCTION sqlite_drop_column.
169
169
//
170
170
// See <https://github.com/groue/GRDB.swift/pull/1144#issuecomment-1015155717>
171
171
// See <https://sqlite.org/forum/forumpost/bd47580ec2>
172
- //
173
- // TODO: remove when SQLite properly reports SQLITE_ALTER_TABLE
174
- if strcmp ( cString2, " sqlite_drop_column " ) == 0 {
172
+ if sqlite3_libversion_number ( ) < 3038000 ,
173
+ let cString2,
174
+ strcmp ( cString2, " sqlite_drop_column " ) == 0
175
+ {
175
176
invalidatesDatabaseSchemaCache = true
176
177
}
177
178
return SQLITE_OK
You can’t perform that action at this time.
0 commit comments