r34293 - in /trunk/libdbd-mysql-perl: ChangeLog INSTALL.html MANIFEST META.yml dbdimp.c debian/changelog debian/control eg/._bug14979.pl eg/._bug21028.pl lib/DBD/mysql.pm lib/DBD/mysql/GetInfo.pm t/40server_prepare.t t/51bind_type_guessing.t t/mysql.mtest
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Tue Apr 28 21:52:03 UTC 2009
Author: eloy
Date: Tue Apr 28 21:51:58 2009
New Revision: 34293
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34293
Log:
new upstream version
Added:
trunk/libdbd-mysql-perl/t/51bind_type_guessing.t
- copied unchanged from r34292, branches/upstream/libdbd-mysql-perl/current/t/51bind_type_guessing.t
Removed:
trunk/libdbd-mysql-perl/eg/._bug14979.pl
trunk/libdbd-mysql-perl/eg/._bug21028.pl
Modified:
trunk/libdbd-mysql-perl/ChangeLog
trunk/libdbd-mysql-perl/INSTALL.html
trunk/libdbd-mysql-perl/MANIFEST
trunk/libdbd-mysql-perl/META.yml
trunk/libdbd-mysql-perl/dbdimp.c
trunk/libdbd-mysql-perl/debian/changelog
trunk/libdbd-mysql-perl/debian/control
trunk/libdbd-mysql-perl/lib/DBD/mysql.pm
trunk/libdbd-mysql-perl/lib/DBD/mysql/GetInfo.pm
trunk/libdbd-mysql-perl/t/40server_prepare.t
trunk/libdbd-mysql-perl/t/mysql.mtest
Modified: trunk/libdbd-mysql-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/ChangeLog?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/ChangeLog (original)
+++ trunk/libdbd-mysql-perl/ChangeLog Tue Apr 28 21:51:58 2009
@@ -1,3 +1,13 @@
+2009-04-13 Patrick Galbraith <patg at patg.net> (4.011)
+* Renamed unsafe_bind_type_guessing, fixed some of the logic. This
+can be used to deal with bug 43822
+(https://rt.cpan.org/Ticket/Display.html?id=43822)
+* Patch from Daniel Frett (daniel Dot frett At ccci Dot org) to fix
+issue of binding sever side integer parameters (server-side prepare
+statements) resulting in corrupt data, bug 42723
+(https://rt.cpan.org/Ticket/Display.html?id=42723)
+* Updated documentation, cruft cleanup (as always)
+
2008-10-24 Patrick Galbraith <patg at patg.net> (4.010)
* Fix to dbd_bind_ph() for uninitialized value 'buffer_length'
thanks for bug report and patch from Askniel.com (thanks!)
@@ -1092,7 +1102,7 @@
* lib/Msql/Statement.pm: Fixed use of Msql::TEXT_TYPE without
checking whether we are running Msql 1.
-$Id: ChangeLog 11993 2008-10-22 00:49:10Z capttofu $
+$Id: ChangeLog 12696 2009-04-14 02:28:12Z capttofu $
DBD::mysql for DBI - Written by Jochen Wiedmann <joe at ispsoft.de>
Modified: trunk/libdbd-mysql-perl/INSTALL.html
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/INSTALL.html?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/INSTALL.html (original)
+++ trunk/libdbd-mysql-perl/INSTALL.html Tue Apr 28 21:51:58 2009
@@ -4,7 +4,7 @@
<head>
<title>INSTALL - How to install and configure DBD::mysql</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<link rev="made" href="mailto:_www at b70.apple.com" />
+<link rev="made" href="mailto:root at localhost" />
</head>
<body style="background-color: white">
Modified: trunk/libdbd-mysql-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/MANIFEST?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/MANIFEST (original)
+++ trunk/libdbd-mysql-perl/MANIFEST Tue Apr 28 21:51:58 2009
@@ -41,6 +41,7 @@
t/42bindparam.t
t/50chopblanks.t
t/50commit.t
+t/51bind_type_guessing.t
t/55utf8.t
t/60leaks.t
t/65types.t
Modified: trunk/libdbd-mysql-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/META.yml?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/META.yml (original)
+++ trunk/libdbd-mysql-perl/META.yml Tue Apr 28 21:51:58 2009
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: DBD-mysql
-version: 4.010
+version: 4.011
version_from: lib/DBD/mysql.pm
installdirs: site
requires:
Modified: trunk/libdbd-mysql-perl/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/dbdimp.c?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/dbdimp.c (original)
+++ trunk/libdbd-mysql-perl/dbdimp.c Tue Apr 28 21:51:58 2009
@@ -1,14 +1,14 @@
/*
* DBD::mysql - DBI driver for the mysql database
*
- * Copyright (c) 2005 Patrick Galbraith
- * Copyright (c) 2003 Rudolf Lippan
+ * Copyright (c) 2005-2009 Patrick Galbraith
+ * Copyright (c) 2003-2005 Rudolf Lippan
* Copyright (c) 1997-2003 Jochen Wiedmann
*
* You may distribute this under the terms of either the GNU General Public
* License or the Artistic License, as specified in the Perl README file.
*
- * $Id: dbdimp.c 11993 2008-10-22 00:49:10Z capttofu $
+ * $Id: dbdimp.c 12689 2009-04-13 19:19:25Z capttofu $
*/
@@ -20,7 +20,6 @@
#include "dbdimp.h"
#if defined(WIN32) && defined(WORD)
- /* Don't exactly know who's responsible for defining WORD ... :-( */
#undef WORD
typedef short WORD;
#endif
@@ -456,7 +455,7 @@
/* of mysql.xs hardcodes all types to SQL_VARCHAR */
if (!ph->type)
{
- if ( bind_type_guessing > 1 )
+ if (bind_type_guessing)
{
valbuf= SvPV(ph->value, vallen);
ph->type= SQL_INTEGER;
@@ -466,8 +465,6 @@
ph->type= SQL_VARCHAR;
}
}
- else if (bind_type_guessing)
- ph->type= SvNIOK(ph->value) ? SQL_INTEGER : SQL_VARCHAR;
else
ph->type= SQL_VARCHAR;
}
@@ -2119,8 +2116,8 @@
else if (kl == 20 && strEQ(key, "mysql_server_prepare"))
imp_dbh->use_server_side_prepare=SvTRUE(valuesv);
- else if (kl == 31 && strEQ(key,"mysql_unsafe_bind_type_guessing"))
- imp_dbh->bind_type_guessing = SvIV(valuesv);
+ else if (kl == 24 && strEQ(key,"mysql_bind_type_guessing"))
+ imp_dbh->bind_type_guessing = SvIV(valuesv);
/*HELMUT */
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
else if (kl == 17 && strEQ(key, "mysql_enable_utf8"))
@@ -2198,9 +2195,9 @@
if (kl == strlen("auto_reconnect") && strEQ(key, "auto_reconnect"))
result= sv_2mortal(newSViv(imp_dbh->auto_reconnect));
break;
- case 'u':
- if (kl == strlen("unsafe_bind_type_guessing") &&
- strEQ(key, "unsafe_bind_type_guessing"))
+ case 'b':
+ if (kl == strlen("bind_type_guessing") &&
+ strEQ(key, "bind_type_guessing"))
result = sv_2mortal(newSViv(imp_dbh->bind_type_guessing));
break;
case 'e':
@@ -2807,7 +2804,7 @@
int use_mysql_use_result
)
{
- bool bind_type_guessing;
+ bool bind_type_guessing= 0;
STRLEN slen;
char *sbuf = SvPV(statement, slen);
char *table;
@@ -2832,10 +2829,10 @@
{
D_imp_dbh(h);
/* if imp_dbh is not available, it causes segfault (proper) on OpenBSD */
- if (imp_dbh)
+ if (imp_dbh && imp_dbh->bind_type_guessing)
bind_type_guessing= imp_dbh->bind_type_guessing;
else
- bind_type_guessing=0;
+ bind_type_guessing= 0;
}
/* h is a sth */
else
@@ -4322,8 +4319,15 @@
break;
}
- buffer= SvPV(imp_sth->params[idx].value, slen);
- buffer_length= slen;
+ if (buffer_type == MYSQL_TYPE_STRING || buffer_type == MYSQL_TYPE_BLOB)
+ {
+ buffer= SvPV(imp_sth->params[idx].value, slen);
+ buffer_length= slen;
+ if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
+ PerlIO_printf(DBILOGFP,
+ " SCALAR type %d ->length %d<- IS A STRING or BLOB\n",
+ sql_type, buffer_length);
+ }
}
else
{
Modified: trunk/libdbd-mysql-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/debian/changelog?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/debian/changelog (original)
+++ trunk/libdbd-mysql-perl/debian/changelog Tue Apr 28 21:51:58 2009
@@ -1,3 +1,10 @@
+libdbd-mysql-perl (4.011-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * debian/control: add me to Uploaders, update Standards-Version to 3.8.1
+
+ -- Krzysztof Krzyżaniak (eloy) <eloy at debian.org> Tue, 28 Apr 2009 23:46:50 +0200
+
libdbd-mysql-perl (4.010-1) UNRELEASED; urgency=low
QUESTION:
Modified: trunk/libdbd-mysql-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/debian/control?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/debian/control (original)
+++ trunk/libdbd-mysql-perl/debian/control Tue Apr 28 21:51:58 2009
@@ -3,8 +3,9 @@
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Raphael Hertzog <hertzog at debian.org>,
- gregor herrmann <gregoa at debian.org>
-Standards-Version: 3.8.0
+ gregor herrmann <gregoa at debian.org>,
+ Krzysztof Krzyżaniak (eloy) <eloy at debian.org>
+Standards-Version: 3.8.1
Homepage: http://search.cpan.org/dist/DBD-mysql/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libdbd-mysql-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libdbd-mysql-perl/
Modified: trunk/libdbd-mysql-perl/lib/DBD/mysql.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/lib/DBD/mysql.pm?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/lib/DBD/mysql.pm (original)
+++ trunk/libdbd-mysql-perl/lib/DBD/mysql.pm Tue Apr 28 21:51:58 2009
@@ -9,7 +9,7 @@
use Carp ();
@ISA = qw(DynaLoader);
-$VERSION = '4.010';
+$VERSION = '4.011';
bootstrap DBD::mysql $VERSION;
@@ -1276,6 +1276,33 @@
This option is experimental and may change in future versions.
+=item mysql_bind_type_guessing
+
+This attribute causes the driver (emulated prepare statements)
+to attempt to guess if a value being bound is a numeric value,
+and if so, doesn't quote the value. This was created by
+Dragonchild and is one way to deal with the performance issue
+of using quotes in a statement that is inserting or updating a
+large numeric value. This was previously called
+C<unsafe_bind_type_guessing> because it is experimental. I have
+successfully run the full test suite with this option turned on,
+the name can now be simply C<mysql_bind_type_guessing>.
+
+See bug: https://rt.cpan.org/Ticket/Display.html?id=43822
+
+C<mysql_bind_type_guessing> can be turned on via
+
+ - through DSN
+
+ my $dbh= DBI->connect('DBI:mysql:test', 'username', 'pass',
+ { mysql_bind_type_guessing => 1})
+
+ - OR after handle creation
+
+ $dbh->{mysql_bind_type_guessing} = 1;
+
+
+
=head1 STATEMENT HANDLES
The statement handles of DBD::mysql support a number
Modified: trunk/libdbd-mysql-perl/lib/DBD/mysql/GetInfo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/lib/DBD/mysql/GetInfo.pm?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/lib/DBD/mysql/GetInfo.pm (original)
+++ trunk/libdbd-mysql-perl/lib/DBD/mysql/GetInfo.pm Tue Apr 28 21:51:58 2009
@@ -4,9 +4,9 @@
#
#
# Generated by DBI::DBD::Metadata
-# $Author: capttofu $ <-- the person to blame
-# $Revision: 8435 $
-# $Date: 2006-12-23 14:03:49 -0500 (Sat, 23 Dec 2006) $
+# $Author: rlippan $ <-- the person to blame
+# $Revision: 1108 $
+# $Date: 2003-03-31 20:17:27 -0500 (Mon, 31 Mar 2003) $
use strict;
use DBD::mysql;
Modified: trunk/libdbd-mysql-perl/t/40server_prepare.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/40server_prepare.t?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/40server_prepare.t (original)
+++ trunk/libdbd-mysql-perl/t/40server_prepare.t Tue Apr 28 21:51:58 2009
@@ -19,7 +19,7 @@
if ($@) {
plan skip_all => "ERROR: $@. Can't continue test";
}
-plan tests => 10;
+plan tests => 21;
ok(defined $dbh, "connecting");
@@ -30,9 +30,10 @@
#
ok($dbh->do(qq{CREATE TABLE t1 (id INT, num DOUBLE)}), "creating table");
-ok($dbh->do(qq{INSERT INTO t1 VALUES (1,3.0),(2,-4.5)}), "loading data");
+my $sth;
+ok($sth= $dbh->prepare(qq{INSERT INTO t1 VALUES (?,?),(?,?)}), "loading data");
+ok($sth->execute(1, 3.0, 2, -4.5));
-my $sth;
ok ($sth= $dbh->prepare("SELECT num FROM t1 WHERE id = ? FOR UPDATE"));
ok ($sth->bind_param(1, 1), "binding parameter");
@@ -45,4 +46,26 @@
ok ($dbh->do(qq{DROP TABLE t1}), "cleaning up");
+#
+# Bug #42723: Binding server side integer parameters results in corrupt data
+#
+ok($dbh->do(qq{DROP TABLE IF EXISTS t2}), "making slate clean");
+
+ok($dbh->do(q{CREATE TABLE `t2` (`i` int,`si` smallint,`ti` tinyint,`bi` bigint)}), "creating test table");
+
+my $sth2;
+ok($sth2 = $dbh->prepare('INSERT INTO t2 VALUES (?,?,?,?)'));
+
+#bind test values
+ok($sth2->bind_param(1, 101, DBI::SQL_INTEGER), "binding int");
+ok($sth2->bind_param(2, 102, DBI::SQL_SMALLINT), "binding smallint");
+ok($sth2->bind_param(3, 103, DBI::SQL_TINYINT), "binding tinyint");
+ok($sth2->bind_param(4, 104, DBI::SQL_INTEGER), "binding bigint");
+
+ok($sth2->execute(), "inserting data");
+
+is_deeply($dbh->selectall_arrayref('SELECT * FROM t2'), [[101, 102, 103, 104]]);
+
+ok ($dbh->do(qq{DROP TABLE t2}), "cleaning up");
+
$dbh->disconnect();
Modified: trunk/libdbd-mysql-perl/t/mysql.mtest
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/mysql.mtest?rev=34293&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/mysql.mtest (original)
+++ trunk/libdbd-mysql-perl/t/mysql.mtest Tue Apr 28 21:51:58 2009
@@ -3,13 +3,13 @@
'embedded' => '',
'ssl' => 0,
'nocatchstderr' => 0,
- 'libs' => '-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm',
+ 'libs' => '-rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm',
'testhost' => '',
'nofoundrows' => 0,
'testdb' => 'test',
- 'cflags' => '-I/usr/local/mysql/include/mysql -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL',
+ 'cflags' => '-I/usr/local/mysql/include/mysql -DUNIV_LINUX',
'testuser' => 'root',
- 'testpassword' => '',
+ 'testpassword' => 'root',
'testsocket' => ''
};
$::test_host = $opt->{'testhost'};
More information about the Pkg-perl-cvs-commits
mailing list