Subject: | Undefined $DBI::errstr on execute fail on Windows-7-x64 |
Date: | Sun, 18 Sep 2011 14:19:30 +0800 |
To: | bug-DBD-mysql [...] rt.cpan.org |
From: | Tadhg MacCarthy <tadhgmaccarthy [...] gmail.com> |
Hello,
The following code:
use warnings;
use DBI;
$h=DBI->connect('dbi:mysql:cq','root','password',{RaiseError=>0,PrintError=>0})
or die "Connection Failed: $DBI::errstr";
$s=$h->prepare("select * from does_not_exist");
$s->execute or die 'Execute Failed with error ['. $s->errstr . ']';
produces the output:
Use of uninitialized value in concatenation (.) or string at
testmysql.plline 15.
Execute Failed with error [] at testmysql.pl line 5.
The environment is:
DBD-mysql 4.0.19
MySQL: Server version: 5.5.15 MySQL Community Server (GPL)
Perl 5.14.1: This is perl 5, version 14, subversion 1 (v5.14.1) built for
MSWin32-x64-multi-thread
ActivePerl 5.14.1 Build 1401 (64-bit)
Windows 7 Professional Sevice Pack 1 64 bit
The code produces the expected output when the operating system is Windows
XP 32-bit.
Other information:
See
http://stackoverflow.com/questions/7432944/undefined-dbierrstr-using-dbi-perl-and-mysql-on-windows-7-x64for
a discussion on StackOverflow
Thanks in advance,
Tadhg