[tracker/wip/carlosg/serialize-api] libtracker-data: Return NULL on failed date conversions
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/serialize-api] libtracker-data: Return NULL on failed date conversions
- Date: Fri, 4 Feb 2022 13:42:28 +0000 (UTC)
commit 8bce38dc3776789ffbcf729edae74514e57181c4
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Feb 4 14:41:03 2022 +0100
libtracker-data: Return NULL on failed date conversions
We shouldn't get dates out of range in our database, but if we do,
don't break otherwise correct queries by raising logic errors.
src/libtracker-data/tracker-db-interface-sqlite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c
b/src/libtracker-data/tracker-db-interface-sqlite.c
index a0153c5c9..ac23beb70 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -451,7 +451,7 @@ function_sparql_format_time (sqlite3_context *context,
-1, g_free);
g_date_time_unref (datetime);
} else {
- result_context_function_error (context, fn, "Datetime conversion error");
+ sqlite3_result_null (context);
}
} else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT) {
const gchar *str;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]