@@ -1201,7 +1201,7 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
1201
1201
dir_list_file (list_file , root , pgdata_exclude , true, add_root );
1202
1202
1203
1203
/* mark files that are possible datafile as 'datafile' */
1204
- for (i = 0 ; i < parray_num (list_file ); i ++ )
1204
+ for (i = 0 ; i < ( int ) parray_num (list_file ); i ++ )
1205
1205
{
1206
1206
pgFile * file = (pgFile * ) parray_get (list_file , i );
1207
1207
char * relative ;
@@ -1221,6 +1221,8 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
1221
1221
continue ;
1222
1222
1223
1223
path_len = strlen (file -> path );
1224
+
1225
+ /* Get link ptrack file to realations files */
1224
1226
if (path_len > 6 && strncmp (file -> path + (path_len - 6 ), "ptrack" , 6 ) == 0 )
1225
1227
{
1226
1228
pgFile * search_file ;
@@ -1254,6 +1256,10 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
1254
1256
continue ;
1255
1257
}
1256
1258
1259
+ /* compress map file it is not data file */
1260
+ if (path_len > 4 && strncmp (file -> path + (path_len - 4 ), ".cfm" , 4 ) == 0 )
1261
+ continue ;
1262
+
1257
1263
/* name of data file start with digit */
1258
1264
fname = last_dir_separator (relative );
1259
1265
if (fname == NULL )
@@ -1286,6 +1292,27 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
1286
1292
file -> segno = (int ) strtol (text_segno , NULL , 10 );
1287
1293
}
1288
1294
}
1295
+
1296
+ /* mark cfs relations as not data */
1297
+ for (i = 0 ; i < (int ) parray_num (list_file ); i ++ )
1298
+ {
1299
+ pgFile * file = (pgFile * ) parray_get (list_file , i );
1300
+ int path_len = (int ) strlen (file -> path );
1301
+
1302
+ if (path_len > 4 && strncmp (file -> path + (path_len - 4 ), ".cfm" , 4 ) == 0 )
1303
+ {
1304
+ pgFile * * pre_search_file ;
1305
+ pgFile tmp_file ;
1306
+ tmp_file .path = pg_strdup (file -> path );
1307
+ tmp_file .path [path_len - 4 ] = '\0' ;
1308
+ pre_search_file = (pgFile * * ) parray_bsearch (list_file , & tmp_file , pgFileComparePath );
1309
+ if (pre_search_file != NULL )
1310
+ {
1311
+ (* pre_search_file )-> is_datafile = false;
1312
+ }
1313
+ pg_free (tmp_file .path );
1314
+ }
1315
+ }
1289
1316
parray_concat (files , list_file );
1290
1317
}
1291
1318
0 commit comments