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

Owner: Nobody in particular
Requestors: ananomaly [...]

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

Subject: Mysql Unsigned Integer Fields
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
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): # # [ #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 infrastructure.

Please report any issues with to