]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Update document on sqlite3_mprintf() and related functions. Discuss the
authordrh <drh@noemail.net>
Sat, 21 Feb 2015 15:42:57 +0000 (15:42 +0000)
committerdrh <drh@noemail.net>
Sat, 21 Feb 2015 15:42:57 +0000 (15:42 +0000)
%w format and point out that obscure ANSI-C formats are not supported.
No changes to code.

FossilOrigin-Name: f8917ba4d917bc762b3b252466ab72a8a70dc0d8

manifest
manifest.uuid
src/sqlite.h.in

index fbd819836120133a40a54172f95dada84f98be6c..8dd0ff33909fceaa17121a82fa8db80aaba3e736 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\scompiler\swarning\sassociated\swith\sUSE_PREAD64.
-D 2015-02-21T00:56:05.294
+C Update\sdocument\son\ssqlite3_mprintf()\sand\srelated\sfunctions.\s\sDiscuss\sthe\n%w\sformat\sand\spoint\sout\sthat\sobscure\sANSI-C\sformats\sare\snot\ssupported.\nNo\schanges\sto\scode.
+D 2015-02-21T15:42:57.800
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -232,7 +232,7 @@ F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b
 F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
 F src/select.c e46cef4c224549b439384c88fc7f57ba064dad54
 F src/shell.c 6276582ee4e9114e0bb0795772414caaf21c0f8e
-F src/sqlite.h.in b02d8d19c5adc73bd02b225054103247aff64425
+F src/sqlite.h.in 86cddbfdb3155967858c1469108813bcc08eda21
 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
 F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
 F src/sqliteInt.h 57a405ae6d2ed10fff52de376d18f21e04d96609
@@ -1239,7 +1239,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 7560a9fa50236ecaa0617f1ab5bb5662f4a61c72
-R afd779aaccfbda112c52de91ea006a71
+P c299e55a661c04f71ab43cb8aed04f8ece6e0567
+R dda772aafb6dee5a528cc1c5d5a14dc2
 U drh
-Z 8991d0e22753a2d2a931885c01f739fa
+Z 75f83919b9b483315b93f05f4ef8627c
index 799d2f85ad2ea52a7ed1fd66f404557a06838507..c46ad20405c5f645ad5fd2f15da8e7987d5592df 100644 (file)
@@ -1 +1 @@
-c299e55a661c04f71ab43cb8aed04f8ece6e0567
\ No newline at end of file
+f8917ba4d917bc762b3b252466ab72a8a70dc0d8
\ No newline at end of file
index 8a358dbb2f994d68d1118a3d7f87f4374e01c90c..ee910393e61ffdd9b4e1a73135822122d47bed5c 100644 (file)
@@ -2232,6 +2232,10 @@ void sqlite3_free_table(char **result);
 **
 ** These routines are work-alikes of the "printf()" family of functions
 ** from the standard C library.
+** These routines understand most of the common K&R formatting options,
+** plus some additional non-standard formats, detailed below.
+** Note that some of the more obscure formatting options from recent
+** C-library standards are omitted from this implementation.
 **
 ** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their
 ** results into memory obtained from [sqlite3_malloc()].
@@ -2264,7 +2268,7 @@ void sqlite3_free_table(char **result);
 ** These routines all implement some additional formatting
 ** options that are useful for constructing SQL statements.
 ** All of the usual printf() formatting options apply.  In addition, there
-** is are "%q", "%Q", and "%z" options.
+** is are "%q", "%Q", "%w" and "%z" options.
 **
 ** ^(The %q option works like %s in that it substitutes a nul-terminated
 ** string from the argument list.  But %q also doubles every '\'' character.
@@ -2317,6 +2321,12 @@ void sqlite3_free_table(char **result);
 ** The code above will render a correct SQL statement in the zSQL
 ** variable even if the zText variable is a NULL pointer.
 **
+** ^(The "%w" formatting option is like "%q" except that it expects to
+** be contained within double-quotes instead of single quotes, and it
+** escapes the double-quote character instead of the single-quote
+** character.)^  The "%w" formatting option is intended for safely inserting
+** table and column names into a constructed SQL statement.
+**
 ** ^(The "%z" formatting option works like "%s" but with the
 ** addition that after the string has been read and copied into
 ** the result, [sqlite3_free()] is called on the input string.)^