summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandeep singh <randeep.s@samsung.com>2019-02-16 15:30:50 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2019-02-16 15:30:50 +0000
commitb49cf5b838078a45e5fb6df623a0f762027f3ea5 (patch)
tree3d84c4378d7beba97279d79925b68f05036d157f
parentf4d290524e6a262358c066d07faaae35267f3e90 (diff)
parenta67bc5cbf462b6da98338eb4b181559f03f70c68 (diff)
downloademail-service-accepted/tizen/unified/20190218.064124.tar.gz
email-service-accepted/tizen/unified/20190218.064124.tar.bz2
email-service-accepted/tizen/unified/20190218.064124.zip
-rwxr-xr-xemail-core/email-storage/email-storage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/email-core/email-storage/email-storage.c b/email-core/email-storage/email-storage.c
index 90a9928..83b4e80 100755
--- a/email-core/email-storage/email-storage.c
+++ b/email-core/email-storage/email-storage.c
@@ -6603,7 +6603,7 @@ INTERNAL_FUNC int emstorage_get_count_read_mail_uid(char *multi_user_name, int a
EM_DEBUG_FUNC_BEGIN("account_id[%d], mailbox_name[%p], count[%p], transaction[%d], err_code[%p]", account_id, mailbox_name , count, transaction, err_code);
if (account_id < FIRST_ACCOUNT_ID || !mailbox_name || !count) {
- EM_DEBUG_EXCEPTION(" account_id[%d], mailbox_name[%s], count[%d] ", account_id, mailbox_name, *count);
+ EM_DEBUG_EXCEPTION("Invalid params");
if (err_code != NULL)
*err_code = EMAIL_ERROR_INVALID_PARAM;
@@ -17825,6 +17825,8 @@ static int emstorage_create_renamed_table(char *multi_user_name, char **input_f
int rc = -1;
sqlite3 *local_db_handle = NULL;
char sql_query_string[QUERY_SIZE] = {0, };
+
+ local_db_handle = emstorage_get_db_connection(multi_user_name);
if (input_full_query == NULL || input_source_table_name == NULL || input_new_table_name == NULL) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
@@ -17832,8 +17834,6 @@ static int emstorage_create_renamed_table(char *multi_user_name, char **input_f
goto FINISH_OFF;
}
- local_db_handle = emstorage_get_db_connection(multi_user_name);
-
EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "BEGIN;", NULL, NULL, NULL), rc);
EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {goto FINISH_OFF; }, ("SQL(BEGIN EXCLUSIVE) exec fail:%d -%s", rc, sqlite3_errmsg(local_db_handle)));
@@ -17865,14 +17865,14 @@ static int emstorage_add_column(char *multi_user_name, char *input_table_name, e
sqlite3 *local_db_handle = NULL;
char sql_query_string[QUERY_SIZE] = {0, };
+ local_db_handle = emstorage_get_db_connection(multi_user_name);
+
if (input_table_name == NULL || input_new_column == NULL) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
error = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
- local_db_handle = emstorage_get_db_connection(multi_user_name);
-
EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "BEGIN;", NULL, NULL, NULL), rc);
EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {goto FINISH_OFF; }, ("SQL(BEGIN EXCLUSIVE) exec fail:%d -%s", rc, sqlite3_errmsg(local_db_handle)));
SNPRINTF(sql_query_string, QUERY_SIZE, "ALTER TABLE %s ADD COLUMN %s %s;", input_table_name, input_new_column->column_name, input_new_column->column_type);
@@ -17899,14 +17899,14 @@ static int emstorage_drop_table(char *multi_user_name, char *input_table_name)
sqlite3 *local_db_handle = NULL;
char sql_query_string[QUERY_SIZE] = {0, };
+ local_db_handle = emstorage_get_db_connection(multi_user_name);
+
if (input_table_name == NULL) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
error = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
- local_db_handle = emstorage_get_db_connection(multi_user_name);
-
EMSTORAGE_PROTECTED_FUNC_CALL(sqlite3_exec(local_db_handle, "BEGIN;", NULL, NULL, NULL), rc);
EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {goto FINISH_OFF; }, ("SQL(BEGIN EXCLUSIVE) exec fail:%d -%s", rc, sqlite3_errmsg(local_db_handle)));
SNPRINTF(sql_query_string, QUERY_SIZE, "DROP TABLE %s;", input_table_name);