Article View: linux.debian.bugs.dist
Article #842Bug#1150893: sqlite3-pcre2: Please mark REGEXP as SQLITE_DETERMINISTIC and SQLITE_INNOCUOUS
From: SpikeTheHobbitMage
Date: Wed, 14 Oct 2026 13:50
Date: Wed, 14 Oct 2026 13:50
56 lines
4744 bytes
4744 bytes
Package: sqlite3-pcre2
Version: 0.1.1~git20220105-e3e02a4a-3
Severity: minor
Tags: upstream patch
X-Debbugs-Cc: SpikeTheHobbitMage@runbox.com
SQLITE_DETERMINISTIC lets sqlite better optimize queries that use REGEXP and is required to use it in partial indexes.
SQLITE_INNOCUOUS would be nice to have but only matters when TRUSTED_SCHEMA is turned off.
https://sqlite.org/c3ref/c_deterministic.html#sqlitedeterministic
SQLITE_DETERMINISTIC
The SQLITE_DETERMINISTIC flag means that the new function always gives the same output when the input parameters are the same. The abs() function is deterministic, for example, but randomblob() is not. Functions must be deterministic in order to be used in certain contexts such as with the WHERE clause of partial indexes or in generated columns. SQLite might also optimize deterministic functions by factoring them out of inner loops.
https://sqlite.org/c3ref/c_deterministic.html#sqliteinnocuous
SQLITE_INNOCUOUS
The SQLITE_INNOCUOUS flag means that the function is unlikely to cause problems even if misused. An innocuous function should have no side effects and should not depend on any values other than its input parameters. The abs() function is an example of an innocuous function. The load_extension() SQL function is not innocuous because of its side effects.
SQLITE_INNOCUOUS is similar to SQLITE_DETERMINISTIC, but is not exactly the same. The random() function is an example of a function that is innocuous but not deterministic.
Some heightened security settings (SQLITE_DBCONFIG_TRUSTED_SCHEMA and PRAGMA trusted_schema=OFF) disable the use of SQL functions inside views and triggers and in schema structures such as CHECK constraints, DEFAULT clauses, expression indexes, partial indexes, and generated columns unless the function is tagged with SQLITE_INNOCUOUS. Most built-in functions are innocuous. Developers are advised to avoid using the SQLITE_INNOCUOUS flag for application-defined functions unless the function has been carefully audited and found to be free of potentially security-adverse side-effects and information-leaks.
change pcre2.c line 157 from
```sqlite3_create_function(db, "REGEXP", 2, SQLITE_UTF8, cache, regexp, NULL, NULL);```
to
```sqlite3_create_function(db, "REGEXP", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS, cache, regexp, NULL, NULL);```
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 7.2.9+deb14-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages sqlite3-pcre2 depends on:
ii libc6 2.43-7
ii libpcre2-8-0 10.48-3.1
sqlite3-pcre2 recommends no packages.
sqlite3-pcre2 suggests no packages.
-- no debconf information
Technical Details
Message-ID:
<NO7wK-5t0A-7@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!usenet.goja.nl.eu.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!usenet.goja.nl.eu.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: SpikeTheHobbitMage@runbox.com Newsgroups: linux.debian.bugs.dist Subject: Bug#1150893: sqlite3-pcre2: Please mark REGEXP as SQLITE_DETERMINISTIC and SQLITE_INNOCUOUS Date: Wed, 14 Oct 2026 15:50:02 +0200 Message-ID: <NO7wK-5t0A-7@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Wed Oct 14 13:41:09 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: 1.611 Reply-To: SpikeTheHobbitMage@runbox.com, 1150893@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: spikethehobbitmage@runbox.com, dod@debian.org X-Debian-Pr-Message: report 1150893 X-Debian-Pr-Package: sqlite3-pcre2 X-Debian-Pr-Keywords: patch upstream X-Debian-Pr-Source: sqlite3-pcre2 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: reportbug 13.2.0+nmu1 X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1996763 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 56 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 14 Oct 2026 07:38:31 -0600 X-Original-Message-ID: <179198511134.28776.6959385684366826909.reportbug@pingchan.lan>