1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Better error messages on constraint violations. Additional tests and bug fixes

for the callback-free API. (CVS 854)

FossilOrigin-Name: ccc82f1ab4539a60ee5cc2625743c5389f9ccd8e
This commit is contained in:
drh
2003-01-29 18:46:51 +00:00
parent 326dce7451
commit 483750ba8a
22 changed files with 256 additions and 144 deletions

View File

@@ -679,6 +679,28 @@ static void mout(void *arg, char *zNewText, int nNewChar){
}
}
/*
** sqlite_mprintf() works like printf(), but allocations memory to hold the
** resulting string and returns a pointer to the allocated memory. Use
** sqliteFree() to release the memory allocated.
*/
char *sqliteMPrintf(const char *zFormat, ...){
va_list ap;
struct sgMprintf sMprintf;
char *zNew;
char zBuf[200];
sMprintf.nChar = 0;
sMprintf.nAlloc = sizeof(zBuf);
sMprintf.zText = zBuf;
sMprintf.zBase = zBuf;
va_start(ap,zFormat);
vxprintf(mout,&sMprintf,zFormat,ap);
va_end(ap);
sMprintf.zText[sMprintf.nChar] = 0;
return sqliteRealloc(sMprintf.zText, sMprintf.nChar+1);
}
/*
** sqlite_mprintf() works like printf(), but allocations memory to hold the
** resulting string and returns a pointer to the allocated memory. Use