r34201 - in /trunk/libdbd-odbc-perl: Changes META.yml Makefile.PL ODBC.pm dbdimp.c dbdimp.h debian/changelog t/12blob.t t/20SqlServer.t t/ODBCTEST.pm t/rt_38977.t t/rt_39841.t

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Mon Apr 27 14:12:13 UTC 2009


Author: bricas-guest
Date: Mon Apr 27 14:12:07 2009
New Revision: 34201

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34201
Log:
New upstream release

Modified:
    trunk/libdbd-odbc-perl/Changes
    trunk/libdbd-odbc-perl/META.yml
    trunk/libdbd-odbc-perl/Makefile.PL
    trunk/libdbd-odbc-perl/ODBC.pm
    trunk/libdbd-odbc-perl/dbdimp.c
    trunk/libdbd-odbc-perl/dbdimp.h
    trunk/libdbd-odbc-perl/debian/changelog
    trunk/libdbd-odbc-perl/t/12blob.t
    trunk/libdbd-odbc-perl/t/20SqlServer.t
    trunk/libdbd-odbc-perl/t/ODBCTEST.pm
    trunk/libdbd-odbc-perl/t/rt_38977.t
    trunk/libdbd-odbc-perl/t/rt_39841.t

Modified: trunk/libdbd-odbc-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/Changes?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/Changes (original)
+++ trunk/libdbd-odbc-perl/Changes Mon Apr 27 14:12:07 2009
@@ -2,7 +2,7 @@
 
 DBD::ODBC::Changes - Log of significant changes to the DBD::ODBC
 
-(As of $LastChangedDate: 2009-04-02 11:54:56 +0100 (Thu, 02 Apr 2009) $ $Revision: 10667 $)
+(As of $LastChangedDate: 2009-04-20 16:21:32 +0100 (Mon, 20 Apr 2009) $ $Revision: 10667 $)
 
 =cut
 
@@ -43,6 +43,35 @@
 
 =head1 CHANGES
 
+=head2 Changes in DBD::ODBC 1.20 April 7, 2009
+
+Fix bug in handling of SQL_WLONGVARCHAR when not built with unicode
+support.  The column was not identified as a long column and hence the
+size of the column was not restricted to LongReadLen. Can cause
+DBD::ODBC to attempt to allocate a huge amount of memory.
+
+Minor changes to Makefile.PL to help diagnose how it decided which
+driver manager to use and where it was found.
+
+Offer suggestion to debian-based systems when some of unixODBC is
+found (the bin part) but the development part is missing.
+
+In 20SqlServer.t attempt to drop any procedures we created if they
+still exist at the end of the test. Reported by Michael Higgins.
+
+In 12blob.t separate code to delete test table into sub and call at
+being and end, handle failures from prepare there were two ENDs.
+
+In ODBCTEST.pm when no acceptable test column type is found output all
+the found types and BAIL_OUT the entire test.
+
+Skip rt_39841.t unless actually using the SQL Server ODBC driver or
+native client.
+
+Handle drivers which return 0 for SQL_MAX_COLUMN_NAME_LEN.
+
+Double the buffer size used for column names if built with unicode.
+
 =head2 Changes in DBD::ODBC 1.19 April 2, 2009
 
 Some minor diagnostic output during tests when running against freeTDS
@@ -60,10 +89,10 @@
 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
+In 20SqlServer.t fix skip count and an erroneous assignment for
 driver_name.
 
-Changes some if tests to Test::More->is tests in 02simple.t.
+Change 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

Modified: trunk/libdbd-odbc-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/META.yml?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/META.yml (original)
+++ trunk/libdbd-odbc-perl/META.yml Mon Apr 27 14:12:07 2009
@@ -1,7 +1,7 @@
 --- #YAML:1.0
 name: DBD-ODBC
 abstract: ODBC DBD for Perl DBI
-version: 1.19
+version: 1.20
 version_from: ODBC.pm
 author:
   - Tim Bunce

Modified: trunk/libdbd-odbc-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/Makefile.PL?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/Makefile.PL (original)
+++ trunk/libdbd-odbc-perl/Makefile.PL Mon Apr 27 14:12:07 2009
@@ -1,6 +1,6 @@
 #!/usr/local/bin/perl -w
 #
-# $Id: Makefile.PL 12667 2009-04-02 10:54:56Z mjevans $
+# $Id: Makefile.PL 12710 2009-04-20 15:21:32Z 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.
@@ -242,33 +242,43 @@
             # exist until 2.2.11 and it was broken wrt --cflags in 2.2.11/2.2.12
             # i.e. --cflags did not include -I/xxx/yyy
             my $odbc_config_v = `odbc_config --version 2>&1`;
+            print "Looking for odbc_config\n";
             if ($odbc_config_v && ($odbc_config_v =~ /^(\d\.)+/)) {
+                print "  Found odbc_config versions $odbc_config_v\n";
                 $odbchome = `odbc_config --prefix 2>&1`;
+                print "  odbc_config reports --prefix=$odbchome\n";
                 chomp $odbchome;
                 if ((-e $odbchome) && (-e "$odbchome/include") &&
                         (-f "$odbchome/include/sql.h") &&
                             (-f "$odbchome/include/sqlext.h") &&
                                 (-f "$odbchome/include/sqltypes.h")) {
-                    print "Set ODBCHOME to $odbchome from odbc_config\n";
+                    print "  Set ODBCHOME to $odbchome from odbc_config\n";
                 } else {
+                    print "  but cannot find header files in that path so ignoring\n";
                     $odbchome = '';
                 }
+            } else {
+                print "  odbc_config not found - ok, there are other things I can do\n";
             }
             if (!$odbchome) {
+                print "Still trying to guess ODBCHOME - looking for headers now\n";
                 if (-f '/usr/include/sql.h' &&
                         -f '/usr/include/sqlext.h' &&
                             -f '/usr/include/sqltypes.h') {
+                    print "  Found sql header files in /use/include\n";
                     $odbchome = '/usr';
                 } elsif (-f '/usr/local/include/sql.h' &&
                              -f '/usr/local/include/sqlext.h' &&
                                  -f '/usr/local/include/sqltypes.h') {
+                    print "  Found sql header files in /use/local/include\n";
                     $odbchome = '/usr/local';
                 } elsif (-d '/usr/local/easysoft/unixODBC') {
+                    print "  Found sql header files in /use/local/easysoft/include\n";
                     $odbchome = '/usr/local/easysoft/unixODBC';
                 }
             }
         }
-        print "Found what looks like a driver manager in $odbchome\n"
+        print "Found what looks like a driver manager files in $odbchome\n"
             if $odbchome;
     }
 
@@ -304,7 +314,7 @@
             my @lines = <$fh>;
             my @found = grep(/iODBC driver manager/i, @lines);
             if (scalar(@found)) {
-                die "\n\nDBD::ODBC does not support unicode on darwin with iODBC and this looks like iODBC. The iODBC driver manager expects wide characters to be 4 bytes long and DBD::ODBC wants wide characters to be UTF16.\nEither\no) Rerun without the -u switch\no) complain to the producer of your ODBC driver manager\no) get another ODBC driver manager (like unixODBC).\n\n";
+                die "\n\nDBD::ODBC does not support unicode with iODBC and this looks like iODBC. The iODBC driver manager expects wide characters to be 4 bytes long and DBD::ODBC wants wide characters to be UTF16.\nEither\no) Rerun without the -u switch\no) complain to the producer of your ODBC driver manager\no) get another ODBC driver manager (like unixODBC).\n\n";
             }
             close $fh;
         }
@@ -430,14 +440,18 @@
     elsif ($myodbc eq 'unixodbc') {
         # if we find odbcinst, output useful info about this version of unixODBC
         # and store unixODBC version
+        print "Look for odbcinst\n";
         if (-x "$odbchome/bin/odbcinst") {
             my $j = `$odbchome/bin/odbcinst -j 2>&1`;
-            print "odbcinst -j reports:\n\n$j\n" if $j;
+            print "  odbcinst -j reports:\n\n$j\n" if $j;
             if ($j =~ /^unixODBC ([\d\.]+).*/ ) {
                 $myodbc_version = $1;
             }
+        } else {
+            print "  odbcinst not found - ok, I can deal with that.\n";
         }
         # if we find odbc_config add --cflags output to CC line
+        print "Looking for odbc_config\n";
         if (-x "$odbchome/bin/odbc_config") {
             my @args = qw(--prefix --include-prefix --lib-prefix --version --odbcversion);
             for my $oca (@args) {
@@ -455,10 +469,17 @@
                 print qq/Adding odbc_config --cflags "$cf" to CC line\n/;
                 $opts{DEFINE} .= " $cf";
             }
+        } else {
+            print "  odbc_config not found - ok\n";
         }
-	my @ilibs = glob "$odbchome/lib/libodbc.*";
-	@ilibs = grep { /\.($Config{so}|$Config{dlext}|a)$/ } @ilibs;
-	die "That's odd, I can't see any unixodbc libs in $odbchome" unless @ilibs;
+	my @libs = glob "$odbchome/lib/libodbc.*";
+	my @ilibs = grep { /\.($Config{so}|$Config{dlext}|a)$/ } @libs;
+        if (scalar(@ilibs) == 0) {
+            die "That's odd, I can't see any unixodbc libs in $odbchome." .
+                "This is all I found:\n" . join(",", @libs) . "\n" .
+                "Perhaps you need to install the unixODBC development " .
+                "package, often called unixodbc-dev.";
+        }
 	print << "EOT";
 
 We expect to find the sql.h, sqlext.h, sqltypes.h and sqlucode.h (which were

Modified: trunk/libdbd-odbc-perl/ODBC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/ODBC.pm?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/ODBC.pm (original)
+++ trunk/libdbd-odbc-perl/ODBC.pm Mon Apr 27 14:12:07 2009
@@ -1,4 +1,4 @@
-# $Id: ODBC.pm 12667 2009-04-02 10:54:56Z mjevans $
+# $Id: ODBC.pm 12674 2009-04-07 09:04:09Z mjevans $
 #
 # Copyright (c) 1994,1995,1996,1998  Tim Bunce
 # portions Copyright (c) 1997-2004  Jeff Urlwin
@@ -12,7 +12,7 @@
 
 require 5.006;
 
-$DBD::ODBC::VERSION = '1.19';
+$DBD::ODBC::VERSION = '1.20';
 
 {
     package DBD::ODBC;
@@ -23,7 +23,7 @@
 
     @ISA = qw(Exporter DynaLoader);
 
-    # my $Revision = substr(q$Id: ODBC.pm 12667 2009-04-02 10:54:56Z mjevans $, 13,2);
+    # my $Revision = substr(q$Id: ODBC.pm 12674 2009-04-07 09:04:09Z mjevans $, 13,2);
 
     require_version DBI 1.21;
 

Modified: trunk/libdbd-odbc-perl/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/dbdimp.c?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/dbdimp.c (original)
+++ trunk/libdbd-odbc-perl/dbdimp.c Mon Apr 27 14:12:07 2009
@@ -1,4 +1,4 @@
-/* $Id: dbdimp.c 12667 2009-04-02 10:54:56Z mjevans $
+/* $Id: dbdimp.c 12710 2009-04-20 15:21:32Z mjevans $
  *
  * portions Copyright (c) 1994,1995,1996,1997  Tim Bunce
  * portions Copyright (c) 1997 Thomas K. Wenrich
@@ -1942,7 +1942,7 @@
         dbd_error(h, rc, "dbd_describe/SQLNumResultCols");
         return 0;
     } else if (DBIc_TRACE(imp_sth, 0, 0, 4))
-        TRACE1(imp_sth, "    dbd_describe SQLNumResultCols=0 (rows=%d)\n",
+        TRACE1(imp_sth, "    dbd_describe SQLNumResultCols=0 (columns=%d)\n",
                num_fields);
 
     /*
@@ -2043,8 +2043,9 @@
                             (SQLSMALLINT)imp_dbh->max_column_name_len,
                             &fbh->ColNameLen,
                             &fbh->ColSqlType,
+                            /* column size or precision depending on type */
                             &fbh->ColDef,
-                            &fbh->ColScale,
+                            &fbh->ColScale,     /* decimal digits */
                             &fbh->ColNullable);
 #endif /* WITH_UNICODE */
         if (!SQL_SUCCEEDED(rc)) {	/* should never fail */
@@ -2056,14 +2057,15 @@
         cur_col_name += fbh->ColNameLen * sizeof(SQLWCHAR);
 #else
         cur_col_name += fbh->ColNameLen + 1;
-        cur_col_name[fbh->ColNameLen] = '\0';
+        cur_col_name[fbh->ColNameLen] = '\0';   /* should not be necessary */
 #endif
 #ifdef SQL_COLUMN_DISPLAY_SIZE
         if (DBIc_TRACE(imp_sth, 0, 0, 8))
             PerlIO_printf(DBIc_LOGPIO(imp_dbh),
                           "   DescribeCol column = %d, name = %s, "
-                          "len = %d, type = %s(%d), "
-                          "column size = %ld, scale = %d, nullable = %d\n",
+                          "namelen = %d, type = %s(%d), "
+                          "precision/column size = %ld, scale = %d, "
+                          "nullable = %d\n",
                           i+1, fbh->ColName,
                           fbh->ColNameLen,
                           S_SqlTypeToString(fbh->ColSqlType),
@@ -2200,9 +2202,11 @@
             /* MS SQL returns bytes, Oracle returns characters ... */
             fbh->ColLength*=sizeof(SQLWCHAR);
             fbh->ColDisplaySize = DBIc_LongReadLen(imp_sth)+1;
+# else
+            fbh->ColDisplaySize = DBIc_LongReadLen(imp_sth) + 1;
+# endif	/* WITH_UNICODE */
             break;
-# endif	/* WITH_UNICODE */
-#endif
+#endif  /* SQL_WLONGVARCHAR */
           case SQL_VARCHAR:
             if (fbh->ColDef == 0) {
                 fbh->ColDisplaySize = DBIc_LongReadLen(imp_sth)+1;
@@ -2284,6 +2288,11 @@
                                     sizeof(int))) % sizeof(int);
 
         /* Bind output column variables */
+        if (DBIc_TRACE(imp_sth, 0, 0, 4))
+            PerlIO_printf(DBIc_LOGPIO(imp_dbh),
+                          "Bind %d: type = %s(%d), buf=%p, buflen=%ld\n",
+                          i+1, S_SqlTypeToString(fbh->ftype), fbh->ftype,
+                          fbh->data, fbh->ColDisplaySize);
         rc = SQLBindCol(imp_sth->hstmt,
                         (SQLSMALLINT)(i+1),
                         fbh->ftype, fbh->data,
@@ -2748,7 +2757,7 @@
       if (DBIc_TRACE(imp_sth, 0, 0, 4))
 	 PerlIO_printf(
              DBIc_LOGPIO(imp_dbh), "    fetch col#%d %s datalen=%d displ=%d\n",
-             i, fbh->ColName, fbh->datalen, fbh->ColDisplaySize);
+             i+1, fbh->ColName, fbh->datalen, fbh->ColDisplaySize);
 
       if (fbh->datalen == SQL_NULL_DATA) {	/* NULL value		*/
 	 SvOK_off(sv);
@@ -5211,6 +5220,8 @@
            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 if (strcmp(imp_dbh->odbc_driver_name, "esoobclient") == 0) {
+           imp_dbh->driver_type = DT_ES_OOB;
        } else {
            imp_dbh->driver_type = DT_DONT_CARE;
        }
@@ -5236,16 +5247,22 @@
    if (!SQL_SUCCEEDED(rc)) {
       dbd_error(dbh, rc, "post_connect/SQLGetInfo(MAX_COLUMN_NAME_LEN)");
       imp_dbh->max_column_name_len = 256;
+   } else if (imp_dbh->max_column_name_len == 0) {
+      imp_dbh->max_column_name_len = 256;
    } else {
        if (DBIc_TRACE(imp_dbh, 0x04000000, 0, 0))
            TRACE1(imp_dbh, "MAX_COLUMN_NAME_LEN = %d\n",
                   imp_dbh->max_column_name_len);
    }
-   if (imp_dbh->max_column_name_len > 256) {
-       imp_dbh->max_column_name_len = 256;
+#ifdef WITH_UNICODE
+   imp_dbh->max_column_name_len = imp_dbh->max_column_name_len *
+       sizeof(SQLWCHAR) + 2;
+#endif
+   if (imp_dbh->max_column_name_len > 512) {
+       imp_dbh->max_column_name_len = 512;
        DBIh_SET_ERR_CHAR(
            dbh, (imp_xxh_t*)imp_drh, "0", 1,
-           "Max column name length pegged at 256", Nullch, Nullch);
+           "Max column name length pegged at 512", Nullch, Nullch);
    }
 
    /* default ignoring named parameters to false */

Modified: trunk/libdbd-odbc-perl/dbdimp.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/dbdimp.h?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/dbdimp.h (original)
+++ trunk/libdbd-odbc-perl/dbdimp.h Mon Apr 27 14:12:07 2009
@@ -1,5 +1,5 @@
 /*
- * $Id: dbdimp.h 12667 2009-04-02 10:54:56Z mjevans $
+ * $Id: dbdimp.h 12710 2009-04-20 15:21:32Z mjevans $
  * portions Copyright (c) 2007-2008 Martin J. Evans
  * Copyright (c) 1997-2001 Jeff Urlwin
  * portions Copyright (c) 1997  Thomas K. Wenrich
@@ -83,7 +83,8 @@
         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 */
+        DT_MS_ACCESS_ACE,                          /* ACEODBC.DLL */
+        DT_ES_OOB                                  /* Easysoft OOB */
     } driver_type;
     char odbc_driver_name[80];
     char odbc_driver_version[20];

Modified: trunk/libdbd-odbc-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/debian/changelog?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/debian/changelog (original)
+++ trunk/libdbd-odbc-perl/debian/changelog Mon Apr 27 14:12:07 2009
@@ -1,3 +1,9 @@
+libdbd-odbc-perl (1.20-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Brian Cassidy <brian.cassidy at gmail.com>  Mon, 27 Apr 2009 11:11:24 -0300
+
 libdbd-odbc-perl (1.19-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libdbd-odbc-perl/t/12blob.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/t/12blob.t?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/t/12blob.t (original)
+++ trunk/libdbd-odbc-perl/t/12blob.t Mon Apr 27 14:12:07 2009
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w -I./t
-# $Id: 12blob.t 12667 2009-04-02 10:54:56Z mjevans $
+# $Id: 12blob.t 12710 2009-04-20 15:21:32Z mjevans $
 #
 # blob tests
 # currently tests you can insert a clob with various odbc_putdata_start settings
@@ -15,28 +15,42 @@
 $tests += 1 if $has_test_nowarnings;
 plan tests => $tests;
 
+my $dbh;
+
 # 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
+sub tidyup {
+    if ($dbh) {
+        #diag "Tidying up\n";
+        eval {
+            local $dbh->{PrintWarn} = 0;
+            local $dbh->{PrintError} = 0;
+            $dbh->do(q/drop table DBD_ODBC_drop_me/);
+        };
+    }
+}
+
 BEGIN {
    if (!defined $ENV{DBI_DSN}) {
       plan skip_all => "DBI_DSN is undefined";
    }
 }
 END {
+    tidyup();
     Test::NoWarnings::had_no_warnings()
           if ($has_test_nowarnings);
 }
 
 my $ev;
 
-my $dbh = DBI->connect();
+$dbh = DBI->connect();
 unless($dbh) {
    BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
    exit 0;
 }
+tidyup();
 
 my $putdata_start = $dbh->{odbc_putdata_start};
 is($putdata_start, 32768, 'default putdata_start');
@@ -92,14 +106,19 @@
 
     $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;
+        skip "prepare failed", 3 unless $sth;
 
-        test_value($dbh, $val);
+        $rc  = $sth->execute($val);
+        ok($rc, "insert clob");
+
+      SKIP: {
+            skip "insert failed - skipping the retrieval test", 2 unless $rc;
+
+            test_value($dbh, $val);
+        };
     };
-
+    $sth = undef;
     eval {$dbh->do(q/delete from DBD_ODBC_drop_me/); };
     $ev = $@;
     diag($ev) if $ev;
@@ -126,11 +145,3 @@
 
     return;
 }
-
-END {
-    if ($dbh) {
-        local $dbh->{PrintError} = 0;
-        local $dbh->{PrintWarn} = 0;
-        eval {$dbh->do(q/drop table DBD_ODBC_drop_me/);};
-    };
-};

Modified: trunk/libdbd-odbc-perl/t/20SqlServer.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/t/20SqlServer.t?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/t/20SqlServer.t (original)
+++ trunk/libdbd-odbc-perl/t/20SqlServer.t Mon Apr 27 14:12:07 2009
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w -I./t
-# $Id: 20SqlServer.t 12639 2009-03-27 20:23:07Z mjevans $
+# $Id: 20SqlServer.t 12672 2009-04-07 08:59:17Z mjevans $
 
 use Test::More;
 use strict;
@@ -13,6 +13,8 @@
 $tests += 1 if $has_test_nowarnings;
 plan tests => $tests;
 
+my $dbh;
+
 # use_ok('DBI', qw(:sql_types));
 # can't seem to get the imports right this way
 use DBI qw(:sql_types);
@@ -24,6 +26,14 @@
         if (!defined $ENV{DBI_DSN});
 }
 END {
+    if ($dbh) {
+        local $dbh->{PrintError} = 0;
+        local $dbh->{PrintWarn} = 0;
+        eval {
+            $dbh->do(q/drop procedure PERL_DBD_PROC1/);
+            $dbh->do(q/drop procedure PERL_DBD_PROC2/);
+        };
+    }
     Test::NoWarnings::had_no_warnings()
           if ($has_test_nowarnings);
 }
@@ -205,7 +215,7 @@
    return 1;
 }
 
-my $dbh = DBI->connect();
+$dbh = DBI->connect();
 unless($dbh) {
    BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
    exit 0;

Modified: trunk/libdbd-odbc-perl/t/ODBCTEST.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/t/ODBCTEST.pm?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/t/ODBCTEST.pm (original)
+++ trunk/libdbd-odbc-perl/t/ODBCTEST.pm Mon Apr 27 14:12:07 2009
@@ -51,6 +51,7 @@
       my @row;
       my $sth;
       foreach $type (@{ $TestFieldInfo{$column} }) {
+          #diag("Looking for type $type\n");
 	 $sth = $dbh->func($type, GetTypeInfo);
 	    # may not be correct behavior, but get the first compat type
 	 if ($sth) {
@@ -61,8 +62,14 @@
 		    # warn "Unable to get type for type $type\n";
 	 }
       }
-      die "Unable to find a suitable test type for field $column"
-	    unless @row;
+      if (scalar(@row) == 0) {
+          my $types = $dbh->type_info_all;
+          foreach my $t (@$types) {
+              next if ref($t) ne 'ARRAY';
+              diag(join(",", map{$_ ? $_ : "undef"} @$t). "\n");
+          }
+          BAIL_OUT("Unable to find a suitable test type for field $column");
+      }
 	# warn join(", ", at row);
       return @row;
    }

Modified: trunk/libdbd-odbc-perl/t/rt_38977.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/t/rt_38977.t?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/t/rt_38977.t (original)
+++ trunk/libdbd-odbc-perl/t/rt_38977.t Mon Apr 27 14:12:07 2009
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w -I./t
-# $Id: rt_38977.t 12185 2008-12-19 19:39:22Z mjevans $
+# $Id: rt_38977.t 12710 2009-04-20 15:21:32Z mjevans $
 #
 # test varbinary(MAX) and varchar(MAX) types in SQL Server
 #
@@ -58,6 +58,7 @@
 
 SKIP: {
     skip "not SQL Server", 6 if $dbms_name !~ /Microsoft SQL Server/;
+    skip "Easysoft OOB", 6 if $driver_name =~ /esoobclient/;
     my $major_version = $dbms_version;
     $major_version =~ s/^(\d+)\..*$/$1/;
     #diag("Major Version: $major_version\n");

Modified: trunk/libdbd-odbc-perl/t/rt_39841.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbd-odbc-perl/t/rt_39841.t?rev=34201&op=diff
==============================================================================
--- trunk/libdbd-odbc-perl/t/rt_39841.t (original)
+++ trunk/libdbd-odbc-perl/t/rt_39841.t Mon Apr 27 14:12:07 2009
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w -I./t
-# $Id: rt_39841.t 12185 2008-12-19 19:39:22Z mjevans $
+# $Id: rt_39841.t 12710 2009-04-20 15:21:32Z mjevans $
 #
 # Test fix for rt 39841 - problem with SQLDecribeParam in MS SQL Server
 #
@@ -53,11 +53,17 @@
 my $dbms_version = $dbh->get_info(18);
 #3
 ok($dbms_version, "got DBMS version: $dbms_version");
+my $driver_name = DBI::neat($dbh->get_info(6));
 
 my ($ev, $sth);
 
 SKIP: {
     skip "not SQL Server", 25 if $dbms_name !~ /Microsoft SQL Server/;
+    skip "not SQL Server ODBC or native client driver", 25
+        if ($driver_name !~ /SQLSRV32.DLL/oi) &&
+            ($driver_name !~ /sqlncli10.dll/oi) &&
+                ($driver_name !~ /SQLNCLI>DLL/oi);
+
     my $major_version = $dbms_version;
 
     eval {




More information about the Pkg-perl-cvs-commits mailing list