From: ivan Date: Tue, 4 Nov 2003 10:56:59 +0000 (+0000) Subject: finish treating serials as ints! X-Git-Tag: freeside_1_4_2beta1~409 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=4e7892098012e6b14a6c5eeed9254bcddef2bf8f;p=freeside.git finish treating serials as ints! --- diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 1f9bd5c87..331de0225 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -225,7 +225,8 @@ sub qsearch { if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) { if ( $op eq '=' ) { if ( driver_name eq 'Pg' ) { - if ( $dbdef->table($table)->column($column)->type =~ /(int)/i ) { + my $type = $dbdef->table($table)->column($column)->type; + if ( $type =~ /(int|serial)/i ) { qq-( $column IS NULL )-; } else { qq-( $column IS NULL OR $column = '' )-; @@ -268,7 +269,7 @@ sub qsearch { grep defined( $record->{$_} ) && $record->{$_} ne '', @fields ) { if ( $record->{$field} =~ /^\d+(\.\d+)?$/ - && $dbdef->table($table)->column($field)->type =~ /(int)/i + && $dbdef->table($table)->column($field)->type =~ /(int|serial)/i ) { $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_INTEGER } ); } else {