Skip to content

Commit

Permalink
Add logging functions for SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMertes committed Nov 20, 2023
1 parent 98b8f93 commit f532a06
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/sql_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -2417,9 +2417,18 @@ databaseType sqlOpenLite (const const_striType host, intType port,
if (open_result != SQLITE_OK) {
if (connection != NULL) {
setDbErrorMsg("sqlOpenLite", "sqlite3_open", connection);
logError(printf("sqlOpenLite: sqlite3_open error %d: %s\n",
open_result, sqlite3_errmsg(connection)););
logError(printf("sqlOpenLite: sqlite3_open(\"%s\", *) --> %d, "
"error %d: %s\n",
fileName8, open_result,
sqlite3_errcode(connection),
sqlite3_errmsg(connection)););
sqlite3_close(connection);
} else {
dbLibError("sqlOpenLite", "sqlite3_open",
"sqlite3_open(\"%s\", *) --> %d\n",
fileName8, open_result);
logError(printf("sqlOpenLite: sqlite3_open(\"%s\", *) --> %d\n",
fileName8, open_result););
} /* if */
err_info = DATABASE_ERROR;
database = NULL;
Expand All @@ -2430,6 +2439,8 @@ databaseType sqlOpenLite (const const_striType host, intType port,
sqlite3_close(connection);
database = NULL;
} else {
logMessage(printf("sqlOpenLite: sqlite3_open(\"%s\", *) --> SQLITE_OK\n",
fileName8););
memset(database, 0, sizeof(dbRecordLite));
database->usage_count = 1;
database->sqlFunc = sqlFunc;
Expand Down

0 comments on commit f532a06

Please sign in to comment.