Hi Patrick,

As the community, one think you can do if you are interested in helping
is to turn on server side prepare statements in 3.0006, or try the
development driver, 3.0006_1 to see if there are any problems.

I've found another problem with the new server side prepare statements in 3.0006_1.

The attached program crashes here:

mysql_st_prepare(sv * 0x0195b0a8, imp_sth_st * 0x0183b008, char * 0x01839470, sv * 0x0000002a) line 2311 + 21 bytes
XS_DBD__mysql__st__prepare(cv * 0x0195850c) line 427 + 42 bytes
[...]

If I delete the " FOR UPDATE" from the SELECT statement then it outputs these errors instead:

FREE ERROR BIND!FREE ERROR FBIND!

If I turn off server side prepare then it works fine, with or without the " FOR UPDATE" clause.

Cheers,
- Steve

PS. I didn't see any reply to my previous patch:

http://www.xray.mpe.mpg.de/mailing-lists/dbi/2006-06/msg00111.html

Please Cc me with any replies: I'm not subscribed to dbi-dev.


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only. If you have received this 
message in error or there are any problems, please notify the sender 
immediately. The unauthorized use, disclosure, copying or alteration of this 
message is strictly forbidden. Note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of Radan Computational Ltd. The recipient(s) of this message should check 
it and any attached files for viruses: Radan Computational will accept no 
liability for any damage caused by any virus transmitted by this email.
use strict;
use warnings;
use DBI qw(:sql_types);
my $tmp_dbh = DBI->connect(
  'dbi:mysql:database=mysql', 'root', undef,
  { AutoCommit => 1, PrintError => 0, RaiseError => 1 }
);
$tmp_dbh->do('CREATE DATABASE IF NOT EXISTS test');
$tmp_dbh->disconnect();
my $dsn = 'dbi:mysql:database=test;mysql_server_prepare=1';    # Crashes
#my $dsn = 'dbi:mysql:database=test;mysql_emulated_prepare=1'; # OK
my $dbh = DBI->connect(
  $dsn, 'root', undef,
  { AutoCommit => 1, PrintError => 0, RaiseError => 1 }
);
$dbh->do('DROP TABLE IF EXISTS foo');
$dbh->do(qq{CREATE TABLE foo (
  id  INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  num INT
) ENGINE=InnoDB});
$dbh->trace(3, 'dbitrace.txt');
my $sql = 'SELECT num FROM foo WHERE id = ? FOR UPDATE';
my $sth = $dbh->prepare($sql);
$sth->bind_param(1, 1);
$sth->execute();
my $rows = $sth->fetchall_arrayref({});
$sth->finish();
$dbh->disconnect();

Reply via email to