MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / runQuery

Method runQuery

Control/TMSITable.cpp:157–168  ·  view source on GitHub ↗

return true on success

Source from the content-addressed store, hash-verified

155
156// return true on success
157bool TMSITable::runQuery(const char *query, int checkChanges) const
158{
159 int resultCode, changes=0;
160 LOG(DEBUG)<<LOGVAR(query)<<LOGVAR(checkChanges);
161 // (pat) It appears that sqlite3_changes returns 0 if the value being replaced matched what was already there.
162 if (!sqlite_command(mTmsiDB,query,&resultCode) || (checkChanges && 0 == (changes = sqlite3_changes(mTmsiDB)))) {
163 // The changes is only useful if checkChanges is set.
164 LOG(ERR) << "TMSI table query failed:" <<LOGVAR(query) <<LOGVAR(resultCode) <<LOGVAR(changes) <<" error:"<<sqlite3_errmsg(mTmsiDB);
165 return false;
166 }
167 return true;
168}
169
170// pat 9-2013: I am adding an extra table to hold attributes including a version number of the TMSI table file.
171// (pat) If the TMSI_TABLE version does not match expected, drop the TMSI_TABLE before returning, and the caller will recreate it.

Callers 1

tmsisFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected