GNOME Bugzilla – Bug 570209
tracker_data_manager_set_db_option_int() uses incorrect parameter order for SetOption
Last modified: 2010-05-17 13:35:20 UTC
Please describe the problem: Note: This also affects 0.6.6 in src/trackerd/tracker-db-sqlite.c::tracker_db_set_option_string() The sqlite stored procedure defined in data/sqlite-stored-procs.sql SetOption REPLACE into Options (OptionKey, OptionValue) values (?,?); is incorrectly called from src/trackerd/tracker-db-sqlite.c::tracker_db_set_option_string() tracker_exec_proc (db_con->common, "SetOption", 2, value, option); parameters 'value' and 'option' order is back-to-front. This has a serious knock-on effect since the sqlite database at ~/.local/share/tracker/data/common.db has the table "Options" with two columns: OptionKey, OptionValue and in the system *tries* to store the "IntegrityCheck" option Steps to reproduce: 1. Examine the Options table of common.db after several trackerd cycles 2. There will be one or more IntegrityCheck entries in the OptionValue column, with the value in the OptionKey column Actual results: The incorrect parameter order is seen Expected results: OptionKey=IntegrityCheck, OptionValue=0 or 1 Does this happen every time? Yes Other information: Existing installations will need a post-install/update script to clean the incorrect entries from the table. sqlite3 common.db "delete from Options where OptionValue='IntegrityCheck';"
Created attachment 127760 [details] [review] Correct parameter order (trunk)
Created attachment 127761 [details] [review] Correct parameter order (0.6.6)
On trunk the bug is in src/libtracker-data/tracker-data-manager.c::tracker_data_manager_set_db_option_int(): result_set = tracker_data_manager_exec_proc (iface, "SetOption", option, str, NULL);
TJ, thanks for the patch, I will look into this.
Thanks for the patch TJ, committed.
Moving "Daemon" component bugs to "General" since "Daemon" refers to the old 0.6 architecture