stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

BAD_ACCESS with iOS 16, release 0.14.1 and table create #1171

Open crudolf opened 1 year ago

crudolf commented 1 year ago

After upgrading to 0.14.1 a table creation for an already existing table gives a BAD_ACCESS.

Build Information

SQLite: 0.14.1 iOS: 16.0.1 Build with Carthage on M1 Pro

General guidelines

In general there is an existing project which works perfectly fine with 0.13.3. After upgrading and starting the application on a real device (not reproducable with the simulator). The table.create function gives a BAD_ACCESS:

public static let table = Table("calendar_entry")

public static let dayExp = Expression<String>("day")
public static let servicerIdExp = Expression<Int64>("servicer_id")
public static let lastUpdateExp = Expression<Date>("last_update")

public static func getCreateTableIfNotExistsQuery() -> String {
    return table.create(ifNotExists: true) { table1 in
        table1.column(dayExp)
        table1.column(servicerIdExp)
        table1.column(lastUpdateExp)
        table1.primaryKey(dayExp, servicerIdExp)
    }
}

After downgrading to 0.13.3 this exception does not occur. Reproducable on the real device.

thiagosan252 commented 2 months ago

I have the same problem.

When changing to variables without "static", tables are created without error