[freeside-devel] MYSQL Patch
Dale Hege
fhege at lumenexus.net
Tue Jun 4 16:30:51 PDT 2002
>
> 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
-------------- next part --------------
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");
}
More information about the freeside-devel
mailing list