[Rt-commit] rt branch, 4.0/postgres-connect, created. rt-4.0.0rc4-24-g7563266
Alex Vandiver
alexmv at bestpractical.com
Mon Jan 24 22:54:45 EST 2011
The branch, 4.0/postgres-connect has been created
at 756326601961f7ffa7e27045464196e1a90ee250 (commit)
- Log -----------------------------------------------------------------
commit 227eb78ff98d20a8053979195099fd1e3fcb38e2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Jan 24 22:48:19 2011 -0500
Only CREATE DATABASE in postgres once
The second CREATE DATABASE line dates from RT 3.0.0; not only have all
versions of Postgres since 7.1 had support for "WITH ENCODING" (and we
require 8.1), but lack of Unicode at the database level would likely
cause other, subtler, errors.
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 49b5140..59df5a3 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -339,8 +339,7 @@ sub CreateDatabase {
elsif ( $db_type eq 'Pg' ) {
# XXX: as we get external DBH we don't know if RaiseError or PrintError
# are enabled, so we have to setup it here and restore them back
- $status = $dbh->do("CREATE DATABASE $db_name WITH ENCODING='UNICODE' TEMPLATE template0")
- || $dbh->do("CREATE DATABASE $db_name TEMPLATE template0");
+ $status = $dbh->do("CREATE DATABASE $db_name WITH ENCODING='UNICODE' TEMPLATE template0");
}
else {
$status = $dbh->do("CREATE DATABASE $db_name");
commit 756326601961f7ffa7e27045464196e1a90ee250
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Jan 24 22:50:46 2011 -0500
Remove an incorrect comment
Not only is there no reason that this comment would apply only to
Postgres, but all places which call CreateDatabase do so with a dbh
explicitly set RaiseError => 0.
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 59df5a3..33703fd 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -337,8 +337,6 @@ sub CreateDatabase {
return (1, "Created user $db_user. All RT's objects should be in his schema.");
}
elsif ( $db_type eq 'Pg' ) {
- # XXX: as we get external DBH we don't know if RaiseError or PrintError
- # are enabled, so we have to setup it here and restore them back
$status = $dbh->do("CREATE DATABASE $db_name WITH ENCODING='UNICODE' TEMPLATE template0");
}
else {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list