Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 75540
Status: resolved
Priority: 0/
Queue: DBD-mysql

Owner: Nobody in particular
Requestors: GNATYNA [...]
Cc: gnatyna [...]

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

CC: gnatyna [...]
Subject: Commented placeholders in sql statement.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1330938119-10814-242"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 222
Download (untitled) / with headers
text/plain 222b
With mysql_server_prepare=0 line $dbh->do(qq[update t1 set id=id+1 where / col1=? and/ id=?],undef,1) gives error "You have an error in your SQL syntax;". $dbh->prepare->execute works fine. Test script in attachement.
MIME-Version: 1.0
Content-Type: application/octet-stream; name=""
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename=""
Content-Transfer-Encoding: base64
Content-Length: 1026
text/x-perl 1k
#!/usr/bin/perl -l use strict; use warnings; use DBI; =head2 SQL create table t1( id int); =cut t_ph(); sub t_ph{ my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost;mysql_server_prepare=0;", undef, undef, {AutoCommit => 1, PrintError=>0, RaiseError => 0}, ); my $query = q[update t1 set id=id+1 where /* col1 = ? and */ id=?]; if($dbh->do($query, undef, 1)){ print "comment do ok"; }else{ warn "comment DO: ".$dbh->errstr; } my $query_nocom = q[update t1 set id=id+1 where id=?]; if($dbh->do($query_nocom, undef, 1)){ print "nocomment do ok"; }else{ warn "no comment DO: ".$dbh->errstr; } my $sth = $dbh->prepare($query,undef); if($sth->execute(1)){ print "Execute-prepare ok"; }else{ warn "execute-prepare: ".$dbh->errstr; } $dbh->disconnect(); }
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-25844-1510688642-1565.75540-0-0 [...]>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 78

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to