Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed temp directory, it's not needed because any temp files can go…

… into the replication directory.
  • Loading branch information...
commit c357f34d3abc9c88db79932086b256659b0d2218 1 parent b5a52f6
Elliot Chance authored
View
9 backend/mysql.pl
@@ -194,7 +194,12 @@ sub backend_mysql_table_exists {
# be left intact.
# @return Always 1.
sub backend_mysql_update_index {
- open(SQL, "temp/CreateIndexes.sql");
+ # TODO: It is not indexing 'id' columns of the tables, this might be because the CREATE TABLEs
+ # contains SERIAL type, this will need to be fixed. One method is to search for SERIAL
+ # columns in CreateTables.sql or simply look for all the 'id' columns and create indexes
+ # on them.
+
+ open(SQL, "replication/CreateIndexes.sql");
chomp(my @lines = <SQL>);
foreach my $line (@lines) {
@@ -268,7 +273,7 @@ sub backend_mysql_update_schema {
# this is where it has to translate PostgreSQL to MySQL as well as making any modifications
# needed.
- open(SQL, "temp/CreateTables.sql");
+ open(SQL, "replication/CreateTables.sql");
chomp(my @lines = <SQL>);
my $table = "";
foreach my $line (@lines) {
View
8 backend/postgresql.pl
@@ -24,7 +24,7 @@ sub backend_postgresql_update_index {
mbz_do_sql("CREATE LANGUAGE plpgsql");
}
- open(SQL, "temp/CreateFunctions.sql");
+ open(SQL, "replication/CreateFunctions.sql");
chomp(my @lines = <SQL>);
my $full = "";
foreach my $line (@lines) {
@@ -40,7 +40,7 @@ sub backend_postgresql_update_index {
}
close(SQL);
- open(SQL, "temp/CreateIndexes.sql");
+ open(SQL, "replication/CreateIndexes.sql");
chomp(my @lines = <SQL>);
foreach my $line (@lines) {
# skip blank lines and single bracket lines
@@ -52,7 +52,7 @@ sub backend_postgresql_update_index {
}
close(SQL);
- open(SQL, "temp/CreatePrimaryKeys.sql");
+ open(SQL, "replication/CreatePrimaryKeys.sql");
chomp(my @lines = <SQL>);
foreach my $line (@lines) {
# skip blank lines and single bracket lines
@@ -80,7 +80,7 @@ sub backend_postgresql_update_index {
# to create (and replace) them. This is just so all the error messages and so nasty.
# @return Always 1.
sub backend_postgresql_update_schema {
- open(SQL, "temp/CreateTables.sql");
+ open(SQL, "replication/CreateTables.sql");
chomp(my @lines = <SQL>);
my $table = "";
foreach my $line (@lines) {
View
29 src/functions.pl
@@ -137,14 +137,14 @@ sub mbz_download_replication {
# indexes and PL/pgSQL. It will later be converted for the RDBMS we are using.
# @return Always 1.
sub mbz_download_schema {
- unlink("temp/CreateTables.sql");
- mbz_download_file($g_schema_url, "temp/CreateTables.sql");
- unlink("temp/CreateIndexes.sql");
- mbz_download_file($g_index_url, "temp/CreateIndexes.sql");
- unlink("temp/CreatePrimaryKeys.sql");
- mbz_download_file($g_pk_url, "temp/CreatePrimaryKeys.sql");
- unlink("temp/CreateFunctions.sql");
- mbz_download_file($g_func_url, "temp/CreateFunctions.sql");
+ unlink("replication/CreateTables.sql");
+ mbz_download_file($g_schema_url, "replication/CreateTables.sql");
+ unlink("replication/CreateIndexes.sql");
+ mbz_download_file($g_index_url, "replication/CreateIndexes.sql");
+ unlink("replication/CreatePrimaryKeys.sql");
+ mbz_download_file($g_pk_url, "replication/CreatePrimaryKeys.sql");
+ unlink("replication/CreateFunctions.sql");
+ mbz_download_file($g_func_url, "replication/CreateFunctions.sql");
return 1;
}
@@ -754,11 +754,12 @@ sub mbz_unzip_mbdump {
my $file = $_[0];
print localtime() . ": Uncompressing $file... ";
mkdir("mbdump");
- system("bunzip2 -f replication/$file");
- system("tar -xf replication/" . substr($file, 0, length($file) - 4) . " -C replication");
if($^O eq "MSWin32") {
system("$g_mv replication\\mbdump\\* mbdump >nul");
+ system("bunzip2 -f replication/$file");
+ system("tar -xf replication/" . substr($file, 0, length($file) - 4) . " -C replication");
} else {
+ system("tar -xjf replication/$file -C replication");
system("$g_mv replication/mbdump/* mbdump");
}
print "Done\n";
@@ -792,8 +793,12 @@ sub mbz_unzip_replication {
my $id = $_[0];
print localtime() . ": Uncompressing... ";
mkdir("replication/$id");
- system("bunzip2 -f replication/replication-$id.tar.bz2");
- system("tar -xf replication/replication-$id.tar -C replication/$id");
+ if($^O eq "MSWin32") {
+ system("bunzip2 -f replication/replication-$id.tar.bz2");
+ system("tar -xf replication/replication-$id.tar -C replication/$id");
+ } else {
+ system("tar -xjf replication/replication-$id.tar.bz2 -C replication/$id");
+ }
print "Done\n";
return 1;
}
View
3  temp/.gitignore
@@ -1,3 +0,0 @@
-.AppleDouble*
-:*
-*.sql
View
1  temp/blank.file
@@ -1 +0,0 @@
-blank.file
Please sign in to comment.
Something went wrong with that request. Please try again.