summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-07-24 22:35:26 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-07-24 22:35:26 -0500
commit860a0e1470854bf8b108fb0d269c60f4ace251df (patch)
tree7597ecef5ac28d02ef1cee524a6f9a0d810b4dc3 /httemplate/search
parentd263de52c7c09e940bbe9d794dded878b98e789b (diff)
RT#29833: MySQL error running Reports -> Packages -> Package Summary
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_pkg_summary.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi
index c0eb69920..76ca8956b 100644
--- a/httemplate/search/cust_pkg_summary.cgi
+++ b/httemplate/search/cust_pkg_summary.cgi
@@ -56,7 +56,8 @@ foreach my $column (keys %conds) {
my $count_query = $h_search->{count_query};
# push a select expression for the total packages with pkgpart=main.pkgpart
- push @select, "($count_query AND h_cust_pkg.pkgpart = main.pkgpart) AS $column";
+ # (have to quote $column, otherwise mysql thinks before/after are keywords)
+ push @select, "($count_query AND h_cust_pkg.pkgpart = main.pkgpart) AS \"$column\"";
# and query the total packages with pkgpart=any of the main.pkgparts
my $total = FS::Record->scalar_sql($count_query .