From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#58756: sqlite-returning tests fails with older SQLite library versions Date: Mon, 24 Oct 2022 11:50:00 +0200 Message-ID: <5574B0A6-E5B0-47AD-AC8A-34962043D35E@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_4FAEE4CA-6F97-4BC3-9CBD-A7190CF85460" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14431"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: 58756@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 12:22:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omubB-0003b1-EA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 12:22:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omu7C-0003dg-F9; Mon, 24 Oct 2022 05:51:27 -0400 Original-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 ) id 1omu6p-0003U3-7y for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 05:51:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omu6o-0005eF-0v for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 05:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omu6n-0004wT-S4 for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 05:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2022 09:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58756 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.166660501118923 (code B ref -1); Mon, 24 Oct 2022 09:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2022 09:50:11 +0000 Original-Received: from localhost ([127.0.0.1]:47128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omu5y-0004v9-W0 for submit@debbugs.gnu.org; Mon, 24 Oct 2022 05:50:11 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omu5w-0004v0-Bo for submit@debbugs.gnu.org; Mon, 24 Oct 2022 05:50:09 -0400 Original-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 ) id 1omu5v-0003DH-QL for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 05:50:07 -0400 Original-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 ) id 1omu5u-0004tC-6g for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 05:50:07 -0400 Original-Received: by mail-lj1-x22b.google.com with SMTP id z24so2033511ljn.4 for ; 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) Original-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) X-Mailer: Apple Mail (2.3654.120.0.1.13) Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=mattias.engdegard@gmail.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246100 Archived-At: --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--