[freeside-commits] freeside/FS/FS Record.pm,1.149,1.150
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Apr 14 06:42:27 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv22907
Modified Files:
Record.pm
Log Message:
Improve record searching
Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- Record.pm 29 Feb 2008 02:29:57 -0000 1.149
+++ Record.pm 14 Apr 2008 13:42:25 -0000 1.150
@@ -298,6 +298,14 @@
&& dbdef->table($table)->column($field)->type =~ /(int|(big)?serial)/i
) {
$sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_INTEGER } );
+ }elsif ( $record->{$field} =~ /^[+-]?\d+(\.\d+)?$/
+ && dbdef->table($table)->column($field)->type =~ /(numeric)/i
+ ) {
+ $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_FLOAT } );
+ }elsif ( $record->{$field} =~ /[-+]?\d*\.?\d+([eE][-+]?\d+)?/
+ && dbdef->table($table)->column($field)->type =~ /(float4)/i
+ ) {
+ $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_FLOAT } );
} else {
$sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_VARCHAR } );
}
More information about the freeside-commits
mailing list