Completely rework the sqlite3SetString() primitive so that it honors the
SQLITE_LIMIT_LENGTH and avoids the use of strlen(). (CVS 5374)

FossilOrigin-Name: 8ed04b1e26a55306e4baf3e93fb084514134d603
diff --git a/src/main.c b/src/main.c
index 74e8aa9..2f31aa5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.471 2008/07/08 14:52:10 drh Exp $
+** $Id: main.c,v 1.472 2008/07/08 19:34:07 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -1737,8 +1737,9 @@
   if( pAutoinc ) *pAutoinc = autoinc;
 
   if( SQLITE_OK==rc && !pTab ){
-    sqlite3SetString(&zErrMsg, "no such table column: ", zTableName, ".", 
-        zColumnName, 0);
+    sqlite3_free(zErrMsg);
+    zErrMsg = sqlite3MPrintf("no such table column: %s.%s", zTableName,
+        zColumnName);
     rc = SQLITE_ERROR;
   }
   sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg);