unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58756: sqlite-returning tests fails with older SQLite library versions
@ 2022-10-24  9:50 Mattias Engdegård
  2022-11-24 20:01 ` bug#58766: 29.0.50; Error in sqlite tests Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2022-10-24  9:50 UTC (permalink / raw)
  To: 58756; +Cc: Lars Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

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.


[-- Attachment #2: sqlite-version.diff --]
[-- Type: application/octet-stream, Size: 2727 bytes --]

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))

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* bug#58766: 29.0.50; Error in sqlite tests
@ 2022-10-24 17:04 Steve Downey
  2022-10-27 16:20 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Steve Downey @ 2022-10-24 17:04 UTC (permalink / raw)
  To: 58766

[-- Attachment #1: Type: text/plain, Size: 14425 bytes --]

When running tests in a clean build of the trunk I'm seeing a failure

Test sqlite-returning backtrace:
  signal(error ("SQL logic error (near \"RETURNING\": syntax error)"))
  apply(signal (error ("SQL logic error (near \"RETURNING\": syntax er
  #f(compiled-function () #<bytecode -0x16449576758bbd7e>)()
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name sqlite-returning :documentation nil :
  ert-run-or-rerun-test(#s(ert--stats :selector (not (or ... ...)) :te
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  command-line-1(("-L" ":." "-l" "ert" "-l" "src/sqlite-tests" "--eval
  command-line()
  normal-top-level()
Test sqlite-returning condition:
    (error "SQL logic error (near \"RETURNING\": syntax error)")
   FAILED   9/11  sqlite-returning (0.000294 sec) at src/sqlite-tests.el:244

This is on Ubuntu 20.04 with sqlite3 version 3.31.1

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2022-10-24 built on R9100817
Repository revision: 8f16578c45fc1d23aacecdb48111f816088c7b83
Repository branch: master
System Description: Ubuntu 20.04.5 LTS

Configured using:
 'configure --prefix=/home/sdowney/install/emacs-wayland/
 --with-imagemagick --with-json --with-native-compilation
 --with-file-notification=yes CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10
 --with-pgtk --with-gconf'

Configured features:
ACL CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  TeX-PDF-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-controls-mode: t
  dap-ui-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  pyvenv-mode: t
  display-time-mode: t
  eval-sexp-fu-flash-mode: t
  js2-imenu-extras-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  company-statistics-mode: t
  global-company-mode: t
  company-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  exordium-global-git-gutter-mode: t
  which-key-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  projectile-mode: t
  async-bytecomp-package-mode: t
  highlight-symbol-nav-mode: t
  global-hl-line-mode: t
  recentf-mode: t
  exordium-global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  global-delete-trailing-whitespace-mode: t
  delete-trailing-whitespace-mode: t
  cua-mode: t
  shell-dirtrack-mode: t
  windmove-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  savehist-mode: t
  desktop-save-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/sdowney/.emacs.d/elpa-29.0.50/transient-20221020.1019/transient hides
/home/sdowney/install/emacs-wayland/share/emacs/29.0.50/lisp/transient

Features:
(shadow sort mail-extr emacsbug conf-mode make-mode plain-tex font-latex
latexenc preview latex-mode-expansions latex latex-flymake tex-ispell
tex-style tex texmathp tex-mode lsp-diagnostics lsp-headerline lsp-icons
lsp-modeline dap-mouse dap-ui bui bui-list bui-info bui-entry bui-core
bui-history bui-button bui-utils lsp-lens dap-mode dap-tasks dap-launch
posframe dap-overlays modern-cpp-font-lock lsp-ui lsp-ui-flycheck
lsp-ui-doc goto-addr lsp-ui-imenu lsp-ui-peek lsp-ui-sideline
lsp-ui-util face-remap view lsp-zig lsp-steep lsp-svelte lsp-sqls
lsp-ruby-syntax-tree lsp-yaml lsp-xml lsp-vimscript lsp-vhdl lsp-volar
lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v lsp-typeprof lsp-ttcn3
lsp-toml lsp-terraform lsp-tex lsp-sorbet lsp-solargraph lsp-rust lsp-rf
lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh
lsp-php lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml
lsp-magik lsp-nix lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown
lsp-lua lsp-kotlin lsp-json lsp-javascript lsp-idris lsp-haxe lsp-groovy
lsp-hack lsp-graphql lsp-gleam lsp-go lsp-completion lsp-gdscript
lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir
lsp-elm lsp-dockerfile lsp-docker lsp-dhall lsp-d lsp-css lsp-csharp
lsp-crystal lsp-cmake lsp-clojure lsp-treemacs lsp-treemacs-generic
lsp-treemacs-themes treemacs-treelib lsp-semantic-tokens lsp-clangd
lsp-beancount lsp-bash lsp-ansible lsp-angular lsp-ada lsp-actionscript
disp-table page-break-lines dockerfile-mode sh-script smie executable
org-eldoc org-special-block-extras lf image-file image-converter ol-eww
eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr
pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start
gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec
gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view
jka-compr ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi scroll-lock
dired-aux sphinx-doc vc-git vc-dispatcher init-powerline init-themes
all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons powerline
powerline-separators powerline-themes ido-completing-read+ memoize
minibuf-eldef init-lsp init-docker xterm-color auto-package-update
rust-utils rust-mode rust-rustfmt rust-playpen rust-compile rust-cargo
haskell-mode haskell-cabal haskell-utils haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme
haskell-align-imports haskell-complete-module haskell-ghc-support
dabbrev haskell-customize pylint highlight-indentation flymake-proc
flymake elpy elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util elpy-shell elpy-profile
elpy-django elpy-refactor hideshow org-re-reveal ox-bibtex ob-plantuml
company-graphviz-dot graphviz-dot-mode clang-format xml midnight
calc-ext time google-c-style modus-vivendi-theme modus-operandi-theme
modus-themes toolkit-tramp dev-tramp lsp-mode lsp-protocol spinner
network-stream lv ewoc init-iwyu init-groovy init-elisp eval-sexp-fu
highlight facemenu init-ruby init-python init-javascript
js2-imenu-extras js2-mode-expansions js2-mode js-mode-expansions js
init-rtags-cdb init-rtags-cmake init-rtags-helm flycheck helm-rtags
init-rtags company-rtags company-oddmuse company-keywords company-etags
etags fileloop company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company-statistics company rtags popup
repeat asm-mode magit-bookmark treemacs-bookmarks bookmark init-gdb
gdb-mi bindat gud init-yasnippet yasnippet init-bde-style init-cpp cpp
iedit iedit-lib init-xml init-org ox-gfm ox-beamer ox-md ox-odt rng-loc
rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda org-refile
ox-html table ox-ascii ox-publish ox org-superstar ob-dot ob-C
cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine ob-python python-el-fgallina-expansions python
ob-shell ob-ruby ob-perl the-org-mode-expansions org-element avl-tree
generator org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob-core ob-eval org-table
oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs init-markdown impatient-mode htmlize simple-httpd
init-shell init-prog-mode init-flb-mode init-forge forge-list
forge-commands forge-semi forge-bitbucket buck forge-gogs gogs
forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub url-http url-gw nsm url-auth gnutls forge-notify
forge-revnote forge-pullreq forge-issue forge-topic yaml bug-reference
forge-post markdown-mode edit-indirect noutline outline forge-repo forge
forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff diff-mode git-commit log-edit message sendmail
yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log magit-core magit-autorevert autorevert magit-margin
magit-transient magit-process with-editor magit-mode magit-git
magit-base magit-section crm compat-27 compat-26 let-alist
init-git-visit-diffs init-git git-gutter-fringe fringe-helper git-gutter
transient compat compat-macs init-dired find-dired wdired init-help
helpful cc-langs cc-vars cc-defs trace edebug debug backtrace info-look
find-func f f-shortdoc shortdoc help-fns radix-tree which-key init-helm
helm-swoop helm-ag helm-descbinds init-helm-projectile
treemacs-projectile treemacs treemacs-header-line treemacs-compatibility
treemacs-mode treemacs-interface treemacs-extensions
treemacs-mouse-interface treemacs-tags imenu xref project
treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode
treemacs-rendering treemacs-annotations treemacs-async
treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-scope pulse color treemacs-faces
treemacs-icons treemacs-themes treemacs-core-utils pfuture inline ht
treemacs-logging treemacs-customization treemacs-macros helm-projectile
tramp-sh projectile lisp-mnt grep compile text-property-search ibuf-ext
ibuffer ibuffer-loaddefs helm-rg derived helm-files image-dired
image-dired-tags image-dired-external image-dired-util xdg image-mode
dired dired-loaddefs exif filenotify docker-tramp tramp-cache time-stamp
tramp tramp-loaddefs trampver tramp-integration cus-edit pp cus-load
files-x tramp-compat parse-time iso8601 time-date ls-lisp helm-buffers
helm-occur helm-tags helm-locate helm-grep helm-regexp format-spec
helm-utils helm-help helm-types helm helm-global-bindings helm-easymenu
helm-core async-bytecomp helm-source helm-multi-match helm-lib async
init-company init-highlight hi-lock highlight-symbol hl-line init-ido
recentf tree-widget wid-edit ido init-util pcase
display-fill-column-indicator goto-chg elisp-refs s dash
init-window-manager ace-window avy init-linum display-line-numbers
init-font-lock init-look-and-feel vlf-setup expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom cua-base default-text-scale evil evil-keybindings
evil-integration evil-maps evil-commands reveal flyspell ispell
evil-jumps evil-command-window evil-search evil-ex shell pcomplete
comint ansi-osc ansi-color evil-types evil-macros evil-repeat
evil-states evil-core evil-common windmove calc calc-loaddefs calc-macs
thingatpt rect evil-digraphs evil-vars ring edmacro kmacro delsel
elec-pair init-desktop saveplace savehist desktop frameset
init-progress-bar server init-prefs init-environment init-lib diminish
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
all-the-icons-autoloads auctex-autoloads tex-site dap-mode-autoloads
company-autoloads enh-ruby-mode-autoloads evil-autoloads
closql-autoloads emacsql-sqlite-autoloads emacsql-autoloads
helm-ag-autoloads flycheck-autoloads helm-autoloads helm-core-autoloads
async-autoloads ido-completing-read+-autoloads comp comp-cstr warnings
icons cl-extra help-mode js2-mode-autoloads json-mode-autoloads rx
json-snatcher-autoloads lsp-treemacs-autoloads lsp-mode-autoloads
magit-autoloads magit-section-autoloads memoize-autoloads
modus-themes-autoloads org-re-reveal-autoloads popup-autoloads
transient-autoloads treemacs-autoloads posframe-autoloads dash-autoloads
projectile-autoloads use-package-autoloads info xterm-color-autoloads
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
password-cache json subr-x map byte-opt gv bytecomp byte-compile cconv
url-vars cl-loaddefs cl-lib advice rmc iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 2035960 828993)
 (symbols 48 90183 106)
 (strings 32 511566 135497)
 (string-bytes 1 16021644)
 (vectors 16 261941)
 (vector-slots 8 4470850 3259295)
 (floats 8 2250 8028)
 (intervals 56 36984 9382)
 (buffers 1000 103))

[-- Attachment #2: Type: text/html, Size: 15500 bytes --]

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

end of thread, other threads:[~2022-11-25 10:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24  9:50 bug#58756: sqlite-returning tests fails with older SQLite library versions Mattias Engdegård
2022-11-24 20:01 ` bug#58766: 29.0.50; Error in sqlite tests Stefan Kangas
2022-11-25 10:18   ` bug#58756: " Mattias Engdegård
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 17:04 Steve Downey
2022-10-27 16:20 ` Eli Zaretskii
2022-10-27 16:29   ` Steve Downey
2022-10-27 17:20     ` Eli Zaretskii
2022-10-27 17:27       ` Steve Downey

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).