summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2017-09-18 15:07:58 +0900
committerMinje Ahn <minje.ahn@samsung.com>2017-09-18 15:07:58 +0900
commitd46c6d6397fc36449df5f98becd63e32370ebdbb (patch)
tree04d115d653a85d15e2b041dcfb6c17db1d60b776
parent2b756ad5cfd20cc161b477053c29e119afdbed34 (diff)
downloadlibmedia-service-d46c6d6397fc36449df5f98becd63e32370ebdbb.tar.gz
libmedia-service-d46c6d6397fc36449df5f98becd63e32370ebdbb.tar.bz2
libmedia-service-d46c6d6397fc36449df5f98becd63e32370ebdbb.zip
Remove rollback query
Media db does not use journal mode. So, no need rollback query. Change-Id: Ib30222d8369bf59349c435dbfc76111a7fabc72b Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xsrc/common/media-svc-db-utils.c7
-rwxr-xr-xsrc/common/media-svc-media.c2
-rwxr-xr-xsrc/common/media-svc.c7
-rwxr-xr-xsrc/include/common/media-svc-db-utils.h1
4 files changed, 0 insertions, 17 deletions
diff --git a/src/common/media-svc-db-utils.c b/src/common/media-svc-db-utils.c
index 14625ff..c8a536e 100755
--- a/src/common/media-svc-db-utils.c
+++ b/src/common/media-svc-db-utils.c
@@ -1411,13 +1411,6 @@ int _media_svc_sql_end_trans(uid_t uid)
return ret;
}
-int _media_svc_sql_rollback_trans(uid_t uid)
-{
- media_svc_error("========_media_svc_sql_rollback_trans");
-
- return _media_svc_sql_query("ROLLBACK;", uid);
-}
-
int _media_svc_sql_query_list(GList **query_list, uid_t uid)
{
int ret = MS_MEDIA_ERR_NONE;
diff --git a/src/common/media-svc-media.c b/src/common/media-svc-media.c
index 053c10d..da33170 100755
--- a/src/common/media-svc-media.c
+++ b/src/common/media-svc-media.c
@@ -670,14 +670,12 @@ int _media_svc_list_query_do(media_svc_query_type_e query_type, uid_t uid)
if (ret != MS_MEDIA_ERR_NONE) {
media_svc_error("_media_svc_list_query_do failed. start rollback");
- _media_svc_sql_rollback_trans(uid);
return ret;
}
ret = _media_svc_sql_end_trans(uid);
if (ret != MS_MEDIA_ERR_NONE) {
media_svc_error("mb_svc_sqlite3_commit_trans failed.. Now start to rollback");
- _media_svc_sql_rollback_trans(uid);
return ret;
}
diff --git a/src/common/media-svc.c b/src/common/media-svc.c
index c7968a1..c20024b 100755
--- a/src/common/media-svc.c
+++ b/src/common/media-svc.c
@@ -921,7 +921,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
if (ret != SQLITE_OK) {
media_svc_error("failed to update folder modified time");
- _media_svc_sql_rollback_trans(uid);
return MS_MEDIA_ERR_DB_INTERNAL;
}
@@ -940,7 +939,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
ret = _media_svc_sql_prepare_to_step_simple(db_handle, select_all_sql, &sql_stmt);
if (ret != MS_MEDIA_ERR_NONE) {
media_svc_error("error when media_svc_rename_folder. err = [%d]", ret);
- _media_svc_sql_rollback_trans(uid);
return ret;
}
@@ -981,7 +979,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
if (replaced_path == NULL) {
media_svc_error("_media_svc_replace_path failed");
SQLITE3_FINALIZE(sql_stmt);
- _media_svc_sql_rollback_trans(uid);
return MS_MEDIA_ERR_INTERNAL;
}
@@ -993,7 +990,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
if (ret != MS_MEDIA_ERR_NONE) {
media_svc_sec_error("ms_user_get_storage_type failed : [%d], path[%s] storage_type[%d]", ret, replaced_path, storage_type);
SAFE_FREE(replaced_path);
- _media_svc_sql_rollback_trans(uid);
return ret;
}
@@ -1002,7 +998,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
media_svc_error("_media_svc_get_thumbnail_path failed : %d", ret);
SAFE_FREE(replaced_path);
SQLITE3_FINALIZE(sql_stmt);
- _media_svc_sql_rollback_trans(uid);
return ret;
}
@@ -1023,7 +1018,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
if (ret != SQLITE_OK) {
media_svc_error("failed to update item");
SQLITE3_FINALIZE(sql_stmt);
- _media_svc_sql_rollback_trans(uid);
return MS_MEDIA_ERR_DB_INTERNAL;
}
@@ -1042,7 +1036,6 @@ int media_svc_rename_folder(MediaSvcHandle *handle, const char *storage_id, cons
ret = _media_svc_sql_end_trans(uid);
if (ret != MS_MEDIA_ERR_NONE) {
media_svc_error("mb_svc_sqlite3_commit_trans failed.. Now start to rollback");
- _media_svc_sql_rollback_trans(uid);
return ret;
}
diff --git a/src/include/common/media-svc-db-utils.h b/src/include/common/media-svc-db-utils.h
index 0ed80a9..6b68895 100755
--- a/src/include/common/media-svc-db-utils.h
+++ b/src/include/common/media-svc-db-utils.h
@@ -43,7 +43,6 @@ int _media_svc_sql_prepare_to_step(sqlite3 *handle, const char *sql_str, sqlite3
int _media_svc_sql_prepare_to_step_simple(sqlite3 *handle, const char *sql_str, sqlite3_stmt **stmt);
int _media_svc_sql_begin_trans(uid_t uid);
int _media_svc_sql_end_trans(uid_t uid);
-int _media_svc_sql_rollback_trans(uid_t uid);
int _media_svc_sql_query_list(GList **query_list, uid_t uid);
void _media_svc_sql_query_add(GList **query_list, char **query);
void _media_svc_sql_query_release(GList **query_list);