mirror of
https://github.com/sqlite/sqlite.git
synced 2026-10-23 21:49:02 +03:00
FTS5: INSERT into a locale=1, contentless_unindexed=1 table with an UNINDEXED
column now works. [bugs:/info/2026-10-21T02:49:37Z|Bug 2026-10-21T02:49:37Z] FossilOrigin-Name: 055f90829c4094f9c78d95ce05662b9443c325cb16af50beabf56e7f8b72b9bf
This commit is contained in:
@@ -383,7 +383,7 @@ int sqlite3Fts5StorageOpen(
|
||||
sqlite3_str_appendf(pDefn, ", c%d", i);
|
||||
}
|
||||
}
|
||||
if( pConfig->bLocale ){
|
||||
if( pConfig->bLocale && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
sqlite3_str_appendf(pDefn, ", l%d", i);
|
||||
|
||||
@@ -293,5 +293,75 @@ do_execsql_test 6.4 {
|
||||
300 {} b3 c3.1 {}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Forum post c9c5ddb17e (2026-10-21).
|
||||
#
|
||||
# A contentless_unindexed=1 table with locale=1 and an UNINDEXED column
|
||||
# could not be written to, as the %_content table was created with
|
||||
# locale columns for the indexed columns, which are not stored.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 7.0 {
|
||||
CREATE VIRTUAL TABLE h USING fts5(a, b UNINDEXED,
|
||||
locale=1, content='', contentless_unindexed=1
|
||||
);
|
||||
INSERT INTO h(rowid, a, b) VALUES (4, 'p q', 'r');
|
||||
SELECT rowid, * FROM h;
|
||||
} {4 {} r}
|
||||
|
||||
do_execsql_test 7.1 {
|
||||
SELECT sql FROM sqlite_schema WHERE name='h_content';
|
||||
} {{CREATE TABLE 'h_content'(id INTEGER PRIMARY KEY, c1)}}
|
||||
|
||||
reset_db
|
||||
do_execsql_test 7.2 {
|
||||
CREATE VIRTUAL TABLE h USING fts5(a, b UNINDEXED, c, d UNINDEXED,
|
||||
locale=1, content='', contentless_unindexed=1, contentless_delete=1
|
||||
);
|
||||
INSERT INTO h(rowid, a, b, c, d) VALUES
|
||||
(1, 'p q', 'b1', 'x y', 'd1'),
|
||||
(2, fts5_locale('en', 's t'), 'b2', 'x z', fts5_locale('en', 'd2')),
|
||||
(3, 'v w', fts5_locale('fr', 'b3'), fts5_locale('fr', 'y z'), 'd3');
|
||||
SELECT rowid, * FROM h;
|
||||
} {
|
||||
1 {} b1 {} d1
|
||||
2 {} b2 {} d2
|
||||
3 {} b3 {} d3
|
||||
}
|
||||
|
||||
do_execsql_test 7.3 {
|
||||
SELECT rowid, b, d FROM h('q');
|
||||
SELECT rowid, b, d FROM h('t');
|
||||
SELECT rowid, b, d FROM h('c:z');
|
||||
} {1 b1 d1 2 b2 d2 2 b2 d2 3 b3 d3}
|
||||
|
||||
do_execsql_test 7.4 {
|
||||
UPDATE h SET b='b1.1' WHERE rowid=1;
|
||||
UPDATE h SET a='m n', c='o' WHERE rowid=3;
|
||||
DELETE FROM h WHERE rowid=2;
|
||||
SELECT rowid, * FROM h;
|
||||
} {
|
||||
1 {} b1.1 {} d1
|
||||
3 {} b3 {} d3
|
||||
}
|
||||
|
||||
do_execsql_test 7.5 {
|
||||
SELECT rowid FROM h('n');
|
||||
INSERT INTO h(h) VALUES('integrity-check');
|
||||
PRAGMA integrity_check;
|
||||
} {3 ok}
|
||||
|
||||
# A normal content table with locale=1 still stores locales.
|
||||
reset_db
|
||||
do_execsql_test 7.6 {
|
||||
CREATE VIRTUAL TABLE h USING fts5(a, b UNINDEXED, locale=1);
|
||||
INSERT INTO h(rowid, a, b) VALUES (4, fts5_locale('en', 'p q'), 'r');
|
||||
SELECT sql FROM sqlite_schema WHERE name='h_content';
|
||||
SELECT rowid, a, b, fts5_get_locale(h, 0) FROM h;
|
||||
} {
|
||||
{CREATE TABLE 'h_content'(id INTEGER PRIMARY KEY, c0, c1, l0)}
|
||||
4 {p q} r en
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
||||
C Merge\sthe\sFTS5\sone-byte\soverread\sfix\sfrom\sbranch-3.54
|
||||
D 2026-10-23T16:01:12.832
|
||||
C FTS5:\sINSERT\sinto\sa\slocale=1,\scontentless_unindexed=1\stable\swith\san\sUNINDEXED\ncolumn\snow\sworks.\n[bugs:/info/2026-10-21T02:49:37Z|Bug\s2026-10-21T02:49:37Z]
|
||||
D 2026-10-23T18:39:36.464
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
@@ -116,7 +116,7 @@ F ext/fts5/fts5_expr.c 1b80d93e5d163a90253ec99c2568e419bc9b224115b3bcd34709ea522
|
||||
F ext/fts5/fts5_hash.c 341a08ad0153b397b819ef3d7a7959c1dc3c84a6988a431d93dece8bd62ae10e
|
||||
F ext/fts5/fts5_index.c e8feafa4e8abc03536a7ac08f198f662eb5c247e9dcaf150b8b7193fa759928b
|
||||
F ext/fts5/fts5_main.c 4b588e2b8218021f3985d930f9dbf4eea4155c6e9cfa997fc9bc25ee8b11e448
|
||||
F ext/fts5/fts5_storage.c 1fa9f5dbbe6c3c03119cb434262bbded60a2ba19ab0be73bfe8ba3c9cffa39fd
|
||||
F ext/fts5/fts5_storage.c 083d868163978ce078a437c426b20da04422e38e7e8c428a283452308bb14f5e
|
||||
F ext/fts5/fts5_tcl.c aed8905b1a3c6ecc94da15e9cc54d889045b9eacecc7a17b6fcc1294225f7716
|
||||
F ext/fts5/fts5_test_mi.c 3074a25cb661b2301143022ef96a950618452a5b082abd9ba7b9daaf29d01537
|
||||
F ext/fts5/fts5_test_tok.c 6021033bd4f4feffe8579efb6e1f58156ed462256bf99a2acdbd629246529204
|
||||
@@ -270,7 +270,7 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda
|
||||
F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818
|
||||
F ext/fts5/test/fts5unicode4.test 6d70dbe56e5179bb1990cfb22e62fdf2aae9458e443ade856e598ce95832fe9b
|
||||
F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae
|
||||
F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02
|
||||
F ext/fts5/test/fts5unindexed2.test 402ae7dddc6567d78692c31564b8dd158fd4241aa9e9d62f3cdb6c2d1f54309a
|
||||
F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc
|
||||
F ext/fts5/test/fts5update2.test c5baa76799ac605ebb8e5e21035db2014b396cef25c903eb96ba39b1d6f9f046
|
||||
F ext/fts5/test/fts5version.test 44ab35566267b7618c090443de2d9ad84f633df5d20bf72e9bad199ae5fced84
|
||||
@@ -2297,8 +2297,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
|
||||
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
|
||||
P 5b0c5f63416a671ee15a2a2bae430d059ea9b664c0f2db41d033286d00d1a56b 60222d023e889eb8c67c0a654637c3f3da741b37143f1b3351a7ac4ef09befc6
|
||||
R b3bcb642118fe12017fe1b12508f2aa5
|
||||
P b5271900464944afdbbc5de9fbed185ff6b6143bc6dca3984e8e6af5f5caa855
|
||||
R a2357c9a00d868562797ad057824ec40
|
||||
U drh
|
||||
Z 7d3c098d81ab7b1ffd325d9d7962e457
|
||||
Z 982cfb1a284ed4bf3c529e566fced4d2
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
@@ -1 +1 @@
|
||||
b5271900464944afdbbc5de9fbed185ff6b6143bc6dca3984e8e6af5f5caa855
|
||||
055f90829c4094f9c78d95ce05662b9443c325cb16af50beabf56e7f8b72b9bf
|
||||
|
||||
Reference in New Issue
Block a user