From b5cbedd0fda47f965479f1464a66da383dc25505 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 1 Nov 2010 13:43:18 +0100 Subject: abrtd: prepearatory patch: is_debug_dump_saved shouldn't need uid Signed-off-by: Denys Vlasenko --- lib/plugins/SQLite3.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/plugins/SQLite3.cpp') diff --git a/lib/plugins/SQLite3.cpp b/lib/plugins/SQLite3.cpp index a57ec873..2ed3f9fd 100644 --- a/lib/plugins/SQLite3.cpp +++ b/lib/plugins/SQLite3.cpp @@ -690,6 +690,27 @@ struct db_row *CSQLite3::GetRow(const char *crash_id) return row; } +struct db_row *CSQLite3::GetRow_by_dir(const char *dir) +{ + if (!is_string_safe(dir)) + return NULL; + + GList *table = get_table_or_die(m_pDB, "SELECT * FROM "ABRT_TABLE + " WHERE "COL_DEBUG_DUMP_PATH"='%s';", + dir + ); + + if (!table) + return NULL; + + GList *first = g_list_first(table); + struct db_row *row = db_rowcpy_from_list(first); + + db_list_free(table); + + return row; +} + void CSQLite3::SetSettings(const map_plugin_settings_t& pSettings) { m_pSettings = pSettings; -- cgit