projects
/
APKPM.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b1ccd9
)
re-format SQL in textarea
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 7 Apr 2011 19:55:18 +0000
(19:55 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 7 Apr 2011 19:55:18 +0000
(19:55 +0000)
web_ui.pl
patch
|
blob
|
history
diff --git
a/web_ui.pl
b/web_ui.pl
index
930fa47
..
eb08d1d
100755
(executable)
--- a/
web_ui.pl
+++ b/
web_ui.pl
@@
-81,6
+81,10
@@
get '/gnuplot' => sub {
my $sql = $self->param('sql');
return $self->render('gnuplot', img => '', gnuplot => '') unless $sql;
+ # re-format SQL
+ $sql =~ s/(from|where|order|limit|join)/\n$1/gs;
+ $self->param( sql => $sql );
+
my $ret = $gearman->req( 'SUBMIT_JOB', 'Store_sql', '', $sql );
die "no result for $sql" unless $ret;