On Mon, Jan 07, 2002 at 03:40:02PM +0000, Tim Bunce wrote:
> Easy. Send me a self-contained test case that demonstrates the poroblem
> in as small amount of code as possible, and using the latest DBI.
> Then it'll magically get fixed, or at least it'll seem like it :)

Ok, here's a simple test program that executes a legal statement,
followed by an illegal statement. The error message prints the wrong
statement.

#!/usr/bin/perl

use strict;
use DBI;

my $dbh = DBI->connect(
        'DBI:mysql:***',
        '***',
        '***',
        {
                AutoCommit => 1,
                RaiseError => 1,
                PrintError => 0,
                ShowErrorStatement => 1
        }
);

$dbh->selectrow_hashref("SHOW TABLES");
$dbh->do("blah blah blah");


Executing this code will cause:

$ perl test.pl
DBD::mysql::db do failed: You have an error in your SQL syntax near 'blah blah blah' 
at line 1 [for statement ``SHOW TABLES'']) at test.pl line 19.

Reply via email to