[freeside-devel] MYSQL Patch
ivan
ivan at 420.am
Wed Jun 5 15:48:54 PDT 2002
great! patch applied
On Tue, Jun 04, 2002 at 07:30:22PM -0400, Dale Hege wrote:
> >
> > I didn't take those changes; try the files from CVS and let me know if
> > they work for you on MySQL.
>
> I found a few problems with the mysql code. Here is a patch for the CVS
> code. I fixed the order by problem. :)
> -Dale
>
> diff -ru search/cust_main.cgi search/cust_main.cgi
> --- search/cust_main.cgi Tue Jun 4 18:18:41 2002
> +++ search/cust_main.cgi Tue Jun 4 18:29:48 2002
> @@ -159,7 +159,7 @@
> }
>
> my @just_cust_main;
> - if ( driver_name eq /mysql/ ) {
> + if ( driver_name eq 'mysql' ) {
> @just_cust_main = qsearch('cust_main', \%search, 'cust_main.*',
> ",temp1_$$,temp2_$$ $ncancelled $orderby $limit");
> } else {
> diff -ru search/cust_pkg.cgi search/cust_pkg.cgi
> --- search/cust_pkg.cgi Tue Jun 4 18:18:41 2002
> +++ search/cust_pkg.cgi Tue Jun 4 18:53:28 2002
> @@ -86,7 +86,7 @@
> WHERE cust_pkg.pkgnum = cust_svc.pkgnum
> AND cust_svc.svcpart = pkg_svc.svcpart
> AND cust_pkg.pkgpart = pkg_svc.pkgpart
> - GROUP BY cust_svc.pkgnum,cust_svc.svcnum";
> + GROUP BY cust_svc.pkgnum,cust_svc.svcpart";
> $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
>
> $sth->execute or die "Error executing \"$query\": ". $sth->errstr;
> @@ -129,12 +129,9 @@
>
> $total = $sth->fetchrow_arrayref->[0];
>
> - #if ( driver_name eq 'mysql' ) { #remove ORDER BY for mysql? hua?
> - # @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf $limit" );
> - #} else {
> - # @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" );
> - #}
> - @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" );
> + my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : '';
> +
> + @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY ${tblname}pkgnum $limit" );
>
> if ( driver_name eq 'mysql' ) {
> $query = "DROP TABLE temp1_$$,temp2_$$;";
> diff -ru search/svc_acct.cgi search/svc_acct.cgi
> --- search/svc_acct.cgi Tue Jun 4 18:18:41 2002
> +++ search/svc_acct.cgi Tue Jun 4 18:39:11 2002
> @@ -64,11 +64,6 @@
>
> $total = $sth->fetchrow_arrayref->[0];
>
> - #if ( driver_name eq 'mysql' ) { #remove ORDER BY for mysql? hua?
> - # @svc_acct = qsearch('svc_acct', {}, '', "$unlinked $limit");
> - #} else {
> - # @svc_acct = qsearch('svc_acct', {}, '', "$unlinked $orderby $limit");
> - #}
> @svc_acct = qsearch('svc_acct', {}, '', "$unlinked $orderby $limit");
>
> }
--
_ivan
More information about the freeside-devel
mailing list