Control: reassign -1 src:golang-github-facebook-ent Control: found -1 0.5.4-2 Control: tags -1 +patch
Hi Paul, On Thu, Jan 13, 2022 at 3:54 PM Paul Gevers <[email protected]> wrote: > With a recent upload of sqlite3 the autopkgtest of crowdsec fails in > testing when that autopkgtest is run with the binary packages of sqlite3 > from unstable. [...] > Currently this regression is blocking the migration of sqlite3 to > testing [1]. Due to the nature of this issue, I filed this bug report > against both packages. Can you please investigate the situation and > reassign the bug to the right package? SQLite3 used to store column data types as text with the same case it was created. So it could have been 'integer', 'INTEGER' or even 'IntEGEr'. But with 3.37.0 and onwards it's now stored as an enumerated value [1] and always translated to uppercase column type [2]. Then golang-github-facebook-ent only checks for lowercase [3] values. Meaning it was wrong for previous SQLite3 versions even. The attached patch fixes this. Hope this helps, Laszlo/GCS [1] https://github.com/sqlite/sqlite/blob/version-3.37.0/src/global.c#L388 [2] https://github.com/sqlite/sqlite/blob/version-3.37.0/src/global.c#L396 [3] https://github.com/ent/ent/blob/v0.5.4/dialect/sql/schema/sqlite.go#L284
Description: SQLite3 3.37.0+ use uppercase column tupe names Starting with SQLite3 3.37.0 it stores column type names as a value and always displayed in uppercase letters. Previously it stored type names as text with the same case as it was given. This breaks testing where the column type is defined in lowercase and expects it to be given back as-is. Fix this with using type names in uppercase. Author: Laszlo Boszormenyi (GCS) <[email protected]> Forwarded: no Last-Update: 2022-01-13 --- --- golang-github-facebook-ent-0.5.4.orig/dialect/sql/schema/sqlite.go +++ golang-github-facebook-ent-0.5.4/dialect/sql/schema/sqlite.go @@ -281,7 +281,7 @@ func (d *SQLite) scanColumn(c *Column, r if err != nil { return err } - switch parts[0] { + switch strings.ToLower(parts[0]) { case "bool", "boolean": c.Type = field.TypeBool case "blob":

