Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 19212
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: ananomaly [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.0002_5
Fixed in: (no value)



Subject: Mysql Unsigned Integer Fields
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 687
Download (untitled) / with headers
text/plain 687b
When using DBD to select unsigned integer fields from a MySQL database. Error is fetchrow_arrayref failed: no statement executing when the integer contained in the field was over 2147483647. It seems as though DBD is treating MySQL field type as a signed integer instead of unsigned as it is listed in the database. I was able to work around the problem by using MySQL CAST to change the type to from unsigned integer to char(10). CPU: AMD Opteron(tm) Processor 246 OS: CentOS release 4.3 (Final) Mysql: 5.0.18-0 DBD: DBD-mysql-3.0002_5 DBI: 1.50 Perl: v5.8.5 built for x86_64-linux-thread-multi uname: Linux dev 2.6.9-34.EL #1 Thu Mar 9 06:03:30 GMT 2006 x86_64 x86_64 x86_64 GNU/Linux
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-11576-1167788723-1223.19212-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 410
Download (untitled) / with headers
text/plain 410b
I'm not able to reproduce this with DBD::mysql 4.00. Here's a snippet of my test (which I've added to the test suite): # # [rt.cpan.org #19212] Mysql Unsigned Integer Fields # ok($dbh->do(qq{CREATE TABLE t1 (num INT UNSIGNED)}), "creating table"); ok($dbh->do(qq{INSERT INTO t1 VALUES (0),(4294967295)}), "loading data"); is_deeply($dbh->selectall_arrayref("SELECT * FROM t1"), [ ['0'], ['4294967295'] ]);


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.