Define MEDIA_SVC_QUERY_LEN_NORMAL and replace some code to it 01/124401/2
authorHaejeong Kim <backto.kim@samsung.com>
Tue, 11 Apr 2017 08:21:38 +0000 (17:21 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Tue, 11 Apr 2017 08:28:55 +0000 (17:28 +0900)
Change-Id: Idf44000b715dec175cc2354a50e478adb0955db6

src/common/media-svc-db-utils.c
src/common/media-svc-debug.c
src/include/common/media-svc-env.h

index 1fdff8d..cccd281 100755 (executable)
@@ -137,7 +137,7 @@ static int __media_svc_rebuild_view_query(sqlite3 *db_handle, uid_t uid)
        int ret = MS_MEDIA_ERR_NONE;
        column_info_s *col_ptr = NULL;
        char *sql = NULL;
-       char table_query[4096] = {0, };
+       char table_query[MEDIA_SVC_QUERY_LEN_NORMAL] = {0, };
        char temp[1024] = {0, };
        bool sflag = false;
        int i, len;
@@ -256,9 +256,9 @@ int _media_svc_make_table_query(const char *table_name, media_svc_table_slist_e
        table_info_s *tb = NULL;
        column_info_s *col_ptr = NULL;
        char *sql = NULL;
-       char table_query[4096] = {0, };
-       char index_query[4096] = {0, };
-       char trigger_query[4096] = {0, };
+       char table_query[MEDIA_SVC_QUERY_LEN_NORMAL] = {0, };
+       char index_query[MEDIA_SVC_QUERY_LEN_NORMAL] = {0, };
+       char trigger_query[MEDIA_SVC_QUERY_LEN_NORMAL] = {0, };
        char table_query_sub[1024] = {0, };
        char temp[1024] = {0 ,};
        int sflag = false;
@@ -1620,7 +1620,7 @@ int _media_svc_update_media_view(sqlite3 *db_handle, uid_t uid)
        int item_cnt = 0;
        int idx = 0;
        GList *storage_list = NULL;
-       char view_query[4096] = {0, };
+       char view_query[MEDIA_SVC_QUERY_LEN_NORMAL] = {0, };
        memset(view_query, 0x00, sizeof(view_query));
 
        snprintf(view_query, sizeof(view_query), "DROP VIEW IF EXISTS %s; CREATE VIEW IF NOT EXISTS %s AS SELECT * from %s ", MEDIA_SVC_DB_VIEW_MEDIA, MEDIA_SVC_DB_VIEW_MEDIA, MEDIA_SVC_DB_TABLE_MEDIA);
index e23d06b..839afbc 100755 (executable)
@@ -31,7 +31,7 @@ static long g_time_usec = 0L;
 
 #ifdef _USE_LOG_FILE_
 static FILE *g_log_fp = NULL;
-static char _g_file_path[1024] = "\0";
+static char _g_file_path[MEDIA_SVC_PATHNAME_SIZE] = "\0";
 
 FILE *get_fp()
 {
index f8240b2..fa7eba1 100755 (executable)
@@ -135,6 +135,8 @@ extern "C" {
 #define MEDIA_SVC_PATHNAME_SIZE                                4096                                    /**< Length of Path name. */
 #define MEDIA_SVC_UUID_SIZE                                            36                                              /**< Length of UUID*/
 #define MEDIA_SVC_QUERY_LEN_MAX                                4096*2                                  /**< Max Query length*/
+#define MEDIA_SVC_QUERY_LEN_NORMAL                     4096                                    /**< Normal Query length*/
+
 
 #define MEDIA_SVC_TAG_UNKNOWN                          ""
 #define MEDIA_SVC_MEDIA_PATH                                   tzplatform_mkpath(TZ_USER_SHARE, "media")                       /**< Media path*/