mail folder, its name is "I", could not be deleted. 63/94063/3
authorSan Cho <san.cho@samsung.com>
Mon, 20 Jun 2016 08:08:04 +0000 (17:08 +0900)
committerintae, jeon <intae.jeon@samsung.com>
Thu, 27 Oct 2016 23:44:00 +0000 (08:44 +0900)
[Problem] mail folder, its name is "I", could not be deleted.
[Cause & Measure] Cause: email-service removes its child folders, searched by "LIKE" sql, so trying to remove "INBOX" as its child folder.
Measure: modifying the sql.

Change-Id: I654d089670317c7fb13e75e23423d043114d4b50

email-core/email-storage/email-storage.c

index 5e3ca31..ac41f4b 100755 (executable)
@@ -5356,7 +5356,7 @@ INTERNAL_FUNC int emstorage_get_child_mailbox_list(char *multi_user_name, int ac
                return false;
        }
 
-       sqlite3_snprintf(sizeof(conditional_clause_string), conditional_clause_string, "WHERE account_id = %d  AND UPPER(mailbox_name) LIKE UPPER('%q%%')", account_id, parent_mailbox_name);
+       sqlite3_snprintf(sizeof(conditional_clause_string), conditional_clause_string, "WHERE account_id = %d  AND (UPPER(mailbox_name) = UPPER('%q') OR UPPER(mailbox_name) LIKE UPPER('%q/%%'))", account_id, parent_mailbox_name, parent_mailbox_name);
        EM_DEBUG_LOG("conditional_clause_string[%s]", conditional_clause_string);
 
        if ((error = emstorage_query_mailbox_tbl(multi_user_name, conditional_clause_string, " ORDER BY mailbox_name DESC ", 0, transaction, mailbox_list, select_num)) != EMAIL_ERROR_NONE) {
@@ -5368,6 +5368,7 @@ INTERNAL_FUNC int emstorage_get_child_mailbox_list(char *multi_user_name, int ac
 
 FINISH_OFF:
 
+
        if (err_code != NULL)
                *err_code = error;