summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/libdnf/libdnf
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2020-05-03 23:15:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-05 13:19:55 +0100
commita197c96039ae7ead78337da0938c4549dd1e8bed (patch)
tree39cce2a99b9da6476001265e3e886937bb78a73b /meta/recipes-devtools/libdnf/libdnf
parente568c8ec2af7157cfb7faa5fd8778a2e991f3d45 (diff)
downloadpoky-a197c96039ae7ead78337da0938c4549dd1e8bed.tar.gz
libdnf: Use single-quotes around string literals used in SQL statements
If sqlite is built with -DSQLITE_DQS=0 in accordance with https://sqlite.org/quirks.html#dblquote, migration to version 1.2 of the history database would fail with: History database cannot be created: .../var/lib/dnf/history.sqlite. Error: SQLite error on ":memory:": Executing an SQL statement failed: no such column: 1.2 (From OE-Core rev: 61d34df201cf6498854fa9258c320437b97071a4) Signed-off-by: Peter Kjellerstedt <pkj@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/libdnf/libdnf')
-rw-r--r--meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
new file mode 100644
index 0000000000..6be484fea3
--- /dev/null
+++ b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
@@ -0,0 +1,36 @@
1From 96ca7d0049461df2293dd0000edcbc69b64255e0 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Sun, 3 May 2020 22:40:39 +0200
4Subject: [PATCH] Use single-quotes around string literals used in SQL
5 statements
6
7If sqlite is built with -DSQLITE_DQS=0 in accordance with
8https://sqlite.org/quirks.html#dblquote, migration to version 1.2 of the
9history database would fail with:
10
11 History database cannot be created: /var/lib/dnf/history.sqlite.
12 Error: SQLite error on ":memory:": Executing an SQL statement failed:
13 no such column: 1.2
14
15Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/951]
16Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
17---
18 libdnf/transaction/sql/migrate_tables_1_2.sql | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/libdnf/transaction/sql/migrate_tables_1_2.sql b/libdnf/transaction/sql/migrate_tables_1_2.sql
22index 49b75315..f80ad1c4 100644
23--- a/libdnf/transaction/sql/migrate_tables_1_2.sql
24+++ b/libdnf/transaction/sql/migrate_tables_1_2.sql
25@@ -1,9 +1,9 @@
26 R"**(
27 BEGIN TRANSACTION;
28 ALTER TABLE trans
29- ADD comment TEXT DEFAULT "";
30+ ADD comment TEXT DEFAULT '';
31 UPDATE config
32- SET value = "1.2"
33+ SET value = '1.2'
34 WHERE key = 'version';
35 COMMIT;
36 )**"