From unknown Fri Jun 20 05:37:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54591 <54591@debbugs.gnu.org> To: bug#54591 <54591@debbugs.gnu.org> Subject: Status: 29.0.50; sqlite-select returns blob result as multibyte string Reply-To: bug#54591 <54591@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:37:15 +0000 retitle 54591 29.0.50; sqlite-select returns blob result as multibyte string reassign 54591 emacs submitter 54591 Yuan Fu severity 54591 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 01:49:32 2022 Received: (at submit) by debbugs.gnu.org; 27 Mar 2022 05:49:32 +0000 Received: from localhost ([127.0.0.1]:55092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYLmN-00013m-SR for submit@debbugs.gnu.org; Sun, 27 Mar 2022 01:49:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:53314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYLmL-00013d-DH for submit@debbugs.gnu.org; Sun, 27 Mar 2022 01:49:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYLmL-0000wd-2B for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2022 01:49:29 -0400 Received: from [2607:f8b0:4864:20::435] (port=38604 helo=mail-pf1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYLmH-0005s6-DT for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2022 01:49:27 -0400 Received: by mail-pf1-x435.google.com with SMTP id b15so9839010pfm.5 for ; Sat, 26 Mar 2022 22:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=slDXRnLgA4vK/m+XpqfB9NL2kJYCQVOFiw+IcPcwqT8=; b=KxXC73ZthRS+icWlTrgtjccIBfeRpzORrkSSZ+GgG/NIBlpA8dvaCaf520pjCuXvd/ 3kJ4qxMGelqfwFUzSY3j3HE/WpQTpWOrny56YzwZVCuWv28ErrA27BSUTzuS9gSMsPBB XBHNveGxHG+ub5FLogwJ7yoWJVzm3Sa2zmNI9sicNwCQScTgpmm7UOsrO6BFfOkPq4Dj FoHztSGlF/gvxrxppZJwMldjSoMEglmKwiiYml/1svbD3A3EYBHjRquvYreXEzhBnsd1 qSjarn3rXQ5LJNjcmBG6agLOo68PnAyrlixCPsG2pBdrrG7RrgFLGZi46FtMgD1mIx1L mjbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=slDXRnLgA4vK/m+XpqfB9NL2kJYCQVOFiw+IcPcwqT8=; b=PJLF+QTIAKhbjFWHflKIb1psZKkRpBVX4fC3UhYwN3xS6LMomBa6YPA8NrM6VYD6kk B897imnlgGfg6gwRjg2CsUu+PB0J0w2XWW2k14Ht1K2PCASxUjBjQ/o8bdZ/HeD+BuR4 FhL+XNw8EiL5pRV7qyybfYZpLVpGkCu5PTySn9mXfCzB6l6M2a0WCFgD+qvX4eyzJkQf dzi0s4rb4NJJtE9EYgSEEkzWQOQrDMPYoBxnLGOC03Sa43nkZWwDunW8zHyT/Y1dtitw +uOMS7qSFwjXAyg976rwy3Uq4rpLHeFBXmr+dwEUwNRB1rCn9a6gXv1Yog63EzjQYT+V lw4A== X-Gm-Message-State: AOAM531GH3s3wZ/e0CsmHh7mA3TE7lVVyH8XqQQaYA56OzDD0EFs69bN wSe21tPXdD7wJX9WPCUV4uK+YU4B5C0vVg== X-Google-Smtp-Source: ABdhPJxBR58Ax7FNiqrwjLfXPeBqm4rzHNRA/Lf+qxMjgTIC5ZDqDpOoc30o98ftQfSVIeX9syFe8Q== X-Received: by 2002:a05:6a00:e8e:b0:4fa:a52f:59cf with SMTP id bo14-20020a056a000e8e00b004faa52f59cfmr17231943pfb.84.1648360162730; Sat, 26 Mar 2022 22:49:22 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:2ec7:8c90:3de5:f87:f35e:da25]) by smtp.gmail.com with ESMTPSA id e12-20020a056a001a8c00b004fab88d7de8sm11426064pfv.132.2022.03.26.22.49.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Mar 2022 22:49:22 -0700 (PDT) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: 29.0.50; sqlite-select returns blob result as multibyte string Message-Id: Date: Sat, 26 Mar 2022 22:49:21 -0700 To: Bug Report Emacs X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::435 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=casouri@gmail.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I=E2=80=99m trying make use of sqlite functionalities added recently and = found that the query result of blob type entries are multibyte string rather than unibyte. That caused issues when I tried to create image out of the query result: the image appears to be broken, even though the data is good. Adding string-as-unibyte solves the issue, but I guess the return value of a blob entry is probably best to be unibyte by default? Yuan In GNU Emacs 29.0.50 (build 7, x86_64-apple-darwin21.3.0, NS = appkit-2113.30 Version 12.2.1 (Build 21D62)) of 2022-03-12 built on Brown Repository revision: 22dde4e621fb49b9f05d560aee22332ad60bf485 Repository branch: master Windowing system distributor 'Apple', version 10.3.2113 System Description: macOS 12.3 Configured using: 'configure --with-pdumper=3Dyes --with-ns' Configured features: ACL DBUS GLIB GNUTLS JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: hexl-follow-ascii: t override-global-mode: t emms-mode-line-mode: t emms-playing-time-display-mode: t emms-playing-time-mode: t global-git-commit-mode: t shell-dirtrack-mode: t keyfreq-mode: t form-feed-mode: t diff-hl-mode: t after-save-mode: t undo-hl-mode: t consult-binded-mode: t pixel-scroll-precision-mode: t global-so-long-mode: t color-outline-mode: t selectrum-prescient-mode: t minibuffer-electric-default-mode: t which-function-mode: t yas-global-mode: t yas-minor-mode: t flymake-mode: t flyspell-mode: t ws-butler-mode: t savehist-mode: t windmove-mode: t global-hl-todo-mode: t hl-todo-mode: t global-highlight-parentheses-mode: t highlight-parentheses-mode: t rainbow-delimiters-mode: t electric-pair-mode: t winner-mode: t aggressive-indent-mode: t recentf-mode: t which-key-mode: t company-mode: t outline-minor-mode: t selectrum-mode: t luna-key-override-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-quote-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 auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t hs-minor-mode: t Load-path shadows: /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-compat hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-compat /Users/yuan/.emacs.d/ranch/matlab-emacs/company-matlab-shell hides = /Users/yuan/.emacs.d/ranch/matlab/company-matlab-shell /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-cgen hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-cgen /Users/yuan/.emacs.d/ranch/matlab-emacs/semanticdb-matlab hides = /Users/yuan/.emacs.d/ranch/matlab/semanticdb-matlab /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-shell-gud hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-shell-gud /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-topic hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-topic /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-maint hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-maint /Users/yuan/.emacs.d/ranch/matlab-emacs/srecode-matlab hides = /Users/yuan/.emacs.d/ranch/matlab/srecode-matlab /Users/yuan/.emacs.d/ranch/matlab-emacs/linemark hides = /Users/yuan/.emacs.d/ranch/matlab/linemark /Users/yuan/.emacs.d/ranch/matlab-emacs/mlint hides = /Users/yuan/.emacs.d/ranch/matlab/mlint /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-shell hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-shell /Users/yuan/.emacs.d/ranch/matlab-emacs/semantic-matlab hides = /Users/yuan/.emacs.d/ranch/matlab/semantic-matlab /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-publish hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-publish /Users/yuan/.emacs.d/ranch/matlab-emacs/tlc hides = /Users/yuan/.emacs.d/ranch/matlab/tlc /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab hides = /Users/yuan/.emacs.d/ranch/matlab/matlab /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-complete hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-complete /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-netshell hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-netshell /Users/yuan/.emacs.d/ranch/matlab-emacs/cedet-matlab hides = /Users/yuan/.emacs.d/ranch/matlab/cedet-matlab /Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-mode-pkg hides = /Users/yuan/.emacs.d/ranch/matlab/matlab-mode-pkg /Users/yuan/.emacs.d/ranch/iscroll/iscroll hides = /Users/yuan/.emacs.d/elpa/iscroll-20210128.1938/iscroll /Users/yuan/.emacs.d/elpa/transient-20211105.100/transient hides = /Users/yuan/emacs-head/nextstep/Emacs.app/Contents/Resources/lisp/transien= t Features: (shadow mail-extr emacsbug sendmail hexl ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util tunes sql vundo-test thai-util thai-word deft vuiet mpv bind-key versuri lastfm elquery memoize esqlite esxml-query anaphora request pcsv org-timer org-clock cal-move valign org-tempo tempo whitespace olivetti org-element avl-tree generator ol-eww eww xdg 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 url-file url-dired gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview doc-view ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi emms-player-vlc emms-player-mpv emms-player-mplayer emms-setup emms-librefm-stream emms-playlist-limit emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser emms-player-xine emms-player-mpd emms-lyrics emms-streams emms-show-all emms-tag-editor emms-tag-tracktag emms-mark emms-info-native emms-info-exiftool emms-info-tinytag emms-info-metaflac emms-info-opusinfo emms-info-ogginfo emms-info-mp3info tq emms-mode-line emms-url emms-librefm-scrobbler bindat sort emms-playlist-sort emms-last-played emms-volume emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-playlist-mode emms-source-playlist emms-source-file locate emms-cache emms-playing-time emms-player-simple emms-info emms-later-do emms emms-compat tar-mode arc-mode archive-mode finder skeleton autoinsert ftable cl-print consult-imenu vundo markdown-mode tramp-archive tramp-gvfs dbus tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat parse-time ls-lisp cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs goggles pulse mm-archive gnutls network-stream url-http url-gw nsm url-cache url-auth bklink xapian-lite flique xeft bug-reference iimg quanjiao magit-extras magit-imenu git-rebase magit-patch-changelog magit-patch magit-bookmark 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 magit-diff smerge-mode diff git-commit log-edit message yank-media rmc 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 magit-core magit-autorevert magit-margin magit-transient magit-process with-editor shell magit-mode transient edmacro magit-git magit-section magit-utils stimmung-themes-light-theme dired-aux autorevert dired+ misearch multi-isearch view tildify table rst rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-util nxml-enc xmltok refer refer-to-bibtex refbib printing picture nroff-mode enriched disp-table facemenu ebnf2ps ps-print ps-print-loaddefs ps-def lpr delim-col rect bib-mode cus-theme eieio-custom xwidget image-mode dired dired-loaddefs exif wid-browse autoload checkdoc lisp-mnt char-fold server descr-text cus-start face-remap add-log keyfreq form-feed diff-hl log-view pcvs-util vc-dir hideshow after-save undo-hl company-dabbrev-code company-dabbrev company-files company-capf vc-mtn vc-hg vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher cus-edit pale-theme pixel-scroll so-long cus-load kinsoku jka-compr cyberpunk-theme light-theme theme-util exec-path-from-shell svg dom xml ghelp ghelp-eglot ghelp-helpful ghelp-builtin derived color-outline pause utility transform no-littering selectrum-prescient prescient consult-selectrum selectrum minibuf-eldef crm consult kmacro bookmark which-func yasnippet eglot array filenotify jsonrpc ert pp ewoc debug xref flymake-proc flymake warnings compile text-property-search project flycheck flyspell ispell expand-region text-mode-expansions the-org-mode-expansions er-basic-expansions thingatpt expand-region-core expand-region-custom ws-butler minions savehist buffer-move windmove hl-todo highlight-parentheses rainbow-delimiters elec-pair winner aggressive-indent swiper cl-extra ivy delsel ivy-faces ivy-overlay colir color recentf-ext recentf tree-widget wid-edit which-key company helpful imenu trace edebug backtrace info-look f elisp-refs s dash org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex iso8601 time-date ol org-keys oc org-compat advice org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs finder-inf tex-site geiser-impl help-fns radix-tree help-mode geiser-custom geiser-base ring proof-site proof-autoloads rx info lunary luna-key easy-mmode luna-load-package pcase cowboy luna-f package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 cl-generic 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 simple abbrev obarray cl-preloaded nadvice button 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 kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 1458806 1449475) (symbols 48 50357 132) (strings 32 263811 152581) (string-bytes 1 8256315) (vectors 16 98731) (vector-slots 8 2508183 1231269) (floats 8 937 5080) (intervals 56 105594 39459) (buffers 992 134)) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 02:40:37 2022 Received: (at 54591) by debbugs.gnu.org; 27 Mar 2022 06:40:37 +0000 Received: from localhost ([127.0.0.1]:55101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYMZp-0002Wv-9N for submit@debbugs.gnu.org; Sun, 27 Mar 2022 02:40:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYMZo-0002Wi-2S for 54591@debbugs.gnu.org; Sun, 27 Mar 2022 02:40:36 -0400 Received: from [2001:470:142:3::e] (port=39674 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYMZi-0003yl-Qq; Sun, 27 Mar 2022 02:40:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5FpXj9XRmCQhv+9AzoUOuze/Iff6aBMrvvLM7eOq/Lk=; b=iINFIyOFEFaqMbLunVfC RI0tCqdKjfDN/L8UJaGx9uln4uhtAj4chJfLE4Gp84E5fYfHKNvjwoun3wBLqwpQLzcGqXWMGZd+n btZJymK0P1HPVM4q4E3Pb0xAXkoZUI3/2L8ZmDghlLlnojsLoh+RJs80wmXT0Zc2XXTrZ3hWZbm5x uFrUW6cUareI0cVpq1Xkr/UFHO32muqGmRHuxN9p7jDq1Z1j52UU9iN1hbmhci67cJE7NbIKMwDdV TchyW4xvm482mlGq+6keT585DnRpNyD+O7WDQU82LaoPdGzD/yZpb9HNUP8Tn7KQ65dTKrKBgn3aB iNnEsHe+Lxr8uQ==; Received: from [87.69.77.57] (port=1629 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYMZi-000103-Aa; Sun, 27 Mar 2022 02:40:30 -0400 Date: Sun, 27 Mar 2022 09:40:29 +0300 Message-Id: <83h77jaof6.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: (message from Yuan Fu on Sat, 26 Mar 2022 22:49:21 -0700) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Sat, 26 Mar 2022 22:49:21 -0700 > > > I’m trying make use of sqlite functionalities added recently and found > that the query result of blob type entries are multibyte string rather > than unibyte. That caused issues when I tried to create image out of the > query result: the image appears to be broken, even though the data is > good. Adding string-as-unibyte solves the issue, but I guess the > return value of a blob entry is probably best to be unibyte by default? If we want to support non-text data in a blob, then yes, I think you are right. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 08:04:58 2022 Received: (at 54591) by debbugs.gnu.org; 27 Mar 2022 12:04:58 +0000 Received: from localhost ([127.0.0.1]:55417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYRdh-0006rh-RC for submit@debbugs.gnu.org; Sun, 27 Mar 2022 08:04:58 -0400 Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:33297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYRdf-0006rT-La for 54591@debbugs.gnu.org; Sun, 27 Mar 2022 08:04:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1648382690; bh=XvpIX9VhrDlT3fJFeuJs5hqWSMIXqut2mZH7ndto6QE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=Q5v7+fpnqXa4tWOr5jsDE34GrmuhS9Efk0JBS72uE1TWb6cRb1rmKfwwW4MmqLygKd+sE4d9F6LZ+ET+N4VwOdT+sAY8REdBkCsIgB4PO4GRYXfEbXMZmohU9oWxCoLWVFmXMaXVENvIJbBhY6Il4Ge0v4CuJpvqOaaCLCgdo9pqzgYdIhN3iU7H7W8aUftY6YwVSnI/74Wc+tk8W+DInrEjymAZMESrfjmYMygG0tavwlkntRt3Hi8EM1zf5YcCasNfZhmh1rtXfGE9OVEt7IQgyy0f6li9d/clsnSRdlM2HLiYhyHdYaRTrbdtnkwz2SahxsgwJnBTi74KBtCO4w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1648382690; bh=7l2aK3Q/g+MYkSZC1W8cPgpZTxoiA951SxYYHjPvLHn=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oXYj/pa24Zhrtjp5CBG3h14Lt6LUDj0NOjBopbJ8t4aXcn8JRWZqCPtoVDPccW+2oFextbX70ba/ldpmvv8Z5n4ESdYOStTYWYDjyywajS9BuMi4ooUx31LMEDYU9t+QepANR7HXBxO5oPbVzVWpp6IpzKqdQPUz1Kp9V5AvCpoZ1FOzDyIVmMGIHa9AzgyLNylbWYfcqrZ6ckJXp0gqauZ+gH1U7lMav7rou5kH1fhitwfmSQDMw9DHskRkWUztyuhvoH0VLQzyUfTZ5QkeZD+LSyHTAbTeQ+2xh8pInOsZLNqTAtXBfhuEdXIQxBgYf/nbsfaEKsksE3Zu0y7Qgw== X-YMail-OSG: SucuTlkVM1mlk7k5rps3YjPC9YefAodA8Pl2xGuVPXJ_KXGbVB_mewiOnAjUBcT VPNEo34uEq9YKBWT91DLKlGU0iSCrJTi5UZhip50VSVQbywbK2o7jslvIjMxf67Yi6cGBqPMEfBB qM79TmemriRHL7zgjij6RrNqgtksNZwb3c6gjMQU5Lg8bszyfDV2nqK4r6FJ9ixnjW5XnjaUCPLP aA6YLSOgB5U48ehhZIoeEpTLvh093CmSBEKsLP68Oe3t76dxbaH887c4iXkrr2HdrCnWXTJl.9V2 KR0QvOvpRdeGPCTFdOyxZRGGYn7vLXC4rOGDGTvMjVUUxKdYbPkIudTFko7oUHPbzlrNPkeA8KZM 6QO.VVI6sqkPfPAEgv6HHT_ojDTkTQlceMXisjr.3oAy2r73S7.0o_wab0dTgpYP1HxJEgnIl7ZT SZl0HCap5up7jaGd6TUASYFaZRwBrYhU6OXWaPeDQxuHJWzxRLcyLwiR.QCvsBWVQ757Wv2OQzga z6RIPXVLoSt2pL6k1MWDIL7giFSPCf4GirGwE1PJ6jlUWyXTYfs13ZSao5ojkT5T5pzOO_UN0naD wjwwT4I2VgKxX_kzwXtoCvvzPMn8cfl.cM9QxMqbXAnCW8AfcteUxIkm_Ei2cL.ijjNF.yaeOsfk xmUh5o4pj_yhF2j1ogmI7ujHbPaXIc0tPSbE_rSnWmSBBqNVmyurl8xObCSAQqOFL9Z_lbtx4HNs egtsviG06V8cTdycuCZ26LZVrYbUAvS.RFMkrqJH0p3zn9gslEpVizSUBek.e5PnCC2qqGs0ezKm U4RPtSCyzXy4Q0yF3KBbqk1VTzlCV_4kGqGk23LAOU4WF7kNWjkjLnNdwI7BuV9fZ64YpT_P8VGS KB6pkgoIqPy4Tg_l2CQPB3Z.DiqHD9SFj6qabXoGQkV.Q5VpIrg83al79Cecj0GDOhQ.jZgb0v6z zyenXdWxlmhUhqip5RGJrgQn4S6pMIYXlZwz_OAA3yt1fKoxMrWFyh7LwEpgkiX9ufAS4mPJitCf SZVYt1jvaEV1lMtErg1bZCaq_.hIZVaEvdLJPmUNNy2Iot1vhEM6oTAR.wHiPOyKjkKfq67YS9gr ZNuNm.CmJYZZ6tjyFned3QApEGKejKJ_yIdd8F.GV48RPqPgDc8bxTl6HDReaGPhOg78rtsnV8I. Cizl8xU0OvMxLwRa5mTvMzrfg8NZ3rVSJ.Dph1ZyQ95dG1UkgOieNY739k5DRBFNLnEG9UvCLM6q O4wlEbtv4.vlX_ZhEDwzd6p6h0ENYp5XUKmoN0sHIdKmrH3KbjmriA7jHiM4HA_zBKdMP3iFl07j PA.8omk59B78aC0nL.pvxitaa9bAQb6Jp_T_LPB7dKr0m_PqojmLUcrHy.aBpU3XRjJb8.dnew7q Y2vW1PfYtVouf8dAXsVI_IGmXhLw16BnJD.TWvS797cyyai2M1lMO5K7PsOEmaqupLrJeMwyyIBq 975OUXplhIngv5U0IWP27tApX_kcmqgSSH_hTApXP9_o3pyAZIgRhWO7UFM79qu3dZRiD5Ub0ogG Sy3.888.gKCEoMsBoeSUHy7zMLGYbZyGolfLcntEWARnhQ6esLFfD_XqxCL8tvtOMZ2fH9rBRlV0 I7nl8fnv2yrUWlPf.bFyy.H5xlv9bJRHqNqDkiC.Hc1lJ3h0Ic.v8ntFeX_FJFrU5KqF3dwVcBt7 G.9PcW6KAi3gFIPxnBw0BzyVginggDlyeUUtdzEn.C4FdCR2kj.GdWz4YHkWeGoBXVtsc_udS8I5 mvh5kybhkQAeCbQW9yPBnngqnl25FG1Y1BhiKeU3pcGLNwGkOimpYnGGGQhOqL_PEIGhMjByfc_B H1PKBjelS3HRiNA6xIQ13YJTSMOsXRgpos0CeFG1050dpcBr.gqkyBGTQRbdWi3XGruTXwg5W6Fl JCo6KkMNqlcV_q3H97UKxQsLWzXRk0yb8NPtGuxrnmDP6.aTFoRkGQohdKAt02aHhGNsJIrpV4tS xaGbrsJ_fAyP7PYfWo6msQFa6sAL.GM0DeNOeQhgNkNN.mpoPeogZD1.SXZM22n24p6POjoCticM R59dM5Noeubo3AmiV1Ny_vuzuI7W7VPsyZFTuHd.jwRtAgUP11RGO2IUYcw8KvXqOo.MU8d0Zf.k P4D5kG94KQJv4pzLNBjr.CqDmtUa2uZK1LOm2FYBEn47RWvlzkAHFe3UriYNh2Bv4fOZrTyDsMIg HCbfMhLT7REo_oYFbL6F.y07Ck5cr5Aee20LqzhsCxZ3i6IC99E3HhTunYNbzpLE6tgE- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Sun, 27 Mar 2022 12:04:50 +0000 Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8ffee32df7e2c5011c29ba333128777a; Sun, 27 Mar 2022 12:04:47 +0000 (UTC) From: Po Lu To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> Date: Sun, 27 Mar 2022 20:04:41 +0800 In-Reply-To: <83h77jaof6.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Mar 2022 09:40:29 +0300") Message-ID: <87fsn338km.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.19987 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 420 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > If we want to support non-text data in a blob, then yes, I think you > are right. BTW, I thought things can go awry quickly if misformed sequences find their way into a multibyte string, so any data which isn't decoded or guaranteed to be valid in Emacs's internal superset of Unicode shouldn't be allowed to get into in a multibyte string. Is that correct? Thanks in advance. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 10:56:14 2022 Received: (at 54591) by debbugs.gnu.org; 27 Mar 2022 14:56:14 +0000 Received: from localhost ([127.0.0.1]:56415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYUJS-0002oC-AD for submit@debbugs.gnu.org; Sun, 27 Mar 2022 10:56:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYUJQ-0002nx-3A for 54591@debbugs.gnu.org; Sun, 27 Mar 2022 10:56:12 -0400 Received: from [2001:470:142:3::e] (port=45038 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYUJK-0000ue-P2; Sun, 27 Mar 2022 10:56:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Dt5KvJ/QB+q3tcq+DYJvEwWUHieXUOJqiUjkmyOl9sc=; b=johiYonc+WlE GK7z7Hs3kITGr8nFZX3qNgpZo+TtTy4wnE51G7gw+giHJF0L/cilRikCtDAXWTyrOWz9CNcnsrVY6 KSVF1WL/ZYLWevbr/LL2QLWlSeqSDGE8QvpI9LeUpsTFxgPeUqRQ8KMrrvPIwi5onCveNAA+/Aohg MNimSTIAL4uYDVWpMN/StPfhgHo+XSDmawjI/ouDFtTjBcUVgemqrYSgTD8fT0XDP5a/JlW4vXO2p 2tkKz+tOkyl4KZT0h5QiuZT9iiYwmU95ptNvIPj5np48Zil2U9yLSoc5c0GV1TpekcoBdkT50naNI MsFfdFjYQ41y8lYzE3m1fw==; Received: from [87.69.77.57] (port=4890 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYUJK-0000IH-1g; Sun, 27 Mar 2022 10:56:06 -0400 Date: Sun, 27 Mar 2022 17:56:05 +0300 Message-Id: <83czi7a1h6.fsf@gnu.org> From: Eli Zaretskii To: Po Lu In-Reply-To: <87fsn338km.fsf@yahoo.com> (message from Po Lu on Sun, 27 Mar 2022 20:04:41 +0800) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87fsn338km.fsf@yahoo.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, casouri@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Po Lu > Cc: Yuan Fu , 54591@debbugs.gnu.org > Date: Sun, 27 Mar 2022 20:04:41 +0800 > > Eli Zaretskii writes: > > > If we want to support non-text data in a blob, then yes, I think you > > are right. > > BTW, I thought things can go awry quickly if misformed sequences find > their way into a multibyte string, so any data which isn't decoded or > guaranteed to be valid in Emacs's internal superset of Unicode shouldn't > be allowed to get into in a multibyte string. > > Is that correct? No. Emacs converts any invalid byte sequences to raw bytes, which have a special internal representation that cannot harm us. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 10:38:54 2022 Received: (at 54591) by debbugs.gnu.org; 29 Mar 2022 14:38:54 +0000 Received: from localhost ([127.0.0.1]:33322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZCzm-0001Ta-IM for submit@debbugs.gnu.org; Tue, 29 Mar 2022 10:38:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZCzl-0001TK-2f for 54591@debbugs.gnu.org; Tue, 29 Mar 2022 10:38:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3bVxCPBGF61ONwSEUI22RvGx/HnJqGVVPb6Cj+CoAbQ=; b=oZG7MQ66OwtYk7FgVCmkiGrFw+ AyC4zdykIPiCXuidMAkSGm5NaNVWuwHQQk/M9d5Nfr58Cp7QfokpWGhNnl0v8V9ksiWqJwxKrJNTu TDhCGRPYNCPo9PzsMs4gy3fpkof7mr8QbHx/D+TdocD/P+BLZMUpE0OVk/NykNRtdqOE=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZCzb-0003n6-Tr; Tue, 29 Mar 2022 16:38:46 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> Date: Tue, 29 Mar 2022 16:38:43 +0200 In-Reply-To: <83h77jaof6.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Mar 2022 09:40:29 +0300") Message-ID: <87lewsakng.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> I’m trying make use of sqlite functionalities added recently and found >> that the query result of blob type entries are multibyte string rather >> than unibyte. That caused issues when I tried t [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> I=E2=80=99m trying make use of sqlite functionalities added recently and= found >> that the query result of blob type entries are multibyte string rather >> than unibyte. That caused issues when I tried to create image out of the >> query result: the image appears to be broken, even though the data is >> good. Adding string-as-unibyte solves the issue, but I guess the >> return value of a blob entry is probably best to be unibyte by default? > > If we want to support non-text data in a blob, then yes, I think you > are right. I'm not sure there's any way to do that reliably. If we change blob selections to not decode, then if you have create table if not exists test7 (col1 text, col2 blob) and then (format "insert into test7 values ('fo=C3=B3', '%s')" binary) will have to encode the entire string in utf-8, meaning you get garbage back when you select. (While today you get encoded binary back.) And if just say "well, don't do that, then; use prepared statements", then "insert into test7 values (?, ?)" ["foo" binary] could work... if we knew the type of the columns here, but I can't find any way to determine that on a statement that has been executed yet (sqlite3_column_type/sqlite3_column_decltype only seems to work on selects; perhaps I'm missing something -- anybody know?) We could then say "well, don't encode unibyte strings", but then we might be inserting that, unencoded, into a text column, and we'd be decoding when we get back, leading to more garbage. Finally, we could introduce a new syntax, like: "insert into test7 values (?, ?)" ["foo" (:binary binary)] or something, but... yuck. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 11:39:05 2022 Received: (at 54591) by debbugs.gnu.org; 29 Mar 2022 15:39:05 +0000 Received: from localhost ([127.0.0.1]:33416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZDw1-0007Ko-0m for submit@debbugs.gnu.org; Tue, 29 Mar 2022 11:39:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZDw0-0007KM-31 for 54591@debbugs.gnu.org; Tue, 29 Mar 2022 11:39:04 -0400 Received: from [2001:470:142:3::e] (port=39692 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZDvu-0001bO-Pc; Tue, 29 Mar 2022 11:38:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=gx1oEWegNHPmrfstAcNyvh+OTdGAJ9BSRS8TKF5rkmM=; b=WEeM+MCiTjIeqE7cHjbZ DaKHVcKCdSNWKsNqd0plUeaoD4L5HZp/T8cQAx5SOYKoHK0ZVu3A/7+FrQL4EY7NzWW0nRArdAXMt 0yqFbmL2MH3bneu9x0zPBqD7mEzgCd6vXEZ8ytaP9HrllT5RXWn/SApTuDpMuXSnpEMW6EYLDRkTH cgnhkj+ohKl6Q+PAWVPaJW0FWofOwwBlFdLrKtsr1o/nr+7Bdqvc+3azd+WhwAv27Qax4JnRr5gH0 8xnft2gi0yD2aJqZLBipGpCGG2+bKJmeHictnsNPLaDSQNFk+MoobWObJsCgNn+LPOjmcJAV5Molc 3OdRCbGf7dJkDw==; Received: from [87.69.77.57] (port=2732 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZDvq-0000qa-NN; Tue, 29 Mar 2022 11:38:58 -0400 Date: Tue, 29 Mar 2022 18:38:59 +0300 Message-Id: <83o81o93ak.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87lewsakng.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 29 Mar 2022 16:38:43 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, casouri@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Yuan Fu , 54591@debbugs.gnu.org > Date: Tue, 29 Mar 2022 16:38:43 +0200 > > > If we want to support non-text data in a blob, then yes, I think you > > are right. > > I'm not sure there's any way to do that reliably. If we change blob > selections to not decode, then if you have > > create table if not exists test7 (col1 text, col2 blob) > > and then > > (format "insert into test7 values ('foó', '%s')" binary) > > will have to encode the entire string in utf-8, meaning you get garbage > back when you select. (While today you get encoded binary back.) > > And if just say "well, don't do that, then; use prepared statements", > then > > "insert into test7 values (?, ?)" ["foo" binary] > > could work... if we knew the type of the columns here, but I can't find > any way to determine that on a statement that has been executed yet > (sqlite3_column_type/sqlite3_column_decltype only seems to work on > selects; perhaps I'm missing something -- anybody know?) Can we place the burden of knowing the type of the column on the caller? I mean, if they know it's a binary blob, they should tell us, and then we don't decode it? (Of course, if there's a way of knowing the type, we could DTRT automatically for each type.) From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 31 07:54:21 2022 Received: (at 54591) by debbugs.gnu.org; 31 Mar 2022 11:54:21 +0000 Received: from localhost ([127.0.0.1]:38120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZtNd-0007is-8v for submit@debbugs.gnu.org; Thu, 31 Mar 2022 07:54:21 -0400 Received: from quimby.gnus.org ([95.216.78.240]:53402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZtNb-0007id-Jn for 54591@debbugs.gnu.org; Thu, 31 Mar 2022 07:54:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XdT8atuDw7omr3TIwPQCAcUm/lInty3aeZsekZj2APc=; b=kFYoGSHIQdyHq+mx3ctLmGz8Zv Y8WaiVkaJQRaYiwayKk4a3a2UDasQrVjG8uOyuErvk4d0ufK81cWcwKW+ZsIlYed8JdmYyq+ZJuPb +AU+9Mz8bUhmPYrtNktYR2/9R28MO6oZAu0xDGUzcQdHXTegMOAWtS8B1PUzBd8kUYGE=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZtNS-0003DR-7C; Thu, 31 Mar 2022 13:54:12 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> Date: Thu, 31 Mar 2022 13:54:08 +0200 In-Reply-To: <83o81o93ak.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 29 Mar 2022 18:38:59 +0300") Message-ID: <87a6d672xr.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > Can we place the burden of knowing the type of the column on the > caller? I mean, if they know it's a binary blob, they should tell us, > and then we don't decode it? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, casouri@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > Can we place the burden of knowing the type of the column on the > caller? I mean, if they know it's a binary blob, they should tell us, > and then we don't decode it? We could -- that was my last example: >> "insert into test7 values (?, ?)" ["foo" (:binary binary)] Or some syntax like that. (And then never decode when we select from a BLOB column.) But... > (Of course, if there's a way of knowing the type, we could DTRT > automatically for each type.) Yes, I'm hoping somebody else could have a look at the sqlite documentation and tell me I'm missing some obvious way to get that information. :-) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 01 15:45:19 2022 Received: (at submit) by debbugs.gnu.org; 1 Apr 2022 19:45:19 +0000 Received: from localhost ([127.0.0.1]:43499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naNCx-0006Af-F6 for submit@debbugs.gnu.org; Fri, 01 Apr 2022 15:45:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:58350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naMa2-00056s-VL for submit@debbugs.gnu.org; Fri, 01 Apr 2022 15:05:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naMa2-0004Lw-Ou for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2022 15:05:06 -0400 Received: from ciao.gmane.io ([116.202.254.214]:56018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naMa1-0000bF-03 for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2022 15:05:06 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1naMZy-00050B-CP for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2022 21:05:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: =?utf-8?Q?Johannes_Gr=C3=B8dem?= Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Date: Fri, 01 Apr 2022 20:34:49 +0200 Message-ID: <878rso7iuu.fsf@flokut.localdomain> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:4jEeisvzLem5ZXSzzdEMN2DU7AI= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 Apr 2022 15:45:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Lars Ingebrigtsen writes: >> (Of course, if there's a way of knowing the type, we could DTRT >> automatically for each type.) > > Yes, I'm hoping somebody else could have a look at the sqlite > documentation and tell me I'm missing some obvious way to get that > information. :-) I might be misunderstanding the issue, but SQLite column types are more like documentation than actual rules to be enforced, unless STRICT tables are enabled. https://www.sqlite.org/datatype3.html In Python's SQLite3 API, ordinary strings are inserted as SQLite TEXTs and bytestrings are inserted as SQLite BLOBs, and returned as the same when you query. It's using a function similar to row_to_value for this, except that it for some reason doesn't switch on SQLITE_BLOB, it just calls sqlite3_column_blob and tests if it returns NULL or not and then it does a switch on the remaining types. Couldn't the Emacs interface just use vectors of byte values for BLOBs both ways? Or is there another data type that makes more sense? By the way, if you want to insert BLOBs in the query itself you can do it like this, but I guess this doesn't need Emacs support, except maybe a helper function for the conversion: INSERT INTO foo VALUES (X'deadcafe'); From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 01:31:46 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 05:31:46 +0000 Received: from localhost ([127.0.0.1]:44373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naWMT-00055E-Pv for submit@debbugs.gnu.org; Sat, 02 Apr 2022 01:31:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naWMS-000551-39 for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 01:31:44 -0400 Received: from [2001:470:142:3::e] (port=37516 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naWMM-00073j-8r; Sat, 02 Apr 2022 01:31:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=yevGowRo4oITWSvkMgPv+RlDCq4gHldBezBIvOQ6hCg=; b=mApzmKCpVrh8gNoIzmWf h+Xt0n1/689tXBkgTwcCbC1QojD90f7B5NehLu+vj1kiToKhY9uQIvTjN4wf+VLnc0Jl9ZGfxpvMh /z4jBUcySITjPFEsTi6uUbEjBRW7mVvGYT3aIU9a4C+7YGIXPEru+CatK3MOsTz5LlA71lfIbFvdD quQZtR00XUHaXvwbjqY2oVKv8574OzhNnoEcB4KZScA5hvAs7/KbNqAavwvps7W1c3KigtG+BwaY/ 3UoUXFxD6Gk48+SfVcZnXHCNHGeaZxOYXXMKGj6FMY53nOICsohDQB2H0RXEcGBNgndl/vYviGy9c 7yKxez+TxUdmwQ==; Received: from [87.69.77.57] (port=2873 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naWML-0002lq-9O; Sat, 02 Apr 2022 01:31:37 -0400 Date: Sat, 02 Apr 2022 08:31:52 +0300 Message-Id: <83r16g3vav.fsf@gnu.org> From: Eli Zaretskii To: Johannes =?iso-8859-1?Q?Gr=F8dem?= In-Reply-To: <878rso7iuu.fsf@flokut.localdomain> (message from Johannes =?iso-8859-1?Q?Gr=F8dem?= on Fri, 01 Apr 2022 20:34:49 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Johannes Grødem > Date: Fri, 01 Apr 2022 20:34:49 +0200 > > In Python's SQLite3 API, ordinary strings are inserted as SQLite TEXTs > and bytestrings are inserted as SQLite BLOBs, and returned as the same > when you query. It's using a function similar to row_to_value for this, > except that it for some reason doesn't switch on SQLITE_BLOB, it just > calls sqlite3_column_blob and tests if it returns NULL or not and then > it does a switch on the remaining types. This would be leaving the responsibility for the issue to the caller, I think. Does SQLite TEXT allow the superset of UTF-8 encoding Emacs uses internally to store characters that are not in Unicode? If it does, we could indeed assume that any BLOB is binary data and not attempt encoding/decoding it. > Couldn't the Emacs interface just use vectors of byte values for BLOBs > both ways? Why? Unibyte strings are easier and more flexible in Emacs. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 02:34:16 2022 Received: (at submit) by debbugs.gnu.org; 2 Apr 2022 06:34:16 +0000 Received: from localhost ([127.0.0.1]:44455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXKy-0006fK-3I for submit@debbugs.gnu.org; Sat, 02 Apr 2022 02:34:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:34816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXKv-0006fC-W8 for submit@debbugs.gnu.org; Sat, 02 Apr 2022 02:34:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXKm-0007iS-Il for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:34:13 -0400 Received: from ciao.gmane.io ([116.202.254.214]:48420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXKk-00080i-SO for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 02:34:04 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1naXKi-0007Sf-3C for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2022 08:34:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: =?utf-8?Q?Johannes_Gr=C3=B8dem?= Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Date: Sat, 02 Apr 2022 08:33:55 +0200 Message-ID: <87ilrsro30.fsf@flokut.localdomain> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <83r16g3vav.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:lfhhBYxomqWX0pPzWjQBotzayi0= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Eli Zaretskii writes: > This would be leaving the responsibility for the issue to the caller, > I think. I think that makes sense. > Does SQLite TEXT allow the superset of UTF-8 encoding Emacs uses > internally to store characters that are not in Unicode? If it does, we > could indeed assume that any BLOB is binary data and not attempt > encoding/decoding it. SQLite documentation says this... TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE). ...but it's still possible to store byte sequences that are not legal Unicode in there. This breaks the mentioned Python SQLite3 API, and possibly others, so maybe not great if someone wants to read tables from something else than Emacs. Python-SQLite3 will attempt to decode it as UTF8 unless cast as a blob: SELECT CAST(bad_text AS blob) FROM foo (It works with the sqlite3 CLI, though.) >> Couldn't the Emacs interface just use vectors of byte values for BLOBs >> both ways? > Why? Unibyte strings are easier and more flexible in Emacs. Sorry, just my lack of knowledge of Emacs types. Unibyte strings seem fine for this. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 02:52:26 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 06:52:26 +0000 Received: from localhost ([127.0.0.1]:44473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXcY-00077w-Gh for submit@debbugs.gnu.org; Sat, 02 Apr 2022 02:52:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naXcW-00077k-Ed for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 02:52:25 -0400 Received: from [2001:470:142:3::e] (port=38414 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXcQ-0002vk-R2; Sat, 02 Apr 2022 02:52:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=G9N/3+nOxDaV31SPg8N46FBUHH6Q2ak7ka8E42U8SCQ=; b=orO4PrazA1Zw3HHIc2oT wQsVW2OxPq6I6z+Pnhl4nsUi9kfAtzgj2OChJVKkawn43Ec4ctnZmsuf2A9oe3GmVuueecReW4mjA 1zEE9C42g8+StJfzMizmGBQuy3boyLV3R0WeQsMzTT7q91JaqmwExH+KGte2Iw2Bg/lz+5O6BqdGX F0EexqrIg9VbFPr1QzzWtuzVA5yYB1HzHFbVb+5Z7xhlEfHfUWF/s0lFAeF8N3lGLW6rVQ2Nq22+j RN/9vkhiqtgb65crAnFR/GQsWLZut/mWsxkFRp0qv/ycpsRcGjxVYQV5IS1xPGJmpTpTvK8pgOVPz nvGJ3z8QQu7PgQ==; Received: from [87.69.77.57] (port=3877 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naXcP-000407-IS; Sat, 02 Apr 2022 02:52:18 -0400 Date: Sat, 02 Apr 2022 09:52:31 +0300 Message-Id: <83lewo3rkg.fsf@gnu.org> From: Eli Zaretskii To: Johannes =?iso-8859-1?Q?Gr=F8dem?= In-Reply-To: <87ilrsro30.fsf@flokut.localdomain> (message from Johannes =?iso-8859-1?Q?Gr=F8dem?= on Sat, 02 Apr 2022 08:33:55 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <83r16g3vav.fsf@gnu.org> <87ilrsro30.fsf@flokut.localdomain> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Johannes Grødem > Date: Sat, 02 Apr 2022 08:33:55 +0200 > > > Does SQLite TEXT allow the superset of UTF-8 encoding Emacs uses > > internally to store characters that are not in Unicode? If it does, we > > could indeed assume that any BLOB is binary data and not attempt > > encoding/decoding it. > > SQLite documentation says this... > > TEXT. The value is a text string, stored using the database encoding > (UTF-8, UTF-16BE or UTF-16LE). > > ...but it's still possible to store byte sequences that are not legal > Unicode in there. This breaks the mentioned Python SQLite3 API, and > possibly others, so maybe not great if someone wants to read tables from > something else than Emacs. This probably means we should reject text with raw bytes or characters whose codepoints are beyond #x10FFFF, and document that those should be encoded manually and stored as BLOBs. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 08:59:33 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 12:59:34 +0000 Received: from localhost ([127.0.0.1]:44825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nadLp-0003r9-KR for submit@debbugs.gnu.org; Sat, 02 Apr 2022 08:59:33 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nadLo-0003qw-EK for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 08:59:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+idr+XWcyK5V5lLSuBaD/NBbsaFDM4ILWKrtUc3U/PM=; b=TT5qBYCm3XzWDxr0HTlnvHPSpy 5ri/omZsAptWZoYHNQH0Lw4guwm0l4gtroeMymQbYERdtlPCMYu/XMrITkiX/v12A5FLTDusu3hK3 VceP79pwNtoFN6YLFZxr2/R6sWnBAKbfUoVJ6qbv8msKyf5xZxMoyx7npFqBflP5GZfo=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nadLe-0005LE-AZ; Sat, 02 Apr 2022 14:59:25 +0200 From: Lars Ingebrigtsen To: Johannes =?utf-8?Q?Gr=C3=B8dem?= Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXxz7f67MnfpaF8 U1T///94Yh8VAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YEAgwpHAodBrQAAAGwSURBVDjLZZMBloMw CESBXiDkBIgX2NX7321nIObVt7zWqj8wA0lFGM7LefGaFfXSXXyIHJ8CuA0Tqzvlkx3nxZUD6XiD GKOWZTRAVdMRUkvUhz0A6XbMyvAuFXktUTssqxQzWOqnMyQBSk21xO2X6xSGogwPXcC9Kol6OGu5 A/gGCsnDzVYfsPUAVcPH5AkArSdVZNkzFGrMo/IHir3B0Blo3EL2GMdyNaOKFuFw3MtVZdCHjgXU l91Z7qFla5zLVQFBXoFwf5VSblRnVFiijxKPtbmBDUOhLJBRu7xAawPgItFWNkBVaCCPAHoEa1YZ DUaVBsDOYztGLJCxDpckK9XWNpD2CMAlMJ/Jb4ZyVRDAudBGAx6HSmEp5TAA9GwNXQC/nOdtwiN3 ULE0eIeM87Y4bwAKzkccK+6bEAAdWAEEGgFQ/9wUQal8AQaB9XSzpj5QpgEqWzXax3KB6xsg8BfY wNsk7c5q6CnFOeUCB8Ej7nh/PHYZDa706UOWRuiwDeBGpUbibGm2RDWC5keDxEnfoM5ZN4hEfWVA cG/t3BoV1z9XuWOD/Ep4g/xajvgDshheeTQhZhQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDQt MDJUMTI6NDE6MjgrMDA6MDCfhoJoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA0LTAyVDEyOjQx OjI4KzAwOjAw7ts61AAAAABJRU5ErkJggg== X-Now-Playing: Gilberto Gil's _Soy Loco por ti America_: "Soy Loco Por Ti America" Date: Sat, 02 Apr 2022 14:59:21 +0200 In-Reply-To: <878rso7iuu.fsf@flokut.localdomain> ("Johannes =?utf-8?Q?Gr?= =?utf-8?Q?=C3=B8dem=22's?= message of "Fri, 01 Apr 2022 20:34:49 +0200") Message-ID: <87v8vrljyu.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Johannes Grødem writes: > I might be misunderstanding the issue, but SQLite column types are more > like documentation than actual rules to be enforced, unless STRICT > tables are enabled. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Johannes Gr=C3=B8dem writes: > I might be misunderstanding the issue, but SQLite column types are more > like documentation than actual rules to be enforced, unless STRICT > tables are enabled. Yeah, you can put anything you want into TEXT and BLOB columns. What I'd like to see happening is that the Emacs interface here is predictable and convenient, and that makes my brain hurt a bit here. Let's take a TEXT column first. Currently, if you have the multibyte string "f=C3=B3o" and insert with "insert into ... (?)", we encode to utf-8 and put the bytes #x66#xc3#xb3#x6f into the database. Selecting from the database, we get the bytes #x66#xc3#xb3#x6f back, decode and return the string "f=C3=B3o". If you have a unibyte string containing the bytes #x66#xc3#xb3#x6f, we don't do anything with that, but insert the bytes as is. When selecting, we decode and return "f=C3=B3o", which is not what the user inserted. In this case, it would be nice to signal an error, but we can't, because we don't know that it's a TEXT column in the first place. Conversely, with BLOB columns, we would prefer to signal an error on multibyte strings, but we can't, because we don't know that it's a BLOB column. But we do the right thing with unibyte strings -- if you give it #x66#xc3#xb3#x6f, it'll put those bytes into the BLOB column, and when selecting, we do know that it's a BLOB column, so we could return the unibyte string #x66#xc3#xb3#x6f, and everything's fine. However, if the user wanted to insert the string "f=C3=B3o", they'll be getting #x66#xc3#xb3#x6f back and will probably be sad. Today, the semantics are at least predictable: We insert everything encoded to utf-8 (no matter whether using bound parameters or inside the string), and if the user wanted something binary in the BLOB they selected, they just have to call `decode-coding-string BLOB-RESULT 'utf-8' to get the binary data. Which I understand is confusing, because it's very confusing indeed. But it's consistent, at least. If we knew what the type of the column we were inserting into, we could be more helpful in the interface, but there doesn't seem to be a way to get at that information? > By the way, if you want to insert BLOBs in the query itself you can do > it like this, but I guess this doesn't need Emacs support, except maybe > a helper function for the conversion: > > INSERT INTO foo VALUES (X'deadcafe'); Yes, but that leaves the issue to the caller, and the issue about what to do when selecting is still unclear. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 09:51:43 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 13:51:43 +0000 Received: from localhost ([127.0.0.1]:44891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeAJ-0007Nu-Fj for submit@debbugs.gnu.org; Sat, 02 Apr 2022 09:51:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeAH-0007Ng-OE for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 09:51:42 -0400 Received: from [2001:470:142:3::e] (port=47136 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naeAB-0007ZC-QO; Sat, 02 Apr 2022 09:51:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=akpDBdCk7DAOgEh2uw9eJKyxuIhlscc6Oe5roBZ/Pyc=; b=qFm81eAWfWYaMwmPGxRO Q5vOl9Fd6UadUF9RnWpfRfPsCquA3F5P9saHVRTkTeil3WUMXWsV0xVrSbpaQ9otgvSdVcsbf2LpS po+DZFFTCNiw9C6JLa28j/9hdWiAecSLb3p64vn+vKptHnpgFGLzRwy2pKUjtgGmBMJEruFiqNWgx C1ZjG1ho6ktwM3q/UDRykQldpsg6vqFTYCb2EUJW3JEYiqUCx7GNdqHHf53UQxfSsc6+pGmncHNTz gGUjxIzvcWqp4S1S0FASN8CaS1Kvz1Q78WTo7qA1QMloFLyVh0ZykvK4ExFNfXKyCMs1+eV/EKrZm YLABXFc7WqdlyA==; Received: from [87.69.77.57] (port=3427 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naeAB-0003WX-Al; Sat, 02 Apr 2022 09:51:35 -0400 Date: Sat, 02 Apr 2022 16:51:51 +0300 Message-Id: <83h77b4mq0.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87v8vrljyu.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 02 Apr 2022 14:59:21 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Sat, 02 Apr 2022 14:59:21 +0200 > Cc: 54591@debbugs.gnu.org > > Let's take a TEXT column first. Currently, if you have the multibyte > string "fóo" and insert with "insert into ... (?)", we encode to utf-8 > and put the bytes #x66#xc3#xb3#x6f into the database. Selecting from > the database, we get the bytes #x66#xc3#xb3#x6f back, decode and return > the string "fóo". > > If you have a unibyte string containing the bytes #x66#xc3#xb3#x6f, we > don't do anything with that, but insert the bytes as is. When > selecting, we decode and return "fóo", which is not what the user > inserted. In this case, it would be nice to signal an error, but we > can't, because we don't know that it's a TEXT column in the first place. We could store unibyte strings as BLOBs, couldn't we? > Conversely, with BLOB columns, we would prefer to signal an error on > multibyte strings, but we can't, because we don't know that it's a BLOB > column. But we do the right thing with unibyte strings -- if you give > it #x66#xc3#xb3#x6f, it'll put those bytes into the BLOB column, and > when selecting, we do know that it's a BLOB column, so we could return > the unibyte string #x66#xc3#xb3#x6f, and everything's fine. However, if > the user wanted to insert the string "fóo", they'll be getting > #x66#xc3#xb3#x6f back and will probably be sad. We could refrain from decoding BLOBs, couldn't we? From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 09:59:42 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 13:59:42 +0000 Received: from localhost ([127.0.0.1]:46329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeI2-0007vX-Cb for submit@debbugs.gnu.org; Sat, 02 Apr 2022 09:59:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeI0-0007vI-33 for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 09:59:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3tEDSrlZqZHXss3nt7PRdFcHYhajnfkztWVYzgxPn4E=; b=lXUA3U7YiyQzZslBWwvfJqLVuE DrfJd0+iRwxgf9aKnXBTl5+9jEe+FIX3oIpQk89aZNhVA4AABjjVCR+89pEnuKD31mb+jqjOsuUNT +XgLArk2VNPPR7SIsBU/us1UgE/OZW/9WJmNK6gHWMlDBiENyRY1g64LPTD6XwZ4rMtM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naeHq-0005yJ-CU; Sat, 02 Apr 2022 15:59:32 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAM1BMVEX+/v7s6Off1NCw qKpGLzZlWl/ZxLudkZGFeYIlGyWPaWTIsqoaEhcQCA0vKDMiFx3///8hP2MuAAAAAWJLR0QQlbIN LAAAAAd0SU1FB+YEAg03JPec68IAAAEjSURBVEjH7VbRjsMgDIOEJKOQ8P9/e6Gs7U5lnU73sJe6 0lZUGzueRBfCNxCfgK+437hx48ZvxL/RMSXiQyzI1xsgPVyxcZhSPlZTiAQA3E7IBYFS4isBo5+o ewrBEMty6RC5QNm3LAsDXBqECP3QPuSvqzeKTtpXwOVTy4UjHyFQlnL5jmCiwiXRIHlFrhfCdy5I VSlCMc1JolhVwwKk1WQq8Sc1ZyHLraqaam3NKFuurpx1ZbX5RdgZzukf+RHQ+rfSpJ/+xAXRWt2Q KUBa5RMBrJQeYudXS9ENdS5A7Ylazq8CQ7HVwc5jk65Rmo88BugdmHcwBGeHpM/cg6velFtQF/S7 8+9nY4Z6jLxmSiOh4qkk32cCb3RAzkNf4x9/O34AeBkPlLrBHzcAAAAldEVYdGRhdGU6Y3JlYXRl ADIwMjItMDQtMDJUMTM6NTU6MzYrMDA6MDAW4F+UAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA0 LTAyVDEzOjU1OjM2KzAwOjAwZ73nKAAAAABJRU5ErkJggg== X-Now-Playing: Pet Shop Boys's _Actually_: "Rent" Date: Sat, 02 Apr 2022 15:59:28 +0200 In-Reply-To: <83h77b4mq0.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Apr 2022 16:51:51 +0300") Message-ID: <878rsnlh6n.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > We could store unibyte strings as BLOBs, couldn't we? As I've said, we don't know whether a column is a TEXT or a BLOB column. And "store as BLOB" has no particular meaning -- internally in sqlite, there is no particular difference: Both are just a serie [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > We could store unibyte strings as BLOBs, couldn't we? As I've said, we don't know whether a column is a TEXT or a BLOB column. And "store as BLOB" has no particular meaning -- internally in sqlite, there is no particular difference: Both are just a series of bytes, and you can put any bytes you want into the columns. > We could refrain from decoding BLOBs, couldn't we? Yes, I think I said so? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 10:06:28 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 14:06:28 +0000 Received: from localhost ([127.0.0.1]:46343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeOa-000893-J5 for submit@debbugs.gnu.org; Sat, 02 Apr 2022 10:06:28 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeOZ-00088r-JJ for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 10:06:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xvU13v2a+woIgVWUA7VRYvwc5F8i/nBOT67KtuW54P0=; b=gqHJeeepMjFuFb5p51YyFiWQP6 ojKnTiqyzfFl/xufNKmJcHn5l8XhvMwnvznW8sFv7aT313V+U7y48FqZijOlsfAkS704WGEq59/uW j475X9l45M94O7+AqJZG4DL46D3BFKDknVia47iybBHLptvatuudLoR9G5xff0KyjyFE=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naeOR-00067n-8b; Sat, 02 Apr 2022 16:06:21 +0200 From: Lars Ingebrigtsen To: Johannes =?utf-8?Q?Gr=C3=B8dem?= Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> X-Now-Playing: Pet Shop Boys's _Actually_: "Hit music" Date: Sat, 02 Apr 2022 16:06:18 +0200 In-Reply-To: <878rso7iuu.fsf@flokut.localdomain> ("Johannes =?utf-8?Q?Gr?= =?utf-8?Q?=C3=B8dem=22's?= message of "Fri, 01 Apr 2022 20:34:49 +0200") Message-ID: <87v8vrk2at.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: But I forgot to say what I think we should do. :-) I think we should just leave it to the user, and I think the interface that makes the most sense is something like "insert into ... (?)" (... (propertize binary-data 'coding-system 'binary)) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) But I forgot to say what I think we should do. :-) I think we should just leave it to the user, and I think the interface that makes the most sense is something like "insert into ... (?)" (... (propertize binary-data 'coding-system 'binary)) and then signal an error if binary-data isn't unibyte when the string has this property. And then, conversely, don't decode BLOB columns on selects. I think that'll be the most interoperable and convenient we'll be able to get. (And, of course, document this mess.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 10:22:46 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 14:22:46 +0000 Received: from localhost ([127.0.0.1]:46390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeeM-0002IY-Ew for submit@debbugs.gnu.org; Sat, 02 Apr 2022 10:22:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naeeL-0002IL-8x for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 10:22:45 -0400 Received: from [2001:470:142:3::e] (port=47536 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naeeF-0003ds-Li; Sat, 02 Apr 2022 10:22:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UTZRuOrpONe940aJ2yvSnBxfMRPXSMrJ8Xxg1sg2BsI=; b=qbl78/akhu2Y JcGQHiUCrSkvLd3KaYtoi3FhhcpY9kPzscwmWH7Fepiz3t25GxvAcxNIx8jvslwqkwQ4EbkPbmMuN Wq46dWZR61vCTPc0QmgUgOc5s7pNhsJ96sNz9rjvLXEWUOEk7KrjO3y+oTfGkiXh+YRUtXzuYMc9r xBfT38TFH825GAYaZtmWtAmVkFUmlkoNCnsnC/BCIwT8SWfYdrEeVyit6cHgSqNVK3N59k0syVIYk KtouFxF6jKxCPNiY7ClhU6+NHW0DU4Kls3mXR70X7HOe1GdVjh+CT5r2tDuRMDXyV6P52/H/yNIGy AYEsjvELxU9QsNENtGv2ug==; Received: from [87.69.77.57] (port=1369 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naeeF-00019O-24; Sat, 02 Apr 2022 10:22:39 -0400 Date: Sat, 02 Apr 2022 17:22:54 +0300 Message-Id: <83ee2f4la9.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <878rsnlh6n.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 02 Apr 2022 15:59:28 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: fjas@grdm.no, 54591@debbugs.gnu.org > Date: Sat, 02 Apr 2022 15:59:28 +0200 > > Eli Zaretskii writes: > > > We could store unibyte strings as BLOBs, couldn't we? > > As I've said, we don't know whether a column is a TEXT or a BLOB column. When storing? we could ask the caller to specify that, or automatically consider unibyte non-ASCII strings as BLOBs. > And "store as BLOB" has no particular meaning -- internally in sqlite, > there is no particular difference: Both are just a series of bytes, and > you can put any bytes you want into the columns. Of course; the question is how those bytes are interpreted. The Python examples shown up-thread show the way, I think. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 10:38:32 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 14:38:32 +0000 Received: from localhost ([127.0.0.1]:46422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naetc-0002ha-Fd for submit@debbugs.gnu.org; Sat, 02 Apr 2022 10:38:32 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naetZ-0002hL-PB for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 10:38:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NOO06orA2aSBOay03MujzSMt/3ROnRhomOKeB3sj9Mc=; b=gqyhc/FCy1LpYK2aNHPgV+8bq5 RHFmgI+P7zrzvpUoKj5kBDeWoaz91tTwXFKPELfMF87FhaFOe7fhtyqBwBuXViWULkDLrGU7fLWMy VIkZ1akQ5YiPs7w043/EP+W2J2HxzgI272UVOHZ88RQvPJVWFhyLsZII5MoradthN7NM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naetR-0006y3-2o; Sat, 02 Apr 2022 16:38:23 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXDkWrlybCZZk9I LCn////qBrHtAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YEAg4lHKUsndYAAAGjSURBVDjLbZTbkcMw CEURbkB2GiDQQAb6720vIDnOzOrDI3OELi+baJy9iMZkvRextH2yEOkDmNAkEs3DFhax7DjkMLgZ nrA2EQCzUBfV8ChbPoRSQ+l6Q+PQAmGeAFYEcwBM+BVwTxsxRIjh8ILRnFJCxgaZiTlrsghH2AiR 8kbswqkDxoYy/MwJ5Mh3VV6AGwBZH6xcpHbU5cHBCj0WyFRsA7m0QPmCxQbvdqiwsAx5WWrq4Cpb ON+gyzQ1i5ag5XWdUxKODVi/AAXhqExYN2iNFMmMotpEHVPKSPZcdg+pC4SLNQeCh6XvA3yIciTG KxrY7YHaj+pLAURSfkBrvI7o1q/qQl7OeQN/gs+Ywg28PcQ6YLrCz2k3MCTe/Zk2foBlGTvgOWlr Gzzq/CoxL2BBLdAX5FD0PEaCdsiiKrVENIgH2Hf+AMEUP0BFeqzpWGHkO4WirFfcy0dXhuoTfABd xawu/APOBvMLZIMLH9r4D/CBMeEvuP8Hl+h7fpPx8/5RtLov8LnBu9XdfsH8BTRvbVo7K9AjVANW H3mCFRJtjT+muY7CF4S9EgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNC0wMlQxNDozNzoyOCsw MDowMBtGOHEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDQtMDJUMTQ6Mzc6MjgrMDA6MDBqG4DN AAAAAElFTkSuQmCC X-Now-Playing: Suzanne Vega's _Solitude Standing_: "Ironbound Fancy Poultry" Date: Sat, 02 Apr 2022 16:38:19 +0200 In-Reply-To: <83ee2f4la9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Apr 2022 17:22:54 +0300") Message-ID: <875ynrk0tg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > When storing? we could ask the caller to specify that, That would be inconvenient in general. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > When storing? we could ask the caller to specify that, That would be inconvenient in general. > or automatically consider unibyte non-ASCII strings as BLOBs. My exegesis upthread explained why that's problematic. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 11:26:50 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 15:26:51 +0000 Received: from localhost ([127.0.0.1]:46515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nafeM-00067m-P4 for submit@debbugs.gnu.org; Sat, 02 Apr 2022 11:26:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nafeL-00067N-1R for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 11:26:49 -0400 Received: from [2001:470:142:3::e] (port=48306 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nafeF-0004Ou-Fn; Sat, 02 Apr 2022 11:26:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6Q7U+LZd4QTQRr+S2L5kynfgPz90htMere/Vadz/Mgs=; b=SPR2ZtLtmLtQ f/KNGR1OcwSgBPJoeroU0uJjD8toMoxc89yNBlECoZ47bXMmmnYNXgtMR3SyKozms+D1a/9Pblw9I 6hXR8EKk8uHA1XyYNHDiwwF7VGCc6qwI5S0fL2/h37hq0q5CoBvemF2cC68oV6H7k5kwzv3G820m8 qXg1FAfB60Ga8QY/rgcWJCRGQW9JZhvPhvfDsv07susc8O7tQ9NuTv8dEqkAqd+jlNj/0ti8Y7Exl fspPOwbVejdGBbeFYvBt+cuzN8NBxf3b3FI0BW0VmwF3wANFmlEPGJ6rt23GfncNFi1dEFt+HLkBU hu9aPJIrlnO/0i/yXzrXnw==; Received: from [87.69.77.57] (port=1403 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nafeE-0004eK-9h; Sat, 02 Apr 2022 11:26:43 -0400 Date: Sat, 02 Apr 2022 18:26:38 +0300 Message-Id: <83czhz4ic1.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <875ynrk0tg.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 02 Apr 2022 16:38:19 +0200) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> <875ynrk0tg.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: fjas@grdm.no, 54591@debbugs.gnu.org > Date: Sat, 02 Apr 2022 16:38:19 +0200 > > Eli Zaretskii writes: > > > When storing? we could ask the caller to specify that, > > That would be inconvenient in general. > > > or automatically consider unibyte non-ASCII strings as BLOBs. > > My exegesis upthread explained why that's problematic. So you think this problems has no solution, none at all? From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 11:28:11 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 15:28:12 +0000 Received: from localhost ([127.0.0.1]:46529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nafff-0006AY-Nz for submit@debbugs.gnu.org; Sat, 02 Apr 2022 11:28:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naffe-0006AJ-AV for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 11:28:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vNGUQOXN1TgtkbwCH/sx7qmYBRaSokDkHCK/jIexEos=; b=VyEVORkZ6te53511byY7yNhIS+ LE1nC5ddm3gx5Sly778jqmDb7uKyJgHwllAGtmY02zet8IisTX8ACRzpGBgo+KbHkp4WYc58z8FU2 xYOFWAIGyASXPpDTKjh/LC0TSPXFdmqlNhQlkQju87rCdc4ibHMu8AYMSrZWR2X8IHTM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naffV-0007V4-G3; Sat, 02 Apr 2022 17:28:03 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> <875ynrk0tg.fsf@gnus.org> <83czhz4ic1.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEUVEw1cRSO0i0r/ ///bjJdBAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YEAg8aDg+JrJUAAAGASURBVCjPRZLPauMwEMY/ F8vQPZUSH5I36D6FDOse9qSARtQ6tZCEtZ+ifYMGoh5ySiAq1Tzljuy49WGGn0bzzR8ZqMji+ys8 hxGX2ZD75IN4r8X8/st8Ed/nSP3I6Sx+kcFW/LW+5kN7jnQ3gipJYEsTKBo4panWbU3MnOIIzjoe +BhzEUiy3DumCfoMQzI/kRkSZQW2V3AZDiNw8Bn2E8Ru+IGPkCHMAsMnczuBvS2in9XMyocjzXWc a7e1vkqbXXhezxBf9MmMQ29j4A865fNfEjlsQ/+cYSWwN693BoXGIPPUvbUEpeFBYdhUj40uNSrY lk83HlppVeDL8blZCZhqJwL88qYWUKZhgbNINaK8GZCimlrBsgcRQSPvfe1QmEW1/5MjRmVb5fmH V12MD5HTuZHG5aU7sqVl2AJcwgeUYKQCodX3FwNtsGux10t3MfQOPBwQap8o5kWtLrC9J5eMLqH+ 4cnKk8g9kp8Ist2u7d5JGizQ1bSpSZdGw/0HY2ekTYBvNMQAAAAldEVYdGRhdGU6Y3JlYXRlADIw MjItMDQtMDJUMTU6MjY6MTQrMDA6MDChszidAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA0LTAy VDE1OjI2OjE0KzAwOjAw0O6AIQAAAABJRU5ErkJggg== X-Now-Playing: Prince's _Sign 'O' The Times (1)_: "Housequake" Date: Sat, 02 Apr 2022 17:28:00 +0200 In-Reply-To: <83czhz4ic1.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Apr 2022 18:26:38 +0300") Message-ID: <87ilrrijy7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > So you think this problems has no solution, none at all? No, I posted a later post which has the solution I'm going to implement. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > So you think this problems has no solution, none at all? No, I posted a later post which has the solution I'm going to implement. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 02 11:41:04 2022 Received: (at 54591) by debbugs.gnu.org; 2 Apr 2022 15:41:04 +0000 Received: from localhost ([127.0.0.1]:46604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nafs8-0006a1-4s for submit@debbugs.gnu.org; Sat, 02 Apr 2022 11:41:04 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nafs5-0006ZO-MG for 54591@debbugs.gnu.org; Sat, 02 Apr 2022 11:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HLsY7Ez2FMd5SiT0JkBI/T0817k6SBvIw0KdEP6WCNU=; b=QLyUXxX+e+C2xAxCNa9AU6RYTC 4ad3koBBjcMVv4pmRO+iabmXgw1PRy0flCx+/afkxwtimLIOZHBzCoB1TePTiJcZj3YKub+u/HNMz /mOJlUXngNMDlXPoci7OrIKFcuAl1y/LyNNA8KwH6kjJaEe/rlgmlIFANlFr/dJSbcf8=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nafrw-0007dD-VT; Sat, 02 Apr 2022 17:40:55 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> <875ynrk0tg.fsf@gnus.org> <83czhz4ic1.fsf@gnu.org> <87ilrrijy7.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEUVEw1cRSO0i0r/ ///bjJdBAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YEAg8aDg+JrJUAAAGASURBVCjPRZLPauMwEMY/ F8vQPZUSH5I36D6FDOse9qSARtQ6tZCEtZ+ifYMGoh5ySiAq1Tzljuy49WGGn0bzzR8ZqMji+ys8 hxGX2ZD75IN4r8X8/st8Ed/nSP3I6Sx+kcFW/LW+5kN7jnQ3gipJYEsTKBo4panWbU3MnOIIzjoe +BhzEUiy3DumCfoMQzI/kRkSZQW2V3AZDiNw8Bn2E8Ru+IGPkCHMAsMnczuBvS2in9XMyocjzXWc a7e1vkqbXXhezxBf9MmMQ29j4A865fNfEjlsQ/+cYSWwN693BoXGIPPUvbUEpeFBYdhUj40uNSrY lk83HlppVeDL8blZCZhqJwL88qYWUKZhgbNINaK8GZCimlrBsgcRQSPvfe1QmEW1/5MjRmVb5fmH V12MD5HTuZHG5aU7sqVl2AJcwgeUYKQCodX3FwNtsGux10t3MfQOPBwQap8o5kWtLrC9J5eMLqH+ 4cnKk8g9kp8Ist2u7d5JGizQ1bSpSZdGw/0HY2ekTYBvNMQAAAAldEVYdGRhdGU6Y3JlYXRlADIw MjItMDQtMDJUMTU6MjY6MTQrMDA6MDChszidAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA0LTAy VDE1OjI2OjE0KzAwOjAw0O6AIQAAAABJRU5ErkJggg== X-Now-Playing: Prince's _Sign 'O' The Times (1)_: "Starfish and Coffee" Date: Sat, 02 Apr 2022 17:40:52 +0200 In-Reply-To: <87ilrrijy7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 02 Apr 2022 17:28:00 +0200") Message-ID: <87pmlzh4sb.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > No, I posted a later post which has the solution I'm going to implement. (Which is basically a tweak on one of the solutions I proposed in my first message in this thread (with the comment "yuck"). I'm still waiting for somebody to correct me that I'm reading the sqlite do [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, fjas@grdm.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > No, I posted a later post which has the solution I'm going to implement. (Which is basically a tweak on one of the solutions I proposed in my first message in this thread (with the comment "yuck"). I'm still waiting for somebody to correct me that I'm reading the sqlite documentation wrong and that you can actually find out the column type you're inserting into, because it seems rather absurd that that functionality doesn't exist.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 03 06:42:29 2022 Received: (at submit) by debbugs.gnu.org; 3 Apr 2022 10:42:29 +0000 Received: from localhost ([127.0.0.1]:47670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naxgi-0004Mt-Ts for submit@debbugs.gnu.org; Sun, 03 Apr 2022 06:42:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:40676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naxgh-0004Mm-BL for submit@debbugs.gnu.org; Sun, 03 Apr 2022 06:42:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naxgh-0001uo-3j for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 06:42:27 -0400 Received: from ciao.gmane.io ([116.202.254.214]:39326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naxgf-0007ID-DH for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 06:42:26 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1naxgc-0004gm-2g for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 12:42:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Rudolf Schlatte Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string Date: Sun, 03 Apr 2022 12:42:15 +0200 Message-ID: References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> <875ynrk0tg.fsf@gnus.org> <83czhz4ic1.fsf@gnu.org> <87ilrrijy7.fsf@gnus.org> <87pmlzh4sb.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) Cancel-Lock: sha1:jNP3imROK0hosk1TrouCfXMMssg= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > >> No, I posted a later post which has the solution I'm going to implement. > > (Which is basically a tweak on one of the solutions I proposed in my > first message in this thread (with the comment "yuck"). I'm still > waiting for somebody to correct me that I'm reading the sqlite > documentation wrong and that you can actually find out the column type > you're inserting into, because it seems rather absurd that that > functionality doesn't exist.) Does the transcript below do what you're looking for? $ sqlite3 SQLite version 3.37.0 2021-12-09 01:34:53 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> create table foo(x text not null, y blob not null); sqlite> select * from sqlite_master; table|foo|foo|2|CREATE TABLE foo(x text not null, y blob not null) sqlite> .schema sqlite_master CREATE TABLE sqlite_master ( type text, name text, tbl_name text, rootpage integer, sql text ); sqlite> From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 03 07:44:12 2022 Received: (at 54591) by debbugs.gnu.org; 3 Apr 2022 11:44:12 +0000 Received: from localhost ([127.0.0.1]:47776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nayeS-00088S-AC for submit@debbugs.gnu.org; Sun, 03 Apr 2022 07:44:12 -0400 Received: from quimby.gnus.org ([95.216.78.240]:59894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nayeQ-00088F-Oh for 54591@debbugs.gnu.org; Sun, 03 Apr 2022 07:44:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7jpQ5xgg7PIZO9XU7pZwQUYDzL0Ktm03Dy76Wfbulsk=; b=OdQxM0hKhJSWGVHSHU0sUgoHxe R7/lKJEHGRY/5yeOuBmlMmseExLHopszbelPjpykVNF866o5K76xLN3QzrG8YHPQfg1yTB/z/xiPb rZSqld9MotoQ54Pjlao33ewcC9G51mKUgLa/TM2lw3asN4mJTsCKL2g9pu6DvrIZWuAQ=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nayeH-0007Gf-JO; Sun, 03 Apr 2022 13:44:03 +0200 From: Lars Ingebrigtsen To: Rudolf Schlatte Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrljyu.fsf@gnus.org> <83h77b4mq0.fsf@gnu.org> <878rsnlh6n.fsf@gnus.org> <83ee2f4la9.fsf@gnu.org> <875ynrk0tg.fsf@gnus.org> <83czhz4ic1.fsf@gnu.org> <87ilrrijy7.fsf@gnus.org> <87pmlzh4sb.fsf@gnus.org> Date: Sun, 03 Apr 2022 13:43:59 +0200 In-Reply-To: (Rudolf Schlatte's message of "Sun, 03 Apr 2022 12:42:15 +0200") Message-ID: <87a6d2l7cw.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Rudolf Schlatte writes: > Does the transcript below do what you're looking for? Nope. I need to know the type of the Xth column in a prepared statement when inserting. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Rudolf Schlatte writes: > Does the transcript below do what you're looking for? Nope. I need to know the type of the Xth column in a prepared statement when inserting. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 08:58:48 2022 Received: (at 54591) by debbugs.gnu.org; 28 Apr 2022 12:58:48 +0000 Received: from localhost ([127.0.0.1]:45736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk3jM-0001pu-9b for submit@debbugs.gnu.org; Thu, 28 Apr 2022 08:58:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk3jJ-0001pf-UN for 54591@debbugs.gnu.org; Thu, 28 Apr 2022 08:58:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AB6JSyB6ynFgPyWR1ndlbEExQ1LDMSyENDKrjUjaiR0=; b=a0qg4dQbhOkjL9XWVKmMaH/7Xb vV0zj/H8IkdCt/HjuzMUh5W7j/cS94mB9HRBQ81pM5lgM0V7yYwXBAoKKcluGzK8SvIERtv0HRlLp HZyv501gAicz3+PYeBbdeSgz9tMdyqg1cIqZUmrDkbYmbK6hFUF9OZWBHzcAkWJmL1N8=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk3jB-0000o8-8F; Thu, 28 Apr 2022 14:58:39 +0200 From: Lars Ingebrigtsen To: Johannes =?utf-8?Q?Gr=C3=B8dem?= Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <878rso7iuu.fsf@flokut.localdomain> <87v8vrk2at.fsf@gnus.org> X-Now-Playing: Lali Puna's _Two Windows_: "Bony Fish" Date: Thu, 28 Apr 2022 14:58:35 +0200 In-Reply-To: <87v8vrk2at.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 02 Apr 2022 16:06:18 +0200") Message-ID: <87v8utjres.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > I think we should just leave it to the user, and I think the interface > that makes the most sense is something like > > "insert into ... (?)" (... (propertize binary-data 'coding-system 'binary)) > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > I think we should just leave it to the user, and I think the interface > that makes the most sense is something like > > "insert into ... (?)" (... (propertize binary-data 'coding-system 'binary)) > > and then signal an error if binary-data isn't unibyte when the string > has this property. And then, conversely, don't decode BLOB columns on > selects. I think that'll be the most interoperable and convenient we'll > be able to get. I've now done this on the trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 08:58:58 2022 Received: (at control) by debbugs.gnu.org; 28 Apr 2022 12:58:58 +0000 Received: from localhost ([127.0.0.1]:45739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk3jW-0001qH-GH for submit@debbugs.gnu.org; Thu, 28 Apr 2022 08:58:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk3jO-0001pl-7x for control@debbugs.gnu.org; Thu, 28 Apr 2022 08:58:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Lrb5gOQP3kIA/lyy8iNIxWZhWPTs3Z8B53nAkN99Egk=; b=jQpEeQNQXOs3dz4hykBlhoRCzq 6O3NVL0e9Hu5Xng2cj1KHRLvbX3W9KbeuaBKl6IJBv1vLG30A4CfThFYt5ihSzjjcqWaNBwSi8M5Y dRRog1LuwkM2Dd3rjQl+GV+br7g7BqkPH/kgC9LJJjnBDGkmLZGv2kKGGHhPGD6K+Rvc=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk3jG-0000oE-Df for control@debbugs.gnu.org; Thu, 28 Apr 2022 14:58:44 +0200 Date: Thu, 28 Apr 2022 14:58:41 +0200 Message-Id: <87tuadjrem.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #54591 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 54591 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 54591 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 29 00:59:41 2022 Received: (at 54591) by debbugs.gnu.org; 29 Apr 2022 04:59:41 +0000 Received: from localhost ([127.0.0.1]:50497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkIjF-0006T0-9w for submit@debbugs.gnu.org; Fri, 29 Apr 2022 00:59:41 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:37790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkIjD-0006Sl-CL for 54591@debbugs.gnu.org; Fri, 29 Apr 2022 00:59:39 -0400 Received: by mail-pj1-f41.google.com with SMTP id t11-20020a17090ad50b00b001d95bf21996so9552054pju.2 for <54591@debbugs.gnu.org>; Thu, 28 Apr 2022 21:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zFqmAnAlDjdsrVJCshqIjPjQdb+BPrCgWfCpLMURttE=; b=MQpm9GZIcLCjErFS+68Tpr8dH+qaAFE4ywVO+iyWTv0jTbwriNaaC0uyvKGe/mtTxy F2xRRlREMkWBSeYyaeAlKJLsmgP/Bd+iGr5z7+kqKc+5MfK6PML+uWNXH41Dn1B5rpqA hZrjLz67ePhctSasQZcsZEfIK4PZfmaQV5xlJf2LCZRuRomI4wr08PnnJYXLnbEJd3lJ Yo+EUDnfH3qhYo/p68H4xFzWCiXDULvUYF9aQ4WaNMae0l3d/lmho9EaacZKzV9q3rP/ NrMMhtjrtDvayNf8116hlLrQbIKw34OK51L7q1rdStTsD1TZqwRZCZqngLbkZ6YIpT7Q nM+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zFqmAnAlDjdsrVJCshqIjPjQdb+BPrCgWfCpLMURttE=; b=YgO0YJKTLep+ma9z/aP5ay7rirqjO6vHRnXV6J+/KlbeSrSFHnwy10u/95s9S/0b4t s60Caer0fyKnAgD3q4eaiXX14ImpOt5/i7NDJzcA1YspfrKJmYCD7jAUhvfBMzhs72p5 K3fPhgBT3AKpa629d04+6iUPW5v7z7ggTaBM9S2RwU4/Pqdh0Ir0CQMCpUEz6vAGkgX/ teEwxSSfIIrCAqdXNLtPeKo5FLSnyvIwB/ZE1tCseGBnQ9Iv1kPuxVp0b/coc0sOiiIJ n+S2JpOmgTmrid9eHtMeTSEStQG1EA9UWZnLlcF4t1HcoGwVWnuqD4ZNRcTFVVKtysMi J2qQ== X-Gm-Message-State: AOAM530QCLbG6eniKd8iLcd2+NYp/HEBiZ0w8KgG1Qt6M1dsL+9tMi9/ twhyWk+Vf4R3QM7NNaV8KWk= X-Google-Smtp-Source: ABdhPJzgmZdOom1kwzJtYnGWOdHG8Bh3tkTQS9FT/9B2N7rcCdotP8S1qzkflX11H/9JUikZOuVptw== X-Received: by 2002:a17:90a:d083:b0:1c9:94bb:732d with SMTP id k3-20020a17090ad08300b001c994bb732dmr1969058pju.106.1651208373328; Thu, 28 Apr 2022 21:59:33 -0700 (PDT) Received: from smtpclient.apple ([104.180.75.250]) by smtp.gmail.com with ESMTPSA id p125-20020a62d083000000b0050d475ed4d2sm1434305pfg.197.2022.04.28.21.59.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2022 21:59:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string From: Yuan Fu In-Reply-To: <87a6d672xr.fsf@gnus.org> Date: Thu, 28 Apr 2022 21:59:21 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9B7077C1-8164-4DE3-BEEC-BF68A235F61C@gmail.com> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> To: Lars Ingebrigtsen X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Mar 31, 2022, at 4:54 AM, Lars Ingebrigtsen wrote: >=20 > Eli Zaretskii writes: >=20 >> Can we place the burden of knowing the type of the column on the >> caller? I mean, if they know it's a binary blob, they should tell = us, >> and then we don't decode it? >=20 > We could -- that was my last example: >=20 >>> "insert into test7 values (?, ?)" ["foo" (:binary binary)] >=20 > Or some syntax like that. (And then never decode when we select from = a > BLOB column.) But... >=20 >> (Of course, if there's a way of knowing the type, we could DTRT >> automatically for each type.) >=20 > Yes, I'm hoping somebody else could have a look at the sqlite > documentation and tell me I'm missing some obvious way to get that > information. :-) I had a quick look at the log and didn=E2=80=99t see anything related to = sql. So what do we end up doing? I think at least a notice could be = added to the manual? Something like =E2=80=9CUse (encode-coding-string = xxx 'raw-text)) if you want to get out a binary blob=E2=80=9D. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 29 06:04:59 2022 Received: (at 54591) by debbugs.gnu.org; 29 Apr 2022 10:04:59 +0000 Received: from localhost ([127.0.0.1]:50893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkNUh-00086Y-Bu for submit@debbugs.gnu.org; Fri, 29 Apr 2022 06:04:59 -0400 Received: from quimby.gnus.org ([95.216.78.240]:35894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkNUf-00086K-R4 for 54591@debbugs.gnu.org; Fri, 29 Apr 2022 06:04:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4EmaVtw340jkjWjpCeYpuyHbIAp19bck8cyHo8xrxL8=; b=EDCFikS3nbrfcmnyUok4IwO6pn vNstO99q0C2QjxV8jwPwuP3Jrg8xREwtCM0CBqzmEZHnYP7Bd/D0RriZ7ZkxBvG3YlpNsWGfs4m2V k3yKqriP1VU87payOteu4ejKssr5n3HgineUEjXzkSBgdXFYqXPjK7pVp8GbVgQ6v4xA=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkNUX-0005Al-F0; Fri, 29 Apr 2022 12:04:51 +0200 From: Lars Ingebrigtsen To: Yuan Fu Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <9B7077C1-8164-4DE3-BEEC-BF68A235F61C@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEVMPz6tSELAp5r/ ///wg2LlAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YEHQktLqgXFxIAAAGdSURBVCjPRZHNatwwFIWP xNh0tHKHcRhm5ZYQEj+FYlIoWanFGmhW3TQkfgrHq5KVY0JoZ+UGzxDfp+yRXajA+H7cc390BAAL u61xASRwib6yhsAvnE/eO7sJUQJEnudmQRiq+BDgG0inPsi8L7Ew6PNZVm6YyXIzyZgyyP41KIHl f1nu2DqduqXldsinOc6XKWU5eqgAWalcFfaMXFpmu/1bAe4UIdr9vsK7FdYTOM7PcsrU2qKQMVzh Lqy+KDZNpn8w4jD1eiESLhfzdy0iQeGMSPN49hNxnUA+5yzVinkLqc9NvYaeamQ4N00rzZx5oywL 8ED4paVOpKvuFeFRy8Pd8WmJyOLlpchZ2i1hmDkyVOUr4TmAsg6dIPaES91adD1Swlj09KGDP/Go Dl9bwkcjR2YO07OsYhkiVAOWyXvoWEbgZqB1Cf50Mn6BPNvwYomWkQ1axdDhKb7cEYLDgNXKw3+f QWldQvX4EBJFbBLEY3rLIquDPycyZLBwzQzjVLOaQfoAeYDtXgZOpW9iUe0nZ+krjZNKpJ3h8Bfz d5OVvNxeIQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNC0yOVQwOTo0NTo0NiswMDowMPQctWcA AAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDQtMjlUMDk6NDU6NDYrMDA6MDCFQQ3bAAAAAElFTkSu QmCC X-Now-Playing: Themselves's _CrownsDown_: "roman is as roman does" Date: Fri, 29 Apr 2022 12:04:48 +0200 In-Reply-To: <9B7077C1-8164-4DE3-BEEC-BF68A235F61C@gmail.com> (Yuan Fu's message of "Thu, 28 Apr 2022 21:59:21 -0700") Message-ID: <87tuacgq7z.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Yuan Fu writes: > I had a quick look at the log and didn’t see anything related to > sql. Which log? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Yuan Fu writes: > I had a quick look at the log and didn=E2=80=99t see anything related to > sql. Which log? * | 5d032f2904..: Lars Ingebrigtsen 2022-04-28 Allow inserting and selectin= g binary blobs from sqlite --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 30 01:27:19 2022 Received: (at 54591) by debbugs.gnu.org; 30 Apr 2022 05:27:19 +0000 Received: from localhost ([127.0.0.1]:55742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkfdX-0003M8-AP for submit@debbugs.gnu.org; Sat, 30 Apr 2022 01:27:19 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:45664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nkfdV-0003Lv-NL for 54591@debbugs.gnu.org; Sat, 30 Apr 2022 01:27:18 -0400 Received: by mail-pj1-f54.google.com with SMTP id w17-20020a17090a529100b001db302efed6so7393404pjh.4 for <54591@debbugs.gnu.org>; Fri, 29 Apr 2022 22:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JgwkLU5TGWK9ZgaAHntj3eX9mEAwB7lxam2JMZayEIc=; b=OrJV1+JbIIiRBAk0ANeMZT595+MOiNQaqC0SN2TWRbZ3uf16+fqc1eQSp4++RvDkv1 XwXqr1bg03gIHC7TVrHyTMysAnYDqUdxSMby0QwfKGujWdU2InyD6au63Lm3F5TGFMMf 8HNPMBxZSlcyXEUpBKIkbzbFkYpTzwDN2BueDM4kYG5z+CvaWIDOC6bq5BOhk/MFqG5+ 243TBt4dW0kI4UC3Yh1dZ4SUj5sQ8v8FIlo+MWRYMQKIY50ejCpWVC8++/uTSe7uZ7IE zWMF4PJLR3vWhOXSP6LngEPwGWa3tC/YFQUjIXlyAuhs8HyjxPU2mlByy+2FLe0VLzee To3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JgwkLU5TGWK9ZgaAHntj3eX9mEAwB7lxam2JMZayEIc=; b=oCLwyFeWwAtlmW0M4GBHKDTqYg/JGuv2VvxlcVTonl0EwtMInSf6o17SxNDa3JcW2g +WPrmbP/+wMdKi1NAfWaK0WVAbxkbGB0gSoPgwSC3BJ5uZxYIc2GpAKx/YZClaVEdhn6 Hx/dKoYApA+yW4PcqkZN/6U/x1GeXQADdxIkDhwdiwkR78NCaS4zgysuwqhFXCglu3I3 sxTailP1Vyh7h5GyTlY0lNOwFantKOXW3fWTEW07EQuuFRPBtlfk7bXflk0Zx86YMaqp puG/5htFsVQlmcypyaeJviqiWRUEQCLXnYtzV48dJLbie+rvFNP3z4HQLz2NXvhaK5Dv NWoA== X-Gm-Message-State: AOAM532z2+TUzoJ+wWf5z3j5crQ6QX8s475MbIp3lsDOCiwGqrwJgnPq /mQYuuuD0+8dS1DRnv5ayrE= X-Google-Smtp-Source: ABdhPJy6bz4sfB0SGcw2+LJM5EeGhRvi+pFG1aRi6wZ6SYnmUkewuLi9CJws09KFOHHo/9HeusARKw== X-Received: by 2002:a17:903:244c:b0:15d:4430:4cbc with SMTP id l12-20020a170903244c00b0015d44304cbcmr2598867pls.83.1651296431732; Fri, 29 Apr 2022 22:27:11 -0700 (PDT) Received: from smtpclient.apple (104-180-75-250.lightspeed.sndgca.sbcglobal.net. [104.180.75.250]) by smtp.gmail.com with ESMTPSA id n21-20020aa78a55000000b0050dc76281c2sm595016pfa.156.2022.04.29.22.27.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Apr 2022 22:27:11 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: bug#54591: 29.0.50; sqlite-select returns blob result as multibyte string From: Yuan Fu In-Reply-To: <87tuacgq7z.fsf@gnus.org> Date: Fri, 29 Apr 2022 22:27:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <87D54965-FE2F-42A5-BDD8-9818147C2FFB@gmail.com> References: <83h77jaof6.fsf@gnu.org> <87lewsakng.fsf@gnus.org> <83o81o93ak.fsf@gnu.org> <87a6d672xr.fsf@gnus.org> <9B7077C1-8164-4DE3-BEEC-BF68A235F61C@gmail.com> <87tuacgq7z.fsf@gnus.org> To: Lars Ingebrigtsen X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54591 Cc: 54591@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Apr 29, 2022, at 3:04 AM, Lars Ingebrigtsen wrote: >=20 > Yuan Fu writes: >=20 >> I had a quick look at the log and didn=E2=80=99t see anything related = to >> sql. >=20 > Which log? >=20 > * | 5d032f2904..: Lars Ingebrigtsen 2022-04-28 Allow inserting and = selecting binary blobs from sqlite >=20 > --=20 > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no Never mind :-) Yuan= From unknown Fri Jun 20 05:37:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 28 May 2022 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator