From: shearer Date: Fri, 25 Sep 2020 08:17:58 +0000 (+0000) Subject: Add reminder comment that, by definition, these functions won't be called from X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a28680095c871a179dbf173b37a4e50d55b9329;p=thirdparty%2Fsqlite.git Add reminder comment that, by definition, these functions won't be called from elsewhere in SQLite. Useful to remember for beginners who may suspect unusued code. FossilOrigin-Name: 6f5c1fde245e18d80dd5b1d33ad36b8320960dc644c666351b0c9b60d8e545ca --- diff --git a/manifest b/manifest index 9dd94331a1..281db9ab1c 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,10 @@ B 3d35fa0be866213274fc09250225b345f6b08a9b4ec373d53d95e627e24512be -C Added\scontext\sto\sexplain\sthat\sthe\stest\scoverage\sis\sabout\sMC/DC\sin\sgeneral,\snot\s\njust\san\sSQLite-specifc\stest\sharness. -D 2020-09-24T11:41:18.469 +C Add\sreminder\scomment\sthat,\sby\sdefinition,\sthese\sfunctions\swon't\sbe\scalled\sfrom\nelsewhere\sin\sSQLite.\sUseful\sto\sremember\sfor\sbeginners\swho\smay\ssuspect\sunusued\scode. +D 2020-09-25T08:17:58.869 F src/btree.h a36f07d3b2a654293b477d80d6f0eff2ce2420dcf964c857eaa44980f1a15a6d +F src/func.c 01d7b7226a02aaa471f667aad348206c55b59390f50250af84260a13aa77285e F src/sqliteInt.h 8cd4cbd10c3263d91a8aa316165f45d8cc9215156e04b635b9a4de8c28c491bb -P 5c306f42514a42fce40fddbfed83df71c3897cc36843ed4e9e968de85ec80b42 -R 60440bb1c556853c2938c18383760027 +P 770dbedddc7ce7fa2355df5db5f77ef08c53549cf7c85d0496b1978e0612c1ab +R 32b3794bc09b7ee1f1b6fdb12b6a4308 U shearer -Z 7cf7042cafcc05ab5168d6b809815715 +Z 0228ae7c068924d2613f708ab4a2497f diff --git a/manifest.uuid b/manifest.uuid index 0958a50951..f12707871b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -770dbedddc7ce7fa2355df5db5f77ef08c53549cf7c85d0496b1978e0612c1ab \ No newline at end of file +6f5c1fde245e18d80dd5b1d33ad36b8320960dc644c666351b0c9b60d8e545ca \ No newline at end of file diff --git a/src/func.c b/src/func.c index 48b5f5f198..0950f7984c 100644 --- a/src/func.c +++ b/src/func.c @@ -10,8 +10,10 @@ ** ************************************************************************* ** This file contains the C-language implementations for many of the SQL -** functions of SQLite. (Some function, and in particular the date and +** functions of SQLite. (Some functions, and in particular the date and ** time functions, are implemented separately.) +** +** Many of these functions are never called from other parts of SQLite. */ #include "sqliteInt.h" #include @@ -257,32 +259,6 @@ endInstrOOM: goto endInstr; } -/* -** Implementation of the printf() function. -*/ -static void printfFunc( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - PrintfArguments x; - StrAccum str; - const char *zFormat; - int n; - sqlite3 *db = sqlite3_context_db_handle(context); - - if( argc>=1 && (zFormat = (const char*)sqlite3_value_text(argv[0]))!=0 ){ - x.nArg = argc-1; - x.nUsed = 0; - x.apArg = argv+1; - sqlite3StrAccumInit(&str, db, 0, 0, db->aLimit[SQLITE_LIMIT_LENGTH]); - str.printfFlags = SQLITE_PRINTF_SQLFUNC; - sqlite3_str_appendf(&str, zFormat, &x); - n = str.nChar; - sqlite3_result_text(context, sqlite3StrAccumFinish(&str), n, - SQLITE_DYNAMIC); - } -} /* ** Implementation of the substr() function. @@ -1969,7 +1945,6 @@ void sqlite3RegisterBuiltinFunctions(void){ FUNCTION2(typeof, 1, 0, 0, typeofFunc, SQLITE_FUNC_TYPEOF), FUNCTION2(length, 1, 0, 0, lengthFunc, SQLITE_FUNC_LENGTH), FUNCTION(instr, 2, 0, 0, instrFunc ), - FUNCTION(printf, -1, 0, 0, printfFunc ), FUNCTION(unicode, 1, 0, 0, unicodeFunc ), FUNCTION(char, -1, 0, 0, charFunc ), FUNCTION(abs, 1, 0, 0, absFunc ),