diff options
author | drh <drh@noemail.net> | 2008-07-08 19:34:06 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-07-08 19:34:06 +0000 |
commit | f089aa459e97f6f8ed27efdc958e8ee642b0b4bb (patch) | |
tree | 345a713531ba65de2f6888ed1b76fafd5fb1dda8 /src/insert.c | |
parent | 0880a7463364f3fd0428c8457c89c5fefae977ea (diff) | |
download | sqlite-f089aa459e97f6f8ed27efdc958e8ee642b0b4bb.tar.gz sqlite-f089aa459e97f6f8ed27efdc958e8ee642b0b4bb.zip |
Completely rework the sqlite3SetString() primitive so that it honors the
SQLITE_LIMIT_LENGTH and avoids the use of strlen(). (CVS 5374)
FossilOrigin-Name: 8ed04b1e26a55306e4baf3e93fb084514134d603
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insert.c b/src/insert.c index afb391473..bada46654 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 @@ void sqlite3GenerateConstraintChecks( 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; } |