GNOME Bugzilla – Bug 731701
GomFilter from 3 filters fails to find resource
Last modified: 2014-06-16 10:54:41 UTC
Created attachment 278507 [details] [review] GomFilter from 3 filters I'm trying to use gom as cache for series and episodes database at: https://bugzilla.gnome.org/show_bug.cgi?id=672933 I'm really not sure if this is a bug or if I'm using the API wrong. There are two functions in this test: find_simple and find_specific. find_simple creates a filter with gom_filter_new_like and successfully finds the resource. find_specific creates a filter from 3 different querys: by series-id, season-number and episode-number; I'm using gom_filter_new_eq for the season and episode number and gom_filter_new_like to the string series-id; It does not find the resource. Thanks for any help,
Review of attachment 278507 [details] [review]: I've added support for guchar (guint8) properties, and made changes to that patch to use that. That's not the reason for the failure though. ::: tests/test-gom-find-specific.c @@ +26,3 @@ + gchar *series_id; + gchar *imdb_id; + guint8 season_number; You use guint8 here. @@ +60,3 @@ + gchar *series_id; + gchar *imdb_id; + guint8 season_number; And here. @@ +181,3 @@ + specs[PROP_IMDB_ID]); + + specs[PROP_SEASON_NUMBER] = g_param_spec_int64 (EPISODE_COLUMN_SEASON_NUMBER, But use int64 for the props. @@ +233,3 @@ + g_assert (ret); + + eres = g_object_new (EPISODE_TYPE_RESOURCE, And somewhere around here, valgrind will complain that some values are initialised on the stack because you overread (64-bit instead of 8).
Created attachment 278530 [details] [review] tests: GomFilter from 3 queries
Created attachment 278531 [details] [review] gom: Fix AND/OR filters memory handling The values were getting double-freed. As gom_filter_get_values() returns a new array, no need to stuff it inside another array that we would create ourselves, just use that original array.
Attachment 278530 [details] pushed as e58eda1 - tests: GomFilter from 3 queries Attachment 278531 [details] pushed as 9369457 - gom: Fix AND/OR filters memory handling