Bug#1003344: restfuldb: FTBFS with SQLite3 3.37.0+

2022-01-14 Thread Andrius Merkys
Hi,

On 2022-01-08 19:46, László Böszörményi (GCS) wrote:
> SQLite3 3.37.0 and onwards changed its inner working. Now table column
> data types are stored as a value and always returned as uppercase
> text. This breaks your package as it relies on the old behavior, when
> this was stored as text and returned in a case it was defined.
> As I broke it, I've created a fix for you, patch is attached. Couldn't
> make it work with older SQLite3 versions thus you will need to build
> depend on SQLite3 3.37.0 and newer.

Thanks a lot for the patch. Since I am one of the upstream developers I
will see how this could be fixed upstream. My priority would be to
support both SQLite3 << 3.37.0 and >= 3.37.0, but I can see that for
Debian your patch is sufficient.

> Sorry for the inconvenience,

No problem, such breakages sometimes happen with dependency updates.

Thanks,
Andrius



Bug#1003344: restfuldb: FTBFS with SQLite3 3.37.0+

2022-01-08 Thread GCS
Source: restfuldb
Version: 0.15.2+dfsg-2
Severity: serious
Tags: patch

Hi,

SQLite3 3.37.0 and onwards changed its inner working. Now table column
data types are stored as a value and always returned as uppercase
text. This breaks your package as it relies on the old behavior, when
this was stored as text and returned in a case it was defined.
As I broke it, I've created a fix for you, patch is attached. Couldn't
make it work with older SQLite3 versions thus you will need to build
depend on SQLite3 3.37.0 and newer.

Sorry for the inconvenience,
Laszlo/GCS
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) 
Forwarded: no
Last-Update: 2022-01-08

---

--- restfuldb-0.15.2+dfsg.orig/tests/cases/Database.pm_007.sh
+++ restfuldb-0.15.2+dfsg/tests/cases/Database.pm_007.sh
@@ -31,8 +31,8 @@ trap "exit 1" HUP INT QUIT TERM
 
 TMP_DB_MAIN="${TMP_DIR}/test.db"
 
-sqlite3 ${TMP_DB_MAIN} "create table parent(id int, name text)"
-sqlite3 ${TMP_DB_MAIN} "create table child(id int, parent_id int, FOREIGN KEY(parent_id) REFERENCES parent(id))"
+sqlite3 ${TMP_DB_MAIN} "create table parent(id INT, name TEXT)"
+sqlite3 ${TMP_DB_MAIN} "create table child(id INT, parent_id INT, FOREIGN KEY(parent_id) REFERENCES parent(id))"
 sqlite3 ${TMP_DB_MAIN} "insert into parent values (1, 'first entry')"
 sqlite3 ${TMP_DB_MAIN} "insert into parent values (2, 'second entry')"
 sqlite3 ${TMP_DB_MAIN} "insert into child values (1, 1)"
--- restfuldb-0.15.2+dfsg.orig/tests/outputs/Database.pm_001.out
+++ restfuldb-0.15.2+dfsg/tests/outputs/Database.pm_001.out
@@ -1,11 +1,11 @@
 $VAR1 = {
-  'image' => 'blob'
+  'image' => 'BLOB'
 };
 $VAR1 = {
-  'caption' => 'text',
-  'description' => 'text',
-  'id' => 'integer',
-  'image' => 'blob'
+  'caption' => 'TEXT',
+  'description' => 'TEXT',
+  'id' => 'INTEGER',
+  'image' => 'BLOB'
 };
 -
 $VAR1 = {
@@ -13,10 +13,10 @@ $VAR1 = {
   'authors' => 'varchar',
   'cdate' => 'date',
   'ctime' => 'time',
-  'id' => 'integer',
-  'revision_id' => 'integer',
-  'title' => 'text',
-  'year' => 'integer'
+  'id' => 'INTEGER',
+  'revision_id' => 'INTEGER',
+  'title' => 'TEXT',
+  'year' => 'INTEGER'
 };
 $VAR1 = {
   'PublicID' => '12',
--- restfuldb-0.15.2+dfsg.orig/tests/outputs/Database.pm_007.out
+++ restfuldb-0.15.2+dfsg/tests/outputs/Database.pm_007.out
@@ -5,7 +5,7 @@ $VAR1 = [
 'coltype' => 'id',
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'int',
+'sqltype' => 'INT',
 'value' => 1
   },
   'parent_id' => {
@@ -29,14 +29,14 @@ $VAR1 = [
   'coltype' => 'id',
   'length' => undef,
   'resolver' => undef,
-  'sqltype' => 'int',
+  'sqltype' => 'INT',
   'value' => 1
 },
 'name' => {
   'coltype' => undef,
   'length' => undef,
   'resolver' => undef,
-  'sqltype' => 'text',
+  'sqltype' => 'TEXT',
   'value' => 'first entry'
 }
   },
@@ -66,7 +66,7 @@ $VAR1 = [
 },
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'int',
+'sqltype' => 'INT',
 'value' => 1
   }
 },
@@ -89,7 +89,7 @@ $VAR1 = [
 'coltype' => 'id',
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'int',
+'sqltype' => 'INT',
 'value' => 1
   },
   'parent_id' => {
@@ -109,7 +109,7 @@ $VAR1 = [
 }, 'Database::ForeignKey' ),
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'int',
+'sqltype' => 'INT',
 'value' => 2
   }
 },
--- restfuldb-0.15.2+dfsg.orig/tests/outputs/Database.pm_012.out
+++ restfuldb-0.15.2+dfsg/tests/outputs/Database.pm_012.out
@@ -12,28 +12,28 @@ $VAR1 = [
 'coltype' => 'id',
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'integer',
+'sqltype' => 'INTEGER',
 'value' => 1
   },
   'locality' => {
 'coltype' => undef,
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'text',
+'sqltype' => 'TEXT',
 'value' => 'New Caledonia'
   },
   'mine' => {
 'coltype' => undef,
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'text',
+'sqltype' => 'TEXT',
 'value' => 'Mea'
   },
   'name' => {
 'coltype' => undef,
 'length' => undef,
 'resolver' => undef,
-'sqltype' => 'text',
+