diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-07-24 22:35:26 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-07-27 21:14:55 -0500 |
commit | 159fbfeb355b1beaeca562ff5ef4e5e8451eaa7a (patch) | |
tree | 12c9c35f92f18dac752b66b474a97aa8a18b00b2 /httemplate | |
parent | 47e1a8203e1fa6695c93bcb48fe6eaf1214c7fa3 (diff) |
RT#29833: MySQL error running Reports -> Packages -> Package Summary
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/search/cust_pkg_summary.cgi | 3 |
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 . |