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/insert.c b/src/insert.c
index afb3914..bada466 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.244 2008/07/04 10:56:08 danielk1977 Exp $
+** $Id: insert.c,v 1.245 2008/07/08 19:34:07 drh Exp $
*/
#include "sqliteInt.h"
@@ -1130,10 +1130,10 @@
case OE_Rollback:
case OE_Abort:
case OE_Fail: {
- char *zMsg = 0;
+ char *zMsg;
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_CONSTRAINT, onError);
- sqlite3SetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
- " may not be NULL", (char*)0);
+ zMsg = sqlite3MPrintf(pParse->db, "%s.%s may not be NULL",
+ pTab->zName, pTab->aCol[i].zName);
sqlite3VdbeChangeP4(v, -1, zMsg, P4_DYNAMIC);
break;
}