added support for reading from replicated databases

This commit is contained in:
JT Smith 2004-07-09 21:10:58 +00:00
parent c39e7dc7b0
commit 7648c6c13f
24 changed files with 87 additions and 48 deletions

View file

@ -21,7 +21,7 @@ sub process {
my ($statement, $format) = WebGUI::Macro::getParams(shift);
$format = '^0;' if ($format eq "");
if ($statement =~ /^\s*select/i || $statement =~ /^\s*show/i || $statement =~ /^\s*describe/i) {
my $sth = WebGUI::SQL->unconditionalRead($statement);
my $sth = WebGUI::SQL->unconditionalRead($statement,WebGUI::SQL->getSlave);
unless ($sth->errorCode < 1) {
return '<p><b>SQL Macro Failed:</b> '.$sth->errorMessage.'<p>';
} else {