Hello community,
here is the log from the commit of package perl-DBD-mysql for openSUSE:Factory
checked in at Mon Jul 19 20:44:40 CEST 2010.
--------
--- perl-DBD-mysql/perl-DBD-mysql.changes 2010-04-16 22:55:21.000000000 +0200
+++ /mounts/work_src_done/STABLE/perl-DBD-mysql/perl-DBD-mysql.changes 2010-07-16 15:32:31.000000000 +0200
@@ -1,0 +2,17 @@
+Fri Jul 16 13:31:55 UTC 2010 - chris@computersalat.de
+
+- update to 4.016
+ * Disabled mysql_bind_type_guessing due to one performance issue
+ querying on a indexed character column unquoted will mean the index
+ is not used
+ * Fixed int types that should be bools
+- 2010-07-09 Patrick Galbraith (4.015)
+ * BUG #56664 fixed t/40blobs.t skip_all logic (W. Phillip Moore)
+ * BUG #57253 Fixed iteration past end of string (crash). (Chris Butler)
+ * Added a new parameter for old behavior- mysql_bind_comment_placeholders which
+ will make it possible to have placeholders bound for those who really
+ want that behavior.
+ * Fixed bind_type_guessing - always on now
+- recreated by cpanspec 1.78
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
DBD-mysql-4.014.tar.bz2
New:
----
DBD-mysql-4.016.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-DBD-mysql.spec ++++++
--- /var/tmp/diff_new_pack.cLKzkW/_old 2010-07-19 20:43:53.000000000 +0200
+++ /var/tmp/diff_new_pack.cLKzkW/_new 2010-07-19 20:43:53.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package perl-DBD-mysql (Version 4.014)
+# spec file for package perl-DBD-mysql (Version 4.016)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,13 +19,14 @@
Name: perl-DBD-mysql
-%define cpan_name %( echo %{name} | %{__sed} -e 's,perl-,,' )
+%define cpan_name DBD-mysql
Summary: MySQL driver for the Perl5 Database Interface (DBI)
-Version: 4.014
+Version: 4.016
Release: 1
-License: Artistic License ..
+License: GPL+ or Artistic
Group: Development/Libraries/Perl
-Url: http://search.cpan.org/dist/DBD-mysql
+Url: http://search.cpan.org/dist/DBD-mysql/
+#Source: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{version}.tar.gz
Source: %{cpan_name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: mysql-devel
@@ -33,26 +34,19 @@
%if 0%{?suse_version} < 1120
BuildRequires: perl-macros
%endif
-BuildRequires: perl(DBI)
-BuildRequires: perl(Data::ShowTable)
-#
+BuildRequires: perl(Data::Dumper)
+BuildRequires: perl(DBI) >= 1.08
Requires: perl = %{perl_version}
-Requires: perl(DBI)
-Requires: perl(Data::ShowTable)
-## FIXME: is this really still needed
-# then enable again
-#Provides: mysqperl perl-Msql-Mysql-modules
-#Obsoletes: mysqperl perl-Msql-Mysql-modules
+Requires: perl(Data::Dumper)
+Requires: perl(DBI) >= 1.08
%description
-DBD::mysql is the Perl5 Database Interface driver for the MySQL
-database. In other words: DBD::mysql is an interface between the Perl
-programming language and the MySQL programming API that comes with
-the MySQL relational database management system. Most functions
-provided by this programming API are supported. Some rarely used
-functions are missing, mainly because noone ever requested them. :-)
-
-
+DBD::mysql is the Perl5 Database Interface driver for the MySQL database.
+In other words: DBD::mysql is an interface between the Perl programming
+language and the MySQL programming API that comes with the MySQL relational
+database management system. Most functions provided by this programming API
+are supported. Some rarely used functions are missing, mainly because noone
+ever requested them. :-)
Authors:
--------
@@ -60,19 +54,18 @@
%prep
%setup -q -n %{cpan_name}-%{version}
-## rpmlint
-# fix file permission
-chmod a-x ChangeLog README INSTALL.html eg/*
-chmod a-x lib/Bundle/DBD/mysql.pm
-chmod a-x lib/DBD/mysql.pm
-chmod a-x lib/DBD/mysql/INSTALL.pod
+# rpmlint: executable-docs,
+# spurious-executable-perm
+# script-without-shebang
+find -type f -exec %{__chmod} 0644 {} \;
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor --cflags="-I%{_includedir}/mysql $RPM_OPT_FLAGS"
+
%{__make} %{?_smp_mflags}
-#check
-#{__make} test
+%check
+%{__make} test
%install
%perl_make_install
@@ -83,7 +76,7 @@
%{__rm} -rf $RPM_BUILD_ROOT
%files -f %{name}.files
-%defattr(-, root, root)
-%doc ChangeLog README INSTALL.html TODO eg
+%defattr(-,root,root,-)
+%doc ChangeLog eg INSTALL.html README TODO
%changelog
++++++ DBD-mysql-4.014.tar.bz2 -> DBD-mysql-4.016.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/ChangeLog new/DBD-mysql-4.016/ChangeLog
--- old/DBD-mysql-4.014/ChangeLog 2010-04-15 05:09:40.000000000 +0200
+++ new/DBD-mysql-4.016/ChangeLog 2010-07-10 18:48:47.000000000 +0200
@@ -1,11 +1,25 @@
+2010-07-10 Patrick Galbraith (4.016)
+* Disabled mysql_bind_type_guessing due to one performance issue
+ querying on a indexed character column unquoted will mean the index
+ is not used
+* Fixed int types that should be bools
+
+2010-07-09 Patrick Galbraith (4.015)
+* BUG #56664 fixed t/40blobs.t skip_all logic (W. Phillip Moore)
+* BUG #57253 Fixed iteration past end of string (crash). (Chris Butler)
+* Added a new parameter for old behavior- mysql_bind_comment_placeholders which
+ will make it possible to have placeholders bound for those who really
+ want that behavior.
+* Fixed bind_type_guessing - always on now
+
2010-04-14 Patrick Galbraith (4.014)
-* BUG 30033 Fixed handling of comments to allow comments that contain characters
+* BUG #30033 Fixed handling of comments to allow comments that contain characters
that might otherwise cause placeholder detection to not work properly
-* BUG 53844, Fix for memory leak in stats. (Gregory Burmistrov)
-* BUG 49719, Fix for handling of NULLs in prepared statements (Gert Pache)
-* BUG 55627, Fix for testing failure due to strict mode (Yves)
-* BUG 51784, Fix for mysqladmin on Windows in Makefile (Zeeshan Muhammad)
-* BUG 41630, Typo in Makefile
+* BUG #53844, Fix for memory leak in stats. (Gregory Burmistrov)
+* BUG #49719, Fix for handling of NULLs in prepared statements (Gert Pache)
+* BUG #55627, Fix for testing failure due to strict mode (Yves)
+* BUG #51784, Fix for mysqladmin on Windows in Makefile (Zeeshan Muhammad)
+* BUG #41630, Typo in Makefile
* Had to define true and false in dbdimp.h. Didn't work out of the box on Linux
2009-09-16 Patrick Galbraith (4.013)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/MANIFEST new/DBD-mysql-4.016/MANIFEST
--- old/DBD-mysql-4.014/MANIFEST 2010-04-14 19:43:16.000000000 +0200
+++ new/DBD-mysql-4.016/MANIFEST 2010-07-09 21:35:09.000000000 +0200
@@ -44,6 +44,7 @@
t/50commit.t
t/51bind_type_guessing.t
t/52comment.t
+t/53comment.t
t/55utf8.t
t/60leaks.t
t/65types.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/META.yml new/DBD-mysql-4.016/META.yml
--- old/DBD-mysql-4.014/META.yml 2010-04-15 05:10:23.000000000 +0200
+++ new/DBD-mysql-4.016/META.yml 2010-07-10 18:49:58.000000000 +0200
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: DBD-mysql
-version: 4.014
+version: 4.016
abstract: A MySQL driver for the Perl5 Database Interface (DBI)
author:
- Rudy Lippan
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/dbdimp.c new/DBD-mysql-4.016/dbdimp.c
--- old/DBD-mysql-4.014/dbdimp.c 2010-04-15 05:01:50.000000000 +0200
+++ new/DBD-mysql-4.016/dbdimp.c 2010-07-10 16:53:53.000000000 +0200
@@ -61,7 +61,7 @@
*/
static int
-count_params(char *statement)
+count_params(char *statement, bool bind_comment_placeholders)
{
bool comment_end= false;
char* ptr= statement;
@@ -78,87 +78,98 @@
/* so, this is a -- comment, so let's burn up characters */
case '-':
{
- comment_length= 1;
- /* let's see if the next one is a dash */
- c = *ptr++;
-
- if (c == '-') {
- /* if two dashes, ignore everything until newline */
- while (c = *ptr)
+ if (bind_comment_placeholders)
{
- if (dbis->debug >= 2)
- PerlIO_printf(DBILOGFP, "%c\n", c);
- ptr++;
- comment_length++;
- if (c == '\n')
- {
- comment_end= true;
+ c = *ptr++;
break;
- }
}
- /*
- so, if there was an end to the comment, increment by one more
- to go past the new line
-
- if not comment_end, the comment never ended and we need to iterate
- back to the beginning of where we started and let the database
- handle whatever is in the statement
- */
- if (comment_end)
- ptr++;
else
- ptr-= comment_length;
- }
- /* otherwise, only one dash/hyphen, backtrack by one */
- else
- ptr--;
- break;
+ {
+ comment_length= 1;
+ /* let's see if the next one is a dash */
+ c = *ptr++;
+
+ if (c == '-') {
+ /* if two dashes, ignore everything until newline */
+ while (c = *ptr)
+ {
+ if (dbis->debug >= 2)
+ PerlIO_printf(DBILOGFP, "%c\n", c);
+ ptr++;
+ comment_length++;
+ if (c == '\n')
+ {
+ comment_end= true;
+ break;
+ }
+ }
+ /*
+ if not comment_end, the comment never ended and we need to iterate
+ back to the beginning of where we started and let the database
+ handle whatever is in the statement
+ */
+ if (! comment_end)
+ ptr-= comment_length;
+ }
+ /* otherwise, only one dash/hyphen, backtrack by one */
+ else
+ ptr--;
+ break;
+ }
}
/* c-type comments */
case '/':
{
- c = *ptr++;
- /* let's check if the next one is an asterisk */
- if (c == '*')
- {
- comment_length= 0;
- comment_end= false;
- /* ignore everything until closing comment */
- while (c= *ptr)
+ if (bind_comment_placeholders)
{
- ptr++;
- comment_length++;
-
- if (c == '*')
- {
c = *ptr++;
- /* alas, end of comment */
- if (c == '/')
+ break;
+ }
+ else
+ {
+ c = *ptr++;
+ /* let's check if the next one is an asterisk */
+ if (c == '*')
{
- ptr++;
- comment_end= true;
- break;
+ comment_length= 0;
+ comment_end= false;
+ /* ignore everything until closing comment */
+ while (c= *ptr)
+ {
+ ptr++;
+ comment_length++;
+
+ if (c == '*')
+ {
+ c = *ptr++;
+ /* alas, end of comment */
+ if (c == '/')
+ {
+ comment_end= true;
+ break;
+ }
+ /*
+ nope, just an asterisk, not so fast, not
+ end of comment, go back one
+ */
+ else
+ ptr--;
+ }
+ }
+ /*
+ if the end of the comment was never found, we have
+ to backtrack to whereever we first started skipping
+ over the possible comment.
+ This means we will pass the statement to the database
+ to see its own fate and issue the error
+ */
+ if (!comment_end)
+ ptr -= comment_length;
}
- /*
- nope, just an asterisk, not so fast, not end of comment, go
- back one
- */
else
- ptr--;
- }
+ ptr--;
+ break;
}
- /*
- if the end of the comment was never found, we have to backtrack
- to whereever we first started skipping over the possible comment.
- This means we will pass the statement to the database to see its own
- fate and issue the error
- */
- if (!comment_end)
- ptr -= comment_length;
- }
- else
- ptr--;
- break;
}
case '`':
case '"':
@@ -488,7 +499,7 @@
}
#endif
-/*
+/*
constructs an SQL statement previously prepared with
actual values replacing placeholders
*/
@@ -498,7 +509,8 @@
STRLEN *slen_ptr,
imp_sth_ph_t* params,
int num_params,
- bool bind_type_guessing)
+ bool bind_type_guessing,
+ bool bind_comment_placeholders)
{
bool comment_end= false;
char *salloc, *statement_ptr;
@@ -590,69 +602,75 @@
/* comment detection. Anything goes in a comment */
case '-':
{
- comment_length= 1;
- comment_end= false;
- *ptr++ = *statement_ptr++;
- if (*statement_ptr == '-')
- {
- /* ignore everything until newline */
- while (*statement_ptr)
+ if (bind_comment_placeholders)
{
- comment_length++;
- *ptr++ = *statement_ptr++;
- if (*statement_ptr == '\n')
- {
- comment_end= true;
+ *ptr++= *statement_ptr++;
break;
- }
}
- /* if comment end found, iterate past the \n */
- if (comment_end)
- {
- *ptr++ = *statement_ptr++;
- }
- /* otherwise, go back to where we started, no end found */
else
{
- statement_ptr -= comment_length;
- ptr -= comment_length;
+ comment_length= 1;
+ comment_end= false;
+ *ptr++ = *statement_ptr++;
+ if (*statement_ptr == '-')
+ {
+ /* ignore everything until newline or end of string */
+ while (*statement_ptr)
+ {
+ comment_length++;
+ *ptr++ = *statement_ptr++;
+ if (!*statement_ptr || *statement_ptr == '\n')
+ {
+ comment_end= true;
+ break;
+ }
+ }
+ /* if not end of comment, go back to where we started, no end found */
+ if (! comment_end)
+ {
+ statement_ptr -= comment_length;
+ ptr -= comment_length;
+ }
+ }
+ break;
}
- }
- break;
}
/* c-type comments */
case '/':
{
- comment_length= 1;
- comment_end= false;
- *ptr++ = *statement_ptr++;
- if (*statement_ptr == '*')
- {
- /* use up characters everything until newline */
- while (*statement_ptr)
+ if (bind_comment_placeholders)
{
- *ptr++ = *statement_ptr++;
- comment_length++;
- if (!strncmp(statement_ptr, "*/", 2))
- {
- comment_length += 2;
- comment_end= true;
+ *ptr++= *statement_ptr++;
break;
- }
- }
- /* iterate past the comment end */
- if (comment_end)
- {
- *ptr++ = *statement_ptr++;
- *ptr++ = *statement_ptr++;
}
else
{
- statement_ptr -= comment_length;
- ptr -= comment_length;
+ comment_length= 1;
+ comment_end= false;
+ *ptr++ = *statement_ptr++;
+ if (*statement_ptr == '*')
+ {
+ /* use up characters everything until newline */
+ while (*statement_ptr)
+ {
+ *ptr++ = *statement_ptr++;
+ comment_length++;
+ if (!strncmp(statement_ptr, "*/", 2))
+ {
+ comment_length += 2;
+ comment_end= true;
+ break;
+ }
+ }
+ /* Go back to where started if comment end not found */
+ if (! comment_end)
+ {
+ statement_ptr -= comment_length;
+ ptr -= comment_length;
+ }
+ }
+ break;
}
- }
- break;
}
case '`':
case '\'':
@@ -716,7 +734,7 @@
}
/* (note this sets *end, which we use if is_num) */
- if( parse_number(valbuf, vallen, &end) != 0 && is_num)
+ if ( parse_number(valbuf, vallen, &end) != 0 && is_num)
{
if (bind_type_guessing) {
/* .. not a number, so apparerently we guessed wrong */
@@ -1705,7 +1723,7 @@
"imp_dbh->use_mysql_use_result: %d\n",
imp_dbh->use_mysql_use_result);
}
- if ((svp = hv_fetch(hv, "mysql_bind_type_guessing", 24, FALSE)) && *svp)
+ if ((svp = hv_fetch(hv, "mysql_bind_type_guessing", 24, TRUE)) && *svp)
{
imp_dbh->bind_type_guessing= SvTRUE(*svp);
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
@@ -1713,6 +1731,14 @@
"imp_dbh->bind_type_guessing: %d\n",
imp_dbh->bind_type_guessing);
}
+ if ((svp = hv_fetch(hv, "mysql_bind_comment_placeholders", 31, FALSE)) && *svp)
+ {
+ imp_dbh->bind_comment_placeholders = SvTRUE(*svp);
+ if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
+ PerlIO_printf(DBILOGFP,
+ "imp_dbh->bind_comment_placeholders: %d\n",
+ imp_dbh->bind_comment_placeholders);
+ }
if ((svp = hv_fetch(hv, "mysql_no_autocommit_cmd", 23, FALSE)) && *svp)
{
imp_dbh->no_autocommit_cmd= SvTRUE(*svp);
@@ -1992,6 +2018,7 @@
imp_dbh->stats.auto_reconnects_ok= 0;
imp_dbh->stats.auto_reconnects_failed= 0;
imp_dbh->bind_type_guessing= FALSE;
+ imp_dbh->bind_comment_placeholders= FALSE;
imp_dbh->has_transactions= TRUE;
/* Safer we flip this to TRUE perl side if we detect a mod_perl env. */
imp_dbh->auto_reconnect = FALSE;
@@ -2322,6 +2349,8 @@
imp_dbh->no_autocommit_cmd= SvTRUE(valuesv);
else if (kl == 24 && strEQ(key,"mysql_bind_type_guessing"))
imp_dbh->bind_type_guessing = SvTRUE(valuesv);
+ else if (kl == 31 && strEQ(key,"mysql_bind_comment_placeholders"))
+ imp_dbh->bind_type_guessing = SvTRUE(valuesv);
#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;
@@ -2401,7 +2430,14 @@
case 'b':
if (kl == strlen("bind_type_guessing") &&
strEQ(key, "bind_type_guessing"))
+ {
result = sv_2mortal(newSViv(imp_dbh->bind_type_guessing));
+ }
+ else if (kl == strlen("bind_comment_placeholders") &&
+ strEQ(key, "bind_comment_placeholders"))
+ {
+ result = sv_2mortal(newSViv(imp_dbh->bind_comment_placeholders));
+ }
break;
case 'e':
if (strEQ(key, "errno"))
@@ -2758,9 +2794,11 @@
#if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION
/* Count the number of parameters (driver, vs server-side) */
if (imp_sth->use_server_side_prepare == 0)
- DBIc_NUM_PARAMS(imp_sth) = count_params(statement);
+ DBIc_NUM_PARAMS(imp_sth) = count_params(statement,
+ imp_dbh->bind_comment_placeholders);
#else
- DBIc_NUM_PARAMS(imp_sth) = count_params(statement);
+ DBIc_NUM_PARAMS(imp_sth) = count_params(statement,
+ imp_dbh->bind_comment_placeholders);
#endif
/* Allocate memory for parameters */
@@ -3012,7 +3050,8 @@
int use_mysql_use_result
)
{
- bool bind_type_guessing= 0;
+ bool bind_type_guessing= FALSE;
+ bool bind_comment_placeholders= TRUE;
STRLEN slen;
char *sbuf = SvPV(statement, slen);
char *table;
@@ -3033,14 +3072,15 @@
if/else (when compiled, it fails for imp_dbh not being defined).
*/
/* h is a dbh */
- if (htype==DBIt_DB)
+ if (htype == DBIt_DB)
{
D_imp_dbh(h);
/* if imp_dbh is not available, it causes segfault (proper) on OpenBSD */
if (imp_dbh && imp_dbh->bind_type_guessing)
+ {
bind_type_guessing= imp_dbh->bind_type_guessing;
- else
- bind_type_guessing= 0;
+ bind_comment_placeholders= bind_comment_placeholders;
+ }
}
/* h is a sth */
else
@@ -3049,9 +3089,10 @@
D_imp_dbh_from_sth;
/* if imp_dbh is not available, it causes segfault (proper) on OpenBSD */
if (imp_dbh)
+ {
bind_type_guessing= imp_dbh->bind_type_guessing;
- else
- bind_type_guessing=0;
+ bind_comment_placeholders= imp_dbh->bind_comment_placeholders;
+ }
}
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
@@ -3063,7 +3104,8 @@
&slen,
params,
num_params,
- bind_type_guessing);
+ bind_type_guessing,
+ bind_comment_placeholders);
if (salloc)
{
@@ -4912,7 +4954,8 @@
}
else if (!isdigit(*cp))
{
- seen_digit= 1;
+ /* Not sure why this was changed */
+ /* seen_digit= 1; */
break;
}
}
@@ -4920,7 +4963,9 @@
*end= cp;
/* length 0 -> not a number */
- if (len == 0 || cp - string < (int) len || seen_digit == 0) {
+ /* Need to revisit this */
+ /*if (len == 0 || cp - string < (int) len || seen_digit == 0) {*/
+ if (len == 0 || cp - string < (int) len) {
return -1;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/dbdimp.h new/DBD-mysql-4.016/dbdimp.h
--- old/DBD-mysql-4.014/dbdimp.h 2010-04-14 22:04:05.000000000 +0200
+++ new/DBD-mysql-4.016/dbdimp.h 2010-07-10 16:53:52.000000000 +0200
@@ -145,25 +145,25 @@
dbih_dbc_t com; /* MUST be first element in structure */
MYSQL *pmysql;
- int has_transactions; /* boolean indicating support for
+ bool has_transactions; /* boolean indicating support for
* transactions, currently always TRUE for MySQL
*/
bool auto_reconnect;
- struct {
- unsigned int auto_reconnects_ok;
- unsigned int auto_reconnects_failed;
- } stats;
- unsigned short int bind_type_guessing;
- unsigned short int no_autocommit_cmd;
- int use_mysql_use_result; /* TRUE if execute should use
+ bool bind_type_guessing;
+ bool bind_comment_placeholders;
+ bool no_autocommit_cmd;
+ bool use_mysql_use_result; /* TRUE if execute should use
* mysql_use_result rather than
* mysql_store_result
*/
- int use_server_side_prepare;
- int has_autodetect_prepare;
+ bool use_server_side_prepare;
#if defined(sv_utf8_decode) && MYSQL_VERSION_ID >=SERVER_PREPARE_VERSION
bool enable_utf8;
#endif
+ struct {
+ unsigned int auto_reconnects_ok;
+ unsigned int auto_reconnects_failed;
+ } stats;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/lib/DBD/mysql.pm new/DBD-mysql-4.016/lib/DBD/mysql.pm
--- old/DBD-mysql-4.014/lib/DBD/mysql.pm 2010-04-15 05:08:37.000000000 +0200
+++ new/DBD-mysql-4.016/lib/DBD/mysql.pm 2010-07-10 18:35:48.000000000 +0200
@@ -9,7 +9,7 @@
use Carp ();
@ISA = qw(DynaLoader);
-$VERSION = '4.014';
+$VERSION = '4.016';
bootstrap DBD::mysql $VERSION;
@@ -1294,8 +1294,53 @@
successfully run the full test suite with this option turned on,
the name can now be simply C.
+CAVEAT: Even though you can insert an integer value into a
+character column, if this column is indexed, if you query that
+column with the integer value not being quoted, it will not
+use the index:
+
+MariaDB [test]> explain select * from test where value0 = '3' \G
+*************************** 1. row ***************************
+ id: 1
+ select_type: SIMPLE
+ table: test
+ type: ref
+possible_keys: value0
+ key: value0
+ key_len: 13
+ ref: const
+ rows: 1
+ Extra: Using index condition
+1 row in set (0.00 sec)
+
+MariaDB [test]> explain select * from test where value0 = 3
+ -> \G
+*************************** 1. row ***************************
+ id: 1
+ select_type: SIMPLE
+ table: test
+ type: ALL
+possible_keys: value0
+ key: NULL
+ key_len: NULL
+ ref: NULL
+ rows: 6
+ Extra: Using where
+1 row in set (0.00 sec)
+
+
See bug: https://rt.cpan.org/Ticket/Display.html?id=43822
+=item mysql_bind_comment_placeholders
+
+This attribute causes the driver (emulated prepare statements)
+will cause any placeholders in comments to be bound. This is
+not correct prepared statement behavior, but some developers
+have come to depend on this behavior, so I have made it available
+in 4.015
+
+See bug: https://rt.cpan.org/Ticket/Display.html?id=
+
C can be turned on via
- through DSN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/t/40blobs.t new/DBD-mysql-4.016/t/40blobs.t
--- old/DBD-mysql-4.014/t/40blobs.t 2010-04-12 19:37:14.000000000 +0200
+++ new/DBD-mysql-4.016/t/40blobs.t 2010-05-16 16:13:12.000000000 +0200
@@ -34,14 +34,16 @@
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";
}
-plan tests => 14;
+else {
+ plan tests => 14;
+}
+
+if ($dbh->get_info($GetInfoType{SQL_DBMS_VER}) lt "4.1") {
+ $charset= '';
+}
my $size= 128;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/t/52comment.t new/DBD-mysql-4.016/t/52comment.t
--- old/DBD-mysql-4.014/t/52comment.t 2010-04-14 16:23:34.000000000 +0200
+++ new/DBD-mysql-4.016/t/52comment.t 2010-07-09 21:21:32.000000000 +0200
@@ -12,13 +12,17 @@
use vars qw($test_dsn $test_user $test_password $table);
my $dbh;
-eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
- { RaiseError => 1, PrintError => 1, AutoCommit => 0 });};
+eval { $dbh= DBI->connect($test_dsn, $test_user, $test_password,
+ { RaiseError => 1,
+ PrintError => 1,
+ AutoCommit => 0, }
+ );
+ };
if ($@) {
plan skip_all =>
"ERROR: $DBI::errstr. Can't continue test";
}
-plan tests => 9;
+plan tests => 30;
ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table";
@@ -56,6 +60,26 @@
$retrow= $dbh->selectrow_arrayref($statement, {}, 1);
cmp_ok $retrow->[0], '==', 1;
+$statement= "SELECT id FROM $table WHERE id = ? /* it's a bug? */";
+
+$retrow= $dbh->selectrow_arrayref($statement, {}, 1);
+cmp_ok $retrow->[0], '==', 1;
+
+$statement= "SELECT id FROM $table WHERE id = ? ";
+my $comment = "/* it's/a_directory/does\ this\ work/bug? */";
+
+for (0 .. 9) {
+ $retrow= $dbh->selectrow_arrayref($statement . $comment, {}, 1);
+ cmp_ok $retrow->[0], '==', 1;
+}
+
+$comment = "/* $0 */";
+
+for (0 .. 9) {
+ $retrow= $dbh->selectrow_arrayref($statement . $comment, {}, 1);
+ cmp_ok $retrow->[0], '==', 1;
+}
+
ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table";
ok $dbh->disconnect;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/t/53comment.t new/DBD-mysql-4.016/t/53comment.t
--- old/DBD-mysql-4.014/t/53comment.t 1970-01-01 01:00:00.000000000 +0100
+++ new/DBD-mysql-4.016/t/53comment.t 2010-07-09 18:47:54.000000000 +0200
@@ -0,0 +1,82 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use DBI;
+use DBI::Const::GetInfoType;
+use Test::More;
+use lib 't', '.';
+require 'lib.pl';
+
+use vars qw($test_dsn $test_user $test_password $table);
+
+my $dbh;
+eval { $dbh= DBI->connect($test_dsn, $test_user, $test_password,
+ { RaiseError => 1,
+ PrintError => 1,
+ AutoCommit => 0,
+ mysql_bind_comment_placeholders => 1,}
+ );
+ };
+if ($@) {
+ plan skip_all =>
+ "ERROR: $DBI::errstr, $@. Can't continue test";
+}
+plan tests => 29;
+
+ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table";
+
+my $create= <<"EOTABLE";
+create table $table (
+ id bigint unsigned not null default 0
+ )
+EOTABLE
+
+
+ok $dbh->do($create), "creating table";
+
+my $statement= "insert into $table (id) values (?)";
+
+my $sth;
+ok $sth= $dbh->prepare($statement);
+
+my $rows;
+ok $rows= $sth->execute('1');
+cmp_ok $rows, '==', 1;
+$sth->finish();
+
+$statement= <selectrow_arrayref($statement, {}, 'hey', 1);
+cmp_ok $retrow->[0], '==', 1;
+
+$statement= "SELECT id FROM $table /* Some value here ? */ WHERE id = ?";
+
+$retrow= $dbh->selectrow_arrayref($statement, {}, "hello", 1);
+cmp_ok $retrow->[0], '==', 1;
+
+$statement= "SELECT id FROM $table WHERE id = ? ";
+my $comment = "/* it's/a_directory/does\ this\ work/bug? */";
+$statement= $statement . $comment;
+
+for (0 .. 9) {
+ $retrow= $dbh->selectrow_arrayref($statement, {}, 1);
+ cmp_ok $retrow->[0], '==', 1;
+}
+
+$comment = "/* $0 */";
+
+for (0 .. 9) {
+ $retrow= $dbh->selectrow_arrayref($statement . $comment, {}, 1);
+ cmp_ok $retrow->[0], '==', 1;
+}
+
+ok $dbh->do("DROP TABLE IF EXISTS $table"), "drop table if exists $table";
+
+ok $dbh->disconnect;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-mysql-4.014/t/mysql.mtest new/DBD-mysql-4.016/t/mysql.mtest
--- old/DBD-mysql-4.014/t/mysql.mtest 2010-04-15 05:08:53.000000000 +0200
+++ new/DBD-mysql-4.016/t/mysql.mtest 2010-07-10 18:36:17.000000000 +0200
@@ -7,7 +7,7 @@
'testhost' => '',
'nofoundrows' => 0,
'testdb' => 'test',
- 'cflags' => '-I/usr/local/maria/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/maria/include/mysql -g -g -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL',
'testuser' => 'root',
'testpassword' => '',
'testsocket' => ''
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org