delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/26/06:22:35

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG40,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <832088.86114.qm@web65503.mail.ac4.yahoo.com>
References: <832088 DOT 86114 DOT qm AT web65503 DOT mail DOT ac4 DOT yahoo DOT com>
Date: Mon, 26 Apr 2010 12:22:21 +0200
Message-ID: <q2o6910a61004260322y289b6a99u644529c549ab9f1@mail.gmail.com>
Subject: Re: perl script fails in 1.7
From: Reini Urban <rurban AT x-ray DOT at>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

2010/4/26 larry s:
> I have a perl script that ran fine until I upgraded to 1.7.=A0 It uses DB=
I to access a mysql database and I have boiled down the problem area to the=
 following:
> [top stuff omitted]
> my $server =3D 'remotesvr';
> my $database =3D 'tcdump';
> print "\nConnecting to mysql on $server ...\t";
> my $dbh =3D DBI->connect("DBI:mysql:tcdump:$server", 'auser', 'pw', {Rais=
eError =3D> 1 } )
> =A0=A0=A0 or die "Couldn't connect to database: $DBI::errstr\n";
> if ($dbh) { print "Connected to mysql database ($database) on $server \n"=
; }
>
> my $sth =3D $dbh->prepare("DESCRIBE aindex") ;
> $sth->execute() or die "STMT=3D execute err=3D " . $dbh->errstr;
>
> while (my @rowx =3D $sth->fetchrow_array() ) {
> =A0=A0=A0=A0=A0=A0=A0 foreach my $jkl (@rowx) {
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (defined($jkl)) {
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 pri=
nt "$jkl \t";
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
> =A0=A0=A0=A0=A0=A0=A0 }
> =A0=A0=A0=A0=A0=A0=A0 print "\n";
> }
>
>
> When run, the fetchrow in the while causes:
> DBD::mysql::st fetchrow_array failed: fetch() without execute() at ./test=
z.pl line 31.
> Uncaught exception from user code:
> =A0=A0=A0=A0=A0=A0=A0 DBD::mysql::st fetchrow_array failed: fetch() witho=
ut execute() at ./testz.pl line 31.
> =A0at ./testz.pl line 31
>
> It still runs fine when run from Linux machines with perl 5.8.8, so I'm w=
ondering if it can be fixed for 5.10 or if there is a way to go back to 5.8=
 on Cygwin 1.7.5.

That looks like a case where you just have to recompile DBD::mysql.
(binary incompat)
$ cpan
> force install DBD::mysql
--=20
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019