MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / PrepareQueryEx

Method PrepareQueryEx

extensions/sqlite/driver/SqDatabase.cpp:204–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204IPreparedQuery *SqDatabase::PrepareQueryEx(const char *query,
205 size_t len,
206 char *error,
207 size_t maxlength,
208 int *errCode/* =NULL */)
209{
210 sqlite3_stmt *stmt = NULL;
211 if ((m_LastErrorCode = sqlite3_prepare_v2(m_sq3, query, len, &stmt, NULL)) != SQLITE_OK
212 || !stmt)
213 {
214 const char *msg;
215 if (m_LastErrorCode != SQLITE_OK)
216 {
217 msg = sqlite3_errmsg(m_sq3);
218 } else {
219 msg = "Invalid query string";
220 m_LastErrorCode = SQLITE_ERROR;
221 }
222 if (error)
223 {
224 strncopy(error, msg, maxlength);
225 }
226 m_LastError.assign(msg);
227 return NULL;
228 }
229 return new SqQuery(this, stmt);
230}
231
232sqlite3 *SqDatabase::GetDb()
233{

Callers

nothing calls this directly

Calls 1

strncopyFunction · 0.70

Tested by

no test coverage detected