Skip to content

Commit

Permalink
Item12018: fix bad code that snuck in during perltidy revert - trunca…
Browse files Browse the repository at this point in the history
…ted SQL query to just be the first line (SVN 14749)

git-svn-id: http://svn.foswiki.org/trunk/SqlPlugin@15258 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
KipLubliner authored and KipLubliner committed Aug 5, 2012
1 parent 4bd858b commit 3644db0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Foswiki/Plugins/SqlPlugin/Core.pm
Expand Up @@ -114,7 +114,7 @@ sub handleSQL {
$theQuery = entityDecode($theQuery);
}

#writeDebug("called handleSQL(" . $theQuery . ")");
#writeDebug("called handleSQL() - " . $theQuery);

my @bindVals = split '\s*,\s*', $theParams;

Expand All @@ -133,9 +133,7 @@ sub handleSQL {
checkAccess($theDatabase, $theQuery);

$connection->connect();
$theQuery =~ m/(.*)/;
$theQuery = $1;


my $sth = $connection->{db}->prepare_cached($theQuery) or
throw Error::Simple("Can't prepare cmd '$theQuery': ".$connection->{db}->errstr);

Expand All @@ -160,6 +158,7 @@ sub handleSQL {
} catch Error::Simple with {
my $msg = shift->{-text};
$msg =~ s/ at .*?$//gs;
$msg .= "<br>for query $theQuery";
$result = inlineError($msg);
};

Expand Down

0 comments on commit 3644db0

Please sign in to comment.