| 216 | } |
| 217 | |
| 218 | SqlState nextRow(sqlite3_stmt* stmt, SqlState current) |
| 219 | { |
| 220 | if (current != SqlState::SQL_ROW) |
| 221 | { // querying a new row after the last invocation gave 'SQL_DONE' might loop around |
| 222 | // to the first entry and give an infinite loop!!! |
| 223 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Sql operation requested on SQL_DONE/SQL_ERROR state. This should never happen. Please file a bug report!"); |
| 224 | } |
| 225 | int rc = sqlite3_step(stmt); |
| 226 | if (rc == SQLITE_ROW) |
| 227 | { |
| 228 | return SqlState::SQL_ROW; |
| 229 | } |
| 230 | if (rc == SQLITE_DONE) |
| 231 | { |
| 232 | return SqlState::SQL_DONE; |
| 233 | } |
| 234 | if (rc == SQLITE_ERROR) |
| 235 | { |
| 236 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Sql operation failed with SQLITE_ERROR!"); |
| 237 | } |
| 238 | if (rc == SQLITE_BUSY) |
| 239 | { |
| 240 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Sql operation failed with SQLITE_BUSY!"); |
| 241 | } |
| 242 | if (rc == SQLITE_MISUSE) |
| 243 | { |
| 244 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Sql operation failed with SQLITE_MISUSE!"); |
| 245 | } |
| 246 | throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Sql operation failed with unexpected error code!"); |
| 247 | } |
| 248 | |
| 249 | /// Special case: store integer in a string data value |
| 250 | bool extractValueIntStr(String* dst, sqlite3_stmt* stmt, int pos) |
no outgoing calls
no test coverage detected