GNU bug report logs - #58756
sqlite-returning tests fails with older SQLite library versions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Mattias Engdegård <mattias.engdegard@HIDDEN>; Keywords: patch; merged with #58766; dated Mon, 24 Oct 2022 09:51:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 58756 <at> debbugs.gnu.org:


Received: (at 58756) by debbugs.gnu.org; 24 Nov 2022 20:01:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 15:01:45 2022
Received: from localhost ([127.0.0.1]:60327 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyIPp-0003sa-5x
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 15:01:45 -0500
Received: from mail-oo1-f45.google.com ([209.85.161.45]:38874)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>)
 id 1oyIPn-0003sI-HR; Thu, 24 Nov 2022 15:01:43 -0500
Received: by mail-oo1-f45.google.com with SMTP id
 g15-20020a4a894f000000b0047f8e899623so392980ooi.5; 
 Thu, 24 Nov 2022 12:01:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=2/1FlLu/FuOk5dHjE4CQ6C+R3k2d6fBCMoPXwITE+p4=;
 b=Rp4eIeOqifm09/0hqoqLYgQcWVSWQtKwxV8ZBRXhbp2GNV/H9wu6t216pVDZFe1+RB
 OOnBvGxP2XKmG2xspbf8thqyrzx5AByB9aBVNuG2bRpjHQKPUZGnkQ/I2+qsOGo2ylvc
 Uel/qQcLcyX+//ffUG5bXlpOVED1z//PtJYIZ8XHb3yCSdDhEytQIl2M+KTIGyX7fbIt
 r30AEJIZf1v2ELNN+1f2UG/uU2BDUySWkkcw/FyJcNz8oz2a9pTLblteOnpZ8lb9QbUu
 Drp36MQNt9NzNmDBUMLhy3nafuGQdS18rPwWrO45uJHgEQj/fm/JFqB0RCYHm7mzgBpL
 mjNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=2/1FlLu/FuOk5dHjE4CQ6C+R3k2d6fBCMoPXwITE+p4=;
 b=cpXzZFcBe6KaTrlF9cUNQDAzgJJZUVnB1vr49pnVoOvD54Xdv1Y1NgTxEbZQ5j1EJR
 tuzJWPEJyZdWsgjrCrDvy0sdB53i6Aru3uPzXc7blo+jw4yya7RkJh5GdqR6tlzlGmVG
 /+vzXgFfE2Xcyrz+rhHXmJT1tzyMbAFNGV15vzkUdhdzHY0WN+gu0zSlI9OxaC1gNILY
 KUxYpvBx4i+n8TdsS+NzIrEkD1gae7ltPYxU21S66acnkyy0SwAX9GoxaUFEGftkTxUB
 7C+H+oj07Aa909XLCTK7WhByIWC6mXEnbPhc02z4L3kaner9+jzClTgEn6RZT3N+TVb3
 +80A==
X-Gm-Message-State: ANoB5pn0WhTvcUpy/DGrNWcXuTi5VnGA1LJFiCY1quwYk8XT0k5lfRWo
 tgi95ZPEPCBH72qDtT1VzL9IycrEj8GtPbtfB+0=
X-Google-Smtp-Source: AA0mqf62Qr/nen7oQwRrogg+B+Ux/iLEAgF3imFYsuJp03+J6H7NfYnE55AzVWLcq2O/pR+aVSGKBsOXCuP2uFeqQSM=
X-Received: by 2002:a4a:54c1:0:b0:49f:d54c:9bcd with SMTP id
 t184-20020a4a54c1000000b0049fd54c9bcdmr11370067ooa.5.1669320097999; Thu, 24
 Nov 2022 12:01:37 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Thu, 24 Nov 2022 12:01:37 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: =?UTF-8?B?PDU1NzRCMEE2LUU1QjAtNDdBRC1BQzhBLTM0OTYyMDQzRDM1RUBnbWFpbC5jb20+?=
 =?UTF-8?B?ICgiTWF0dGlhcyBFbmdkZWfDpXJkIidzIG1lc3NhZ2Ugb2YgIk1vbiwgMjQgT2N0IDIwMjIgMTE6NTA6?=
 =?UTF-8?B?MDAgKzAyMDAiKQ==?=
References: <5574B0A6-E5B0-47AD-AC8A-34962043D35E@HIDDEN>
X-Hashcash: 1:20:221124:mattias.engdegard@HIDDEN::cs/TNbOnjhZ6vEvh:0NQ7
MIME-Version: 1.0
Date: Thu, 24 Nov 2022 12:01:37 -0800
Message-ID: <CADwFkmn5WtO8GS-c_Qz39X_ntz1viU08Exk1QQV9TgT4Oafbhg@HIDDEN>
Subject: Re: bug#58766: 29.0.50; Error in sqlite tests
To: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 58756
Cc: 58756 <at> debbugs.gnu.org, 58766 <at> debbugs.gnu.org,
 Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattias.engdegard@HIDDEN> writes:

> The recently added sqlite-returning test fails when the SQLite library
> does not implement RETURNING, added in 3.35.
>
> What about adding a Lisp function for retrieving the SQLite library
> version? It can be used to skip this particular test but would also be
> useful on its own.
>
> Proof-of-concept patch attached.

LGTM.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58756; Package emacs. Full text available.
Forcibly Merged 58756 58766. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) patch. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Oct 2022 09:50:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 24 05:50:11 2022
Received: from localhost ([127.0.0.1]:47128 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1omu5y-0004v9-W0
	for submit <at> debbugs.gnu.org; Mon, 24 Oct 2022 05:50:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:49200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1omu5w-0004v0-Bo
 for submit <at> debbugs.gnu.org; Mon, 24 Oct 2022 05:50:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1omu5v-0003DH-QL
 for bug-gnu-emacs@HIDDEN; Mon, 24 Oct 2022 05:50:07 -0400
Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mattias.engdegard@HIDDEN>)
 id 1omu5u-0004tC-6g
 for bug-gnu-emacs@HIDDEN; Mon, 24 Oct 2022 05:50:07 -0400
Received: by mail-lj1-x22b.google.com with SMTP id z24so2033511ljn.4
 for <bug-gnu-emacs@HIDDEN>; Mon, 24 Oct 2022 02:50:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=to:cc:date:message-id:subject:mime-version:from:sender:from:to:cc
 :subject:date:message-id:reply-to;
 bh=vVtxp6TmG9aH3TTBWGEQQcATWr2E0RxQtDN6ndiakos=;
 b=TKJEBprFyrloeq9hVF6YvgS51FwTNskZUqf0Qx5ms2rdvqUksvpAxBtOpRbHkgZocN
 T1n85KqGyOHxWZbBC9xI+QCrNt6oXGZgPCqFpYD23/gIa5GMo89AVTSKQvwtEts8BV4S
 5A2NqB0KBg7vArfHxw9c5RUzy1W7pIVmhFTkJMCRKiXThr2rgmH+02O+R9xczF7YOZAO
 RxLoxp36jrTb5YS9DnlaAgdugOKc+IksAFks7W4n+ywk5OQA1TTn7FhjulLG2ycqienR
 7rKLHWtIgJJQzpoLsBdZ645gJXc7h0K4Vztq13gjSlMZXhrtpeMD+tOV7OTFaJoL7B/B
 jy8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:cc:date:message-id:subject:mime-version:from:sender
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=vVtxp6TmG9aH3TTBWGEQQcATWr2E0RxQtDN6ndiakos=;
 b=NOeScrJ9AYVCEm4kOQyqFNL6Eo14iXdcH9dh6vMcyezVVT85mRy7lxLf0lB1bcFibO
 EtT/y+TdNJQ09OS+sPp3vb1F/MXzfLZApHDM+X51dBuK3Q47RLVONs0H60Jlx5zGYgQ6
 kHgdy2zDNONdsOIJNdf35tVEUcwyVdYYB9u3h5DOItaxVV1Lp3RMV7JpniedjpKCCg/7
 h+5/ZVXRIt/MLP+4nzWH1ujp+7je0YJbYiNwoUemwxQka0yydjOKkT4hk68W6vF4zX9v
 BLBYLfOa3Sez/0OvDhunULupNKr88G8F2fhRgyChwaUMu0bv+t7Vn957PAuEhqDE7ZrF
 taMg==
X-Gm-Message-State: ACrzQf2VSb3Au7L8u5caJt5UKL5QhYXoECS3OFlta/tSJHajVp0V5gey
 8a7qg/w2kvp2PtMxGlQSYyZxUdNrLqo=
X-Google-Smtp-Source: AMsMyM4wy3P1Ks/gC3wcLBvq+M+8AMX9Qyf1OEVLYqNE9BQqBk/zHvuhwmzI0vQmXzOOVsMc/D+gYQ==
X-Received: by 2002:a2e:b0cf:0:b0:277:903:2d4c with SMTP id
 g15-20020a2eb0cf000000b0027709032d4cmr1954292ljl.64.1666605003776; 
 Mon, 24 Oct 2022 02:50:03 -0700 (PDT)
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se.
 [188.150.171.209]) by smtp.gmail.com with ESMTPSA id
 w6-20020a05651234c600b00492e570e036sm4460947lfr.54.2022.10.24.02.50.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 24 Oct 2022 02:50:03 -0700 (PDT)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_4FAEE4CA-6F97-4BC3-9CBD-A7190CF85460"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: sqlite-returning tests fails with older SQLite library versions
Message-Id: <5574B0A6-E5B0-47AD-AC8A-34962043D35E@HIDDEN>
Date: Mon, 24 Oct 2022 11:50:00 +0200
To: Emacs Bug Report <bug-gnu-emacs@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
Received-SPF: pass client-ip=2a00:1450:4864:20::22b;
 envelope-from=mattias.engdegard@HIDDEN; helo=mail-lj1-x22b.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


--Apple-Mail=_4FAEE4CA-6F97-4BC3-9CBD-A7190CF85460
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

The recently added sqlite-returning test fails when the SQLite library =
does not implement RETURNING, added in 3.35.

What about adding a Lisp function for retrieving the SQLite library =
version? It can be used to skip this particular test but would also be =
useful on its own.

Proof-of-concept patch attached.


--Apple-Mail=_4FAEE4CA-6F97-4BC3-9CBD-A7190CF85460
Content-Disposition: attachment;
	filename=sqlite-version.diff
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="sqlite-version.diff"
Content-Transfer-Encoding: 7bit

diff --git a/src/sqlite.c b/src/sqlite.c
index 1526e344e5..761ddc8361 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -52,6 +52,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_bind_null, (sqlite3_stmt*, int));
 DEF_DLL_FN (SQLITE_API int, sqlite3_bind_int, (sqlite3_stmt*, int, int));
 DEF_DLL_FN (SQLITE_API const char*, sqlite3_errmsg, (sqlite3*));
 DEF_DLL_FN (SQLITE_API const char*, sqlite3_errstr, (int));
+DEF_DLL_FN (SQLITE_API const char*, sqlite3_libversion, (void));
 DEF_DLL_FN (SQLITE_API int, sqlite3_step, (sqlite3_stmt*));
 DEF_DLL_FN (SQLITE_API int, sqlite3_changes, (sqlite3*));
 DEF_DLL_FN (SQLITE_API int, sqlite3_column_count, (sqlite3_stmt*));
@@ -90,6 +91,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension,
 # undef sqlite3_bind_int
 # undef sqlite3_errmsg
 # undef sqlite3_errstr
+# undef sqlite3_libversion
 # undef sqlite3_step
 # undef sqlite3_changes
 # undef sqlite3_column_count
@@ -115,6 +117,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension,
 # define sqlite3_bind_int fn_sqlite3_bind_int
 # define sqlite3_errmsg fn_sqlite3_errmsg
 # define sqlite3_errstr fn_sqlite3_errstr
+# define sqlite3_libversion fn_sqlite3_libversion
 # define sqlite3_step fn_sqlite3_step
 # define sqlite3_changes fn_sqlite3_changes
 # define sqlite3_column_count fn_sqlite3_column_count
@@ -143,6 +146,7 @@ load_dll_functions (HMODULE library)
   LOAD_DLL_FN (library, sqlite3_bind_int);
   LOAD_DLL_FN (library, sqlite3_errmsg);
   LOAD_DLL_FN (library, sqlite3_errstr);
+  LOAD_DLL_FN (library, sqlite3_libversion);
   LOAD_DLL_FN (library, sqlite3_step);
   LOAD_DLL_FN (library, sqlite3_changes);
   LOAD_DLL_FN (library, sqlite3_column_count);
@@ -737,6 +741,15 @@ DEFUN ("sqlite-finalize", Fsqlite_finalize, Ssqlite_finalize, 1, 1, 0,
   return Qt;
 }
 
+DEFUN ("sqlite-version", Fsqlite_version, Ssqlite_version, 0, 0, 0,
+       doc: /* SQLite library version string.  */)
+  (void)
+{
+  if (!init_sqlite_functions ())
+    error ("sqlite support is not available");
+  return build_string (sqlite3_libversion ());
+}
+
 #endif /* HAVE_SQLITE3 */
 
 DEFUN ("sqlitep", Fsqlitep, Ssqlitep, 1, 1, 0,
@@ -788,6 +801,7 @@ syms_of_sqlite (void)
   defsubr (&Ssqlite_columns);
   defsubr (&Ssqlite_more_p);
   defsubr (&Ssqlite_finalize);
+  defsubr (&Ssqlite_version);
   DEFSYM (Qset, "set");
   DEFSYM (Qfull, "full");
 #endif
diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el
index be4f60ab57..e9ddf9c0be 100644
--- a/test/src/sqlite-tests.el
+++ b/test/src/sqlite-tests.el
@@ -243,6 +243,7 @@ sqlite-blob
 
 (ert-deftest sqlite-returning ()
   (skip-unless (sqlite-available-p))
+  (skip-unless (version<= "3.35" (sqlite-version)))
   (let (db)
     (progn
       (setq db (sqlite-open))

--Apple-Mail=_4FAEE4CA-6F97-4BC3-9CBD-A7190CF85460--




Acknowledgement sent to Mattias Engdegård <mattias.engdegard@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#58756; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 24 Nov 2022 20:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.