r34395 - in /branches/upstream/libdbd-odbc-perl/current: Changes FAQ MANIFEST META.yml ODBC.pm dbdimp.c t/02simple.t t/12blob.t test_results.txt

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Thu Apr 30 12:27:17 UTC 2009


Author: bricas-guest
Date: Thu Apr 30 12:27:12 2009
New Revision: 34395

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=34395
Log:
[svn-upgrade] Integrating new upstream version, libdbd-odbc-perl (1.21)

Added:
    branches/upstream/libdbd-odbc-perl/current/test_results.txt
Modified:
    branches/upstream/libdbd-odbc-perl/current/Changes
    branches/upstream/libdbd-odbc-perl/current/FAQ
    branches/upstream/libdbd-odbc-perl/current/MANIFEST
    branches/upstream/libdbd-odbc-perl/current/META.yml
    branches/upstream/libdbd-odbc-perl/current/ODBC.pm
    branches/upstream/libdbd-odbc-perl/current/dbdimp.c
    branches/upstream/libdbd-odbc-perl/current/t/02simple.t
    branches/upstream/libdbd-odbc-perl/current/t/12blob.t

Modified: branches/upstream/libdbd-odbc-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/Changes?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/Changes (original)
+++ branches/upstream/libdbd-odbc-perl/current/Changes Thu Apr 30 12:27:12 2009
@@ -43,7 +43,20 @@
 
 =head1 CHANGES
 
-=head2 Changes in DBD::ODBC 1.20 April 7, 2009
+=head2 Changes in DBD::ODBC 1.21 April 27, 2009
+
+Change 02simple test to output Perl, DBI and DBD::ODBC versions.
+
+Fixed bug where if ODBC driver supports SQLDescribeParam and it
+succeeds for a parameterised query but you override the parameter
+type, DBD::ODBC was still using the size returned by
+SQLDescribeParam. Thanks to Brian Becker for finding, diagnosing and
+fixing this issue.
+
+Added FAQ entry about SQL Server and calling procedures with named
+parameters out of order.
+
+=head2 Changes in DBD::ODBC 1.20 April 20, 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

Modified: branches/upstream/libdbd-odbc-perl/current/FAQ
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/FAQ?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/FAQ (original)
+++ branches/upstream/libdbd-odbc-perl/current/FAQ Thu Apr 30 12:27:12 2009
@@ -524,6 +524,36 @@
 error e.g., if you attempt to bind a non-datetime string to a datetime
 column or a non-numeric string to a numeric column.
 
+=head2 Why do I get strange results with SQL Server and named parameters?
+
+If you are using a MS SQL Server driver and named parameters to
+procedures be very careful to use then in the sasme order they are
+defined in the procedure. i.e., if you have a procedure like this:
+
+  create procedure test
+        @param1 varchar(50),
+        @param2 smallint
+  as
+  begin
+  ..
+  end
+
+then ensure if you call it using named parameters you specify them in
+the same order they are declared:
+
+  exec test @param1=?, at param2=?
+
+and not
+
+  exec test @param2=?, at param1=?
+
+The reason for this is that all SQL Server drivers we have seen
+describe procedures parameters in the order they are declared and
+ignore the order they are used in the SQL. If you specify them out of
+order DBD::ODBC will get details on p1 which are really for p2
+etc. This can lead to data truncation errors and all sort of other
+problems it is impossible for DBD::ODBC spot or workaround.
+
 =head1 AUTHOR
 
 Parts of this document were written by Tim Bunce,

Modified: branches/upstream/libdbd-odbc-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/MANIFEST?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/MANIFEST (original)
+++ branches/upstream/libdbd-odbc-perl/current/MANIFEST Thu Apr 30 12:27:12 2009
@@ -10,6 +10,7 @@
 Makefile.PL
 MANIFEST			This list of files
 META.yml
+test_results.txt
 examples/cancel.pl
 examples/coltest.pl
 examples/contest.pl

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

Modified: branches/upstream/libdbd-odbc-perl/current/ODBC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/ODBC.pm?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/ODBC.pm (original)
+++ branches/upstream/libdbd-odbc-perl/current/ODBC.pm Thu Apr 30 12:27:12 2009
@@ -12,7 +12,7 @@
 
 require 5.006;
 
-$DBD::ODBC::VERSION = '1.20';
+$DBD::ODBC::VERSION = '1.21';
 
 {
     package DBD::ODBC;

Modified: branches/upstream/libdbd-odbc-perl/current/dbdimp.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/dbdimp.c?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/dbdimp.c (original)
+++ branches/upstream/libdbd-odbc-perl/current/dbdimp.c Thu Apr 30 12:27:12 2009
@@ -2290,7 +2290,7 @@
         /* 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",
+                          "    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,
@@ -3209,7 +3209,8 @@
    }
 
    if ((phs->describe_param_called == 1) &&
-       (SQL_SUCCEEDED(phs->describe_param_status))) {
+       (SQL_SUCCEEDED(phs->describe_param_status)) &&
+       (phs->requested_type == 0)) {            /* type not overriden */
        default_column_size = phs->param_size;
    } else {
        if ((phs->sql_type == SQL_VARCHAR) && !phs->is_inout) {

Modified: branches/upstream/libdbd-odbc-perl/current/t/02simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/t/02simple.t?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/t/02simple.t (original)
+++ branches/upstream/libdbd-odbc-perl/current/t/02simple.t Thu Apr 30 12:27:12 2009
@@ -3,6 +3,7 @@
 
 use Test::More;
 use strict;
+use Config;
 
 $| = 1;
 
@@ -38,6 +39,10 @@
 # Output DBMS which is useful when debugging cpan-testers output
 {
     diag("\n");
+    diag("Perl $Config{PERL_REVISION}.$Config{PERL_SUBVERSION}.$Config{PERL_VERSION}\n");
+    diag("osname=$Config{osname}, osvers=$Config{osvers}, archname=$Config{archname}\n");
+    diag("Using DBI $DBI::VERSION\n");
+    diag("Using DBD::ODBC $DBD::ODBC::VERSION\n");
     diag("Using DBMS_NAME " . DBI::neat($dbh->get_info(17)) . "\n");
     diag("Using DBMS_VER " . DBI::neat($dbh->get_info(18)) . "\n");
     $driver_name = DBI::neat($dbh->get_info(6));

Modified: branches/upstream/libdbd-odbc-perl/current/t/12blob.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/t/12blob.t?rev=34395&op=diff
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/t/12blob.t (original)
+++ branches/upstream/libdbd-odbc-perl/current/t/12blob.t Thu Apr 30 12:27:12 2009
@@ -11,7 +11,7 @@
 my $has_test_nowarnings = 1;
 eval "require Test::NoWarnings";
 $has_test_nowarnings = undef if $@;
-my $tests = 21;
+my $tests = 24;
 $tests += 1 if $has_test_nowarnings;
 plan tests => $tests;
 
@@ -141,7 +141,12 @@
     diag($ev) if $ev;
     ok(!$ev, 'select test data back');
 
-    is($row->[0]->[0], $value, 'data read back compares');
+    my $rc = is(length($row->[0]->[0]), length($value),
+                       "sizes of insert/select compare");
+  SKIP: {
+        skip "sizes do not match", 1 unless $rc;
+        is($row->[0]->[0], $value, 'data read back compares');
+    };
 
     return;
 }

Added: branches/upstream/libdbd-odbc-perl/current/test_results.txt
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdbd-odbc-perl/current/test_results.txt?rev=34395&op=file
==============================================================================
--- branches/upstream/libdbd-odbc-perl/current/test_results.txt (added)
+++ branches/upstream/libdbd-odbc-perl/current/test_results.txt Thu Apr 30 12:27:12 2009
@@ -1,0 +1,51 @@
+======================================================================
+t/01base................ok
+t/02simple..............ok 1/65#
+# Perl v5.9.5 built for MSWin32-x64-multi-thread
+# Using DBI 1.59
+# Using DBD::ODBC 1.20
+# Using DBMS_NAME 'Microsoft SQL Server'
+# Using DBMS_VER '09.00.3042'
+# Using DRIVER_NAME 'sqlncli10.dll'
+# Using DRIVER_VER '10.00.1049'
+# odbc_has_unicode 1
+t/02simple..............ok
+t/03dbatt...............ok 1/29#
+# N.B. Some drivers (postgres/cache) may return ODBC 2.0 column names for the SQ
+LTables result-set e.g. TABLE_QUALIFIER instead of TABLE_CAT
+t/03dbatt...............ok
+t/05meth................ok
+t/07bind................ok
+t/08bind2...............ok
+t/09multi...............ok
+t/10handler.............ok
+t/12blob................ok
+t/20SqlServer...........ok
+t/30Oracle..............ok
+        3/5 skipped: various reasons
+t/40UnicodeRoundTrip....ok
+t/41Unicode.............ok
+t/pod-coverage..........ok 1/1# Test::Pod::Coverage 1.04 required for testing PO
+D coverage
+t/pod-coverage..........ok
+t/pod...................ok
+        3/3 skipped: various reasons
+t/rt_38977..............ok
+t/rt_39841..............ok 1/28# [Microsoft][SQL Server Native Client 10.0]Inval
+id character value for cast specification (SQL-22018)
+# 22018
+#
+# NOTE: Your SQL Server ODBC driver has a bug which can describe parameters
+# in SQL using sub selects incorrectly. In this case a VARCHAR(8) parameter
+# is described as an INTEGER
+#
+# Checking you can work around bug in SQL Server ODBC Driver
+# Yes you can
+t/rt_39841..............ok
+        5/28 skipped: various reasons
+t/rt_39897..............ok
+t/rt_43384..............ok
+        7/9 skipped: various reasons
+All tests successful, 18 subtests skipped.
+Files=19, Tests=427, 11 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)
+======================================================================




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