tracker r2798 - in trunk: . src/libtracker-data
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2798 - in trunk: . src/libtracker-data
- Date: Thu, 15 Jan 2009 17:42:56 +0000 (UTC)
Author: mottela
Date: Thu Jan 15 17:42:56 2009
New Revision: 2798
URL: http://svn.gnome.org/viewvc/tracker?rev=2798&view=rev
Log:
Proper null handling added to queries
Modified:
trunk/ChangeLog
trunk/src/libtracker-data/tracker-data-search.c
Modified: trunk/src/libtracker-data/tracker-data-search.c
==============================================================================
--- trunk/src/libtracker-data/tracker-data-search.c (original)
+++ trunk/src/libtracker-data/tracker-data-search.c Thu Jan 15 17:42:56 2009
@@ -786,7 +786,7 @@
g_string_append_printf (sql_order, ",");
}
- g_string_append_printf (sql_select, "%s", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
g_string_append_printf (sql_order, " %s %s",
tracker_field_data_get_select_field (fd),
order_desc ? "DESC" : "ASC" );
@@ -912,11 +912,11 @@
g_string_append_printf (sql_group, ",");
}
- g_string_append_printf (sql_select, "%s", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
g_string_append_printf (sql_order, " %s %s",
tracker_field_data_get_select_field (fd),
order_desc ? "DESC" : "ASC" );
- g_string_append_printf (sql_group, "%s", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_group, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
}
@@ -939,7 +939,7 @@
return NULL;
}
- g_string_append_printf (sql_select, ", COUNT (DISTINCT %s)", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, ", COUNT (DISTINCT COALESCE(%s,''))", tracker_field_data_get_select_field (fd));
} else {
g_string_append_printf (sql_select, ", COUNT (DISTINCT S.ID)");
}
@@ -1072,11 +1072,11 @@
g_string_append_printf (sql_group, ",");
}
- g_string_append_printf (sql_select, "%s", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
g_string_append_printf (sql_order, " %s %s",
tracker_field_data_get_select_field (fd),
order_desc ? "DESC" : "ASC" );
- g_string_append_printf (sql_group, "%s", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_group, "COALESCE(%s,'')", tracker_field_data_get_select_field (fd));
}
@@ -1099,7 +1099,7 @@
return NULL;
}
- g_string_append_printf (sql_select, ", COUNT (DISTINCT %s)", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, ", COUNT (DISTINCT COALESCE(%s,''))", tracker_field_data_get_select_field (fd));
} else {
g_string_append_printf (sql_select, ", COUNT (DISTINCT S.ID)");
}
@@ -1357,7 +1357,7 @@
return 0;
}
- g_string_append_printf (sql_select, "COUNT (DISTINCT %s)", tracker_field_data_get_select_field (fd));
+ g_string_append_printf (sql_select, "COUNT (DISTINCT COALESCE(%s,''))", tracker_field_data_get_select_field (fd));
} else {
g_string_append_printf (sql_select, "COUNT (DISTINCT S.ID)");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]