Mysql problems with viewing customer invoice
Gilbert Rebeiro
gilbert at dido.ca
Mon Jun 28 04:14:35 PDT 2004
Hi,
Since a recent change to Record.pm when I click on any invoice
http://fluffy.dido.ca/freeside-mason/view/cust_bill.cgi?308
I get this error:
System error
error: Error executing "SELECT * FROM part_bill_event WHERE payby = ? AND
plan = ? AND plandata ~ ? ORDER BY seconds LIMIT 1": You have an error in
your SQL syntax. Check the manual that corresponds to your MySQL server
version for the right syntax to use near '~ '(^|\n)agentnum 1(\n|$)' ORDER
BY seconds LIMIT 1' at line 1 at
/var/www/html/freeside-mason/view/cust_bill.cgi line 52
context: ...
187: # whether they should generate a full stack trace (confess() and
cluck())
188: # or simply report the caller's package (croak() and carp()),
respectively.
189: # confess() and croak() die, carp() and cluck() warn.
190:
191: sub croak { die shortmess @_ }
192: sub confess { die longmess @_ }
193: sub carp { warn shortmess @_ }
194: sub cluck { warn longmess @_ }
195:
...
code stack: /usr/lib/perl5/5.8.3/Carp.pm:191
/usr/lib/perl5/site_perl/5.8.3//FS/Record.pm:327
/usr/lib/perl5/site_perl/5.8.3//FS/Record.pm:422
/usr/lib/perl5/site_perl/5.8.3//FS/cust_bill.pm:687
/usr/lib/perl5/site_perl/5.8.3//FS/cust_bill.pm:676
/usr/lib/perl5/site_perl/5.8.3//FS/cust_bill.pm:856
/var/www/html/freeside-mason/view/cust_bill.cgi:52
/var/www/html/freeside-mason/autohandler:1
I have tracked it down to the tilde in Postgres not being compatible with
Mysql.
I have added this line in Record.pm
Line 221 #$op = 'LIKE' if $op =~ /^ILIKE$/i && driver_name ne 'Pg';
Line 222 if ( $op = '~' ) { $op= 'REGEXP';}
I don't know if my line 222 is what was intended but it works for me.
Best regards,
Gilbert Rebeiro.
More information about the freeside-devel
mailing list