pg_upgrade_test_92.patch

text/x-patch

Filename: pg_upgrade_test_92.patch
Type: text/x-patch
Part: 0
Message: 9.2 pg_upgrade regression tests on WIndows

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
contrib/pg_upgrade/exec.c 2 0
contrib/pg_upgrade/test.sh 6 0
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
index 6f993df..57ca1df 100644
--- a/contrib/pg_upgrade/exec.c
+++ b/contrib/pg_upgrade/exec.c
@@ -91,10 +91,12 @@ exec_prog(bool throw_error, bool is_priv, const char *log_file,
 	else
 		retval = 0;
 
+#ifndef WIN32
 	if ((log = fopen_priv(log_file, "a+")) == NULL)
 		pg_log(PG_FATAL, "cannot write to log file %s\n", log_file);
 	fprintf(log, "\n\n");
 	fclose(log);
+#endif
 
 	return retval;
 }
diff --git a/contrib/pg_upgrade/test.sh b/contrib/pg_upgrade/test.sh
index 299b7a5..7d41953 100644
--- a/contrib/pg_upgrade/test.sh
+++ b/contrib/pg_upgrade/test.sh
@@ -15,6 +15,8 @@ set -e
 : ${PGPORT=50432}
 export PGPORT
 
+testhost=`uname -o`
+
 temp_root=$PWD/tmp_check
 
 if [ "$1" = '--install' ]; then
@@ -114,6 +116,10 @@ if [ -n "$pg_dumpall2_status" ]; then
 	exit 1
 fi
 
+if [ $testhost = Msys ] ; then
+	dos2unix "$temp_root"/dump1.sql "$temp_root"/dump2.sql
+fi
+
 if diff -q "$temp_root"/dump1.sql "$temp_root"/dump2.sql; then
 	echo PASSED
 	exit 0