mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-24 14:17:58 +03:00
Add the SQLITE_PREPARE_DONT_LOG option for sqlite3_prepare_v3(), that prevents
errors in the compilation of the SQL from being sent to sqlite3_log(). FossilOrigin-Name: 870403425493866232cf9e8fa62288861b7d0a4091b15d75727f8bb31da46f94
This commit is contained in:
22
manifest
22
manifest
@@ -1,5 +1,5 @@
|
||||
C Minor\sdoc\supdate\sin\sauto.def.\sNo\sfunctional\schanges.
|
||||
D 2024-12-06T00:12:43.147
|
||||
C Add\sthe\sSQLITE_PREPARE_DONT_LOG\soption\sfor\ssqlite3_prepare_v3(),\sthat\sprevents\nerrors\sin\sthe\scompilation\sof\sthe\sSQL\sfrom\sbeing\ssent\sto\ssqlite3_log().
|
||||
D 2024-12-06T18:35:16.856
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
|
||||
@@ -770,7 +770,7 @@ F src/parse.y dcf45a81b61223ac93e61fdfe9b22d635dd371c446e8222634d90aa37e25e5f6
|
||||
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 49516ad7718a3626f28f710fa7448ef1fce3c07fd169acbb4817341950264319
|
||||
F src/pragma.c a2ec3657a953fa7dea7c1e680e4358b6ce6ae570b6c5234e0f5ef219d308d223
|
||||
F src/pragma.c 767accbbbe53f6bacd05d35cfe2b3e6b830b01719010e8c684cb8b126dbad46e
|
||||
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
|
||||
F src/prepare.c 1832be043fce7d489959aae6f994c452d023914714c4d5457beaed51c0f3d126
|
||||
F src/printf.c 96f7f8baeedc7639da94e4e7a4a2c200e2537c4eec9e5e1c2ffc821f40eb3105
|
||||
@@ -779,7 +779,7 @@ F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 1334b0606dbdc753c8333f41bff441c97f77ef8ad9e33f3701e8adfe3b587c28
|
||||
F src/shell.c.in 660da73720fc0783a00317568aa098ff1887a0a5cbc0c49138d348d9fc890961
|
||||
F src/sqlite.h.in 4d93768709c53b7c653a63817a82d5a8625264ca0d8cdf99967ba147bdcf2aa6
|
||||
F src/sqlite.h.in 6afbcaae44140216704a6c82e4c4ea4118c46d5f6573d6c5fa4fc901ed9d369e
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
F src/sqliteInt.h 77be043f8694f4a8702d0ee882022b2e5a6489a0493e77c5d9a73f1efc5a2cc1
|
||||
@@ -838,7 +838,7 @@ F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb7
|
||||
F src/test_window.c 6d80e11fba89a1796525e6f0048ff0c7789aa2c6b0b11c80827dc1437bd8ea72
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 3f703cacdab728d7741e5a6ac242006d74fe1c2754d4f03ed889d7253259bd68
|
||||
F src/tokenize.c fe17e03175cae35b6694d0f879e7bc3d1ddea2fd4ab148cba9bbd025b7a7bb12
|
||||
F src/treeview.c 921392561385e05ef5703f20a7a72f0a0a45c1fb749558d7467fae2c3f525006
|
||||
F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461
|
||||
F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508
|
||||
@@ -847,7 +847,7 @@ F src/utf.c 8b29d9a5956569ea2700f869669b8ef67a9662ee5e724ff77ab3c387e27094ba
|
||||
F src/util.c ceebf912f673247e305f16f97f0bb7285fca1d37413b79680714a553a9021d33
|
||||
F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40
|
||||
F src/vdbe.c 8a6eb02823b424b273614bae41579392a5c495424592b60423dd2c443a583df0
|
||||
F src/vdbe.h c2549a215898a390de6669cfa32adba56f0d7e17ba5a7f7b14506d6fd5f0c36a
|
||||
F src/vdbe.h 9676348d342bd04e21e384c63b57224171ce84fac77853357334ef94c4d33cf4
|
||||
F src/vdbeInt.h 2da01c73e8e3736a9015d5b04aa04d209bc9023d279d237d4d409205e921ea1e
|
||||
F src/vdbeapi.c 6353de05e8e78e497ccb33381ba5662ccc11c0339e5b1455faff01b6dacc3075
|
||||
F src/vdbeaux.c f0706ad786b8a6c5bc7ea622f3916c2ba2b883abc872d0b4911c4f021945c0e5
|
||||
@@ -1532,7 +1532,7 @@ F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b76
|
||||
F test/pragma.test 11cb9310c42f921918f7f563e3c0b6e70f9f9c3a6a1cf12af8fccb6c574f3882
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
F test/pragma3.test 92a46bbea12322dd94a404f49edcfbfc913a2c98115f0d030a7459bb4712ef31
|
||||
F test/pragma4.test f93f317693e90ece4ed0f5505d9035cae03f9fc684b718278433f2e48703f693
|
||||
F test/pragma4.test 336b99c2a9fd35af3cc6da94f794b4cba09bbdb18f0ecbd3f734bb6bb8e1c15c
|
||||
F test/pragma5.test 7b33fc43e2e41abf17f35fb73f71b49671a380ea92a6c94b6ce530a25f8d9102
|
||||
F test/pragma6.test c5ec577ba087954b4dfa619a3cbe97b155b60a0af487527abe89b10fc17e6512
|
||||
F test/pragmafault.test 275edaf3161771d37de60e5c2b412627ac94cef11739236bec12ed1258b240f8
|
||||
@@ -2202,8 +2202,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 a38606bf44a1b5d0f684f67174c33f8c88c7927e23fc6a715e8d3ae7a6614bbd
|
||||
R 33caa7144247a27ce977090c08431529
|
||||
U stephan
|
||||
Z 799ae7852d1959c2ef269cb9b60fc9dd
|
||||
P d324be296de443bd2853c732b10960178bf3ba9f18c80c509f6b41e2cfb2f3af
|
||||
R ec11279f510ab644cd4a136e6f39dd62
|
||||
U drh
|
||||
Z 8980c884368db10cb1cda65aa0a82ff3
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
@@ -1 +1 @@
|
||||
d324be296de443bd2853c732b10960178bf3ba9f18c80c509f6b41e2cfb2f3af
|
||||
870403425493866232cf9e8fa62288861b7d0a4091b15d75727f8bb31da46f94
|
||||
|
||||
@@ -1279,7 +1279,8 @@ void sqlite3Pragma(
|
||||
char *zSql = sqlite3MPrintf(db, "SELECT*FROM\"%w\"", pTab->zName);
|
||||
if( zSql ){
|
||||
sqlite3_stmt *pDummy = 0;
|
||||
(void)sqlite3_prepare(db, zSql, -1, &pDummy, 0);
|
||||
(void)sqlite3_prepare_v3(db, zSql, -1, SQLITE_PREPARE_DONT_LOG,
|
||||
&pDummy, 0);
|
||||
(void)sqlite3_finalize(pDummy);
|
||||
sqlite3DbFree(db, zSql);
|
||||
}
|
||||
|
||||
@@ -4204,11 +4204,22 @@ int sqlite3_limit(sqlite3*, int id, int newVal);
|
||||
** <dd>The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler
|
||||
** to return an error (error code SQLITE_ERROR) if the statement uses
|
||||
** any virtual tables.
|
||||
**
|
||||
** [[SQLITE_PREPARE_DONT_LOG]] <dt>SQLITE_PREPARE_DONT_LOG</dt>
|
||||
** <dd>The SQLITE_PREPARE_DONT_LOG flag prevents SQL compiler
|
||||
** errors from being sent to the error log defined by
|
||||
** [SQLITE_CONFIG_LOG]. This can be used, for example, to do test
|
||||
** compiles to see if some SQL syntax is well-formed, without generating
|
||||
** messages on the global error log when it is not. If the test compile
|
||||
** fails, the sqlite3_prepare_v3() call returns the same error indications
|
||||
** with or without this flag; it just omits the call to [sqlite3_log()] that
|
||||
** logs the error.
|
||||
** </dl>
|
||||
*/
|
||||
#define SQLITE_PREPARE_PERSISTENT 0x01
|
||||
#define SQLITE_PREPARE_NORMALIZE 0x02
|
||||
#define SQLITE_PREPARE_NO_VTAB 0x04
|
||||
#define SQLITE_PREPARE_DONT_LOG 0x10
|
||||
|
||||
/*
|
||||
** CAPI3REF: Compiling An SQL Statement
|
||||
|
||||
@@ -728,7 +728,9 @@ int sqlite3RunParser(Parse *pParse, const char *zSql){
|
||||
if( pParse->zErrMsg==0 ){
|
||||
pParse->zErrMsg = sqlite3MPrintf(db, "%s", sqlite3ErrStr(pParse->rc));
|
||||
}
|
||||
sqlite3_log(pParse->rc, "%s in \"%s\"", pParse->zErrMsg, pParse->zTail);
|
||||
if( (pParse->prepFlags & SQLITE_PREPARE_DONT_LOG)==0 ){
|
||||
sqlite3_log(pParse->rc, "%s in \"%s\"", pParse->zErrMsg, pParse->zTail);
|
||||
}
|
||||
nErr++;
|
||||
}
|
||||
pParse->zTail = zSql;
|
||||
|
||||
@@ -185,7 +185,7 @@ typedef struct VdbeOpList VdbeOpList;
|
||||
** Additional non-public SQLITE_PREPARE_* flags
|
||||
*/
|
||||
#define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
|
||||
#define SQLITE_PREPARE_MASK 0x0f /* Mask of public flags */
|
||||
#define SQLITE_PREPARE_MASK 0x1f /* Mask of public flags */
|
||||
|
||||
/*
|
||||
** Prototypes for the VDBE interface. See comments on the implementation
|
||||
|
||||
@@ -281,6 +281,27 @@ ifcapable vtab {
|
||||
JOIN pragma_table_info(f."table", t.schema) AS i
|
||||
WHERE i.pk;
|
||||
} {t2 t1 d a 1}
|
||||
|
||||
# With a corrupt VIEW in the schema, the PRAGMA table_list command
|
||||
# will generate internal errors. Confirm that these internal errors
|
||||
# do not appears on the log. https://sqlite.org/src/forumpost/00ee467e
|
||||
test_sqlite3_log [list lappend ::log]
|
||||
set ::log {}
|
||||
do_execsql_test 6.1 {
|
||||
CREATE VIEW v1 AS SELECT abs(a) FROM t1;
|
||||
PRAGMA writable_schema=ON;
|
||||
UPDATE sqlite_schema
|
||||
SET sql=replace(sql,'abs(a)','nosuchfunc(a)')
|
||||
WHERE name='v1';
|
||||
PRAGMA writable_schema=RESET;
|
||||
} {}
|
||||
do_execsql_test 6.2 {
|
||||
PRAGMA table_list;
|
||||
} {main v1 view 0 0 0 main t2 table 2 0 0 main t1 table 2 0 0 main sqlite_schema table 5 0 0 temp sqlite_temp_schema table 5 0 0}
|
||||
do_test 6.3 {
|
||||
set ::log
|
||||
} {}
|
||||
test_sqlite3_log {}
|
||||
}
|
||||
|
||||
# 2024-05-08 https://sqlite.org/forum/forumpost/cf29a33e94
|
||||
|
||||
Reference in New Issue
Block a user