diff options
-rwxr-xr-x | email-core/email-storage/email-storage.c | 14 |
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); |