| 175 | } |
| 176 | |
| 177 | IPreparedQuery *SqDatabase::PrepareQuery(const char *query, |
| 178 | char *error, |
| 179 | size_t maxlength, |
| 180 | int *errCode/* =NULL */) |
| 181 | { |
| 182 | sqlite3_stmt *stmt = NULL; |
| 183 | if ((m_LastErrorCode = sqlite3_prepare_v2(m_sq3, query, -1, &stmt, NULL)) != SQLITE_OK |
| 184 | || !stmt) |
| 185 | { |
| 186 | const char *msg; |
| 187 | if (m_LastErrorCode != SQLITE_OK) |
| 188 | { |
| 189 | msg = sqlite3_errmsg(m_sq3); |
| 190 | } else { |
| 191 | msg = "Invalid query string"; |
| 192 | m_LastErrorCode = SQLITE_ERROR; |
| 193 | } |
| 194 | if (error) |
| 195 | { |
| 196 | strncopy(error, msg, maxlength); |
| 197 | } |
| 198 | m_LastError.assign(msg); |
| 199 | return NULL; |
| 200 | } |
| 201 | return new SqQuery(this, stmt); |
| 202 | } |
| 203 | |
| 204 | IPreparedQuery *SqDatabase::PrepareQueryEx(const char *query, |
| 205 | size_t len, |
nothing calls this directly
no test coverage detected