public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements
@ 2020-05-04 16:20 Peter Kjellerstedt
  2020-05-11 14:21 ` [OE-core] " Steve Sakoman
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Kjellerstedt @ 2020-05-04 16:20 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
---

PATCH v2: Updated the Upstream-Status to Accepted.

 ...s-around-string-literals-used-in-SQL.patch | 36 +++++++++++++++++++
 meta/recipes-devtools/libdnf/libdnf_0.47.0.bb |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch

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..293bdcdd24
--- /dev/null
+++ b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
@@ -0,0 +1,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: Accepted [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;
+ )**"
diff --git a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
index 1b4b7e4233..1b06d66b19 100644
--- a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
+++ b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \
            file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
            file://0001-Add-WITH_TESTS-option.patch \
            file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \
+           file://0001-Use-single-quotes-around-string-literals-used-in-SQL.patch \
            "
 
 SRCREV = "8330eea6985c4e4b53796f858de5b6b38b1ddf5c"
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core] [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements
  2020-05-04 16:20 [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements Peter Kjellerstedt
@ 2020-05-11 14:21 ` Steve Sakoman
  2020-05-11 19:02   ` Peter Kjellerstedt
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Sakoman @ 2020-05-11 14:21 UTC (permalink / raw)
  To: peter.kjellerstedt; +Cc: Patches and discussions about the oe-core layer

Hi Peter,

Is this patch suitable for inclusion in dunfell lts?

Thanks,

Steve

On Mon, May 4, 2020 at 6:20 AM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> 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
>
> Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
> ---
>
> PATCH v2: Updated the Upstream-Status to Accepted.
>
>  ...s-around-string-literals-used-in-SQL.patch | 36 +++++++++++++++++++
>  meta/recipes-devtools/libdnf/libdnf_0.47.0.bb |  1 +
>  2 files changed, 37 insertions(+)
>  create mode 100644 meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
>
> 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..293bdcdd24
> --- /dev/null
> +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-around-string-literals-used-in-SQL.patch
> @@ -0,0 +1,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: Accepted [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;
> + )**"
> diff --git a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> index 1b4b7e4233..1b06d66b19 100644
> --- a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> +++ b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> @@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/libdnf;branch=dnf-4-master \
>             file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
>             file://0001-Add-WITH_TESTS-option.patch \
>             file://0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch \
> +           file://0001-Use-single-quotes-around-string-literals-used-in-SQL.patch \
>             "
>
>  SRCREV = "8330eea6985c4e4b53796f858de5b6b38b1ddf5c"
> --
> 2.21.1
>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements
  2020-05-11 14:21 ` [OE-core] " Steve Sakoman
@ 2020-05-11 19:02   ` Peter Kjellerstedt
  2020-05-11 19:24     ` Steve Sakoman
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Kjellerstedt @ 2020-05-11 19:02 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: Patches and discussions about the oe-core layer

Yes, I believe it is. If you cherry-pick it from master, then you should 
change the Upstream-Status as per below to Accepted.

//Peter

> -----Original Message-----
> From: Steve Sakoman <sakoman@gmail.com>
> Sent: den 11 maj 2020 16:21
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: Patches and discussions about the oe-core layer <openembedded-
> core@lists.openembedded.org>
> Subject: Re: [OE-core] [meta-oe][PATCH v2] libdnf: Use single-quotes
> around string literals used in SQL statements
> 
> Hi Peter,
> 
> Is this patch suitable for inclusion in dunfell lts?
> 
> Thanks,
> 
> Steve
> 
> On Mon, May 4, 2020 at 6:20 AM Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> >
> > 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
> >
> > Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
> > ---
> >
> > PATCH v2: Updated the Upstream-Status to Accepted.
> >
> >  ...s-around-string-literals-used-in-SQL.patch | 36 +++++++++++++++++++
> >  meta/recipes-devtools/libdnf/libdnf_0.47.0.bb |  1 +
> >  2 files changed, 37 insertions(+)
> >  create mode 100644 meta/recipes-devtools/libdnf/libdnf/0001-Use-
> single-quotes-around-string-literals-used-in-SQL.patch
> >
> > 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..293bdcdd24
> > --- /dev/null
> > +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-
> around-string-literals-used-in-SQL.patch
> > @@ -0,0 +1,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: Accepted [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;
> > + )**"
> > diff --git a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > index 1b4b7e4233..1b06d66b19 100644
> > --- a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > +++ b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > @@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-
> management/libdnf;branch=dnf-4-master \
> >             file://0001-Get-parameters-for-both-libsolv-and-libsolvext-
> libdn.patch \
> >             file://0001-Add-WITH_TESTS-option.patch \
> >             file://0001-Look-fo-sphinx-only-if-documentation-is-
> actually-ena.patch \
> > +           file://0001-Use-single-quotes-around-string-literals-used-
> in-SQL.patch \
> >             "
> >
> >  SRCREV = "8330eea6985c4e4b53796f858de5b6b38b1ddf5c"
> > --
> > 2.21.1
> >
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements
  2020-05-11 19:02   ` Peter Kjellerstedt
@ 2020-05-11 19:24     ` Steve Sakoman
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Sakoman @ 2020-05-11 19:24 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Patches and discussions about the oe-core layer

On Mon, May 11, 2020 at 9:02 AM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> Yes, I believe it is. If you cherry-pick it from master, then you should
> change the Upstream-Status as per below to Accepted.

I just noticed the version of libdnf on the patch!  Dunfell is still
at 0.28.1 and I'm not going to do a version bump to 0.47.0 without a
really good reason.

Sorry I didn't notice that on my first review.

Steve

> > -----Original Message-----
> > From: Steve Sakoman <sakoman@gmail.com>
> > Sent: den 11 maj 2020 16:21
> > To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> > Cc: Patches and discussions about the oe-core layer <openembedded-
> > core@lists.openembedded.org>
> > Subject: Re: [OE-core] [meta-oe][PATCH v2] libdnf: Use single-quotes
> > around string literals used in SQL statements
> >
> > Hi Peter,
> >
> > Is this patch suitable for inclusion in dunfell lts?
> >
> > Thanks,
> >
> > Steve
> >
> > On Mon, May 4, 2020 at 6:20 AM Peter Kjellerstedt
> > <peter.kjellerstedt@axis.com> wrote:
> > >
> > > 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
> > >
> > > Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
> > > ---
> > >
> > > PATCH v2: Updated the Upstream-Status to Accepted.
> > >
> > >  ...s-around-string-literals-used-in-SQL.patch | 36 +++++++++++++++++++
> > >  meta/recipes-devtools/libdnf/libdnf_0.47.0.bb |  1 +
> > >  2 files changed, 37 insertions(+)
> > >  create mode 100644 meta/recipes-devtools/libdnf/libdnf/0001-Use-
> > single-quotes-around-string-literals-used-in-SQL.patch
> > >
> > > 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..293bdcdd24
> > > --- /dev/null
> > > +++ b/meta/recipes-devtools/libdnf/libdnf/0001-Use-single-quotes-
> > around-string-literals-used-in-SQL.patch
> > > @@ -0,0 +1,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: Accepted [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;
> > > + )**"
> > > diff --git a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > > index 1b4b7e4233..1b06d66b19 100644
> > > --- a/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > > +++ b/meta/recipes-devtools/libdnf/libdnf_0.47.0.bb
> > > @@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-
> > management/libdnf;branch=dnf-4-master \
> > >             file://0001-Get-parameters-for-both-libsolv-and-libsolvext-
> > libdn.patch \
> > >             file://0001-Add-WITH_TESTS-option.patch \
> > >             file://0001-Look-fo-sphinx-only-if-documentation-is-
> > actually-ena.patch \
> > > +           file://0001-Use-single-quotes-around-string-literals-used-
> > in-SQL.patch \
> > >             "
> > >
> > >  SRCREV = "8330eea6985c4e4b53796f858de5b6b38b1ddf5c"
> > > --
> > > 2.21.1
> > >
> > > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-11 19:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04 16:20 [meta-oe][PATCH v2] libdnf: Use single-quotes around string literals used in SQL statements Peter Kjellerstedt
2020-05-11 14:21 ` [OE-core] " Steve Sakoman
2020-05-11 19:02   ` Peter Kjellerstedt
2020-05-11 19:24     ` Steve Sakoman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox