r24529 - in /trunk/libdbd-mysql-perl: ./ debian/ lib/DBD/ t/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Aug 23 17:33:37 UTC 2008
Author: gregoa
Date: Sat Aug 23 17:33:33 2008
New Revision: 24529
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24529
Log:
New upstream release.
Modified:
trunk/libdbd-mysql-perl/ChangeLog
trunk/libdbd-mysql-perl/INSTALL.html
trunk/libdbd-mysql-perl/META.yml
trunk/libdbd-mysql-perl/Makefile.PL
trunk/libdbd-mysql-perl/README
trunk/libdbd-mysql-perl/dbdimp.c
trunk/libdbd-mysql-perl/debian/changelog
trunk/libdbd-mysql-perl/lib/DBD/mysql.pm
trunk/libdbd-mysql-perl/mysql.xs
trunk/libdbd-mysql-perl/t/40bindparam.t
trunk/libdbd-mysql-perl/t/40blobs.t
trunk/libdbd-mysql-perl/t/50chopblanks.t
trunk/libdbd-mysql-perl/t/50commit.t
trunk/libdbd-mysql-perl/t/70takeimp.t
trunk/libdbd-mysql-perl/t/71impdata.t
trunk/libdbd-mysql-perl/t/76multi_statement.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=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/ChangeLog (original)
+++ trunk/libdbd-mysql-perl/ChangeLog Sat Aug 23 17:33:33 2008
@@ -1,16 +1,25 @@
-2008-5-11 Patrick Galbraith <patg at grazr.com> (4.007)
+2008-8-15 Patrick Galbraith <patg at patg.net> (4.008)
+* Multi statement patch, thanks to Chris Heath!
+* Disabled TAKE_IMP_DATA_VERSION because segfault with DBI < 1.607
+* #29528: bind_param(..., SQL_FLOAT) ignores exponents - fixed, Thanks to
+Tokuhiro Matsuno!
+* Cleanups to make mysqlEmb work under Cygwin - Thanks to Chris Rodgers
+<http://rodgers.org.uk/> !
+* Modified and disabled tests for MySQL version < 4.1 for unsupported features
+
+2008-5-11 Patrick Galbraith <patg at patg.net> (4.007)
* Took out mysql_server_init call where not needed
* Complete re-write of test suit to use Test::More - tons of cleanups!
* Makefile.PL changes to use current user in 'make test' if not defined
-2007-12-26 Patrick Galbraith <patg at grazr.com> (4.006)
+2007-12-26 Patrick Galbraith <patg at patg.net> (4.006)
* Cleanups on OS X compile
* Fixes to syntax errors on AIX
* Removed test code that was leaving trace files around
-2007-3-22 Patrick Galbraith <patg at grazr.com> (4.005)
+2007-3-22 Patrick Galbraith <patg at patg.net> (4.005)
* Fixed mysql_warning issue < 4.1 (reminers, patches, help from ROAM, (issue 25713)
* makerealclean patch from ROAM (issue #25714)
@@ -28,7 +37,7 @@
-2007-3-22 Patrick Galbraith <patg at grazr.com> Jim Winstead <jimw at mysql.com> (4.004)
+2007-3-22 Patrick Galbraith <patg at patg.net> Jim Winstead <jimw at mysql.com> (4.004)
* Work around a bug in old 3.23 servers by specifying NOT NULL for fields used
as a primary key in tests. (Bug #20325, reported by Julian Ladisch)
* Add support for mysql_warning_count statement handle attribute. (Bug #25457,
@@ -43,11 +52,11 @@
* Fixed do_error definition (Scott Hildreth, Tim Bunce)
* Conversion of test suite to Test::More
-2007-3-5 Patrick Galbraith <patg at grazr.com> Jim Winstead <jimw at mysql.com> (4.003)
+2007-3-5 Patrick Galbraith <patg at patg.net> Jim Winstead <jimw at mysql.com> (4.003)
* Fix inclusion of non-primary keys in primary_key_info. (Bug #26786,
reported and patch by Dave Rolsky)
-2007-3-1 Patrick Galbraith <patg at grazr.com> Jim Winstead <jimw at mysql.com> (4.002)
+2007-3-1 Patrick Galbraith <patg at patg.net> Jim Winstead <jimw at mysql.com> (4.002)
* Fix re-exec of Makefile.PL when forcing $ENV{LANG} to 'C'. (RT #25233,
reported by Slaven Rezic)
* Rewrote table_info method to support all arguments (previously it would
@@ -77,7 +86,7 @@
Dave Rolsky, and final implementation based on Connector/J code)
-2007-1-8 Jim Winstead <jimw at mysql.com> Patrick Galbraith <patg at grazr.com> (4.001)
+2007-1-8 Jim Winstead <jimw at mysql.com> Patrick Galbraith <patg at patg.net> (4.001)
* Fix handling of unsigned integer values in result sets when using
server-side prepared statements (they were not retrieved at all).
* Fix handling of signed integer values when using server-side prepared
@@ -1075,7 +1084,7 @@
* lib/Msql/Statement.pm: Fixed use of Msql::TEXT_TYPE without
checking whether we are running Msql 1.
-$Id: ChangeLog 11247 2008-05-11 15:54:20Z capttofu $
+$Id: ChangeLog 11650 2008-08-15 13:58:29Z 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=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/INSTALL.html (original)
+++ trunk/libdbd-mysql-perl/INSTALL.html Sat Aug 23 17:33:33 2008
@@ -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:patg at my.patg.net" />
+<link rev="made" href="mailto:root at omen.apple.com" />
</head>
<body style="background-color: white">
Modified: trunk/libdbd-mysql-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/META.yml?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/META.yml (original)
+++ trunk/libdbd-mysql-perl/META.yml Sat Aug 23 17:33:33 2008
@@ -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.007
+version: 4.008
version_from: lib/DBD/mysql.pm
installdirs: site
requires:
Modified: trunk/libdbd-mysql-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/Makefile.PL?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/Makefile.PL (original)
+++ trunk/libdbd-mysql-perl/Makefile.PL Sat Aug 23 17:33:33 2008
@@ -108,7 +108,11 @@
if ($source->{'embedded'} eq 'mysql_config')
{
#We have to use libmygcc to resolve linking problem
- $opt->{'embedded'} .= " -lmygcc";
+ # this causes problems for cygwin
+ #$opt->{'embedded'} .= " -lmygcc";
+ # Under Cygwin (at least) we have to use libstdc++ to resolve linking
+ # problem because libmysqld is built using g++ rather than gcc.
+ $opt->{'embedded'} .= " -lstdc++";
}
my @files = ($^O =~ /mswin32/i) ? qw(mysqlclient.lib) :
@@ -261,9 +265,6 @@
replace => { '\$mdriver =.*' => "\$mdriver =\'mysqlEmb\';"},
makedir => 'mysqlEmb/t'
},
- 't/10dsnlist.t' => { filename => 'mysqlEmb/t/10dsnlist.t',
- makedir => 'mysqlEmb/t'
- },
't/20createdrop.t' => { filename => 'mysqlEmb/t/20createdrop.t',
makedir => 'mysqlEmb/t'
},
@@ -294,21 +295,6 @@
't/60leaks.t' => { filename => 'mysqlEmb/t/60leaks.t',
makedir => 'mysqlEmb/t'
},
- 't/dbdadmin.t' => { filename => 'mysqlEmb/t/dbdadmin.t',
- makedir => 'mysqlEmb/t'
- },
- 't/insertid.t' => { filename => 'mysqlEmb/t/insertid.t',
- makedir => 'mysqlEmb/t'
- },
- 't/texecute.t' => { filename => 'mysqlEmb/t/texecute.t',
- makedir => 'mysqlEmb/t'
- },
- 't/prepare_noerror.t' => { filename => 'mysqlEmb/t/prepare_noerror.t',
- makedir => 'mysqlEmb/t'
- },
- 't/param_values.t' => { filename => 'mysqlEmb/t/param_values.t',
- makedir => 'mysqlEmb/t'
- },
't/00base.t' => { filename => 'mysqlEmb/t/00base.t',
makedir => 'mysqlEmb/t'
},
@@ -347,6 +333,8 @@
$e{'INC'} .= " -DDBD_MYSQL_EMBEDDED";
+ print "Preparing embedded Makefile\n";
+
#Create Makefile.conf for mysqlEmb Makefile.PL
create_makefile(Data::Dumper->Dump([\%e], ["o"]));
@@ -387,9 +375,10 @@
--libs=<libs> Use <libs> for running the linker; defaults
to the value of "mysql_config --libs" or a gussed
value
- --embedded=<libs> Build embedded version of DBD and use <libs> for this;
- defaults to the value of "mysql_config --embedded"
- (default: off)
+ --force-embedded Build version of driver supporting mysqlEmb
+ --embedded=<libs> Use these libs when building the embedded version of
+ DBD (with --force-embedded). Defaults to the value of
+ "mysql_config --embedded".
--testdb=<db> Use the database <db> for running the test suite;
defaults to $TESTDB
--testuser=<user> Use the username <user> for running the test suite;
@@ -411,7 +400,6 @@
--ps-protocol Toggle the use of driver emulated prepared statements
prepare, requires MySQL server >= 4.1.3 for
server side prepared statements, off by default
- --force-embedded Force to build embedded version of driver
--ssl Enable SSL support
--help Print this message and exit
Modified: trunk/libdbd-mysql-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/README?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/README (original)
+++ trunk/libdbd-mysql-perl/README Sat Aug 23 17:33:33 2008
@@ -50,6 +50,28 @@
make test # Some minor error messages can be ignored here
make install
+ Windows/CygWin (to build with embedded MySQL too)
+
+ First, build MySQL
+ tar -xzf mysql-5.0.51b.tar.gz
+ cd mysql-5.0.51b/
+ ./configure --without-server --with-embedded-server
+ make
+ make install
+
+ Then build DBD::mysqlEmb
+ cpan
+ look DBD::mysql
+ perl Makefile.PL --force-embedded
+ make
+ make install
+
+ Test with the following snippet
+ perl -e 'use DBI; $dbh = DBI->connect("DBI:mysqlEmb:database=test;mysql_embedded=1;mysql_embedded_options=--help,--verbose","a","b");'
+
+ If your build is OK, this will print the mysql embedded help.
+
+
Linux/Red Hat (you may prefer gnorpm to use)
rpm -i mysql mysql-devel mysql-server
Modified: trunk/libdbd-mysql-perl/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/dbdimp.c?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/dbdimp.c (original)
+++ trunk/libdbd-mysql-perl/dbdimp.c Sat Aug 23 17:33:33 2008
@@ -8,7 +8,7 @@
* 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 11150 2008-04-28 23:36:14Z capttofu $
+ * $Id: dbdimp.c 11649 2008-08-15 13:31:25Z capttofu $
*/
@@ -1562,6 +1562,7 @@
imp_dbh->use_server_side_prepare);
#endif
+ /* HELMUT */
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
if ((svp = hv_fetch(hv, "mysql_enable_utf8", 17, FALSE)) && *svp) {
/* Do not touch imp_dbh->enable_utf8 as we are called earlier
@@ -1709,7 +1710,8 @@
char* mysql_socket;
D_imp_xxh(dbh);
-#define TAKE_IMP_DATA_VERSION 1
+ /* TODO- resolve this so that it is set only if DBI is 1.607 */
+#define TAKE_IMP_DATA_VERSION 1
#if TAKE_IMP_DATA_VERSION
if (DBIc_has(imp_dbh, DBIcf_IMPSET))
{ /* eg from take_imp_data() */
@@ -1800,6 +1802,7 @@
/* Safer we flip this to TRUE perl side if we detect a mod_perl env. */
imp_dbh->auto_reconnect = FALSE;
+ /* HELMUT */
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
imp_dbh->enable_utf8 = FALSE; /* initialize mysql_enable_utf8 */
#endif
@@ -2118,6 +2121,7 @@
else if (kl == 31 && strEQ(key,"mysql_unsafe_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"))
imp_dbh->enable_utf8 = bool_value;
@@ -2208,6 +2212,7 @@
const char* msg = mysql_error(imp_dbh->pmysql);
result= sv_2mortal(newSVpv(msg, strlen(msg)));
}
+ /* HELMUT */
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
else if (kl == strlen("enable_utf8") && strEQ(key, "enable_utf8"))
result = sv_2mortal(newSViv(imp_dbh->enable_utf8));
@@ -2668,7 +2673,7 @@
/* No more pending result set(s)*/
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
PerlIO_printf(DBILOGFP,
- "\n <- dbs_st_more_rows no more results\n");
+ "\n <- dbs_st_more_results no more results\n");
return 0;
}
@@ -2698,6 +2703,8 @@
DBIc_ACTIVE_off(imp_sth);
next_result_return_code= mysql_next_result(svsock);
+
+ imp_sth->warning_count = mysql_warning_count(imp_dbh->pmysql);
/*
mysql_next_result returns
@@ -2709,6 +2716,7 @@
{
do_error(sth, mysql_errno(svsock), mysql_error(svsock),
mysql_sqlstate(svsock));
+
return 0;
}
else
@@ -2721,10 +2729,12 @@
do_error(sth, mysql_errno(svsock), mysql_error(svsock),
mysql_sqlstate(svsock));
+ imp_sth->row_num= mysql_affected_rows(imp_dbh->pmysql);
+
if (imp_sth->result == NULL)
{
/* No "real" rowset*/
- return 0;
+ return 1;
}
else
{
@@ -3137,7 +3147,13 @@
if (imp_sth->row_num+1 != (my_ulonglong)-1)
{
if (!imp_sth->result)
+ {
imp_sth->insertid= mysql_insert_id(imp_dbh->pmysql);
+#if MYSQL_VERSION_ID >= MULTIPLE_RESULT_SET_VERSION
+ if (mysql_more_results(imp_dbh->pmysql))
+ DBIc_ACTIVE_on(imp_sth);
+#endif
+ }
else
{
/** Store the result in the current statement handle */
@@ -3470,6 +3486,7 @@
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
PerlIO_printf(DBILOGFP, "\t\tst_fetch string data %s\n", fbh->data);
sv_setpvn(sv, fbh->data, fbh->length);
+ /*HELMUT*/
#ifdef sv_utf8_decode
if(imp_dbh->enable_utf8)
sv_utf8_decode(sv);
@@ -3585,6 +3602,7 @@
}
sv_setpvn(sv, col, len);
/* UTF8 */
+ /*HELMUT*/
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
#if MYSQL_VERSION_ID >= FIELD_CHARSETNR_VERSION
@@ -3674,7 +3692,7 @@
We don't close the cursor till DESTROY.
The application may re execute it.
*/
- if (imp_sth && imp_sth->result)
+ if (imp_sth && DBIc_ACTIVE(imp_sth))
{
/*
Clean-up previous result set(s) for sth to prevent
@@ -4591,10 +4609,11 @@
{
int seen_neg;
int seen_dec;
+ int seen_e;
+ int seen_plus;
char *cp;
- seen_neg= 0;
- seen_dec= 0;
+ seen_neg= seen_dec= seen_e= seen_plus= 0;
if (len <= 0) {
len= strlen(string);
@@ -4610,17 +4629,14 @@
{
if ('-' == *cp)
{
- if (seen_neg)
+ if (seen_neg >= 2)
{
- /* second '-' */
+ /*
+ third '-'. number can contains two '-'.
+ because -1e-10 is valid number */
break;
}
- else if (cp > string)
- {
- /* '-' after digit(s) */
- break;
- }
- seen_neg= 1;
+ seen_neg += 1;
}
else if ('.' == *cp)
{
@@ -4631,7 +4647,25 @@
}
seen_dec= 1;
}
- else if (!isdigit(*cp))
+ else if ('e' == *cp)
+ {
+ if (seen_e)
+ {
+ /* second 'e' */
+ break;
+ }
+ seen_e= 1;
+ }
+ else if ('+' == *cp)
+ {
+ if (seen_plus)
+ {
+ /* second '+' */
+ break;
+ }
+ seen_plus= 1;
+ }
+ else if (!isdigit(*cp))
{
break;
}
Modified: trunk/libdbd-mysql-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/debian/changelog?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/debian/changelog (original)
+++ trunk/libdbd-mysql-perl/debian/changelog Sat Aug 23 17:33:33 2008
@@ -1,3 +1,9 @@
+libdbd-mysql-perl (4.008-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org> Sat, 23 Aug 2008 14:31:10 -0300
+
libdbd-mysql-perl (4.007-1) unstable; urgency=low
* New upstream release.
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=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/lib/DBD/mysql.pm (original)
+++ trunk/libdbd-mysql-perl/lib/DBD/mysql.pm Sat Aug 23 17:33:33 2008
@@ -9,7 +9,7 @@
use Carp ();
@ISA = qw(DynaLoader);
-$VERSION = '4.007';
+$VERSION = '4.008';
bootstrap DBD::mysql $VERSION;
@@ -1071,7 +1071,12 @@
Example:
+use DBI;
$testdsn="DBI:mysqlEmb:database=test;mysql_embedded_options=--help,--verbose";
+$dbh = DBI->connect($testdsn,"a","b");
+
+This would cause the command line help to the embedded MySQL server library
+to be printed.
=item mysql_embedded_groups
Modified: trunk/libdbd-mysql-perl/mysql.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/mysql.xs?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/mysql.xs (original)
+++ trunk/libdbd-mysql-perl/mysql.xs Sat Aug 23 17:33:33 2008
@@ -1,6 +1,6 @@
/* Hej, Emacs, this is -*- C -*- mode!
- $Id: mysql.xs 11150 2008-04-28 23:36:14Z capttofu $
+ $Id: mysql.xs 11647 2008-08-15 13:00:36Z capttofu $
Copyright (c) 2003 Rudolf Lippan
Copyright (c) 1997-2003 Jochen Wiedmann
@@ -234,6 +234,9 @@
int retval;
struct imp_sth_ph_st* params= NULL;
MYSQL_RES* result= NULL;
+#if MYSQL_VERSION_ID >= MULTIPLE_RESULT_SET_VERSION
+ int next_result_rc;
+#endif
#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
STRLEN slen;
char *str_ptr, *statement_ptr, *buffer;
@@ -247,6 +250,16 @@
MYSQL_STMT *stmt= NULL;
MYSQL_BIND *bind= NULL;
imp_sth_phb_t *fbind= NULL;
+#endif
+#if MYSQL_VERSION_ID >= MULTIPLE_RESULT_SET_VERSION
+ while (mysql_next_result(imp_dbh->pmysql)==0)
+ {
+ MYSQL_RES* res = mysql_use_result(imp_dbh->pmysql);
+ if (res)
+ mysql_free_result(res);
+ }
+#endif
+#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
/*
* Globaly enabled using of server side prepared statement
@@ -281,8 +294,10 @@
if (mysql_stmt_prepare(stmt, str_ptr, strlen(str_ptr)))
{
- /* For commands that are not supported by server side prepared statement
- mechanism lets try to pass them through regular API */
+ /*
+ For commands that are not supported by server side prepared
+ statement mechanism lets try to pass them through regular API
+ */
if (mysql_stmt_errno(stmt) == ER_UNSUPPORTED_PS)
{
use_server_side_prepare= 0;
@@ -299,8 +314,8 @@
else
{
/*
- * 'items' is the number of arguments passed to XSUB, supplied by xsubpp
- * compiler, as listed in manpage for perlxs
+ 'items' is the number of arguments passed to XSUB, supplied
+ by xsubpp compiler, as listed in manpage for perlxs
*/
if (items > 3)
{
@@ -341,10 +356,10 @@
}
/*
- if this statement has a result set, field types will be correctly
- identified. If there is no result set, such as with an INSERT,
- fields will not be defined, and all buffer_type will default to
- MYSQL_TYPE_VAR_STRING
+ if this statement has a result set, field types will be
+ correctly identified. If there is no result set, such as
+ with an INSERT, fields will not be defined, and all
+ buffer_type will default to MYSQL_TYPE_VAR_STRING
*/
col_type= (stmt->fields) ? stmt->fields[i].type : MYSQL_TYPE_STRING;
@@ -492,6 +507,29 @@
mysql_free_result(result);
result= 0;
}
+#if MYSQL_VERSION_ID >= MULTIPLE_RESULT_SET_VERSION
+ if (retval != -2) /* -2 means error */
+ {
+ /* more results? -1 = no, >0 = error, 0 = yes (keep looping) */
+ while ((next_result_rc= mysql_next_result(imp_dbh->pmysql)) == 0)
+ {
+ result = mysql_use_result(imp_dbh->pmysql);
+ if (result)
+ mysql_free_result(result);
+ }
+ if (next_result_rc > 0)
+ {
+ if (dbis->debug >= 2)
+ PerlIO_printf(DBILOGFP, "\t<- do() ERROR: %s\n",
+ mysql_error(imp_dbh->pmysql));
+
+ do_error(dbh, mysql_errno(imp_dbh->pmysql),
+ mysql_error(imp_dbh->pmysql),
+ mysql_sqlstate(imp_dbh->pmysql));
+ retval= -2;
+ }
+ }
+#endif
/* remember that dbd_st_execute must return <= -2 for error */
if (retval == 0) /* ok with no rows affected */
XST_mPV(0, "0E0"); /* (true but zero) */
Modified: trunk/libdbd-mysql-perl/t/40bindparam.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/40bindparam.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/40bindparam.t (original)
+++ trunk/libdbd-mysql-perl/t/40bindparam.t Sat Aug 23 17:33:33 2008
@@ -1,6 +1,6 @@
#!perl -w
#
-# $Id: 40bindparam.t 11244 2008-05-11 15:13:10Z capttofu $
+# $Id: 40bindparam.t 11650 2008-08-15 13:58:29Z capttofu $
#
@@ -17,6 +17,11 @@
if ($@) {
plan skip_all => "ERROR: $DBI::errstr. Can't continue test";
}
+if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") {
+ plan skip_all =>
+ "SKIP TEST: You must have MySQL version 4.1 and greater for this test to run";
+}
+
plan tests => 41;
ok ($dbh->do("DROP TABLE IF EXISTS $table"));
Modified: trunk/libdbd-mysql-perl/t/40blobs.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/40blobs.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/40blobs.t (original)
+++ trunk/libdbd-mysql-perl/t/40blobs.t Sat Aug 23 17:33:33 2008
@@ -1,7 +1,7 @@
#!perl -w
# vim: ft=perl
#
-# $Id: 40blobs.t 11244 2008-05-11 15:13:10Z capttofu $
+# $Id: 40blobs.t 11650 2008-08-15 13:58:29Z capttofu $
#
# This is a test for correct handling of BLOBS; namely $dbh->quote
# is expected to work correctly.
@@ -9,6 +9,7 @@
use DBI ();
+use DBI::Const::GetInfoType;
use Test::More;
use vars qw($table $test_dsn $test_user $test_password);
use lib '.', 't';
@@ -28,8 +29,14 @@
}
my $dbh;
+my $charset= 'DEFAULT CHARSET=utf8';
+
eval {$dbh = DBI->connect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, AutoCommit => 1}) or ServerError() ;};
+
+if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") {
+ $charset= '';
+}
if ($@) {
plan skip_all => "ERROR: $DBI::errstr. Can't continue test";
@@ -43,7 +50,7 @@
my $create = <<EOT;
CREATE TABLE $table (
id INT(3) NOT NULL DEFAULT 0,
- name BLOB ) DEFAULT CHARSET=utf8
+ name BLOB ) $charset
EOT
ok ($dbh->do($create));
Modified: trunk/libdbd-mysql-perl/t/50chopblanks.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/50chopblanks.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/50chopblanks.t (original)
+++ trunk/libdbd-mysql-perl/t/50chopblanks.t Sat Aug 23 17:33:33 2008
@@ -1,13 +1,14 @@
#!perl -w
# vim: ft=perl
#
-# $Id: 50chopblanks.t 11244 2008-05-11 15:13:10Z capttofu $
+# $Id: 50chopblanks.t 11650 2008-08-15 13:58:29Z capttofu $
#
# This driver should check whether 'ChopBlanks' works.
#
use strict;
use DBI;
+use DBI::Const::GetInfoType;
use Test::More;
use lib 't', '.';
require 'lib.pl';
@@ -38,7 +39,15 @@
ok (my $sth2= $dbh->prepare("SELECT id, name FROM $table WHERE id = ?"));
-my $rows = [ [1, ''], [2, ' '], [3, ' a b c ']];
+my $rows;
+
+if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") {
+ $rows = [ [1, ''], [2, ''], [3, ' a b c']];
+}
+else {
+ $rows = [ [1, ''], [2, ' '], [3, ' a b c ']];
+}
+
my $ref;
for $ref (@$rows) {
my ($id, $name) = @$ref;
Modified: trunk/libdbd-mysql-perl/t/50commit.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/50commit.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/50commit.t (original)
+++ trunk/libdbd-mysql-perl/t/50commit.t Sat Aug 23 17:33:33 2008
@@ -1,6 +1,6 @@
#!perl -w
#
-# $Id: 50commit.t 11244 2008-05-11 15:13:10Z capttofu $
+# $Id: 50commit.t 11645 2008-08-15 11:36:38Z capttofu $
#
# This is testing the transaction support.
#
@@ -110,7 +110,7 @@
}
else {
- plan tests => 11;
+ plan tests => 13;
ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table";
my $create =<<EOT;
Modified: trunk/libdbd-mysql-perl/t/70takeimp.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/70takeimp.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/70takeimp.t (original)
+++ trunk/libdbd-mysql-perl/t/70takeimp.t Sat Aug 23 17:33:33 2008
@@ -2,7 +2,7 @@
# vim: ft=perl
#
-# $Id: 70takeimp.t 11244 2008-05-11 15:13:10Z capttofu $
+# $Id: 70takeimp.t 11645 2008-08-15 11:36:38Z capttofu $
#
# This is a skeleton test. For writing new tests, take this file
# and modify/extend it.
@@ -34,6 +34,7 @@
unless ($dbh->can('take_imp_data')) {
plan skip_all => "version of DBI $DBI::VERSION doesn't support this test. Can't continue test";
}
+plan skip_all => "This test is disabled";
plan tests => 21;
pass("obtained driver handle");
Modified: trunk/libdbd-mysql-perl/t/71impdata.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/71impdata.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/71impdata.t (original)
+++ trunk/libdbd-mysql-perl/t/71impdata.t Sat Aug 23 17:33:33 2008
@@ -24,6 +24,7 @@
unless ($dbh->can('take_imp_data')) {
plan skip_all => "version of DBI $DBI::VERSION doesn't support this test. Can't continue test";
}
+plan skip_all => "This test is disabled";
plan tests => 10;
pass("Connected to database");
Modified: trunk/libdbd-mysql-perl/t/76multi_statement.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-mysql-perl/t/76multi_statement.t?rev=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/76multi_statement.t (original)
+++ trunk/libdbd-mysql-perl/t/76multi_statement.t Sat Aug 23 17:33:33 2008
@@ -19,32 +19,55 @@
if ($@) {
plan skip_all => "ERROR: $@. Can't continue test";
}
-plan tests => 7;
+plan tests => 24;
ok (defined $dbh, "Connected to database with multi statement support");
$dbh->{mysql_server_prepare}= 0;
SKIP: {
- skip "Server doesn't support multi statements", 6
+ skip "Server doesn't support multi statements", 23
if $dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1";
ok($dbh->do("DROP TABLE IF EXISTS $table"), "clean up");
ok($dbh->do("CREATE TABLE $table (a INT)"), "create table");
- ok($dbh->do("INSERT INTO $table VALUES (1); INSERT INTO $table VALUES (2);"));
+ ok($dbh->do("INSERT INTO $table VALUES (1); INSERT INTO $table VALUES (2);"), "2 inserts");
- $dbh->disconnect();
+ # Check that a second do() doesn't fail with an 'Out of sync' error
+ ok($dbh->do("INSERT INTO $table VALUES (3); INSERT INTO $table VALUES (4);"), "2 more inserts");
- $dbh= DBI->connect($test_dsn, $test_user, $test_password,
- { RaiseError => 0, PrintError => 0, AutoCommit => 0,
- mysql_multi_statements => 0 });
- ok (defined $dbh, "Connected to database without multi statement support");
+ # Check that more_results works for non-SELECT results too
+ my $sth;
+ ok($sth = $dbh->prepare("UPDATE $table SET a=5 WHERE a=1; UPDATE $table SET a='6-' WHERE a<4"));
+ ok($sth->execute(), "Execute updates");
+ is($sth->rows, 1, "First update affected 1 row");
+ is($sth->{mysql_warning_count}, 0, "First update had no warnings");
+ ok($sth->{Active}, "Statement handle is Active");
+ ok($sth->more_results());
+ is($sth->rows, 2, "Second update affected 2 rows");
+ is($sth->{mysql_warning_count}, 2, "Second update had 2 warnings");
+ ok(not $sth->more_results());
+ ok($sth->finish());
- ok (not $dbh->do("INSERT INTO $table VALUES (1); INSERT INTO $table VALUES (2);"));
+ # Now run it again without calling more_results().
+ ok($sth->execute(), "Execute updates again");
+ ok($sth->finish());
- ok ($dbh->do("DROP TABLE IF EXISTS $table"), "clean up");
+ # Check that do() doesn't fail with an 'Out of sync' error
+ is($dbh->do("DELETE FROM $table"), 4, "Delete all rows");
+
+ # Test that do() reports errors from all result sets
+ $dbh->{RaiseError} = $dbh->{PrintError} = 0;
+ ok(!$dbh->do("INSERT INTO $table VALUES (1); INSERT INTO bad_$table VALUES (2);"), "do() reports errors");
+
+ # Test that execute() reports errors from only the first result set
+ ok($sth = $dbh->prepare("UPDATE $table SET a=2; UPDATE bad_$table SET a=3"));
+ ok($sth->execute(), "Execute updates");
+ ok(!$sth->err(), "Err was not set after execute");
+ ok(!$sth->more_results());
+ ok($sth->err(), "Err was set after more_results");
};
$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=24529&op=diff
==============================================================================
--- trunk/libdbd-mysql-perl/t/mysql.mtest (original)
+++ trunk/libdbd-mysql-perl/t/mysql.mtest Sat Aug 23 17:33:33 2008
@@ -7,8 +7,8 @@
'testhost' => '',
'nofoundrows' => 0,
'testdb' => 'test',
- 'cflags' => '-I/usr/local/mysql/include/mysql -Wreturn-type -Wtrigraphs -W -Wformat -Wsign-compare -Wunused-function -Wunused-value -Wunused-parameter -mtune=pentium-m',
- 'testuser' => 'patg',
+ 'cflags' => '-I/usr/local/include/mysql -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL',
+ 'testuser' => 'root',
'testpassword' => '',
'testsocket' => ''
};
More information about the Pkg-perl-cvs-commits
mailing list