Hello community,
here is the log from the commit of package perl-DBD-ODBC for openSUSE:Factory
checked in at Tue Apr 7 14:12:41 CEST 2009.
--------
--- perl-DBD-ODBC/perl-DBD-ODBC.changes 2009-01-20 17:44:26.000000000 +0100
+++ /mounts/work_src_done/STABLE/perl-DBD-ODBC/perl-DBD-ODBC.changes 2009-04-06 14:05:06.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Apr 6 14:04:28 CEST 2009 - anicka@suse.cz
+
+- update to 1.19
+ * test fixes
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
DBD-ODBC-1.18.tar.bz2
perl-DBD-ODBC-1.18-Makefile.diff
New:
----
DBD-ODBC-1.19.tar.bz2
perl-DBD-ODBC-1.19-Makefile.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-DBD-ODBC.spec ++++++
--- /var/tmp/diff_new_pack.l25899/_old 2009-04-07 14:12:28.000000000 +0200
+++ /var/tmp/diff_new_pack.l25899/_new 2009-04-07 14:12:28.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package perl-DBD-ODBC (Version 1.18)
+# spec file for package perl-DBD-ODBC (Version 1.19)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -27,7 +27,7 @@
Requires: perl-DBI unixODBC
Requires: perl = %{perl_version}
Summary: Perl DBD module for interfacing with ODBC databases
-Version: 1.18
+Version: 1.19
Release: 1
Source: DBD-ODBC-%{version}.tar.bz2
Patch: %{name}-%{version}-Makefile.diff
@@ -76,6 +76,9 @@
/var/adm/perl-modules/%{name}
%changelog
+* Mon Apr 06 2009 anicka@suse.cz
+- update to 1.19
+ * test fixes
* Tue Jan 20 2009 anicka@suse.cz
- update to 1.18
* bugfixes, test fixes
++++++ DBD-ODBC-1.18.tar.bz2 -> DBD-ODBC-1.19.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/Changes new/DBD-ODBC-1.19/Changes
--- old/DBD-ODBC-1.18/Changes 2009-01-16 19:47:38.000000000 +0100
+++ new/DBD-ODBC-1.19/Changes 2009-04-02 12:54:58.000000000 +0200
@@ -2,7 +2,7 @@
DBD::ODBC::Changes - Log of significant changes to the DBD::ODBC
-(As of $LastChangedDate: 2009-01-16 18:47:37 +0000 (Fri, 16 Jan 2009) $ $Revision: 10667 $)
+(As of $LastChangedDate: 2009-04-02 11:54:56 +0100 (Thu, 02 Apr 2009) $ $Revision: 10667 $)
=cut
@@ -43,6 +43,92 @@
=head1 CHANGES
+=head2 Changes in DBD::ODBC 1.19 April 2, 2009
+
+Some minor diagnostic output during tests when running against freeTDS
+to show we know of issues in freeTDS.
+
+Fixed issue in 20SqlServer.t where the connection string got set with
+two consecutive semi-colons. Most drivers don't mind this but freeTDS
+ignores everything after that point in the connection string.
+
+Quieten some delete table output during tests.
+
+Handle connect failures in 20SqlServer.t in the multiple active
+statement tests.
+
+In 02simple.t cope with ODBC drivers or databases that do not need a
+username or password (MS Access).
+
+In 20SqlServer.t fix skip count and an erroneouse assignement for
+driver_name.
+
+Changes some if tests to Test::More->is tests in 02simple.t.
+
+Fix "invalid precision" error during tests with the new ACEODBC.DLL MS
+Access driver. Same workaround applied for the old MS Access driver
+(ODBCJT32.DLL) some time ago.
+
+Fix out of memory error during tests against the new MS Access driver
+(ACEODBC.DLL). The problem appears to be that the new Access driver
+reports ridiculously large parameter sizes for "select ?" queries and
+there are some of these in the unicode round trip test.
+
+Fixed minor typo in Makefile.PL - diagnostic message mentioned "ODBC
+HOME" instead of ODBCHOME.
+
+12blob.t test somehow got lost from MANIFEST - replaced. Also changed
+algorithm to get a long char type column as some MS Access drivers
+only show SQL_WLONGVARCHAR type in unicode.
+
+Added diagnostic output to 02simple.t to show the state of
+odbc_has_unicode.
+
+=head2 Changes in DBD::ODBC 1.18_4 March 13, 2009
+
+A mistake in the MANIFEST lead to the rt_43384.t test being omitted.
+
+Brian Becker reported the tables PERL_DBD_39897 and PERL_DBD_TEST are
+left behind after testing. I've fixed the former but not the latter
+yet.
+
+Yet another variation on the changes for rt 43384. If the parameter is
+bound specifically as SQL_VARCHAR, you got invalid precision
+error. Thanks to Øystein Torget for finding this and helping me verify
+the fix.
+
+If you attempt to insert large amounts of data into MS Access (which
+does not have SQLDescribeParam) you can get an invalid precision error
+which can be worked around by setting the bind type to
+SQL_LONGVARCHAR. This version does that for you.
+
+08bind2.t had a wrong skip count.
+
+12blob.t had strict commented out and GetTypeInfo was not quoted. Also
+introduced a skip if the execute fails as it just leads to more
+obvious failures.
+
+In dbdimp.c/rebind_ph there was a specific workaround for SQL Server
+which was not done after testing if we are using SQL Server - this
+was breaking tests to MS Access.
+
+=head2 Changes in DBD::ODBC 1.18_2 March 9, 2009
+
+Added yet another workaround for the SQL Server Native Client driver
+version 2007.100.1600.22 and 2005.90.1399.00 (driver version
+09.00.1399) which leads to HY104, "Invalid precision value" in the
+rt_39841.t test.
+
+=head2 Changes in DBD::ODBC 1.18_1 March 6, 2009
+
+Fixed bug reported by Toni Salomäki leading to a describe failed error
+when calling procedures with no results. Test cases added to
+20SqlServer.t.
+
+Fixed bug rt 43384 reported by Øystein Torget where you cannot insert
+more than 127 characters into a Microsoft Access text(255) column when
+DBD::ODBC is built in unicode mode.
+
=head2 Changes in DBD::ODBC 1.18 January 16, 2009
Major release of all the 1.17 development releases below.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/dbdimp.c new/DBD-ODBC-1.19/dbdimp.c
--- old/DBD-ODBC-1.18/dbdimp.c 2008-12-19 20:39:23.000000000 +0100
+++ new/DBD-ODBC-1.19/dbdimp.c 2009-04-02 12:54:58.000000000 +0200
@@ -1,9 +1,9 @@
-/* $Id: dbdimp.c 12185 2008-12-19 19:39:22Z mjevans $
+/* $Id: dbdimp.c 12667 2009-04-02 10:54:56Z mjevans $
*
* portions Copyright (c) 1994,1995,1996,1997 Tim Bunce
* portions Copyright (c) 1997 Thomas K. Wenrich
* portions Copyright (c) 1997-2001 Jeff Urlwin
- * portions Copyright (c) 2007-2008 Martin J. Evans
+ * portions Copyright (c) 2007-2009 Martin J. Evans
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the Perl README file.
@@ -41,7 +41,7 @@
#define TRACE2(a,b,c,d) PerlIO_printf(DBIc_LOGPIO(a), (b), (c), (d))
#define TRACE3(a,b,c,d,e) PerlIO_printf(DBIc_LOGPIO(a), (b), (c), (d), (e))
-static SQLSMALLINT default_parameter_type(imp_sth_t *imp_sth);
+static SQLSMALLINT default_parameter_type(imp_sth_t *imp_sth, phs_t *phs);
static int post_connect(SV *dbh, imp_dbh_t *imp_dbh, SV *attr);
static int set_odbc_version(SV *dbh, imp_dbh_t *imp_dbh, SV* attr);
static const char *S_SqlTypeToString (SWORD sqltype);
@@ -90,8 +90,10 @@
or failed */
#ifdef WITH_UNICODE
# define ODBC_BACKUP_BIND_TYPE_VALUE SQL_WVARCHAR
+# define ODBC_BACKUP_LONG_BIND_TYPE_VALUE SQL_WLONGVARCHAR
#else
# define ODBC_BACKUP_BIND_TYPE_VALUE SQL_VARCHAR
+# define ODBC_BACKUP_LONG_BIND_TYPE_VALUE SQL_LONGVARCHAR
#endif
SV *dbd_param_err(SQLHANDLE h, int recno);
@@ -1990,6 +1992,7 @@
if (num_fields == 0) {
if (DBIc_TRACE(imp_sth, 0, 0, 4))
TRACE0(imp_dbh, " dbd_describe skipped (no result cols)\n");
+ imp_sth->done_desc = 1;
return 1;
}
@@ -2060,7 +2063,7 @@
PerlIO_printf(DBIc_LOGPIO(imp_dbh),
" DescribeCol column = %d, name = %s, "
"len = %d, type = %s(%d), "
- "precision = %ld, scale = %d, nullable = %d\n",
+ "column size = %ld, scale = %d, nullable = %d\n",
i+1, fbh->ColName,
fbh->ColNameLen,
S_SqlTypeToString(fbh->ColSqlType),
@@ -2154,6 +2157,17 @@
if (fbh->ColDef == 0) { /* cope with nvarchar(max) */
fbh->ColDisplaySize = DBIc_LongReadLen(imp_sth);
fbh->ColLength = DBIc_LongReadLen(imp_sth);
+ } else if (fbh->ColDef > 2147483590) {
+ /*
+ * The new MS Access driver ACEODBC.DLL cannot cope with the
+ * 40UnicodeRoundTrip test which contains a
+ * select ?, LEN(?)
+ * returning a massive number for the column display size of
+ * the first column. This leads to a memory allocation error
+ * unless we trap it as a large column.
+ */
+ fbh->ColDisplaySize = DBIc_LongReadLen(imp_sth);
+ fbh->ColLength = DBIc_LongReadLen(imp_sth);
}
fbh->ColDisplaySize*=sizeof(SQLWCHAR);
@@ -2952,7 +2966,7 @@
default a SQL type to bind the parameter as. The default is either
the value set with odbc_default_bind_type or a fallback of
SQL_VARCHAR. */
- phs->sql_type = default_parameter_type(imp_sth);
+ phs->sql_type = default_parameter_type(imp_sth, phs);
if (DBIc_TRACE(imp_sth, 0, 0, 4))
TRACE1(imp_dbh, " defaulted param type to %d\n", phs->sql_type);
} else if (!phs->describe_param_called) {
@@ -2967,7 +2981,7 @@
phs->describe_param_called = 1;
phs->describe_param_status = rc;
if (!SQL_SUCCEEDED(rc)) {
- phs->sql_type = default_parameter_type(imp_sth);
+ phs->sql_type = default_parameter_type(imp_sth, phs);
if (DBIc_TRACE(imp_sth, 0, 0, 3))
TRACE1(imp_dbh, " SQLDescribeParam failed reverting to "
"default SQL bind type %d\n", phs->sql_type);
@@ -3095,8 +3109,7 @@
#else
SvGROW(phs->sv, (phs->maxlen < 28) ? 28 : phs->maxlen+1);
#endif /* WITH_UNICODE */
- }
- else {
+ } else {
/* phs->sv is copy of real variable, upgrade to at least string */
(void)SvUPGRADE(phs->sv, SVt_PV);
}
@@ -3145,10 +3158,11 @@
#endif /* WITH_UNICODE */
if (DBIc_TRACE(imp_sth, 0, 0, 4)) {
- PerlIO_printf(DBIc_LOGPIO(imp_dbh),
- " bind %s '%.100s' value_len=%d maxlen=%ld null=%d)\n",
- phs->name, SvOK(phs->sv) ? phs->sv_buf : "(null)",
- value_len,(long)phs->maxlen, SvOK(phs->sv) ? 0 : 1);
+ PerlIO_printf(
+ DBIc_LOGPIO(imp_dbh),
+ " bind %s '%.100s' value_len=%d maxlen=%ld null=%d)\n",
+ phs->name, SvOK(phs->sv) ? phs->sv_buf : "(null)",
+ value_len,(long)phs->maxlen, SvOK(phs->sv) ? 0 : 1);
}
/*
@@ -3204,12 +3218,12 @@
/* When we fill a LONGVARBINARY, the CTYPE must be set to SQL_C_BINARY */
if (value_type == SQL_C_CHAR) { /* could be changed by bind_plh */
+ d_digits = 0; /* not relevent to char types */
switch(phs->sql_type) {
case SQL_LONGVARBINARY:
case SQL_BINARY:
case SQL_VARBINARY:
value_type = SQL_C_BINARY;
- d_digits = 0;
column_size = default_column_size;
break;
#ifdef SQL_WLONGVARCHAR
@@ -3218,7 +3232,6 @@
case SQL_CHAR:
case SQL_VARCHAR:
case SQL_LONGVARCHAR:
- d_digits = 0;
column_size = default_column_size;
break;
case SQL_DATE:
@@ -3229,8 +3242,6 @@
case SQL_TIMESTAMP:
case SQL_TYPE_TIMESTAMP:
d_digits = 0; /* tbd: millisecondS?) */
- /* bug fix! if phs->sv is not OK, then there's a chance
- * we go through garbage data to determine the length */
if (SvOK(phs->sv)) {
char *cp;
if (phs->sv_buf && *phs->sv_buf) {
@@ -3252,7 +3263,9 @@
default:
break;
}
- }
+ } else if ( value_type = SQL_C_WCHAR) {
+ d_digits = 0;
+ }
if (!SvOK(phs->sv)) {
phs->strlen_or_ind = SQL_NULL_DATA;
@@ -3303,19 +3316,7 @@
value_ptr = (UCHAR*) phs;
}
- if (DBIc_TRACE(imp_sth, 0, 0, 5)) {
- PerlIO_printf(
- DBIc_LOGPIO(imp_dbh),
- " SQLBindParameter: idx=%d: param_type=%d, name=%s, "
- "value_type=%d, SQL_Type=%d, column_size=%d, d_digits=%d, "
- "value_ptr=%p, buffer_length=%d, cbValue=%d, param_size=%d\n",
- phs->idx, param_type, phs->name, value_type, phs->sql_type,
- column_size, d_digits, value_ptr, buffer_length, phs->strlen_or_ind,
- phs->param_size);
- /* avoid tracing data_at_exec as value_ptr will point to phs */
- if ((value_type == SQL_C_CHAR) && (phs->strlen_or_ind > 0)) {
- TRACE1(imp_sth, " Param value = %s\n", value_ptr);
- }
+
#if THE_FOLLOWING_CODE_IS_FLAWED_AND_BROKEN
/*
* value_ptr is not null terminated - it is a byte array so PVallocW
@@ -3330,7 +3331,7 @@
}
#endif /* WITH_UNICODE */
#endif
- }
+
/*
* The following code is a workaround for a problem in SQL Server
@@ -3355,13 +3356,35 @@
* SQL_LEN_DATA_AT_EXEC(0) and the buffer_length to 0.
*
*/
- if ((strcmp(imp_dbh->odbc_driver_name, "SQLSRV32.DLL") == 0) &&
- ((phs->sql_type == SQL_LONGVARCHAR) || (phs->sql_type == SQL_LONGVARBINARY)) &&
+ if ((imp_dbh->driver_type == DT_SQL_SERVER) &&
+ ((phs->sql_type == SQL_LONGVARCHAR) ||
+ (phs->sql_type == SQL_LONGVARBINARY)) &&
(column_size == 2147483647) && (phs->strlen_or_ind < 0) &&
((-phs->strlen_or_ind + SQL_LEN_DATA_AT_EXEC_OFFSET) >= 409600)) {
phs->strlen_or_ind = SQL_LEN_DATA_AT_EXEC(0);
buffer_length = 0;
}
+#if defined(WITH_UNICODE)
+ /*
+ * rt43384 - MS Access does not seem to like us binding parameters as
+ * wide characters and then SQLBindParameter column_size to byte length.
+ * e.g., if you have a text(255) column and try and insert 190 ascii chrs
+ * then the unicode enabled version of DBD::ODBC will convert those 190
+ * ascii chrs to wide chrs and hence double the size to 380. If you pass
+ * 380 to Access for column_size it just returns an invalid precision
+ * value. This changes to column_size to chrs instead of bytes but
+ * only if column_size is not reduced to 0 - which also produces
+ * an access error e.g., in the empty string '' case.
+ */
+ else if (((imp_dbh->driver_type == DT_MS_ACCESS_JET) ||
+ (imp_dbh->driver_type == DT_MS_ACCESS_ACE)) &&
+ (value_type == SQL_C_WCHAR) && (column_size > 1)) {
+ column_size = column_size / 2;
+ if (DBIc_TRACE(imp_sth, 0, 0, 4))
+ TRACE0(imp_dbh, " MSAccess - setting chrs not bytes\n");
+ }
+#endif
+
/*
* workaround bug in SQL Server ODBC driver where it can describe some
* parameters (especially in SQL using sub selects) the wrong way.
@@ -3371,9 +3394,40 @@
* a varchar(10) column can be desribed as a varchar(n) where n is less
* than 10 and this leads to data truncation errors - see rt 39841.
*/
- if ((phs->sql_type == SQL_VARCHAR) && (column_size < buffer_length)) {
+ if (((imp_dbh->driver_type == DT_SQL_SERVER) ||
+ (imp_dbh->driver_type == DT_SQL_SERVER_NATIVE_CLIENT)) &&
+ (phs->sql_type == SQL_VARCHAR) &&
+ (column_size < buffer_length)) {
column_size = buffer_length;
}
+ /*
+ * Yet another workaround for SQL Server native client.
+ * If you have a varbinary(max) or varchar(max) you have to pass 0
+ * for the column_size or you get HY104 "Invalid precision value".
+ * See rt_38977.t which causes this.
+ * The versions of native client I've seen this with are:
+ * 2007.100.1600.22 sqlncli10.dll driver version = ?
+ * 2005.90.1399.00 SQLNCLI.DLL driver version = 09.00.1399
+ */
+ if ((imp_dbh->driver_type == DT_SQL_SERVER_NATIVE_CLIENT) &&
+ (phs->strlen_or_ind < 0) &&
+ (phs->param_size == 0)) {
+ column_size = 0;
+ }
+ if (DBIc_TRACE(imp_sth, 0, 0, 5)) {
+ PerlIO_printf(
+ DBIc_LOGPIO(imp_dbh),
+ " SQLBindParameter: idx=%d: param_type=%d, name=%s, "
+ "value_type=%d, SQL_Type=%d, column_size=%d, d_digits=%d, "
+ "value_ptr=%p, buffer_length=%d, cbValue=%d, param_size=%d\n",
+ phs->idx, param_type, phs->name, value_type, phs->sql_type,
+ column_size, d_digits, value_ptr, buffer_length, phs->strlen_or_ind,
+ phs->param_size);
+ /* avoid tracing data_at_exec as value_ptr will point to phs */
+ if ((value_type == SQL_C_CHAR) && (phs->strlen_or_ind > 0)) {
+ TRACE1(imp_sth, " Param value = %s\n", value_ptr);
+ }
+ }
rc = SQLBindParameter(imp_sth->hstmt,
phs->idx, param_type, value_type, phs->sql_type,
column_size, d_digits,
@@ -5146,7 +5200,22 @@
if (!SQL_SUCCEEDED(rc)) {
dbd_error(dbh, rc, "post_connect/SQLGetInfo(DRIVER_NAME)");
strcpy(imp_dbh->odbc_driver_name, "unknown");
+ imp_dbh->driver_type = DT_DONT_CARE;
+ } else {
+ if (strcmp(imp_dbh->odbc_driver_name, "SQLSRV32.DLL") == 0) {
+ imp_dbh->driver_type = DT_SQL_SERVER;
+ } else if ((strcmp(imp_dbh->odbc_driver_name, "sqlncli10.dll") == 0) ||
+ (strcmp(imp_dbh->odbc_driver_name, "SQLNCLI.DLL") == 0)) {
+ imp_dbh->driver_type = DT_SQL_SERVER_NATIVE_CLIENT;
+ } else if (strcmp(imp_dbh->odbc_driver_name, "odbcjt32.dll") == 0) {
+ imp_dbh->driver_type = DT_MS_ACCESS_JET;
+ } else if (strcmp(imp_dbh->odbc_driver_name, "ACEODBC.DLL") == 0) {
+ imp_dbh->driver_type = DT_MS_ACCESS_ACE;
+ } else {
+ imp_dbh->driver_type = DT_DONT_CARE;
+ }
}
+
if (DBIc_TRACE(imp_dbh, 0x04000000, 0, 0))
TRACE1(imp_dbh, "DRIVER_NAME = %s\n", imp_dbh->odbc_driver_name);
@@ -5346,12 +5415,22 @@
-static SQLSMALLINT default_parameter_type(imp_sth_t *imp_sth)
+static SQLSMALLINT default_parameter_type(imp_sth_t *imp_sth, phs_t *phs)
{
if (imp_sth->odbc_default_bind_type != 0) {
return imp_sth->odbc_default_bind_type;
} else {
- return ODBC_BACKUP_BIND_TYPE_VALUE;
+ /* MS Access can return an invalid precision error in the 12blob
+ test unless the large valud is bound as an SQL_LONGVARCHAR
+ or SQL_WLONGVARCHAR. Who knows what large is, but for now it is
+ 4000 */
+ if (!SvOK(phs->sv)) {
+ return ODBC_BACKUP_BIND_TYPE_VALUE;
+ } else if (SvCUR(phs->sv) > 4000) {
+ return ODBC_BACKUP_LONG_BIND_TYPE_VALUE;
+ } else {
+ return ODBC_BACKUP_BIND_TYPE_VALUE;
+ }
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/dbdimp.h new/DBD-ODBC-1.19/dbdimp.h
--- old/DBD-ODBC-1.18/dbdimp.h 2008-12-16 10:48:10.000000000 +0100
+++ new/DBD-ODBC-1.19/dbdimp.h 2009-04-02 12:54:58.000000000 +0200
@@ -1,5 +1,5 @@
/*
- * $Id: dbdimp.h 12168 2008-12-16 09:48:08Z mjevans $
+ * $Id: dbdimp.h 12667 2009-04-02 10:54:56Z mjevans $
* portions Copyright (c) 2007-2008 Martin J. Evans
* Copyright (c) 1997-2001 Jeff Urlwin
* portions Copyright (c) 1997 Thomas K. Wenrich
@@ -74,6 +74,17 @@
* SQLColAttributes for these attributes fails we fallback on a default
* value. */
SQLLEN odbc_column_display_size;
+ /*
+ * We need special workarounds for the following drivers. To avoid
+ * strcmping their names every time we do it once and store the type here
+ */
+ enum {
+ DT_DONT_CARE,
+ DT_SQL_SERVER, /* SQLSRV32.DLL */
+ DT_SQL_SERVER_NATIVE_CLIENT, /* sqlncli10.dll | SQLNCLI.DLL */
+ DT_MS_ACCESS_JET, /* odbcjt32.dll */
+ DT_MS_ACCESS_ACE /* ACEODBC.DLL */
+ } driver_type;
char odbc_driver_name[80];
char odbc_driver_version[20];
};
@@ -152,7 +163,7 @@
typedef struct phs_st phs_t; /* scalar placeholder */
-struct phs_st { /* scalar placeholder EXPERIMENTAL */
+struct phs_st { /* scalar placeholder */
SQLUSMALLINT idx; /* index number of this param 1, 2, ... */
SV *sv; /* the scalar holding the value */
int sv_type; /* original sv type at time of bind */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/Makefile.PL new/DBD-ODBC-1.19/Makefile.PL
--- old/DBD-ODBC-1.18/Makefile.PL 2008-11-17 15:31:10.000000000 +0100
+++ new/DBD-ODBC-1.19/Makefile.PL 2009-04-02 12:54:58.000000000 +0200
@@ -1,6 +1,6 @@
#!/usr/local/bin/perl -w
#
-# $Id: Makefile.PL 12080 2008-11-17 14:31:09Z mjevans $
+# $Id: Makefile.PL 12667 2009-04-02 10:54:56Z mjevans $
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.
@@ -129,26 +129,31 @@
"o=s" => \$opt_o,
"u!" => \$opt_u) or die "Invalid arguments\n";
if (($ENV{LANG} || '') =~ m/utf-?8/i) {
- print <<"EOF";
+ print <<"EOT";
Your LANG environment variable is set to "$ENV{LANG}"\a
This is known to cause problems in some perl installations - even stopping
-this Makefile.PL to run without errors. If you have problems please try
-re-running with LANG unset or with the utf part of LANG removed.
+this Makefile.PL from running without errors. If you have problems please
+try re-running with LANG unset or with the utf part of LANG removed.
-EOF
+EOT
sleep 4;
}
if ($Config{useithreads}) {
- print <<"EOF";
-You are using a Perl configured with threading enabled\a.
+ print <<'EOT';
+You are using a Perl configured with threading enabled.
Please read the warnings in DBI about this.
+
+EOT
+ if ($^O ne 'MSWin32') {
+ print <<'EOT';
You should also be aware that on non-Windows platforms ODBC drivers come
in two forms, thread-safe and non-thread-safe drivers and you may need
to make sure you are using the right one.
-EOF
+EOT
+ }
prompt("Press return to continue...");
}
print "Overriding ODBC Directory with command line option: $opt_o\n"
@@ -244,7 +249,7 @@
(-f "$odbchome/include/sql.h") &&
(-f "$odbchome/include/sqlext.h") &&
(-f "$odbchome/include/sqltypes.h")) {
- print "Set ODBC HOME to $odbchome from odbc_config\n";
+ print "Set ODBCHOME to $odbchome from odbc_config\n";
} else {
$odbchome = '';
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/MANIFEST new/DBD-ODBC-1.19/MANIFEST
--- old/DBD-ODBC-1.18/MANIFEST 2008-11-17 10:28:14.000000000 +0100
+++ new/DBD-ODBC-1.19/MANIFEST 2009-03-31 17:24:04.000000000 +0200
@@ -75,6 +75,7 @@
README.unicode
README.windows
README.osx
+README.sqlserver
t/01base.t
t/02simple.t
t/03dbatt.t
@@ -83,6 +84,7 @@
t/08bind2.t
t/09multi.t
t/10handler.t
+t/12blob.t
t/20SqlServer.t
t/30Oracle.t
t/40UnicodeRoundTrip.t
@@ -94,5 +96,6 @@
t/rt_38977.t
t/rt_39841.t
t/rt_39897.t
+t/rt_43384.t
unicode_helper.c
unicode_helper.h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/META.yml new/DBD-ODBC-1.19/META.yml
--- old/DBD-ODBC-1.18/META.yml 2009-01-16 19:46:33.000000000 +0100
+++ new/DBD-ODBC-1.19/META.yml 2009-04-02 12:45:00.000000000 +0200
@@ -1,7 +1,7 @@
--- #YAML:1.0
name: DBD-ODBC
abstract: ODBC DBD for Perl DBI
-version: 1.18
+version: 1.19
version_from: ODBC.pm
author:
- Tim Bunce
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/ODBC.pm new/DBD-ODBC-1.19/ODBC.pm
--- old/DBD-ODBC-1.18/ODBC.pm 2009-01-16 19:47:38.000000000 +0100
+++ new/DBD-ODBC-1.19/ODBC.pm 2009-04-02 12:54:58.000000000 +0200
@@ -1,9 +1,9 @@
-# $Id: ODBC.pm 12450 2009-01-16 18:47:37Z mjevans $
+# $Id: ODBC.pm 12667 2009-04-02 10:54:56Z mjevans $
#
# Copyright (c) 1994,1995,1996,1998 Tim Bunce
# portions Copyright (c) 1997-2004 Jeff Urlwin
# portions Copyright (c) 1997 Thomas K. Wenrich
-# portions Copyright (c) 2007-2008 Martin J. Evans
+# portions Copyright (c) 2007-2009 Martin J. Evans
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.
@@ -12,7 +12,7 @@
require 5.006;
-$DBD::ODBC::VERSION = '1.18';
+$DBD::ODBC::VERSION = '1.19';
{
package DBD::ODBC;
@@ -23,7 +23,7 @@
@ISA = qw(Exporter DynaLoader);
- # my $Revision = substr(q$Id: ODBC.pm 12450 2009-01-16 18:47:37Z mjevans $, 13,2);
+ # my $Revision = substr(q$Id: ODBC.pm 12667 2009-04-02 10:54:56Z mjevans $, 13,2);
require_version DBI 1.21;
@@ -36,7 +36,6 @@
sub parse_trace_flag {
my ($class, $name) = @_;
- #return 0x02000000 if name eq 'this_is_spare_use_me';
return 0x02000000 if $name eq 'odbcunicode';
return 0x04000000 if $name eq 'odbcconnection';
return DBI::parse_trace_flag($class, $name);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/README new/DBD-ODBC-1.19/README
--- old/DBD-ODBC-1.18/README 2008-07-29 15:05:06.000000000 +0200
+++ new/DBD-ODBC-1.19/README 2009-03-09 11:36:12.000000000 +0100
@@ -1,11 +1,11 @@
DBD::ODBC -- DBD module interfacing the ODBC databases.
- $Id: README 11610 2008-07-29 13:04:02Z mjevans $
+ $Id: README 12590 2009-03-09 10:36:10Z mjevans $
Copyright (c) 1994,1995,1996,1997,1998 Tim Bunce
portions Copyright (c) 1997,1998,1999,2000,2001,2002 Jeff Urlwin
portions Copyright (c) 1997 Thomas K. Wenrich
- portions Copyright (c) 2007,2008 Martin J. Evans
+ portions Copyright (c) 2007,2008, 2009 Martin J. Evans
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the Perl README file.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/README.sqlserver new/DBD-ODBC-1.19/README.sqlserver
--- old/DBD-ODBC-1.18/README.sqlserver 1970-01-01 01:00:00.000000000 +0100
+++ new/DBD-ODBC-1.19/README.sqlserver 2009-03-09 11:36:12.000000000 +0100
@@ -0,0 +1,97 @@
+# $Id: README.sqlserver 12590 2009-03-09 10:36:10Z mjevans $
+
+It is proving near impossible to workaround all the different bugs in
+the various SQL Server ODBC drivers and SQL Server Native Client
+drivers. From here on I am going to try and keep a record or what
+worked and what bugs I found.
+
+There are 5 basic ways I know to connect to SQL Server via ODBC:
+
+1. On windows via the SQL Server OBDC Driver
+2. On Windows via the SQL Server Native Client
+3. On UNIX via an ODBC driver manager (of which there are 3) and
+ a SQL Server ODBC Driver. There are at least 4 of these:
+ o Easysoft SQL Server ODBC Driver
+ o Data Direct SQL Server Driver
+ o Openlink SQL Server Driver
+ o FreeTDS SQL Server Driver
+4. On Unix via DBD::Proxy
+5. On Unix via an ODBC-ODBC Bridge
+ At least Easysoft and Openlink have these.
+
+Each driver manager and driver has it own bugs and other issues and it
+is exceedingly difficult to keep up with them all. For Windows and the
+various SQL Server drivers the list of bugs and workarounds is growing
+to a point making it difficult to keep track.
+
+Driver: SQL Server
+Version reported in ODBC Administrator: 2000.85.1132.00
+Driver version: 03.85.1132
+Driver name: SQLSRV32.DLL
+Passes all tests in: 1.18_2
+Issues/Notes:
+
+ 1. does not support MARS_Connection (see 20SqlServer.t)
+
+ 2. needs special workaround when inserting more than 400K into a
+ varxxx(max) field (see rt_38977.t). The workaround is to set the
+ strlen_or_indptr in SQLBindParameter to SQL_LEN_DATA_AT_EXEC(0)
+ and the buffer_length to 0. Without the workaround the errors
+ produced in rt_38977.t are:
+
+ The insert/update of a text or image column(s) did not succeed.
+ The text, ntext, or image pointer value conflicts with the column name.
+
+ 3. Sometimes describes parameters incorrectly. Although the
+ workaround in dbdimp.c to set the column_size to the
+ buffer_length works around most sometimes you need to set the
+ parameter type yourself (see rt_39841.t).
+
+Driver: SQL Native Client
+Version reported in ODBC Administrator: 2005.90.1399.00
+Driver version: 09.00.1399
+Driver Name: SQLNCLI.DLL
+Passes all tests in: 1.18_2
+Issues/Notes:
+
+ 1. does support MARS_Connection
+
+ 2. Sometimes describes parameters incorrectly. Although the
+ workaround in dbdimp.c to set the column_size to the
+ buffer_length works around most sometimes you need to set the
+ parameter type yourself (see rt_39841.t).
+
+ 3. Fails the rt_38977.t test to insert more than 400K into a
+ varxxx(max) field unless column_size is set to 0 in the
+ SQLBindParamter call.
+
+Driver: SQL Server
+Version reported in ODBC Administrator: 6.00.6000.16386
+Driver version: 06.00.6000
+Driver Name: SQLSRV32.DLL
+Passes all tests in: 1.18_2
+Issues/Notes:
+
+ Probably has many of the same issues as other SQL Server ODBC drivers
+ but not individually tested.
+
+Driver: SQL Server
+Version reported in ODBC Administrator: 2000.86.1830.00
+Driver version: 03.86.1830
+Driver Name: SQLSRV32.DLL
+Passes all tests in: 1.18_2
+Issues/Notes:
+
+ Probably has many of the same issues as other SQL Server ODBC drivers
+ but not individually tested.
+
+Driver: SQL Server
+Version reported in ODBC Administrator: 2000.85.1132.00
+Driver version: ??????
+Driver Name: SQLSRV32.DLL
+Passes all tests in: ??
+Issues/Notes:
+
+ There is more than one "driver version" reported for the version the
+ ODBC Administrator reports (2000.85.1132.00) and at least one of them
+ fails rt_38977.t with "Invalid precision value".
\ No newline at end of file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/t/02simple.t new/DBD-ODBC-1.19/t/02simple.t
--- old/DBD-ODBC-1.18/t/02simple.t 2008-12-16 10:48:10.000000000 +0100
+++ new/DBD-ODBC-1.19/t/02simple.t 2009-04-02 12:54:58.000000000 +0200
@@ -1,5 +1,5 @@
#!perl -w -I./t
-# $Id: 02simple.t 12168 2008-12-16 09:48:08Z mjevans $
+# $Id: 02simple.t 12667 2009-04-02 10:54:56Z mjevans $
use Test::More;
use strict;
@@ -9,7 +9,7 @@
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;
-my $tests = 63;
+my $tests = 65;
$tests += 1 if $has_test_nowarnings;
plan tests => $tests;
@@ -34,13 +34,16 @@
BAIL_OUT("Unable to connect to the database ($DBI::errstr)\nTests skipped.\n");
exit 0;
}
+my $driver_name;
# Output DBMS which is useful when debugging cpan-testers output
{
diag("\n");
diag("Using DBMS_NAME " . DBI::neat($dbh->get_info(17)) . "\n");
diag("Using DBMS_VER " . DBI::neat($dbh->get_info(18)) . "\n");
- diag("Using DRIVER_NAME " . DBI::neat($dbh->get_info(6)) . "\n");
+ $driver_name = DBI::neat($dbh->get_info(6));
+ diag("Using DRIVER_NAME $driver_name\n");
diag("Using DRIVER_VER " . DBI::neat($dbh->get_info(7)) . "\n");
+ diag("odbc_has_unicode " . $dbh->{odbc_has_unicode} . "\n");
}
# ReadOnly
@@ -151,10 +154,17 @@
# now force an error and ensure we get a long truncated event.
$dbh->{LongTruncOk} = 0;
is($dbh->{LongTruncOk}, '', "Set Long TruncOk 0");
-ok(!select_long($dbh, \$max_col_len, 0), "Select Long Data failure");
+# Following test fails with FreeTDS 0.63 and 0.64 because FreeTDS does not
+# report a data truncation error and hence no error is raised and there
+# err, errstr and state are not set.
+$rc = select_long($dbh, \$max_col_len, 0);
+ok(!$rc, "Select Long Data failure");
ok($dbh->err, 'error set on truncated handle');
ok($dbh->errstr, 'errstr set on truncated handle');
ok($dbh->state, 'state set on truncated handle');
+if ($rc && ($driver_name =~ /tdsodbc/)) {
+ diag(qq/\nNOTE:\nFreeTDS fails the previous 4 tests because when you select a column greater\nthan 80 characters with LongTruncOk it does not generate a\n01004, "String data, right truncation error\n"/);
+}
my $sth = $dbh->prepare("SELECT * FROM $ODBCTEST::table_name ORDER BY COL_A");
ok(defined($sth), "prepare select from table");
@@ -198,8 +208,14 @@
#
$sth = $dbh->prepare("SELECT XXNOTCOLUMN FROM $ODBCTEST::table_name");
$sth->execute() if $sth;
-cmp_ok(length($DBI::errstr), '>', 0, "Error reported on bad query");
-
+if (!defined($DBI::errstr) || (length($DBI::errstr) == 0)) {
+ fail("Error reported on bad query");
+ if ($driver_name =~ /tdsodbc/) {
+ diag(qq/NOTE:\nfreeTDS 0.63 at least, fails the previous test because no error is returned\nfrom SQLPrepare or SQLExecute when you enter a\n"select non_existent_table_name from table" query.\nVersion 0.82 seems to have fixed this./);
+ }
+} else {
+ pass("Error reported on bad query");
+}
my @row = ODBCTEST::get_type_for_column($dbh, 'COL_D');
my $dateval;
@@ -276,7 +292,9 @@
ok(defined($dbh3), "Connection with DSN=$connstr");
$dbh3->disconnect if (defined($dbh3));
- my $cs = $connstr . ";UID=$ENV{DBI_USER};PWD=$ENV{DBI_PASS}";
+ my $cs = $connstr;
+ $cs .= ";UID=$ENV{DBI_USER}" if exists($ENV{DBI_USER});
+ $cs .= ";PWD=$ENV{DBI_PASS}" if exists($ENV{DBI_PASS});
$dbh3 = DBI->connect($cs,undef,undef, {RaiseError=>0, PrintError=>0});
ok(defined($dbh3),
"Connection with DSN=$connstr and UID and PWD are set") or diag($cs);
@@ -323,20 +341,17 @@
$sth->execute();
while (@row = $sth->fetchrow()) {
if ($row[0] == 4) {
- if ($row[1] eq $ODBCTEST::longstr) {
- # print "retrieved ", length($ODBCTEST::longstr), " byte string OK\n";
- } else {
- diag("Basic retrieval of longer rows not working!\nRetrieved value = $row[1] vs $ODBCTEST::longstr\n");
- return 0;
- }
- } elsif ($row[0] == 5) {
- if ($row[1] eq $ODBCTEST::longstr2) {
- # print "retrieved ", length($ODBCTEST::longstr2), " byte string OK\n";
- } else {
- diag(print "Basic retrieval of row longer than 255 chars not working!" .
- "\nRetrieved ", length($row[1]), " bytes instead of " .
- length($ODBCTEST::longstr2) . "\nRetrieved value = $row[1]\n");
- return 0;
+ if (!is($row[1], $ODBCTEST::longstr, "long strings compare")) {
+ diag("Basic retrieval of longer rows not working\n" .
+ DBI::data_diff($row[1], $ODBCTEST::longstr));
+ return 0;
+ }
+ } elsif ($row[0] == 5) {
+ if (!is($row[1], $ODBCTEST::longstr2, "long strings compare 255")) {
+ diag("Basic retrieval of row longer than 255 chars" .
+ " not working!\n" .
+ DBI::data_diff($row[1], $ODBCTEST::longstr2));
+ return 0;
}
}
}
@@ -356,7 +371,10 @@
my $rc = 0;
my $longest = undef;
- $dbh->{RaiseError} = 1;
+ local $dbh->{RaiseError} = 1;
+ local $dbh->{PrintError} = 0;
+ local $dbh->{PrintWarn} = 0;
+
$sth = $dbh->prepare("SELECT COL_A,COL_C FROM $ODBCTEST::table_name WHERE COL_A=4");
if ($sth) {
$sth->execute();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/t/08bind2.t new/DBD-ODBC-1.19/t/08bind2.t
--- old/DBD-ODBC-1.18/t/08bind2.t 2008-08-28 10:23:37.000000000 +0200
+++ new/DBD-ODBC-1.19/t/08bind2.t 2009-03-13 14:14:21.000000000 +0100
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w -I./t
-# $Id: 08bind2.t 11680 2008-08-28 08:23:27Z mjevans $
+# $Id: 08bind2.t 12606 2009-03-13 13:14:20Z mjevans $
use Test::More;
use strict;
@@ -16,8 +16,8 @@
# use_ok('DBI', qw(:sql_types));
# can't seem to get the imports right this way
use DBI qw(:sql_types);
-use_ok('ODBCTEST');
-use_ok('Data::Dumper');
+use_ok('ODBCTEST'); # 1
+use_ok('Data::Dumper'); # 2
BEGIN {
if (!defined $ENV{DBI_DSN}) {
@@ -37,7 +37,7 @@
SKIP:
{
- skip "SQLDescribeParam not supported using " . $dbh->get_info(17) . "\n", $tests -2, unless $dbh->func(58, 'GetFunctions');
+ skip "SQLDescribeParam not supported using " . $dbh->get_info(17) . "\n", 3, unless $dbh->func(58, 'GetFunctions');
$dbh->{RaiseError} = 0;
$dbh->{PrintError} = 0;
@@ -76,11 +76,11 @@
unless ($rc) {
diag("These are tests which rely upon the driver to tell what the parameter type is for the column. This means you need to ensure you tell your driver the type of the column in bind_col().\n");
}
- ok($rc, "insert #1 various test data no dates, no long data");
+ ok($rc, "insert #1 various test data no dates, no long data"); # 3
$dbh->{PrintError} = 0;
$rc = ODBCTEST::tab_insert_bind($dbh, \@data_no_dates_with_long, 0);
- ok($rc, "insert #2 various test data no dates, with long data");
+ ok($rc, "insert #2 various test data no dates, with long data"); # 4
$rc = ODBCTEST::tab_insert_bind($dbh, \@data_with_dates, 0);
# warn "\nThis test is known to fail using Oracle's ODBC drivers for
@@ -89,7 +89,7 @@
{
skip "Known to fail using Oracle's ODBC drivers 8.x and 9.x", 1 if (!$rc && $dbname =~ /Oracle/i);
- ok($rc, "insert #3 various test data data with dates");
+ ok($rc, "insert #3 various test data data with dates"); # 5
};
ODBCTEST::tab_delete($dbh);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/t/12blob.t new/DBD-ODBC-1.19/t/12blob.t
--- old/DBD-ODBC-1.18/t/12blob.t 1970-01-01 01:00:00.000000000 +0100
+++ new/DBD-ODBC-1.19/t/12blob.t 2009-04-02 14:29:14.000000000 +0200
@@ -0,0 +1,136 @@
+#!/usr/bin/perl -w -I./t
+# $Id: 12blob.t 12667 2009-04-02 10:54:56Z mjevans $
+#
+# blob tests
+# currently tests you can insert a clob with various odbc_putdata_start settings
+#
+use Test::More;
+use strict;
+$| = 1;
+
+my $has_test_nowarnings = 1;
+eval "require Test::NoWarnings";
+$has_test_nowarnings = undef if $@;
+my $tests = 21;
+$tests += 1 if $has_test_nowarnings;
+plan tests => $tests;
+
+# can't seem to get the imports right this way
+use DBI qw(:sql_types);
+use_ok('ODBCTEST');
+
+# to help ActiveState's build process along by behaving (somewhat) if a dsn is not provided
+BEGIN {
+ if (!defined $ENV{DBI_DSN}) {
+ plan skip_all => "DBI_DSN is undefined";
+ }
+}
+END {
+ Test::NoWarnings::had_no_warnings()
+ if ($has_test_nowarnings);
+}
+
+my $ev;
+
+my $dbh = DBI->connect();
+unless($dbh) {
+ BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
+ exit 0;
+}
+
+my $putdata_start = $dbh->{odbc_putdata_start};
+is($putdata_start, 32768, 'default putdata_start');
+
+my $sth = $dbh->func(SQL_ALL_TYPES, 'GetTypeInfo');
+ok($sth, "GetTypeInfo");
+
+my ($type_name, $type);
+
+while (my @row = $sth->fetchrow) {
+ #diag("$row[0], $row[1], $row[2]");
+ next if (($row[1] != SQL_WLONGVARCHAR) && ($row[1] != SQL_LONGVARCHAR));
+ if ($row[2] > 60000) {
+ #diag("$row[0] $row[1] $row[2]");
+ ($type_name, $type) = ($row[0], $row[1]);
+ $sth->finish;
+ last;
+ }
+}
+SKIP: {
+ skip "ODBC Driver/Database has not got a big enough type", 18
+ if (!$type_name);
+
+ #diag("Using type $type_name");
+ eval { $dbh->do(qq/create table DBD_ODBC_drop_me(a $type_name)/); };
+ $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, "table DBD_ODBC_drop_me created");
+
+ SKIP: {
+ skip "Cannot create test table", 17 if $ev;
+
+ my $bigval = "x" x 30000;
+ test($dbh, $bigval);
+
+ test($dbh, $bigval, 500);
+
+ $bigval = 'x' x 60000;
+ test($dbh, $bigval, 60001);
+ };
+};
+
+sub test
+{
+ my ($dbh, $val, $putdata_start) = @_;
+ my $rc;
+
+ if ($putdata_start) {
+ $dbh->{odbc_putdata_start} = $putdata_start;
+ my $pds = $dbh->{odbc_putdata_start};
+ is($pds, $putdata_start, "retrieved putdata_start = set value");
+ }
+
+ $sth = $dbh->prepare(q/insert into DBD_ODBC_drop_me values(?)/);
+ ok($sth, "prepare for insert");
+ $rc = $sth->execute($val);
+ ok($rc, "insert clob");
+ SKIP: {
+ skip "insert failed - skipping the retrieval test", 2 unless $rc;
+
+ test_value($dbh, $val);
+ };
+
+ eval {$dbh->do(q/delete from DBD_ODBC_drop_me/); };
+ $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, 'delete records from test table');
+
+ return;
+}
+
+sub test_value
+{
+ my ($dbh, $value) = @_;
+
+ local $dbh->{RaiseError} = 1;
+ my $max = 60001;
+ $max = 120001 if ($type == SQL_WLONGVARCHAR);
+ local $dbh->{LongReadLen} = $max;
+
+ my $row = $dbh->selectall_arrayref(q/select a from DBD_ODBC_drop_me/);
+ $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, 'select test data back');
+
+ is($row->[0]->[0], $value, 'data read back compares');
+
+ return;
+}
+
+END {
+ if ($dbh) {
+ local $dbh->{PrintError} = 0;
+ local $dbh->{PrintWarn} = 0;
+ eval {$dbh->do(q/drop table DBD_ODBC_drop_me/);};
+ };
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/DBD-ODBC-1.18/t/20SqlServer.t new/DBD-ODBC-1.19/t/20SqlServer.t
--- old/DBD-ODBC-1.18/t/20SqlServer.t 2008-10-10 15:30:03.000000000 +0200
+++ new/DBD-ODBC-1.19/t/20SqlServer.t 2009-03-31 16:08:56.000000000 +0200
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w -I./t
-# $Id: 20SqlServer.t 11955 2008-10-10 13:30:04Z mjevans $
+# $Id: 20SqlServer.t 12639 2009-03-27 20:23:07Z mjevans $
use Test::More;
use strict;
@@ -9,7 +9,7 @@
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;
-my $tests = 53;
+my $tests = 65;
$tests += 1 if $has_test_nowarnings;
plan tests => $tests;
@@ -31,18 +31,21 @@
my $dbms_name;
my $dbms_version;
my $m_dbmsversion;
+my $driver_name;
sub getinfo
{
my $dbh = shift;
- my $dbms_name = $dbh->get_info(17);
+ $dbms_name = $dbh->get_info(17);
ok($dbms_name, "got DBMS name: $dbms_name");
- my $dbms_version = $dbh->get_info(18);
+ $dbms_version = $dbh->get_info(18);
ok($dbms_version, "got DBMS version: $dbms_version");
$m_dbmsversion = $dbms_version;
$m_dbmsversion =~ s/^(\d+).*/$1/;
ok($m_dbmsversion, "got DBMS major version: $m_dbmsversion");
+ $driver_name = $dbh->get_info(6);
+ ok($driver_name, "got Driver Name: $driver_name");
}
sub varmax_test
@@ -87,8 +90,96 @@
};
};
};
- eval {$dbh->do(q/drop table PERL_DBD_TABLE1/);};
+ eval {
+ local $dbh->{PrintError} = 0;
+ local $dbh->{RaiseError} = 0;
+ $dbh->do(q/drop table PERL_DBD_TABLE1/);
+ };
}
+
+sub _do_proc
+{
+ my ($dbh, $proc) = @_;
+
+ my $sth;
+
+ eval {$sth = $dbh->prepare($proc, {odbc_exec_direct => 1})};
+ my $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, "prepare for $proc");
+
+ SKIP: {
+ skip "prepare for $proc failed", 3 if $ev;
+ SKIP: {
+ eval {$sth->execute};
+ $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, "execute for $proc");
+
+ SKIP: {
+ skip "execute for $proc failed", 2 if $ev;
+
+ my $fields;
+ eval {$fields = $sth->{NUM_OF_FIELDS}};
+ $ev = $@;
+ diag($ev) if $ev;
+ ok(!$ev, "NUM_OF_FIELDS for $proc");
+ like($fields, qr|^\d+$|, "numeric fields");
+ };
+ $sth->finish;
+ };
+ };
+}
+
+sub procs_with_no_results
+{
+ my $dbh = shift;
+
+ local $dbh->{PrintError} = 0;
+
+ eval {$dbh->do(q/drop procedure PERL_DBD_PROC1/)};
+ eval {$dbh->do(q/drop procedure PERL_DBD_PROC2/)};
+
+ my $proc1 = <