From: Jonathan Prykop Date: Sat, 25 Jul 2015 03:35:26 +0000 (-0500) Subject: RT#29833: MySQL error running Reports -> Packages -> Package Summary X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=860a0e1470854bf8b108fb0d269c60f4ace251df RT#29833: MySQL error running Reports -> Packages -> Package Summary --- 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 .