I'm enclosing a script which displays the bug,
and a gross patch which fixes it.

The patch just makes dbix treat bigints as non-numeric.
Maybe it would be better to use Math::BigInt,
or transparent bigint in perl5.8?

On Thu, 10 Oct 2002, Kee Hinckley wrote:

> At 10:27 PM -0400 10/9/02, Joshua Spoerri wrote:
> >When i try to use a 64 bit integer, dbix insists on treating it in
> >numerical context, and changes it to floating point (because perl doesn't
> >support 64 bit integers, even though mysql does). Is there a known fix for
> >this? (I'm using DBIx-Recordset-0.24.) Please cc me, since I'm not
> >subscribed.
>
> I haven't hit that problem in the instance where we are using them,
> but we're zero-filling the fields, which might be the difference.
> I'd be interested in what you find out though, since we're using them
> for ids, and I'm concerned about what's going to happen when they do
> exceed 32bit limits.
> --
>
> Kee Hinckley - Somewhere.Com, LLC
> http://consulting.somewhere.com/
>
> I'm not sure which upsets me more: that people are so unwilling to accept
> responsibility for their own actions, or that they are so eager to regulate
> everyone else's.
>
#!/usr/bin/perl
use DBIx::Recordset;
$DBIx::Recordset::FetchsizeWarn = 0;
$db = DBIx::Database->new({'!DataSource'=>'dbi:mysql:partners', '!KeepOpen'=>1});
$db->DBHdl->do("create table biginttest ( x bigint )");
*table = DBIx::Recordset->Setup({'!DataSource'=>$db, '!Table'=>'biginttest'});
$table->Insert({x=>'9223372036854775807'});
$table->Search();
print "the record is in the database: $table[0]{x}\n" if @table;
$table->Search({x=>'9223372036854775807'});
print "but we can't find it\n" unless @table;
*** Compat.pm.orig      2002-10-18 14:50:24.000000000 -0400
--- Compat.pm   2002-10-18 14:50:30.000000000 -0400
***************
*** 235,241 ****
              'ListTables'     => \&ListTables,    # Default: Use DBI $dbh -> tables
              # QuoteTypes isn't used anymore !!
              'QuoteTypes'   => {   1=>1,   12=>1,  -1=>1, 9 => 1, 10 => 1, 11 => 1}, 
# Default: ODBC Types, quote char, varchar and longvarchar
!             'NumericTypes'   => { 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1, 8 
=> 1, -5 => 1, -6 => 1}, # Default numeric ODBC Types
              'SupportJoin'    => 1,               # Default: Driver supports joins 
(select with multiple tables)
              'SupportSQLJoin' => 1,               # Default: Driver supports 
INNER/LEFT/RIGHT JOIN Syntax in SQL select
              'SQLJoinOnly2Tabs' => 0,             # Default: Driver supports 
LEFT/RIGHT JOIN with more then two tables
--- 235,241 ----
              'ListTables'     => \&ListTables,    # Default: Use DBI $dbh -> tables
              # QuoteTypes isn't used anymore !!
              'QuoteTypes'   => {   1=>1,   12=>1,  -1=>1, 9 => 1, 10 => 1, 11 => 1}, 
# Default: ODBC Types, quote char, varchar and longvarchar
!             'NumericTypes'   => { 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1, 8 
=> 1, -6 => 1}, # Default numeric ODBC Types
              'SupportJoin'    => 1,               # Default: Driver supports joins 
(select with multiple tables)
              'SupportSQLJoin' => 1,               # Default: Driver supports 
INNER/LEFT/RIGHT JOIN Syntax in SQL select
              'SQLJoinOnly2Tabs' => 0,             # Default: Driver supports 
LEFT/RIGHT JOIN with more then two tables
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to