From 31fa8cb66d7480c730b2aa7c3112a61c14c2ba6b Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 3 Jul 2008 04:19:35 +0000 Subject: [PATCH] should FINALLY get binding correctly in light of regression caused by get_real_fields refactor --- FS/FS/Record.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index d3b5e183e..23c78cf0f 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -377,18 +377,18 @@ sub qsearch { grep defined( $record->{$_} ) && $record->{$_} ne '', @real_fields ) { my $value = $record->{$field}; - $value = $value->{'value'} if ref($value); + #done above in 1.7# $value = $value->{'value'} if ref($value); my $type = dbdef->table($table)->column($field)->type; if ( $type =~ /(int|(big)?serial)/i && $value =~ /^\d+(\.\d+)?$/ ) { - $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_INTEGER } ); + $sth->bind_param($bind++, $value, { TYPE => SQL_INTEGER } ); } elsif ( ( $type =~ /(numeric)/i && $value =~ /^[+-]?\d+(\.\d+)?$/) || ( $type =~ /(real|float4)/i && $value =~ /[-+]?\d*\.?\d+([eE][-+]?\d+)?/ ) ) { - $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_FLOAT } ); + $sth->bind_param($bind++, $value, { TYPE => SQL_FLOAT } ); } else { - $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_VARCHAR } ); + $sth->bind_param($bind++, $value, { TYPE => SQL_VARCHAR } ); } } -- 2.20.1