Commit 523c5764 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

Merge together the GetFileChildren and SelectFileChild stored procedures.

2009-03-05  Carlos Garnacho  <carlos@imendio.com>

        Merge together the GetFileChildren and SelectFileChild stored
        procedures.

        * data/db/sqlite-stored-procs.sql: Only one can stand.
        * src/libtracker-data/tracker-data-query.c
        (tracker_data_query_service_children):
        * src/libtracker-data/tracker-data-search.c
        (tracker_data_search_files_get): Adapt to stored procedures change.

svn path=/trunk/; revision=3021
parent 8873e462
2009-03-05 Carlos Garnacho <carlos@imendio.com>
Merge together the GetFileChildren and SelectFileChild stored
procedures.
* data/db/sqlite-stored-procs.sql: Only one can stand.
* src/libtracker-data/tracker-data-query.c
(tracker_data_query_service_children):
* src/libtracker-data/tracker-data-search.c
(tracker_data_search_files_get): Adapt to stored procedures change.
2009-03-04 Martyn Russell <martyn@imendio.com>
* src/tracker-indexer/tracker-indexer.c:
......
......@@ -13,7 +13,7 @@ GetFileByID SELECT S.Path, S.Name, S.Mime, S.ServiceTypeID FR
GetFileByID2 SELECT (S.Path || '/' || S.Name) AS uri, GetServiceName (ServiceTypeID), S.Mime FROM Services AS S WHERE S.ID = ? AND S.Enabled = 1 AND (S.AuxilaryID = 0 OR S.AuxilaryID IN (SELECT VolumeID FROM Volumes WHERE Enabled = 1));
GetFileMTime SELECT M.MetaDataValue FROM Services AS S INNER JOIN ServiceNumericMetaData M ON S.ID = M.ServiceID WHERE S.Path = ? AND S.Name = ? AND M.MetaDataID = (SELECT ID FROM MetaDataTypes WHERE MetaName ='File:Modified');
GetServices SELECT TypeName, Description, Parent FROM ServiceTypes ORDER BY TypeID;
GetFileChildren SELECT ID, Name FROM Services WHERE Path = ?;
GetFileChildren SELECT ID, Path, Name, IsDirectory FROM Services WHERE Path = ?;
/*
* Live search queries
......@@ -45,8 +45,6 @@ CreateService INSERT INTO Services (ID, Path, Name, ServiceType
MoveService UPDATE Services SET Path = ?, Name = ? WHERE Path = ? AND Name = ?;
MoveServiceChildren UPDATE Services SET Path = replace (Path, ?, ?) WHERE Path = ? OR Path LIKE (? || '/%');
SelectFileChild SELECT ID, Path, Name, IsDirectory FROM Services WHERE Path = ?;
DeleteContent DELETE FROM ServiceContents WHERE ServiceID = ? AND MetadataId = ?;
DeleteService1 DELETE FROM Services WHERE ID = ?;
DeleteServiceRecursively DELETE FROM Services WHERE Path = ? OR Path LIKE (? || '/%');
......
......@@ -394,7 +394,6 @@ tracker_data_query_service_children (TrackerService *service,
result_set = tracker_db_interface_execute_procedure (iface, NULL,
"GetFileChildren",
dirname,
dirname,
NULL);
if (!result_set) {
......@@ -408,14 +407,14 @@ tracker_data_query_service_children (TrackerService *service,
while (valid) {
guint32 id;
gchar *child_path;
gchar *child_name;
tracker_db_result_set_get (result_set,
0, &id,
1, &child_path,
2, &child_name,
-1);
g_hash_table_insert (children, GUINT_TO_POINTER (id), child_path);
g_hash_table_insert (children, GUINT_TO_POINTER (id), child_name);
valid = tracker_db_result_set_iter_next (result_set);
}
......
......@@ -509,9 +509,9 @@ tracker_data_search_files_get (TrackerDBInterface *iface,
g_return_val_if_fail (folder_path != NULL, NULL);
result_set = tracker_data_manager_exec_proc (iface,
"SelectFileChild",
folder_path,
NULL);
"GetFileChildren",
folder_path,
NULL);
array = g_ptr_array_new ();
if (result_set) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment