SQLITE源码剖析(13)
声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iteye.com/)原创,未经笔者授权,任何人和机构不能转载
//第一个参数的每个回调请求被转到sqlite3_exec() 的第4个参数,
//如果指向sqlite3_exec()的回调指针是NULL,则没有回调被调用,
//且结果行被忽略。
**^The 4th argument to
** to sqlite3_exec() is relayed through to the 1st argument of each
** callback invocation. ^If the callback pointer to sqlite3_exec()
** is NULL, then no callback is ever invoked and result rows are
** ignored.
**当执行SQL语句时,如果错误发生在sqlite3_exec()中,则当前语句
**的执行停止,且子语句被跳过。如果sqlite3_exec()的第5个参
**数非NULL,则error信息被写入从sqlite3_malloc()分配的内存。为防
**内存泄露,应用程序必须调用sqlite3_free()释放从sqlite3_exec()的
**第5个参数返回的错误信息字符串,当这些错误信息字符串不再需要时。
**如果sqlite3_exec()的第5个参数为非NULL且没有错误发生,
**sqlite3_exec()返回前将设置其为NULL
** ^If an error occurs while evaluating the SQL statements passed into
** sqlite3_exec(), then execution of the current statement stops and
** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
** is not NULL then any error message is written into memory obtained
** from [sqlite3_malloc()] and passed back through the 5th parameter.
** To avoid memory leaks, the application should invoke [sqlite3_free()]
** on error message strings returned through the 5th parameter of
** of sqlite3_exec() after the error message string is no longer needed.
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
** NULL before returning.
**如果sqlite3_exec()回调返回非0,则sqlite3_exec()通常
**返回SQLITE_ABORT,不运行任何后来的SQL语句
** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
** routine returns SQLITE_ABORT without invoking the callback again and
** without running any subsequent SQL statements.