diff -Nru ../DBD-mysql-4.006/dbdimp.c ./dbdimp.c
--- ../DBD-mysql-4.006/dbdimp.c 2007-12-12 00:41:50.000000000 +0300
+++ ./dbdimp.c 2008-10-10 16:09:17.000000000 +0400
@@ -80,7 +80,7 @@
while ((c = *ptr) && c != end_token)
{
if (c == '\\')
- if (! *ptr)
+ if (! *(++ptr))
continue;
++ptr;
diff -Nru ../DBD-mysql-4.006/t/43count_params.t ./t/43count_params.t
--- ../DBD-mysql-4.006/t/43count_params.t 1970-01-01 03:00:00.000000000 +0300
+++ ./t/43count_params.t 2008-10-10 16:05:40.000000000 +0400
@@ -0,0 +1,106 @@
+#!/usr/local/bin/perl
+#
+# $Id: 40bindparam.t 6127 2008-10-08 22:36:13Z zhur $
+#
+# This is a skeleton test. For writing new tests, take this file
+# and modify/extend it.
+#
+
+$^W = 1;
+
+
+#
+# Make -w happy
+#
+$test_dsn = '';
+$test_user = '';
+$test_password = '';
+
+
+#
+# Include lib.pl
+#
+use DBI ();
+use vars qw($COL_NULLABLE);
+$mdriver = "";
+foreach $file ("lib.pl", "t/lib.pl") {
+ do $file; if ($@) { print STDERR "Error while executing lib.pl: $@\n";
+ exit 10;
+ }
+ if ($mdriver ne '') {
+ last;
+ }
+}
+if ($mdriver eq 'pNET') {
+ print "1..0\n";
+ exit 0;
+}
+
+sub ServerError() {
+ my $err = $DBI::errstr; # Hate -w ...
+ print STDERR ("Cannot connect: ", $DBI::errstr, "\n",
+ "\tEither your server is not up and running or you have no\n",
+ "\tpermissions for acessing the DSN $test_dsn.\n",
+ "\tThis test requires a running server and write permissions.\n",
+ "\tPlease make sure your server is running and you have\n",
+ "\tpermissions, then retry.\n");
+ exit 10;
+}
+
+$dbh = DBI->connect($test_dsn, $test_user, $test_password,
+ { RaiseError => 1, AutoCommit => 1}) or ServerError() ;
+
+#
+# Main loop; leave this untouched, put tests after creating
+# the new table.
+#
+while (Testing()) {
+ $table = "t1";
+
+ # Connect to the database
+ Test($state or ($dbh = DBI->connect($test_dsn, $test_user,
+ $test_password, {mysql_enable_utf8 => 1})))
+ or ServerError();
+
+ # Create table
+ Test($state or $sth = $dbh->do("DROP TABLE IF EXISTS $table"))
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or $sth = $dbh->do("CREATE TABLE $table (id int, name varchar(100))"))
+ or DbiError($dbh->err, $dbh->errstr);
+
+ #
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (name, id)"
+ . " VALUES ('Charles de Batz de Castelmore, comte d\\'Artagnan', ?)")->execute(1))
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (name, id) "
+ . " VALUES ('Charles de Batz de Castelmore, comte d\\'Artagnan', 2)")->execute())
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (name, id)"
+ . " VALUES (?, ?)")->execute("Charles de Batz de Castelmore, comte d\\'Artagnan", 3))
+ or DbiError($dbh->err, $dbh->errstr);
+
+
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (id, name)"
+ . " VALUES (?, 'Charles de Batz de Castelmore, comte d\\'Artagnan')")->execute(1))
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (id, name) "
+ . " VALUES (2, 'Charles de Batz de Castelmore, comte d\\'Artagnan')")->execute())
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or $sth = $dbh->prepare("INSERT INTO $table (id, name)"
+ . " VALUES (?, ?)")->execute(3, "Charles de Batz de Castelmore, comte d\\'Artagnan"))
+ or DbiError($dbh->err, $dbh->errstr);
+
+
+ #
+ # Finally drop the test table.
+ #
+ Test($state or $dbh->do("DROP TABLE $table"))
+ or DbiError($dbh->err, $dbh->errstr);
+
+ Test($state or undef $sth or 1);
+
+}