New Upstream Snapshot - libdbd-odbc-perl

Ready changes

Summary

Merged new upstream version: 1.61+git20200217.2.74a88b4 (was: 1.61+git20200217.1.74a88b4).

Resulting package

Built on 2023-01-19T00:13 (took 15m38s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots libdbd-odbc-perl-dbgsymapt install -t fresh-snapshots libdbd-odbc-perl

Diff

diff --git a/Changes b/Changes
index c364591..0cd5b62 100644
--- a/Changes
+++ b/Changes
@@ -5,6 +5,19 @@ use strict;
 
 DBD::ODBC::Changes - Log of significant changes to the DBD::ODBC
 
+1.62_1 2020-02-16
+
+  [BUG FIXES]
+
+  Fix for issue 18. This is a significant change to the way binary columns are
+  bound as DBD::ODBC was pushing the bytes in a scalar PV instead of the code
+  points. If you bind input parameters as SQL_VARBINARY you will want to check
+  this carefully. NOTE: the change does not yet affect in/out bound parameters.
+
+  [ENHANCEMENTS]
+
+  A few changes to tests to support Postgres ODBC driver issues.
+
 1.61 2020-01-30
 
   [BUG FIXES]
diff --git a/META.yml b/META.yml
index 1da42cc..6bb91cf 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
 #--- #YAML:1.0
 name: DBD-ODBC
 abstract: ODBC DBD for Perl DBI
-version: 1.61
+version: 1.62_1
 version_from: ODBC.pm
 author:
   - Martin J. Evans <mjevans@cpan.org>
diff --git a/ODBC.pm b/ODBC.pm
index a2e9cc6..b026a06 100644
--- a/ODBC.pm
+++ b/ODBC.pm
@@ -18,7 +18,7 @@ require 5.008;
 # see discussion on dbi-users at
 # http://www.nntp.perl.org/group/perl.dbi.dev/2010/07/msg6096.html and
 # http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/
-$DBD::ODBC::VERSION = '1.61';
+$DBD::ODBC::VERSION = '1.62_1';
 
 {
     ## no critic (ProhibitMagicNumbers ProhibitExplicitISA)
@@ -671,7 +671,7 @@ DBD::ODBC - ODBC Driver for DBI
 
 =head1 VERSION
 
-This documentation refers to DBD::ODBC version 1.61.
+This documentation refers to DBD::ODBC version 1.62_1.
 
 
 =head1 WARNING
diff --git a/dbdimp.c b/dbdimp.c
index 8547c6e..a83f906 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -4444,6 +4444,9 @@ int dbd_bind_ph(
    char *name;
    char namebuf[30];
    phs_t *phs;
+   STRLEN binary_len;
+   char *binary;
+
    D_imp_dbh_from_sth;
    SQLSMALLINT sql_type;
 
@@ -4542,6 +4545,12 @@ int dbd_bind_ph(
        if (phs->sv == &PL_sv_undef)             /* (first time bind) */
            phs->sv = newSV(0);
        sv_setsv(phs->sv, newvalue);
+
+       if (sql_type == SQL_VARBINARY || sql_type == SQL_LONGVARBINARY) {
+           binary = SvPVbyte(newvalue, binary_len);
+           sv_setpvn(phs->sv, binary, binary_len);
+       }
+
        if (SvAMAGIC(phs->sv)) /* if it has any magic force to string */
                sv_pvn_force(phs->sv, &PL_na);
    } else if (newvalue != phs->sv) {
@@ -7711,6 +7720,10 @@ static void check_for_unicode_param(
             phs->sql_type = phs->described_sql_type;
         }
     }
+
+    if (DBIc_TRACE(imp_sth, DBD_TRACING, 0, 5)) {
+        TRACE1(imp_sth, "    Changed to %s\n", S_SqlTypeToString(phs->sql_type));
+    }
 }
 
 
diff --git a/debian/changelog b/debian/changelog
index 69f1a3b..320d8c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libdbd-odbc-perl (1.61+git20200217.2.74a88b4-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 19 Jan 2023 00:02:37 -0000
+
 libdbd-odbc-perl (1.61-2) unstable; urgency=medium
 
   * Replace '--with perl_dbi' in debian/rules with a build dependency on
diff --git a/t/12blob.t b/t/12blob.t
index ee42c35..357a75e 100755
--- a/t/12blob.t
+++ b/t/12blob.t
@@ -5,6 +5,7 @@
 #
 use Test::More;
 use strict;
+#use Data::Dumper;
 $| = 1;
 
 my $has_test_nowarnings = 1;
@@ -62,7 +63,12 @@ my ($type_name, $type);
 while (my $row = shift @{$type_info_all}) {
     #diag("$row->[$map->{TYPE_NAME}],$row->[$map->{DATA_TYPE}], $row->[$map->{COLUMN_SIZE}]");
     next if (($row->[$map->{DATA_TYPE}] != SQL_WLONGVARCHAR) && ($row->[$map->{DATA_TYPE}] != SQL_LONGVARCHAR));
-    if ($row->[$map->{COLUMN_SIZE}] > 60000) {
+    # Postgres driver does not have COLUMN_SIZE but its text data type is big enough
+    # Postgres has no COLUMN_SIZE - it uses the old PRECISION
+    # In Postgres the PRECISION on text column type is 8190 - it is wrong, it is up to 1GB
+    #print Dumper($map);
+    #print Dumper($row);
+    if ($row->[$map->{TYPE_NAME}] eq 'text' || $row->[$map->{COLUMN_SIZE}] > 60000) {
         #diag("$row->[$map->{TYPE_NAME}] $row->[$map->{DATA_TYPE}] $row->[$map->{COLUMN_SIZE}]");
         ($type_name, $type) = ($row->[$map->{TYPE_NAME}],
                                $row->[$map->{DATA_TYPE}]);
diff --git a/t/82_table_info.t b/t/82_table_info.t
index e7a9253..a5677af 100755
--- a/t/82_table_info.t
+++ b/t/82_table_info.t
@@ -96,6 +96,10 @@ if ($dbh->get_info($GetInfoType{SQL_SCHEMA_USAGE}) != 0) {
     # test type_info() - returns tables
     my $s = $dbh->table_info(undef, undef, 'PERL_DBD_DROP_ME');
     my $r = $s->fetchall_arrayref;
+    if (scalar(@$r) == 0) {
+        $s = $dbh->table_info(undef, undef, 'perl_dbd_drop_me');
+        $r = $s->fetchall_arrayref;
+    }
     ok(scalar(@$r) > 0, 'table found');
 
     if ($r && scalar(@$r)) {    # assuming we get something back

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/debug/.build-id/fc/61bc069ad21519a3a246b155c52b49bf351e82.debug

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/debug/.build-id/d7/e82eafdb37d039a417bb7e36d98c33c97bcfe7.debug

No differences were encountered between the control files of package libdbd-odbc-perl

Control files of package libdbd-odbc-perl-dbgsym: lines which differ (wdiff format)

  • Build-Ids: d7e82eafdb37d039a417bb7e36d98c33c97bcfe7 fc61bc069ad21519a3a246b155c52b49bf351e82

More details

Full run details