mirror of
https://github.com/sqlite/sqlite.git
synced 2024-11-23 23:57:41 +01:00
Ensure that the database encoding is detected before the code generator gets
too far down into byte-code generation and execution, but not so early that it interferes with initialization. [forum:/forumpost/bc75a4d20b756044|Forum thread bc75a4d20b756044]. FossilOrigin-Name: af7173a10ec6a4ab465207c1ee20393e8b5f06604c0f3b2fdc19e52c2fc013d5
This commit is contained in:
parent
4bf24c8830
commit
bc60d7bee9
@ -198,7 +198,7 @@ if {[permutation]=="inmemory_journal"} {
|
||||
} else {
|
||||
do_catchsql_test 6.1 {
|
||||
SELECT ( 'elvis' IN(SELECT rtreecheck('t1')) ) FROM (SELECT 1) GROUP BY 1;
|
||||
} {1 {database table is locked}}
|
||||
} {0 0}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
22
manifest
22
manifest
@ -1,5 +1,5 @@
|
||||
C Avoid\sloading\sthe\sentire\srecord\sinto\smemory\sfor\san\ssqlite3_preupdate_old()\scall\sthat\sretrieves\san\sIPK\svalue.
|
||||
D 2024-11-04T16:59:02.337
|
||||
C Ensure\sthat\sthe\sdatabase\sencoding\sis\sdetected\sbefore\sthe\scode\sgenerator\sgets\ntoo\sfar\sdown\sinto\sbyte-code\sgeneration\sand\sexecution,\sbut\snot\sso\searly\sthat\nit\sinterferes\swith\sinitialization.\n[forum:/forumpost/bc75a4d20b756044|Forum\sthread\sbc75a4d20b756044].
|
||||
D 2024-11-04T19:08:53.154
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md c5b4009dca54d127d2d6033c22fd9cc34f53bedb6ef12c7cbaa468381c74ab28
|
||||
@ -558,7 +558,7 @@ F ext/rtree/rtreeI.test 608e77f7fde9be5a12eae316baef640fffaafcfa90a3d67443e78123
|
||||
F ext/rtree/rtreeJ.test 93227ccd4d6c328f5ac46a902b8880041509dd2d68f6ce71560f0d8ab5bb507a
|
||||
F ext/rtree/rtree_perf.tcl 6c18c1f23cd48e0f948930c98dfdd37dfccb5195
|
||||
F ext/rtree/rtree_util.tcl 202ca70df1f0645ef9d5a2170e62d378a28098d9407f0569e85c9c1cf1bd020a
|
||||
F ext/rtree/rtreecheck.test 934546ad9b563e090ee0c5cbdc69ad014189ad76e5df7320526797a9a345661f
|
||||
F ext/rtree/rtreecheck.test 84eedb43b25b3edf591125266d0bb1cebdfcdcc9c4a56b27d85bcb63c7dd7558
|
||||
F ext/rtree/rtreecirc.test aec664eb21ae943aeb344191407afff5d392d3ae9d12b9a112ced0d9c5de298e
|
||||
F ext/rtree/rtreeconnect.test 225ad3fcb483d36cbee423a25052a6bbae762c9576ae9268332360c68c170d3d
|
||||
F ext/rtree/rtreedoc.test d633982d61542f3bc0a0a2df0382a02cc699ac56cbda01130cde6da44a228490
|
||||
@ -766,13 +766,13 @@ F src/os_win.c 69fa1aaff68270423c85cff4327ba17ef99a1eb017e1a2bfb97416d9b8398b05
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c 9656ad4e8331efb8a4f94f7a0c6440b98caea073950a367ea0c728a53b8e62c9
|
||||
F src/pager.h 4b1140d691860de0be1347474c51fee07d5420bd7f802d38cbab8ea4ab9f538a
|
||||
F src/parse.y a7a8d42eeff01d267444ddb476029b0b1726fb70ae3d77984140f17ad02e2d61
|
||||
F src/parse.y 8ec56598aa0df92428627502267d0d1c9778cc27308f8ffd31dfb2d017a8755f
|
||||
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 49516ad7718a3626f28f710fa7448ef1fce3c07fd169acbb4817341950264319
|
||||
F src/pragma.c a2ec3657a953fa7dea7c1e680e4358b6ce6ae570b6c5234e0f5ef219d308d223
|
||||
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
|
||||
F src/prepare.c 3ba0ad907b7773ed642f66cea8a2c9c8edc18841aa1050b6218dbb3479e86225
|
||||
F src/prepare.c 1832be043fce7d489959aae6f994c452d023914714c4d5457beaed51c0f3d126
|
||||
F src/printf.c 6a87534ebfb9e5346011191b1f3a7ebc457f5938c7e4feeea478ecf53f6a41b2
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
@ -1120,7 +1120,7 @@ F test/e_walauto.test 248af31e73c98df23476a22bdb815524c9dc3ba8
|
||||
F test/e_walckpt.test 28c371a6bb5e5fe7f31679c1df1763a19d19e8a0
|
||||
F test/e_walhook.test 01b494287ba9e60b70f6ebf3c6c62e0ffe01788e344a4846b08e5de0b344cb66
|
||||
F test/emptytable.test a38110becbdfa6325cd65cb588dca658cd885f62
|
||||
F test/enc.test 9a7be5479da985381d740b15f432800f65e2c87029ee57a318f42cb2eb43763a
|
||||
F test/enc.test b5503a87b31cea8a5084c6e447383f9ca08933bd2f29d97b6b6201081b2343eb
|
||||
F test/enc2.test 848bf05f15b011719f478dddb7b5e9aea35e39e457493cba4c4eef75d849a5ec
|
||||
F test/enc3.test 55ef64416d72975c66167310a51dc9fc544ba3ae4858b8d5ab22f4cb6500b087
|
||||
F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
|
||||
@ -1457,7 +1457,7 @@ F test/misc1.test e3e36262aff1bd9b8b9bf1eeb3af04adb3fc1e23f0a92dbff708bba9e939ac
|
||||
F test/misc2.test a1a3573cc02662becd967766021d6f16c54684d56df5f227481c7ef0d9df0bd0
|
||||
F test/misc3.test 651b88bca19b8ff6a7b6af73dae00c3fd5b3ea5bee0c0d1d91abd4c4b4748718
|
||||
F test/misc4.test 10cd6addb2fa9093df4751a1b92b50440175dd5468a6ec84d0386e78f087db0e
|
||||
F test/misc5.test 027cf0ac10314ea534173f335a33bb4059907ddabbac2c16786766d6f26c8923
|
||||
F test/misc5.test 02fcaf4d42405be02ec975e946270a50b0282dac98c78303ade0d1392839d2b8
|
||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||
F test/misc7.test d912f3d45c2989191b797504a220ca225d6be80b21acad22ba0d35f4a9ee4579
|
||||
F test/misc8.test 08d2380bc435486b12161521f225043ac2be26f02471c2c1ea4cac0b1548edbd
|
||||
@ -2199,8 +2199,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P af0a345b3b287f82b54249cfa574ef3ce52305a6452058aac98cd473c361919e
|
||||
R 84f5bc88e95886a46e23b56039713592
|
||||
U dan
|
||||
Z ba372c464e587d954c923d1075bdeb25
|
||||
P 7f4de43733200beeb3ff0a70d51bbc68f5331895698ea95a82741cfd7bb66834
|
||||
R 37843e70c3ec2e1305165bf8dbe6f9d9
|
||||
U drh
|
||||
Z 34b3ce0ce5f61e360e39d80506afd73c
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
7f4de43733200beeb3ff0a70d51bbc68f5331895698ea95a82741cfd7bb66834
|
||||
af7173a10ec6a4ab465207c1ee20393e8b5f06604c0f3b2fdc19e52c2fc013d5
|
||||
|
@ -499,7 +499,11 @@ cmd ::= DROP VIEW ifexists(E) fullname(X). {
|
||||
//
|
||||
cmd ::= select(X). {
|
||||
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
|
||||
sqlite3Select(pParse, X, &dest);
|
||||
if( (pParse->db->mDbFlags & DBFLAG_EncodingFixed)!=0
|
||||
|| sqlite3ReadSchema(pParse)==SQLITE_OK
|
||||
){
|
||||
sqlite3Select(pParse, X, &dest);
|
||||
}
|
||||
sqlite3SelectDelete(pParse->db, X);
|
||||
}
|
||||
|
||||
|
@ -306,14 +306,7 @@ int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFlags){
|
||||
#else
|
||||
encoding = SQLITE_UTF8;
|
||||
#endif
|
||||
if( db->nVdbeActive>0 && encoding!=ENC(db)
|
||||
&& (db->mDbFlags & DBFLAG_Vacuum)==0
|
||||
){
|
||||
rc = SQLITE_LOCKED;
|
||||
goto initone_error_out;
|
||||
}else{
|
||||
sqlite3SetTextEncoding(db, encoding);
|
||||
}
|
||||
sqlite3SetTextEncoding(db, encoding);
|
||||
}else{
|
||||
/* If opening an attached database, the encoding much match ENC(db) */
|
||||
if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){
|
||||
|
@ -249,4 +249,33 @@ do_execsql_test enc-12.10 {
|
||||
SELECT * FROM t1;
|
||||
} {d e f xxx yyy zzz}
|
||||
|
||||
|
||||
# 2024-11-04
|
||||
# https://sqlite.org/forum/forumpost/bc75a4d20b756044
|
||||
#
|
||||
# Ensure the database encoding is detected in a timely manner,
|
||||
# and before we get too far along in generating and running
|
||||
# bytecode.
|
||||
#
|
||||
# See also check-in https://sqlite.org/src/info/a02da71f3a.
|
||||
#
|
||||
db close
|
||||
forcedelete utf16.db
|
||||
sqlite3 db utf16.db
|
||||
db eval {PRAGMA encoding=UTF16; CREATE TABLE t2(y); INSERT INTO t2 VALUES('utf16');}
|
||||
db close
|
||||
sqlite3 db utf16.db
|
||||
do_test enc-13.1 {
|
||||
db eval {PRAGMA function_list} {db eval {SELECT * FROM sqlite_schema}}
|
||||
} {}
|
||||
ifcapable rtree {
|
||||
db eval {CREATE VIRTUAL TABLE t3 USING rtree(id,x1,x2)}
|
||||
db close
|
||||
sqlite3 db utf16.db
|
||||
do_execsql_test enc-13.2 {
|
||||
WITH t1(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM t1 WHERE x<3)
|
||||
SELECT rtreecheck('t3') FROM t1;
|
||||
} {ok ok ok}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
@ -523,6 +523,7 @@ if {[permutation] == ""} {
|
||||
CREATE TABLE t1(a,b,c);
|
||||
}
|
||||
} {1 {file is not a database}}
|
||||
reset_db
|
||||
}
|
||||
|
||||
# Ticket #1371. Allow floating point numbers of the form .N or N.
|
||||
|
Loading…
Reference in New Issue
Block a user