diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-02 22:15:35 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-02 22:15:35 +0100 |
commit | 0babd10cdf9a589209895b5c8a2f5d7650db5cfc (patch) | |
tree | 0e2cdd9b52c49260a3df4290b51211de914e087f /lib/Plugins/SQLite3.cpp | |
parent | bbe377fb54426bd17c1f4ee0738842aded6e6756 (diff) | |
download | abrt-0babd10cdf9a589209895b5c8a2f5d7650db5cfc.tar.gz abrt-0babd10cdf9a589209895b5c8a2f5d7650db5cfc.tar.xz abrt-0babd10cdf9a589209895b5c8a2f5d7650db5cfc.zip |
root is god (zprikryl)
Diffstat (limited to 'lib/Plugins/SQLite3.cpp')
-rw-r--r-- | lib/Plugins/SQLite3.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 3a67bad..78dd5b2 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -172,7 +172,12 @@ void CSQLite3::Insert(const std::string& pUUID, void CSQLite3::Delete(const std::string& pUUID, const std::string& pUID) { - if (Exist(pUUID, pUID)) + if (pUID == "0") + { + Exec("DELETE FROM "TABLE_NAME" " + "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"';"); + } + else if (Exist(pUUID, pUID)) { Exec("DELETE FROM "TABLE_NAME" " "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " @@ -180,7 +185,7 @@ void CSQLite3::Delete(const std::string& pUUID, const std::string& pUID) } else { - throw std::string("CSQLite3::SetReported(): UUID is not found in DB."); + throw std::string("CSQLite3::Delete(): UUID is not found in DB."); } } @@ -219,10 +224,19 @@ const database_row_t CSQLite3::GetUUIDData(const std::string& pUUID, const std:: { vector_database_rows_t table; - GetTable("SELECT * FROM "TABLE_NAME" " - "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " - "AND "DATABASE_COLUMN_UID" = '"+pUID+"';", - table); + if (pUID == "0") + { + GetTable("SELECT * FROM "TABLE_NAME" " + "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"';", + table); + } + else + { + GetTable("SELECT * FROM "TABLE_NAME" " + "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " + "AND "DATABASE_COLUMN_UID" = '"+pUID+"';", + table); + } if (table.size() == 0) { |