summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
blob: 6be484fea342269d184bab9e0ee17fe1d3d1cdd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 96ca7d0049461df2293dd0000edcbc69b64255e0 Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Sun, 3 May 2020 22:40:39 +0200
Subject: [PATCH] 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

Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/951]
Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
---
 libdnf/transaction/sql/migrate_tables_1_2.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libdnf/transaction/sql/migrate_tables_1_2.sql b/libdnf/transaction/sql/migrate_tables_1_2.sql
index 49b75315..f80ad1c4 100644
--- a/libdnf/transaction/sql/migrate_tables_1_2.sql
+++ b/libdnf/transaction/sql/migrate_tables_1_2.sql
@@ -1,9 +1,9 @@
 R"**(
 BEGIN TRANSACTION;
     ALTER TABLE trans
-        ADD comment TEXT DEFAULT "";
+        ADD comment TEXT DEFAULT '';
     UPDATE config
-        SET value = "1.2"
+        SET value = '1.2'
         WHERE key = 'version';
 COMMIT;
 )**"