diff --git a/ChangeLog b/ChangeLog index 66dc897365..81f5b8a824 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-09-14 Derek Atkins + + * src/backend/postgres/test/run-tests.sh: small fix from + hawkfan to get tests to work when building outside srcdir. + * src/backend/postgres/putil.c: fix a bug introduced by Matthew -- + ANSI C does not allow you to declare a variable in the middle + of an expression. Move the declaration to the top of the function. + * src/backend/postgres/functions.sql: + * src/backend/postgres/table-audit.sql: + We don't need the trailing semi-colon because the #include adds + one. The double semi-colon causes build failures in some cases. + 2003-09-13 Derek Atkins * src/import-export/ofx/gnc-ofx-import.c: use diff --git a/src/backend/postgres/functions.sql b/src/backend/postgres/functions.sql index f93f7b3d4a..5da654217f 100644 --- a/src/backend/postgres/functions.sql +++ b/src/backend/postgres/functions.sql @@ -66,4 +66,4 @@ " gncTransaction.currency = gncCommodity.commodity' \n" " LANGUAGE 'sql'; \n" " \n" -"-- end of file"; +"-- end of file" diff --git a/src/backend/postgres/putil.c b/src/backend/postgres/putil.c index ace1ac3377..6f88406c1a 100644 --- a/src/backend/postgres/putil.c +++ b/src/backend/postgres/putil.c @@ -48,6 +48,7 @@ static short module = MOD_BACKEND; ExecStatusType execQuery(PGBackend *be, const char * q) { PGresult * result; ExecStatusType status; + gchar * msg; ENTER(" "); @@ -68,7 +69,7 @@ ExecStatusType execQuery(PGBackend *be, const char * q) { } status = PQresultStatus(result); - gchar * msg = (gchar *)PQresultErrorMessage(result); + msg = (gchar *)PQresultErrorMessage(result); PINFO("Result status: %s/%s", PQresStatus(status), (strlen(msg)) > 0 ? msg : "(No Message)"); PINFO("Number of rows affected: %d", atoi(PQcmdTuples(result))); diff --git a/src/backend/postgres/table-audit.sql b/src/backend/postgres/table-audit.sql index 8b14e02fc0..4b54e3e926 100644 --- a/src/backend/postgres/table-audit.sql +++ b/src/backend/postgres/table-audit.sql @@ -165,4 +165,4 @@ "CREATE INDEX gncSplitTrail_split_idx ON gncSplitTrail (splitGuid); \n" "CREATE INDEX gncPriceTrail_price_idx ON gncPriceTrail (priceGuid); \n" "CREATE INDEX gncTransactionTrail_trans_idx ON gncTransactionTrail (transGuid); \n" -"-- end of file"; +"-- end of file" diff --git a/src/backend/postgres/test/run-tests.sh b/src/backend/postgres/test/run-tests.sh index ce7b8afde2..b1fdb84a44 100755 --- a/src/backend/postgres/test/run-tests.sh +++ b/src/backend/postgres/test/run-tests.sh @@ -6,11 +6,11 @@ EXIT_VALUE=0 # gdb .libs/test-db rm -f test_file_* -if ./db-control.sh create; then - ./db-control.sh start +if ${srcdir}/db-control.sh create; then + ${srcdir}/db-control.sh start ./test-db localhost 7777 || EXIT_VALUE=1 - ./db-control.sh stop - ./db-control.sh destroy + ${srcdir}/db-control.sh stop + ${srcdir}/db-control.sh destroy elif [ "${PGHOST}X" != "X" ]; then # This expects the logged in user to have authority # to create databases.