Will print out the contents of .sql on failure to prepare statement.

This commit is contained in:
2017-03-19 00:47:08 -07:00
parent 589f7cec9f
commit afb0a4848e

View File

@ -116,7 +116,7 @@ static bool executequery(const char *sql, const char *str) {
// prepare sql to s, reading until null character.
con = sqlite3_prepare_v2(db, sql, -1, &s, NULL);
if (con != SQLITE_OK) {
fprintf(stderr, "Could not prepare SQL statement: %s\n", sqlite3_errmsg(db));
fprintf(stderr, "Could not prepare SQL statement: %s\n\n%s", sqlite3_errmsg(db), sql);
return false;
}
// bind parameter with a string length that is the # of bytes to null char.