Add an experimental API for retrieving the SQL source from a compiled statement: sqlite3_sql(). Ticket #2769. (CVS 4543)

FossilOrigin-Name: d31f1e0d74a871d66cf7d3ef35faae5171d5cbc3
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index cb1adf2..a169b8c 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -30,7 +30,7 @@
 ** the version number) and changes its name to "sqlite3.h" as
 ** part of the build process.
 **
-** @(#) $Id: sqlite.h.in,v 1.269 2007/11/05 17:54:17 drh Exp $
+** @(#) $Id: sqlite.h.in,v 1.270 2007/11/14 06:48:48 danielk1977 Exp $
 */
 #ifndef _SQLITE3_H_
 #define _SQLITE3_H_
@@ -1595,6 +1595,23 @@
 );
 
 /*
+** Retrieve the original SQL statement associated with a compiled statement
+** in UTF-8 encoding.
+**
+** If the compiled SQL statement passed as an argument was compiled using
+** either sqlite3_prepare_v2 or sqlite3_prepare16_v2, then this function
+** returns a pointer to a nul-terminated string containing a copy of
+** the original SQL statement. The pointer is valid until the statement
+** is deleted using sqlite3_finalize().
+**
+** If the statement was compiled using either of the legacy interfaces 
+** sqlite3_prepare() or sqlite3_prepare16(), this function returns NULL.
+** 
+****** EXPERIMENTAL - subject to change without notice **************
+*/
+const char *sqlite3_sql(sqlite3_stmt *pStmt);
+
+/*
 ** CAPI3REF:  Dynamically Typed Value Object
 **
 ** SQLite uses dynamic typing for the values it stores.  Values can