Hello community,
here is the log from the commit of package perl-DBD-ODBC for openSUSE:Factory checked in at 2015-09-03 18:02:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DBD-ODBC (Old)
and /work/SRC/openSUSE:Factory/.perl-DBD-ODBC.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-DBD-ODBC"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-DBD-ODBC/perl-DBD-ODBC.changes 2014-07-24 00:44:33.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-DBD-ODBC.new/perl-DBD-ODBC.changes 2015-09-03 18:07:45.000000000 +0200
@@ -1,0 +2,131 @@
+Tue Sep 1 08:52:17 UTC 2015 - coolo@suse.com
+
+- updated to 1.52
+ see /usr/share/doc/packages/perl-DBD-ODBC/Changes
+
+ 1.52 2015-04-15
+
+ [MISCELLANEOUS]
+
+ Changes to the test suite to make it run better with Postgres thanks
+ to Greg Sabino Mullane.
+
+ 1.51_4 2015-01-18
+
+ [BUG FIXES]
+
+ Numerous errors in the test suite (with SQLite ODBC driver) mostly down to not
+ creating the test table first.
+
+ [MISCELLANEOUS]
+
+ Try and make the test suite run ok for SQLite ODBC driver so I can use it
+ in travis-ci.
+
+ 1.51_3 2015-01-17
+
+ [BUG FIXES]
+
+ RT101579 - using bound input parameters for numeric columns (e.g.,
+ SQL_NUMERIC) only works the first time and will quite likey fail
+ with "string data, right truncation" on the second and subsequent
+ calls to execute. Thanks to Laura Cox for finding.
+
+ 1.51_2 2014-11-19
+
+ [BUG FIXES]
+
+ The table_info method (ANSI version only) was incorrectly passing
+ the table name for the type argument. I think this bug was
+ introduced last year.
+
+ 1.51_1 2014-11-14
+
+ [BUG FIXES]
+
+ RT100186 - handle VARBINARY(MAX) parameters with SQL Server native
+ client. Identify "libmsodbcsql*" as the MS ODBC Driver for Linux as
+ there are some specific workarounds for MS Native Client ODBC driver.
+
+ 1.50 2014-07-25
+
+ [BUG FIXES]
+
+ The 80_odbc_diags.t test could fail if a driver fails a table does
+ not exist test in the prepare instead of the execute.
+
+ 1.49_4 2014-07-08
+
+ [BUG FIXES]
+
+ Fixed sql_type_cast.t test which assumed column aliases which stay
+ lowercase.
+
+ Fixed 87_odbc_lob_read.t test which did not bow out of the test
+ properly if the database was not MS SQL Server.
+
+ [DOCUMENTATION]
+
+ Revised the query notification example and documentation.
+
+ Added a link to a better Query Notification article.
+
+ 1.49_3 2014-05-01
+
+ [CHANGE IN BEHAVIOUR]
+
+ As warned years ago, this release removes the odbc_old_unicode attribute.
+ If you have a good reason to use it speak up now before the next non-development
+ release.
+
+ [BUG FIXES]
+
+ Fix rt89255: Fails to create test table for tests using PostgreSQL odbc driver.
+ Change test suite to fallback on PRECISION if COLUMN_SIZE is not found.
+
+ [ENHANCEMENTS]
+
+ Added support for MS SQL Server Query Notification. See the new
+ section in the pod.
+
+ Added a currently undocumented (and experimental)
+ odbc_describe_param method on a statement handle which takes a
+ parameter number as the only argument and returns an array of the
+ data type, parameter size, decimal digits and nullable (as per
+ SQLDescribeParam).
+
+ [DOCUMENTATION]
+
+ Added FAQ on truncated column names with freeTDS.
+
+ [MISCELLANEOUS]
+
+ I have removed the "experimental" tag for odbc_getdiagfield and odbc_getdiagrec
+ methods.
+
+ 1.49_2 2014-04-26
+
+ [BUG FIXES]
+
+ Change to data_sources in 1.49_1 could lead to a compile error since
+ data_sources was not returning a value if an error occurred.
+
+ 1.49_1 2014-04-25
+
+ [BUG FIXES]
+
+ If you had a lot of DSNs on Windows (more than 280 but it depends on
+ the length of their names) and called the data_sources method it
+ could crash your script. Code internally changed to stop putting the DSNs
+ returned on the stack.
+
+ [CHANGE IN BEHAVIOUR]
+
+ As warned years ago, the private data_sources method has been
+ removed - use DBI one instead.
+
+ [MISCELLANEOUS]
+
+ Added FAQ entry of maximum number of allowed parameters.
+
+-------------------------------------------------------------------
Old:
----
DBD-ODBC-1.48.tar.gz
New:
----
DBD-ODBC-1.52.tar.gz
cpanspec.yml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-DBD-ODBC.spec ++++++
--- /var/tmp/diff_new_pack.qlE6Vu/_old 2015-09-03 18:07:48.000000000 +0200
+++ /var/tmp/diff_new_pack.qlE6Vu/_new 2015-09-03 18:07:48.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-DBD-ODBC
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,71 +16,66 @@
#
-%bcond_with test
-
Name: perl-DBD-ODBC
-Version: 1.48
+Version: 1.52
Release: 0
%define cpan_name DBD-ODBC
Summary: ODBC Driver for DBI
-License: GPL-1.0+ or Artistic-1.0
+License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/DBD-ODBC/
-Source: http://www.cpan.org/authors/id/M/MJ/MJEVANS/%{cpan_name}-%{version}.tar.gz
-Patch0: %{name}-1.29-Makefile.diff
+Source0: http://www.cpan.org/authors/id/M/MJ/MJEVANS/%{cpan_name}-%{version}.tar.gz
+Source1: cpanspec.yml
+Patch0: perl-DBD-ODBC-1.29-Makefile.diff
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: unixODBC-devel
-BuildRequires: perl(DBI) >= 1.609
+BuildRequires: perl(DBI) >= 1.21
BuildRequires: perl(Test::Simple) >= 0.90
-Requires: unixODBC
Requires: perl(DBI) >= 1.609
+Requires: perl(Test::Simple) >= 0.90
+Recommends: perl(Test::Version) >= 1.002001
%{perl_requires}
+# MANUAL BEGIN
+BuildRequires: unixODBC-devel
+# MANUAL END
%description
-This module is needed to access ODBC databases from within Perl. The
-module uses the unixODBC manager to connect to the database.
+ODBC Driver for DBI
%prep
%setup -q -n %{cpan_name}-%{version}
-%patch0
find . -type f -print0 | xargs -0 chmod 644
-
-#rpmlint: wrong-file-end-of-line-encoding
+%patch0 -p0
+# MANUAL BEGIN
for file in README.af README.unicode; do
perl -p -i -e "s|\r\n|\n|" "$file"
done
-
pushd examples
#rpmlint: wrong-file-end-of-line-encoding
find -type f -exec perl -p -i -e "s|\r\n|\n|" {} \;
#rpmlint: wrong-script-interpreter
-for ex in $(ls -1); do
- sed -i -e 's,#[!|#]perl\(.*\),#!perl\1,' "$ex"
+for ex in *; do
+ sed -i -e 's,^#!*perl\(.*\),#!/usr/bin/perl\1,' "$ex"
sed -i -e 's,perl.exe -w,perl -w,' "$ex"
done
popd
+# MANUAL END
%build
-perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
-make %{?_smp_mflags}
+%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
+%{__make} %{?_smp_mflags}
%check
-make test
+%{__make} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
-%clean
-rm -rf %{buildroot}
-
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc Changes FAQ if_you_are_taking_over_this_code.txt
-%doc README README.adabas README.af README.informix README.sqlserver README.unicode
-%doc test_results.txt examples
+%defattr(-,root,root,755)
+%doc Changes examples FAQ if_you_are_taking_over_this_code.txt README README.adabas README.af README.hpux README.informix README.osx README.RH9 README.sqlserver README.unicode README.windows test_results.txt TO_DO
%changelog
++++++ DBD-ODBC-1.48.tar.gz -> DBD-ODBC-1.52.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/Changes new/DBD-ODBC-1.52/Changes
--- old/DBD-ODBC-1.48/Changes 2014-03-03 16:22:10.000000000 +0100
+++ new/DBD-ODBC-1.52/Changes 2015-04-15 10:58:08.000000000 +0200
@@ -5,6 +5,131 @@
DBD::ODBC::Changes - Log of significant changes to the DBD::ODBC
+1.52 2015-04-15
+
+ [MISCELLANEOUS]
+
+ Changes to the test suite to make it run better with Postgres thanks
+ to Greg Sabino Mullane.
+
+1.51_4 2015-01-18
+
+ [BUG FIXES]
+
+ Numerous errors in the test suite (with SQLite ODBC driver) mostly down to not
+ creating the test table first.
+
+ [MISCELLANEOUS]
+
+ Try and make the test suite run ok for SQLite ODBC driver so I can use it
+ in travis-ci.
+
+1.51_3 2015-01-17
+
+ [BUG FIXES]
+
+ RT101579 - using bound input parameters for numeric columns (e.g.,
+ SQL_NUMERIC) only works the first time and will quite likey fail
+ with "string data, right truncation" on the second and subsequent
+ calls to execute. Thanks to Laura Cox for finding.
+
+1.51_2 2014-11-19
+
+ [BUG FIXES]
+
+ The table_info method (ANSI version only) was incorrectly passing
+ the table name for the type argument. I think this bug was
+ introduced last year.
+
+1.51_1 2014-11-14
+
+ [BUG FIXES]
+
+ RT100186 - handle VARBINARY(MAX) parameters with SQL Server native
+ client. Identify "libmsodbcsql*" as the MS ODBC Driver for Linux as
+ there are some specific workarounds for MS Native Client ODBC driver.
+
+1.50 2014-07-25
+
+ [BUG FIXES]
+
+ The 80_odbc_diags.t test could fail if a driver fails a table does
+ not exist test in the prepare instead of the execute.
+
+1.49_4 2014-07-08
+
+ [BUG FIXES]
+
+ Fixed sql_type_cast.t test which assumed column aliases which stay
+ lowercase.
+
+ Fixed 87_odbc_lob_read.t test which did not bow out of the test
+ properly if the database was not MS SQL Server.
+
+ [DOCUMENTATION]
+
+ Revised the query notification example and documentation.
+
+ Added a link to a better Query Notification article.
+
+1.49_3 2014-05-01
+
+ [CHANGE IN BEHAVIOUR]
+
+ As warned years ago, this release removes the odbc_old_unicode attribute.
+ If you have a good reason to use it speak up now before the next non-development
+ release.
+
+ [BUG FIXES]
+
+ Fix rt89255: Fails to create test table for tests using PostgreSQL odbc driver.
+ Change test suite to fallback on PRECISION if COLUMN_SIZE is not found.
+
+ [ENHANCEMENTS]
+
+ Added support for MS SQL Server Query Notification. See the new
+ section in the pod.
+
+ Added a currently undocumented (and experimental)
+ odbc_describe_param method on a statement handle which takes a
+ parameter number as the only argument and returns an array of the
+ data type, parameter size, decimal digits and nullable (as per
+ SQLDescribeParam).
+
+ [DOCUMENTATION]
+
+ Added FAQ on truncated column names with freeTDS.
+
+ [MISCELLANEOUS]
+
+ I have removed the "experimental" tag for odbc_getdiagfield and odbc_getdiagrec
+ methods.
+
+1.49_2 2014-04-26
+
+ [BUG FIXES]
+
+ Change to data_sources in 1.49_1 could lead to a compile error since
+ data_sources was not returning a value if an error occurred.
+
+1.49_1 2014-04-25
+
+ [BUG FIXES]
+
+ If you had a lot of DSNs on Windows (more than 280 but it depends on
+ the length of their names) and called the data_sources method it
+ could crash your script. Code internally changed to stop putting the DSNs
+ returned on the stack.
+
+ [CHANGE IN BEHAVIOUR]
+
+ As warned years ago, the private data_sources method has been
+ removed - use DBI one instead.
+
+ [MISCELLANEOUS]
+
+ Added FAQ entry of maximum number of allowed parameters.
+
1.48 2014-03-03
[MISCELLANEOUS]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/FAQ new/DBD-ODBC-1.52/FAQ
--- old/DBD-ODBC-1.48/FAQ 2014-02-19 14:23:15.000000000 +0100
+++ new/DBD-ODBC-1.52/FAQ 2014-04-29 20:17:41.000000000 +0200
@@ -1286,6 +1286,27 @@
Not yet. Patches welcome.
+=head2 Why do I get "COUNT field incorrect or syntax error (SQL-07002)"?
+
+In general this error is telling you the number of parameters bound or
+passed to execute does not match the number of parameter markers in
+your SQL. However, this can also happen if you attempt to use too many
+parameters.
+
+For instance, for MS SQL Server
+(http://msdn.microsoft.com/en-us/library/ms143432.aspx) the maximum is
+2100.
+
+=head2 Why are my column names truncated to 30 characters when using freeTDS?
+
+You should note this is only an observed answer. The person who
+reported this to me was using MS SQL Server 2008. If he set TDS
+protocol 6.0, 9.0 or 10.0 his column names were truncated to 30
+charatcers. If he specified TDS protocol 7.0 or 8.0 his column names
+were not truncated. We guessed his server did not support protocols
+9.0 or 10.0 and fall back to 6.0 where column names are restricted to
+30 characters.
+
=head1 AUTHOR
Parts of this document were written by Tim Bunce,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/MANIFEST new/DBD-ODBC-1.52/MANIFEST
--- old/DBD-ODBC-1.48/MANIFEST 2014-03-03 16:19:23.000000000 +0100
+++ new/DBD-ODBC-1.52/MANIFEST 2015-01-17 11:36:53.000000000 +0100
@@ -131,6 +131,7 @@
t/rt_79190.t
t/rt_79397.t
t/rt_81911.t
+t/rt_101579.t
t/sql_type_cast.t
t/odbc_describe_parameter.t
unicode_helper.c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/META.yml new/DBD-ODBC-1.52/META.yml
--- old/DBD-ODBC-1.48/META.yml 2014-03-03 16:20:44.000000000 +0100
+++ new/DBD-ODBC-1.52/META.yml 2015-04-15 10:07:21.000000000 +0200
@@ -1,7 +1,7 @@
#--- #YAML:1.0
name: DBD-ODBC
abstract: ODBC DBD for Perl DBI
-version: 1.48
+version: 1.52
version_from: ODBC.pm
author:
- Martin J. Evans
@@ -42,6 +42,8 @@
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=DBD-ODBC
MailingList: http://dbi.perl.org/support
repository: https://github.com/perl5-dbi/DBD-ODBC.git
+# this would be x_IRC if using v2 meta-spec
+ IRC: irc://irc.perl.org/#dbi
installdirs: site
keywords:
- ODBC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/ODBC.h new/DBD-ODBC-1.52/ODBC.h
--- old/DBD-ODBC-1.48/ODBC.h 2013-12-06 09:54:11.000000000 +0100
+++ new/DBD-ODBC-1.52/ODBC.h 2014-04-24 15:13:23.000000000 +0200
@@ -43,5 +43,6 @@
char *table, int unique, int quick);
int dbd_st_bind_col(SV *sth, imp_sth_t *imp_sth, SV *col, SV *ref,
IV type, SV *attribs);
+AV* dbd_data_sources(SV *drh );
/* end of ODBC.h */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/ODBC.pm new/DBD-ODBC-1.52/ODBC.pm
--- old/DBD-ODBC-1.48/ODBC.pm 2014-03-03 16:58:46.000000000 +0100
+++ new/DBD-ODBC-1.52/ODBC.pm 2015-04-15 10:07:14.000000000 +0200
@@ -18,7 +18,7 @@
# 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.48';
+$DBD::ODBC::VERSION = '1.52';
{
## no critic (ProhibitMagicNumbers ProhibitExplicitISA)
@@ -114,6 +114,7 @@
if (!$methods_are_installed) {
DBD::ODBC::st->install_method("odbc_lob_read");
DBD::ODBC::st->install_method("odbc_rows", { O=>0x00000000 });
+ DBD::ODBC::st->install_method("odbc_describe_param", { O=>0x00000000 });
# don't clear errors - IMA_KEEP_ERR = 0x00000004
DBD::ODBC::st->install_method("odbc_getdiagrec", { O=>0x00000004 });
DBD::ODBC::db->install_method("odbc_getdiagrec", { O=>0x00000004 });
@@ -159,6 +160,14 @@
}
## use critic
+ sub data_sources {
+ my ($drh, $attr) = @_;
+ my $dsref = DBD::ODBC::dr::_data_sources( $drh, $attr );
+ if( defined( $dsref ) && ref( $dsref ) eq "ARRAY" ) {
+ return @$dsref;
+ }
+ return (); # Return empty array
+ }
}
@@ -184,7 +193,6 @@
odbc_force_rebind => undef, # sth and dbh
odbc_async_exec => undef, # sth and dbh
odbc_exec_direct => undef,
- odbc_old_unicode => undef,
odbc_describe_parameters => undef,
odbc_SQL_ROWSET_SIZE => undef,
odbc_SQL_DRIVER_ODBC_VER => undef,
@@ -560,7 +568,6 @@
odbc_column_display_size => undef, # sth and dbh
odbc_utf8_on => undef, # sth and dbh
odbc_exec_direct => undef, # sth and dbh
- odbc_old_unicode => undef, # sth and dbh
odbc_describe_parameters => undef, # sth and dbh
odbc_batch_size => undef, # sth and dbh
odbc_array_operations => undef, # sth and dbh
@@ -658,9 +665,14 @@
DBD::ODBC - ODBC Driver for DBI
+=for html
+<a href="https://travis-ci.org/perl5-dbi/DBD-ODBC"><img src="https://travis-ci.org/perl5-dbi/DBD-ODBC.svg?branch=master"></a>
+<a href="http://badge.fury.io/pl/DBD-ODBC"><img src="https://badge.fury.io/pl/DBD-ODBC.svg" alt="CPAN version" height="18"></a>
+
=head1 VERSION
-This documentation refers to DBD::ODBC version 1.48.
+This documentation refers to DBD::ODBC version 1.52.
+
=head1 WARNING
@@ -775,7 +787,7 @@
BNote: Since DBD::ODCB 1.44_3, if the driver does not support
setting C and returns SQL_SUCCESS_WITH_INFO and
"option value changed" a warning is issued (which you'll only see if
-you have DBI > 1.628). In addition, an subsequent attempts to fetch
+you have DBI > 1.628). In addition, any subsequent attempts to fetch
the ReadOnly attribute will return the value last set.
This attribute requires DBI version 1.55 or better.
@@ -926,37 +938,6 @@
C attribute only applies to non-unicode enabled builds
of DBD::ODBC.
-=head3 odbc_old_unicode
-
-Defaults to off. If set to true returns DBD::ODBC to the old unicode
-behavior in 1.29 and earlier. You can also set this on the prepare
-method.
-
-By default DBD::ODBC now binds all char columns as SQL_WCHARs meaning
-the driver is asked to return the bound data as wide (Unicode)
-characters encoded in UCS2. So long as the driver supports the ODBC
-Unicode API properly this should mean you get your data back correctly
-in Perl even if it is in a character set (codepage) different from the
-one you are working in.
-
-However, if you wrote code using DBD::ODBC 1.29 or earlier and knew
-DBD::ODBC bound varchar/longvarchar columns as SQL_CHARs and decoded
-them yourself the new behaviour will adversely affect you (sorry). To
-revert to the old behaviour set odbc_old_unicode to true.
-
-You can also set this attribute in the attributes passed to the
-prepare method.
-
-See the stackoverflow question at
-Lhttp://stackoverflow.com/questions/5912082, the RT at
-Lhttp://rt.cpan.org/Public/Bug/Display.html?id=67994 and lastly a
-small discussion on dbi-dev at
-Lhttp://www.nntp.perl.org/group/perl.dbi.dev/2011/05/msg6559.html.
-
-BWarning: I am hoping to remove this attribute in the near
-future. If you use it you are well advised to let me know and explain
-why.
-
=head3 odbc_describe_parameters
Defaults to on. When set this allows DBD::ODBC to call SQLDescribeParam
@@ -991,8 +972,6 @@
@diags = $handle->odbc_getdiagrec($record_number);
-NOTE: This is an experimental method and may change.
-
Introduced in 1.34_3.
This is just a wrapper around the ODBC API SQLGetDiagRec. When a
@@ -1020,8 +999,6 @@
$diag = $handle->odbc_getdiagfield($record, $identifier);
-NOTE: This is an experimental method and may change.
-
This is just a wrapper around the ODBC API SQLGetDiagField. When a
method on a connection or statement handle fails if there are any
ODBC diagnostics you can use this method to retrieve the individual
@@ -1271,7 +1248,7 @@
WITH_UNICODE macro is automatically added. To disable specify -nou as
an argument to Makefile.PL (e.g. C). On non-Windows
platforms the WITH_UNICODE macro is B<not> enabled by default and to enable
-you need to specify the -u argument to Makefile.PL. Please bare in mind
+you need to specify the -u argument to Makefile.PL. Please bear in mind
that some ODBC drivers do not support SQL_Wxxx columns or parameters.
UNICODE support in ODBC Drivers differs considerably. Please read the
@@ -1339,7 +1316,7 @@
=head3 odbc_batch_size
Sets the batch size for execute_for_fetch which defaults to 10.
-Bare in mind the bigger you set this the more memory DBD::ODBC will need
+Bear in mind the bigger you set this the more memory DBD::ODBC will need
to allocate when running execute_for_fetch and the memory required is
max_length_of_pn * odbc_batch_size * n_parameters.
@@ -1723,13 +1700,7 @@
=head3 data_sources
B
-
-You call data_sources like this:
-
- @dsns = $dbh->func("data_sources);
-
-Handled since 0.21.
+method and was finally removed in 1.49_1>
=head3 GetSpecialColumns
@@ -1959,7 +1930,7 @@
=head3 Using the same placeholder more than once
DBD::ODBC does not support (currently) the use of one named placeholder
-more than once in the a single SQL string. i.e.,
+more than once in a single SQL string. i.e.,
insert into foo values (:bar, :p1, :p2, :bar);
@@ -2034,7 +2005,7 @@
DBD::ODBC's own execute_for_fetch but quite a few ODBC drivers just
cannot handle it. As such, from DBD::ODBC 1.36_2 the default was
changed to not use DBD::ODBC's execute_for_fetch (i.e., you need to
-enable it with odbc_array_operations).
+enable it with L).
NOTE: Some ODBC drivers don't support setting SQL_ATTR_PARAMSET_SIZE >
1, and hence cannot support binding arrays of parameters. The only way
@@ -2174,7 +2145,12 @@
2. If for some reason your driver describes the parameter
incorrectly. It is difficult to describe an example of this.
-Also, DBI exports some types which are not available in ODBC e.g., SQL_BLOB. If you are unsure about ODBC types look at your ODBC header files or look up valid types in the ODBC specification.
+3. If SQLDescribeParam is supported but fails e.g., MS SQL Server has
+problems with SQL like "select myfunc(?) where 1 = 1".
+
+Also, DBI exports some types which are not available in ODBC e.g.,
+SQL_BLOB. If you are unsure about ODBC types look at your ODBC header
+files or look up valid types in the ODBC specification.
=head2 Unicode
@@ -2324,8 +2300,8 @@
defaults which set WCHAR as 2 bytes.
I believe that the iODBC driver manager expects wide characters to be
-wchar_t types (which are usually 4) and hence DBD::ODBC will not work
-iODBC when built for unicode.
+wchar_t types (which are usually 4 bytes) and hence DBD::ODBC will not
+work iODBC when built for unicode.
The ODBC Driver must expect Unicode data specified in SQLBindParameter
and SQLBindCol to be UTF-16 in local endianness. Similarly, in calls to
@@ -2469,6 +2445,73 @@
$s = $h->prepare(q/insert into mytable values(?)/);
$s->bind_param(1, "\x{263a}", SQL_WVARCHAR);
+=head2 MS SQL Server Query Notification
+
+Query notifications were introduced in SQL Server 2005 and SQL Server
+Native Client. Query notifications allow applications to be notified
+when data has changed.
+
+DBD::ODBC supports query notification with MS SQL Server using the additional
+prepare attributes odbc_qn_msgtxt, odbc_qn_options and odbc_qn_timeout. When
+you pass suitable values for these attributes to the prepare method, DBD::ODBC
+will make the appropriate SQLSetStmtAttr calls after the statement
+has been allocated.
+
+It is beyond the scope of this document to provide a tutorial on doing this
+but here are some notes that might help you get started.
+
+On SQL Server
+
+ create database MyDatabase
+ ALTER DATABASE MyDatabase SET ENABLE_BROKER
+ use MyDatabase
+ CREATE TABLE QNtest (a int NOT NULL PRIMARY KEY,
+ b nchar(5) NOT NULL,
+ c datetime NOT NULL)
+ INSERT QNtest (a, b, c) SELECT 1, 'ALFKI', '19991212'
+ CREATE QUEUE myQueue
+ CREATE SERVICE myService ON QUEUE myQueue
+ See Lhttp://technet.microsoft.com/en-us/library/ms175110%28v=SQL.105%29.aspx
+
+
+You need to set these SQL Server permissions unless the subscriber is a sysadmin:
+
+ GRANT RECEIVE ON QueryNotificationErrorsQueue TO "<login-for-subscriber>"
+ GRANT SUBSCRIBE QUERY NOTIFICATIONS TO "<login-for-subscriber>"
+
+To subscribe to query notification for this example:
+
+ # Prepare the statement.
+ # This is the SQL you want to know if the result changes later
+ my $sth = $dbh->prepare(q/SELECT a, b, c FROM dbo.QNtest WHERE a = 1/,
+ {odbc_qn_msgtxt => 'Message text',
+ odbc_qn_options => 'service=myService',
+ odbc_qn_timeout=> 430000});
+ # Fetch and display the result set value.
+ while ( my @row = $sth->fetchrow_array ) {
+ print "@row\n";
+ }
+ # select * from sys.dm_qn_subscriptions will return a record now you are subscribed
+
+To wait for notification:
+
+ # Avoid "String data, right truncation" error when retrieving
+ # the message.
+ $dbh->{LongReadLen} = 800;
+
+ # This query generates a result telling you which query has changed
+ # It will block until the timeout or the query changes
+ my $sth = $dbh->prepare(q/WAITFOR (RECEIVE * FROM MyQueue)/);
+ $sth->execute();
+
+ # in the mean time someone does UPDATE dbo.QNtest SET c = '19981212' WHERE a = 1
+
+ # Fetch and display the result set value.
+ while ( my @row = $sth->fetchrow_array ) {
+ print "@row\n";
+ }
+ # You now need to understand the result and look to decide which query has changed
+
=head2 Version Control
DBD::ODBC source code was under version control at svn.perl.org
@@ -2663,6 +2706,10 @@
Lhttps://github.com/mjegh/dbd_odbc_sql_server_unicode/blob/master/common_prob...
+How do I use SQL Server Query Notifications from Linux and UNIX?
+
+Lhttp://www.easysoft.com/support/kb/kb01069.html
+
=head2 Frequently Asked Questions
Frequently asked questions are now in LDBD::ODBC::FAQ. Run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/ODBC.xs new/DBD-ODBC-1.52/ODBC.xs
--- old/DBD-ODBC-1.48/ODBC.xs 2013-12-06 09:54:11.000000000 +0100
+++ new/DBD-ODBC-1.52/ODBC.xs 2014-04-30 16:47:53.000000000 +0200
@@ -6,8 +6,47 @@
INCLUDE: ODBC.xsi
+MODULE = DBD::ODBC PACKAGE = DBD::ODBC::dr
+
+void
+_data_sources( drh, attribs=Nullsv )
+ SV * drh
+ SV * attribs
+ CODE:
+ {
+ AV *ds = dbd_data_sources( drh );
+ ST(0) = sv_2mortal( newRV_noinc( (SV*)ds ) );
+ }
+
+
MODULE = DBD::ODBC PACKAGE = DBD::ODBC::st
+void odbc_describe_param(sth, param)
+ SV * sth
+ SV * param
+ PPCODE:
+ D_imp_sth(sth);
+ D_imp_xxh(sth);
+ SQLRETURN rc;
+ SQLSMALLINT data_type;
+ SQLULEN size;
+ SQLSMALLINT dd;
+ SQLSMALLINT nullable;
+
+ rc = SQLDescribeParam(imp_sth->hstmt, SvIV(param), &data_type, &size, &dd, &nullable);
+ if (SQL_SUCCEEDED(rc)) {
+ XPUSHs(sv_2mortal(newSViv(data_type)));
+ XPUSHs(sv_2mortal(newSViv(size)));
+ XPUSHs(sv_2mortal(newSViv(dd)));
+ XPUSHs(sv_2mortal(newSViv(nullable)));
+ } else {
+ DBIh_SET_ERR_CHAR(
+ sth, imp_xxh, Nullch, 1,
+ "SQLDescribeParam failed",
+ "IM008", Nullch);
+ }
+
+
IV odbc_rows(sth)
SV * sth
@@ -76,9 +115,9 @@
PPCODE:
SQLCHAR buf[256];
SQLSMALLINT buf_len;
- SQLLEN len_type;
- SQLINTEGER int_type;
- SQLRETURN ret_type;
+ SQLLEN len_type = 0;
+ SQLINTEGER int_type = 0;
+ SQLRETURN ret_type = 0;
SQLPOINTER info_ptr;
SQLRETURN rc;
D_imp_sth(sth);
@@ -474,68 +513,7 @@
}
}
-MODULE = DBD::ODBC PACKAGE = DBD::ODBC::db
-MODULE = DBD::ODBC PACKAGE = DBD::ODBC::dr
+MODULE = DBD::ODBC PACKAGE = DBD::ODBC::db
-void
-data_sources(drh, attr = NULL)
- SV* drh;
- SV* attr;
- PROTOTYPE: $;$
- PPCODE:
- {
-#ifdef DBD_ODBC_NO_DATASOURCES
- /* D_imp_drh(drh);
- imp_drh->henv = SQL_NULL_HENV;
- dbd_error(drh, (RETCODE) SQL_ERROR, "data_sources: SOLID doesn't implement SQLDataSources()");*/
- XSRETURN(0);
-#else
- int numDataSources = 0;
- UWORD fDirection = SQL_FETCH_FIRST;
- RETCODE rc;
- UCHAR dsn[SQL_MAX_DSN_LENGTH+1+9 /* strlen("DBI:ODBC:") */];
- SWORD dsn_length;
- UCHAR description[256];
- SWORD description_length;
- D_imp_drh(drh);
-
- if (!imp_drh->connects) {
- rc = SQLAllocEnv(&imp_drh->henv);
- if (!SQL_ok(rc)) {
- imp_drh->henv = SQL_NULL_HENV;
- dbd_error(drh, rc, "data_sources/SQLAllocEnv");
- XSRETURN(0);
- }
- }
- strcpy(dsn, "dbi:ODBC:");
- while (1) {
- rc = SQLDataSources(imp_drh->henv, fDirection,
- dsn+9, /* strlen("DBI:ODBC:") */
- SQL_MAX_DSN_LENGTH,
- &dsn_length,
- description, sizeof(description),
- &description_length);
- if (!SQL_ok(rc)) {
- if (rc != SQL_NO_DATA_FOUND) {
- /*
- * Temporarily increment imp_drh->connects, so
- * that dbd_error uses our henv.
- */
- imp_drh->connects++;
- dbd_error(drh, rc, "data_sources/SQLDataSources");
- imp_drh->connects--;
- }
- break;
- }
- ST(numDataSources++) = newSVpv(dsn, dsn_length+9 /* strlen("dbi:ODBC:") */ );
- fDirection = SQL_FETCH_NEXT;
- }
- if (!imp_drh->connects) {
- SQLFreeEnv(imp_drh->henv);
- imp_drh->henv = SQL_NULL_HENV;
- }
- XSRETURN(numDataSources);
-#endif /* no data sources */
- }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/TO_DO new/DBD-ODBC-1.52/TO_DO
--- old/DBD-ODBC-1.48/TO_DO 2013-12-06 09:54:11.000000000 +0100
+++ new/DBD-ODBC-1.52/TO_DO 2015-01-16 14:35:34.000000000 +0100
@@ -12,6 +12,8 @@
=head1 Todo
+ Get travis testing actually running tests against a driver.
+
Better/more tests on multiple statement handles which ensure the
correct number of rows
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/dbdimp.c new/DBD-ODBC-1.52/dbdimp.c
--- old/DBD-ODBC-1.48/dbdimp.c 2014-03-03 16:25:15.000000000 +0100
+++ new/DBD-ODBC-1.52/dbdimp.c 2015-01-17 11:36:53.000000000 +0100
@@ -29,7 +29,7 @@
* http://perldoc.perl.org/perlguts.html#Formatted-Printing-of-IVs,-UVs,-and-NV...
* http://cpansearch.perl.org/src/RURBAN/illguts-0.44/index.html
* Internal replacements for standard C library functions:
- * http://search.cpan.org/~jesse/perl-5.12.1/pod/perlclib.pod
+ * http://perldoc.perl.org/perlclib.html
* http://search.cpan.org/dist/Devel-PPPort/PPPort.pm
*
* MS ODBC 64 bit:
@@ -155,7 +155,6 @@
#define ODBC_COLUMN_DISPLAY_SIZE 0x8340
#define ODBC_UTF8_ON 0x8341
#define ODBC_FORCE_BIND_TYPE 0x8342
-#define ODBC_OLD_UNICODE 0x8343
#define ODBC_DESCRIBE_PARAMETERS 0x8344
#define ODBC_DRIVER_COMPLETE 0x8345
#define ODBC_BATCH_SIZE 0x8346
@@ -260,8 +259,8 @@
phs_t *phs = (phs_t*)(void*)SvPVX(AvARRAY(imp_sth->out_params_av)[i]);
SV *sv = phs->sv;
if (debug >= 8) {
- TRACE2(imp_sth, " outparam %s, length:%ld\n",
- phs->name, (long)phs->strlen_or_ind);
+ TRACE2(imp_sth, " outparam %s, length:%ld\n",
+ phs->name, (long)phs->strlen_or_ind);
}
/* phs->strlen_or_ind has been updated by ODBC to hold the length
@@ -1755,7 +1754,7 @@
acatalog ? acatalog : NULL, SQL_NTS,
aschema ? aschema : NULL, SQL_NTS,
atable ? atable : NULL, SQL_NTS,
- atype ? atable : NULL, SQL_NTS /* type (view, table, etc) */
+ atype ? atype : NULL, SQL_NTS /* type (view, table, etc) */
);
}
@@ -2044,7 +2043,6 @@
imp_sth->odbc_column_display_size = imp_dbh->odbc_column_display_size;
imp_sth->odbc_utf8_on = imp_dbh->odbc_utf8_on;
imp_sth->odbc_exec_direct = imp_dbh->odbc_exec_direct;
- imp_sth->odbc_old_unicode = imp_dbh->odbc_old_unicode;
imp_sth->odbc_describe_parameters = imp_dbh->odbc_describe_parameters;
imp_sth->odbc_batch_size = imp_dbh->odbc_batch_size;
imp_sth->odbc_array_operations = imp_dbh->odbc_array_operations;
@@ -2088,32 +2086,63 @@
{
/*
- * allow setting of odbc_old_unicode in prepare() or overriding
+ * allow setting of odbc_describe_parameters in prepare() or overriding
*/
SV **attr_sv;
/* if the attribute is there, let it override what the default
* value from the dbh is (set above).
*/
if ((attr_sv =
- DBD_ATTRIB_GET_SVP(attribs, "odbc_old_unicode",
- (I32)strlen("odbc_old_unicode"))) != NULL) {
- imp_sth->odbc_old_unicode = SvIV(*attr_sv) != 0;
+ DBD_ATTRIB_GET_SVP(
+ attribs, "odbc_describe_parameters",
+ (I32)strlen("odbc_describe_parameters"))) != NULL) {
+ imp_sth->odbc_describe_parameters = SvIV(*attr_sv) != 0;
}
}
- {
- /*
- * allow setting of odbc_describe_parameters in prepare() or overriding
- */
+ { /* MS SQL Server query notification */
SV **attr_sv;
- /* if the attribute is there, let it override what the default
- * value from the dbh is (set above).
- */
if ((attr_sv =
DBD_ATTRIB_GET_SVP(
- attribs, "odbc_describe_parameters",
- (I32)strlen("odbc_describe_parameters"))) != NULL) {
- imp_sth->odbc_describe_parameters = SvIV(*attr_sv) != 0;
+ attribs, "odbc_qn_msgtxt",
+ (I32)strlen("odbc_qn_msgtxt"))) != NULL) {
+ rc = SQLSetStmtAttr(imp_sth->hstmt,
+ 1234 /*SQL_SOPT_SS_QUERYNOTIFICATION_MSGTEXT*/,
+ (SQLPOINTER)SvPV_nolen(*attr_sv), SQL_NTS);
+ if (!SQL_SUCCEEDED(rc)) {
+ dbd_error(sth, rc, "SQLSetStmtAttr(QUERYNOTIFICATION_MSGTXT)");
+ SQLFreeHandle(SQL_HANDLE_STMT, imp_sth->hstmt);
+ imp_sth->hstmt = SQL_NULL_HSTMT;
+ return 0;
+ }
+ }
+ if ((attr_sv =
+ DBD_ATTRIB_GET_SVP(
+ attribs, "odbc_qn_options",
+ (I32)strlen("odbc_qn_options"))) != NULL) {
+ rc = SQLSetStmtAttr(imp_sth->hstmt,
+ 1235 /*SQL_SOPT_SS_QUERYNOTIFICATION_OPTIONS*/,
+ (SQLPOINTER)SvPV_nolen(*attr_sv), SQL_NTS);
+ if (!SQL_SUCCEEDED(rc)) {
+ dbd_error(sth, rc, "SQLSetStmtAttr(QUERYNOTIFICATION_OPTIONS)");
+ SQLFreeHandle(SQL_HANDLE_STMT, imp_sth->hstmt);
+ imp_sth->hstmt = SQL_NULL_HSTMT;
+ return 0;
+ }
+ }
+ if ((attr_sv =
+ DBD_ATTRIB_GET_SVP(
+ attribs, "odbc_qn_timeout",
+ (I32)strlen("odbc_qn_timeout"))) != NULL) {
+ rc = SQLSetStmtAttr(imp_sth->hstmt,
+ 1233 /*SQL_SOPT_SS_QUERYNOTIFICATION_TIMEOUT*/,
+ (SQLPOINTER)SvIV(*attr_sv), SQL_NTS);
+ if (!SQL_SUCCEEDED(rc)) {
+ dbd_error(sth, rc, "SQLSetStmtAttr(QUERYNOTIFICATION_TIMEOUT)");
+ SQLFreeHandle(SQL_HANDLE_STMT, imp_sth->hstmt);
+ imp_sth->hstmt = SQL_NULL_HSTMT;
+ return 0;
+ }
}
}
@@ -2164,7 +2193,7 @@
if (!SQL_SUCCEEDED(rc)) {
dbd_error(sth, rc, "st_prepare/SQLPrepare");
- SQLFreeHandle(SQL_HANDLE_STMT,imp_sth->hstmt);
+ SQLFreeHandle(SQL_HANDLE_STMT, imp_sth->hstmt);
imp_sth->hstmt = SQL_NULL_HSTMT;
return 0;
}
@@ -2516,19 +2545,16 @@
# if defined(WITH_UNICODE)
fbh->ColLength += 1; /* add extra byte for double nul terminator */
- /* Unless old unicode behavior map SQL_CHAR to SQL_WCHAR */
- if (!imp_sth->odbc_old_unicode) {
- switch(fbh->ColSqlType) {
- case SQL_CHAR:
- fbh->ColSqlType = SQL_WCHAR;
- break;
- case SQL_VARCHAR:
- fbh->ColSqlType = SQL_WVARCHAR;
- break;
- case SQL_LONGVARCHAR:
- fbh->ColSqlType = SQL_WLONGVARCHAR;
- break;
- }
+ switch(fbh->ColSqlType) {
+ case SQL_CHAR:
+ fbh->ColSqlType = SQL_WCHAR;
+ break;
+ case SQL_VARCHAR:
+ fbh->ColSqlType = SQL_WVARCHAR;
+ break;
+ case SQL_LONGVARCHAR:
+ fbh->ColSqlType = SQL_WLONGVARCHAR;
+ break;
}
# endif
#else /* !SQL_COLUMN_LENGTH */
@@ -4126,6 +4152,8 @@
* [SQL Server]The size (4001) given to the parameter '@P1' exceeds the
* maximum allowed (4000)
*
+ * Update, see RT100186 - same applies to VARBINARY(MAX)
+ *
* So to sum up for the native client when the parameter size is 0 or
* when the database is sql server and wchar and sql type not overwritten
* we need to use column size 0. We cannot do this if the requested_type
@@ -4141,7 +4169,7 @@
/* See rt 55736 */
if ((imp_dbh->driver_type == DT_SQL_SERVER_NATIVE_CLIENT) ||
((strcmp(imp_dbh->odbc_dbms_name, "Microsoft SQL Server") == 0) &&
- (phs->sql_type == SQL_WVARCHAR) &&
+ ((phs->sql_type == SQL_WVARCHAR) || (phs->sql_type == SQL_VARBINARY)) &&
(phs->requested_type == 0))) {
column_size = 0;
}
@@ -4583,7 +4611,6 @@
{ "odbc_putdata_start", ODBC_PUTDATA_START, PARAM_READWRITE, PARAM_TYPE_CUSTOM },
{ "odbc_column_display_size", ODBC_COLUMN_DISPLAY_SIZE, PARAM_READWRITE, PARAM_TYPE_CUSTOM },
{ "odbc_utf8_on", ODBC_UTF8_ON, PARAM_READWRITE, PARAM_TYPE_CUSTOM },
- { "odbc_old_unicode", ODBC_OLD_UNICODE, PARAM_READWRITE, PARAM_TYPE_CUSTOM },
{ "odbc_has_unicode", ODBC_HAS_UNICODE, PARAM_READ, PARAM_TYPE_CUSTOM },
{ "odbc_out_connect_string", ODBC_OUTCON_STR, PARAM_READ, PARAM_TYPE_CUSTOM},
{ "odbc_describe_parameters", ODBC_DESCRIBE_PARAMETERS, PARAM_READWRITE, PARAM_TYPE_CUSTOM },
@@ -4802,11 +4829,6 @@
imp_dbh->odbc_exec_direct = SvTRUE(valuesv);
break;
- case ODBC_OLD_UNICODE:
- bSetSQLConnectionOption = FALSE;
- imp_dbh->odbc_old_unicode = SvTRUE(valuesv);
- break;
-
case ODBC_DESCRIBE_PARAMETERS:
bSetSQLConnectionOption = FALSE;
imp_dbh->odbc_describe_parameters = SvTRUE(valuesv);
@@ -5097,10 +5119,6 @@
retsv = newSViv(imp_dbh->odbc_driver_complete);
break;
- case ODBC_OLD_UNICODE:
- retsv = newSViv(imp_dbh->odbc_old_unicode);
- break;
-
case ODBC_DESCRIBE_PARAMETERS:
retsv = newSViv(imp_dbh->odbc_describe_parameters);
break;
@@ -6525,7 +6543,8 @@
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)) {
+ (strcmp(imp_dbh->odbc_driver_name, "SQLNCLI.DLL") == 0) ||
+ (memcmp(imp_dbh->odbc_driver_name, "libmsodbcsql", 13) == 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;
@@ -6683,7 +6702,6 @@
imp_dbh->odbc_column_display_size = 2001;
imp_dbh->odbc_utf8_on = 0;
imp_dbh->odbc_exec_direct = 0; /* default to not having SQLExecDirect used */
- imp_dbh->odbc_old_unicode = 0;
imp_dbh->odbc_describe_parameters = 1;
imp_dbh->RowCacheSize = 1; /* default value for now */
@@ -7567,7 +7585,7 @@
phs_t *phs) {
if (DBIc_TRACE(imp_sth, DBD_TRACING, 0, 5)) {
- TRACE2(imp_sth, "check_for_unicode_param - sql_type=%s, described=%s",
+ TRACE2(imp_sth, "check_for_unicode_param - sql_type=%s, described=%s\n",
S_SqlTypeToString(phs->sql_type), S_SqlTypeToString(phs->described_sql_type));
}
@@ -7589,8 +7607,68 @@
TRACE1(imp_sth, " SvUTF8 parameter - changing to %s type\n",
S_SqlTypeToString(phs->sql_type));
} else {
- phs->sql_type = phs->described_sql_type;
+ if (phs->described_sql_type == SQL_NUMERIC ||
+ phs->described_sql_type == SQL_DECIMAL ||
+ phs->described_sql_type == SQL_FLOAT ||
+ phs->described_sql_type == SQL_REAL ||
+ phs->described_sql_type == SQL_DOUBLE) {
+ phs->sql_type = SQL_VARCHAR;
+ } else {
+ phs->sql_type = phs->described_sql_type;
+ }
}
}
+
+AV* dbd_data_sources(SV *drh ) {
+ int numDataSources = 0;
+ SQLUSMALLINT fDirection = SQL_FETCH_FIRST;
+ RETCODE rc;
+ SQLCHAR dsn[SQL_MAX_DSN_LENGTH+1+9 /* strlen("DBI:ODBC:") */];
+ SQLSMALLINT dsn_length;
+ SQLCHAR description[256];
+ SQLSMALLINT description_length;
+ AV *ds = newAV();
+ D_imp_drh(drh);
+
+ if (!imp_drh->connects) {
+ rc = SQLAllocEnv(&imp_drh->henv);
+ if (!SQL_ok(rc)) {
+ imp_drh->henv = SQL_NULL_HENV;
+ dbd_error(drh, rc, "data_sources/SQLAllocEnv");
+ return NULL;
+
+ }
+ }
+ strcpy(dsn, "dbi:ODBC:");
+ while (1) {
+ description[0] = '\0';
+ rc = SQLDataSources(imp_drh->henv, fDirection,
+ dsn+9, /* strlen("dbi:ODBC:") */
+ SQL_MAX_DSN_LENGTH,
+ &dsn_length,
+ description, sizeof(description),
+ &description_length);
+ if (!SQL_ok(rc)) {
+ if (rc != SQL_NO_DATA_FOUND) {
+ /*
+ * Temporarily increment imp_drh->connects, so
+ * that dbd_error uses our henv.
+ */
+ imp_drh->connects++;
+ dbd_error(drh, rc, "data_sources/SQLDataSources");
+ imp_drh->connects--;
+ }
+ break;
+ }
+ av_push( ds, newSVpv(dsn, dsn_length + 9 ) );
+ fDirection = SQL_FETCH_NEXT;
+ }
+ if (!imp_drh->connects) {
+ SQLFreeEnv(imp_drh->henv);
+ imp_drh->henv = SQL_NULL_HENV;
+ }
+ return ds;
+
+}
/* end */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/dbdimp.h new/DBD-ODBC-1.52/dbdimp.h
--- old/DBD-ODBC-1.48/dbdimp.h 2013-12-17 10:40:21.000000000 +0100
+++ new/DBD-ODBC-1.52/dbdimp.h 2014-05-01 12:28:06.000000000 +0200
@@ -67,8 +67,6 @@
/* flag indicating if we should pass SQL_DRIVER_COMPLETE to
SQLDriverConnect */
int odbc_driver_complete;
- /* use old unicode behaviour of binding varchar/longvarchar as SQL_CHAR */
- int odbc_old_unicode;
/* used to disable describing paramters with SQLDescribeParam */
int odbc_describe_parameters;
/* flag to store the type of asynchronous execution the driver supports */
@@ -180,7 +178,6 @@
IV odbc_putdata_start;
IV odbc_column_display_size;
int odbc_utf8_on;
- int odbc_old_unicode;
int odbc_describe_parameters;
SQLUSMALLINT *param_status_array; /* array for execute_for_fetch parameter status */
SQLULEN params_processed; /* for execute_for_fetch */
@@ -265,6 +262,7 @@
#define dbd_init odbc_init
#define dbd_db_login odbc_db_login
#define dbd_db_login6 odbc_db_login6
+#define dbd_data_sources dbd_data_sources
/*
* Not defined by DBI
* #define dbd_db_do odbc_db_do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/02simple.t new/DBD-ODBC-1.52/t/02simple.t
--- old/DBD-ODBC-1.48/t/02simple.t 2013-12-17 10:31:39.000000000 +0100
+++ new/DBD-ODBC-1.52/t/02simple.t 2015-01-19 09:39:25.000000000 +0100
@@ -3,6 +3,7 @@
use Test::More;
use strict;
use Config;
+use DBD::ODBC;
$| = 1;
@@ -28,7 +29,6 @@
}
-#DBI->trace(2);
my $dbh = DBI->connect();
unless($dbh) {
BAIL_OUT("Unable to connect to the database ($DBI::errstr)\nTests skipped.\n");
@@ -47,14 +47,15 @@
$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");
+ diag("odbc_has_unicode " . ($dbh->{odbc_has_unicode} || '') . "\n");
}
# ReadOnly
{
# NOTE: the catching of warnings here needs a DBI > 1.628
+ local $dbh->{AutoCommit} = 0;
my $warning;
- local $SIG{__WARN__} = sub {diag @_; $warning = 1};
+ local $SIG{__WARN__} = sub {diag "AA:"; diag @_; $warning = 1};
$dbh->{ReadOnly} = 1;
if ($warning) {
diag "Your ODBC driver does not support setting ReadOnly";
@@ -104,7 +105,7 @@
};
#
-# Test changing of AutoCommit - start be setting away from the default
+# Test changing of AutoCommit - start by setting away from the default
#
$dbh->{AutoCommit} = 0;
pass("Set Auto commit off");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/03dbatt.t new/DBD-ODBC-1.52/t/03dbatt.t
--- old/DBD-ODBC-1.48/t/03dbatt.t 2014-02-12 14:26:49.000000000 +0100
+++ new/DBD-ODBC-1.52/t/03dbatt.t 2015-01-17 14:43:49.000000000 +0100
@@ -2,11 +2,12 @@
use Test::More;
use strict;
+use Data::Dumper;
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;
-my $tests = 25 + 4;
+my $tests = 26 + 4;
$tests += 1 if $has_test_nowarnings;
plan tests => $tests;
@@ -16,19 +17,24 @@
use_ok('DBI', qw(:sql_types));
use_ok('ODBCTEST');
+my $dbh;
+
BEGIN {
if (!defined $ENV{DBI_DSN}) {
plan skip_all => "DBI_DSN is undefined";
}
}
END {
+ if ($dbh) {
+ ODBCTEST::tab_delete($dbh);
+ }
Test::NoWarnings::had_no_warnings()
if ($has_test_nowarnings);
}
my @row;
-my $dbh = DBI->connect();
+$dbh = DBI->connect();
unless($dbh) {
BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
exit 0;
@@ -38,6 +44,8 @@
is($dbh->{LongReadLen}, 1000, "Set Long Read Len");
my $dbname = $dbh->{odbc_SQL_DBMS_NAME};
+ok(ODBCTEST::tab_create($dbh), "Create tables");
+
#### testing set/get of connection attributes
$dbh->{RaiseError} = 0;
$dbh->{AutoCommit} = 1;
@@ -103,7 +111,6 @@
$sth->finish();
};
-
$rows = 0;
$dbh->{PrintError} = 0;
my @tables = $dbh->tables;
@@ -111,12 +118,10 @@
cmp_ok(@tables, '>', 0, "tables returns array");
$rows = 0;
if ($sth = $dbh->column_info(undef, undef, $ODBCTEST::table_name, undef)) {
- while (@row = $sth->fetchrow()) {
- $rows++;
- }
- $sth->finish();
+ my $fetched = $sth->fetchall_arrayref;
+ cmp_ok(scalar(@$fetched), '>', 0, "column info returns more than one row for test table") or
+ diag(Dumper($fetched));
}
-cmp_ok($rows, '>', 0, "column info returns more than one row for test table");
$rows = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/05meth.t new/DBD-ODBC-1.52/t/05meth.t
--- old/DBD-ODBC-1.48/t/05meth.t 2014-02-12 14:28:33.000000000 +0100
+++ new/DBD-ODBC-1.52/t/05meth.t 2015-01-17 14:43:47.000000000 +0100
@@ -10,19 +10,25 @@
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;
-my $tests = 13;
+my $tests = 15;
$tests += 1 if $has_test_nowarnings;
plan tests => $tests;
use_ok('DBI', qw(:sql_types));
+use_ok('ODBCTEST');
use strict;
+my $dbh;
+
BEGIN {
if (!defined $ENV{DBI_DSN}) {
plan skip_all => "DBI_DSN is undefined";
}
}
END {
+ if ($dbh) {
+ ODBCTEST::tab_delete($dbh);
+ }
Test::NoWarnings::had_no_warnings()
if ($has_test_nowarnings);
}
@@ -30,7 +36,7 @@
my @row;
-my $dbh = DBI->connect();
+$dbh = DBI->connect();
unless($dbh) {
BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
exit 0;
@@ -39,10 +45,12 @@
#### testing Tim's early draft DBI methods
+ok(ODBCTEST::tab_create($dbh), "Create tables");
+
my $r1 = $DBI::rows;
$dbh->{AutoCommit} = 0;
my $sth;
-$sth = $dbh->prepare("DELETE FROM PERL_DBD_TEST");
+$sth = $dbh->prepare("DELETE FROM $ODBCTEST::table_name");
ok($sth, "delete prepared statement");
$sth->execute();
cmp_ok($sth->rows, '>=', 0, "Number of rows > 0");
@@ -51,7 +59,7 @@
$dbh->rollback();
pass("finished and rolled back");
-$sth = $dbh->prepare('SELECT * FROM PERL_DBD_TEST WHERE 1 = 0');
+$sth = $dbh->prepare("SELECT * FROM $ODBCTEST::table_name WHERE 1 = 0");
$sth->execute();
@row = $sth->fetchrow();
if ($sth->err) {
@@ -63,7 +71,7 @@
$sth->finish();
my ($a, $b);
-$sth = $dbh->prepare('SELECT COL_A, COL_B FROM PERL_DBD_TEST');
+$sth = $dbh->prepare("SELECT COL_A, COL_B FROM $ODBCTEST::table_name");
$sth->execute();
while (@row = $sth->fetchrow()) {
print " \@row a,b:", $row[0], ",", $row[1], "\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/08bind2.t new/DBD-ODBC-1.52/t/08bind2.t
--- old/DBD-ODBC-1.48/t/08bind2.t 2013-12-17 10:31:55.000000000 +0100
+++ new/DBD-ODBC-1.52/t/08bind2.t 2015-01-17 14:20:52.000000000 +0100
@@ -8,7 +8,7 @@
my $has_test_nowarnings = 1;
eval "require Test::NoWarnings";
$has_test_nowarnings = undef if $@;
-my $tests = 5;
+my $tests = 6;
$tests += 1 if $has_test_nowarnings;
plan tests => $tests;
@@ -18,22 +18,29 @@
use_ok('ODBCTEST'); # 1
use_ok('Data::Dumper'); # 2
+my $dbh;
+
BEGIN {
if (!defined $ENV{DBI_DSN}) {
plan skip_all => "DBI_DSN is undefined";
}
}
END {
+ if ($dbh) {
+ ODBCTEST::tab_delete($dbh);
+ }
Test::NoWarnings::had_no_warnings()
if ($has_test_nowarnings);
}
-my $dbh = DBI->connect();
+$dbh = DBI->connect();
unless($dbh) {
BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
exit 0;
}
+ok(ODBCTEST::tab_create($dbh), "Create tables");
+
SKIP:
{
#skip "SQLDescribeParam not supported using " . $dbh->get_info(6) . "\n", 3, unless $dbh->func(58, 'GetFunctions');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/70execute_array_native.t new/DBD-ODBC-1.52/t/70execute_array_native.t
--- old/DBD-ODBC-1.48/t/70execute_array_native.t 2014-01-06 09:55:15.000000000 +0100
+++ new/DBD-ODBC-1.52/t/70execute_array_native.t 2015-01-17 13:54:22.000000000 +0100
@@ -43,7 +43,11 @@
($driver_name =~ /ACEODBC.DLL/i) ||
($dbms_name eq 'ACCESS')) { # for OOB
$has_test_nowarnings = 0;
- plan skip_all => 'MS Access does not support array operations'
+ plan skip_all => 'MS Access does not support array operations';
+ }
+ if ($driver_name =~ /sqlite/) {
+ $has_test_nowarnings = 0;
+ plan skip_all => "SQLite fails this test horribly - I can't find anywhere to report it";
}
diag("\n\nNOTE: This is an experimental test. Since DBD::ODBC added the execute_for_fetch method this tests the native method and not DBI's fallback method. If you fail this test it probably means the ODBC driver you are using does not have sufficient support (or is buggy) for array operations. If you pass this test your ODBC Driver seems ok and you can get faster insert/update/delete operations using DBI's execute_array or execute_for_fetch methods by setting the odbc_array_operations to true.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/80_odbc_diags.t new/DBD-ODBC-1.52/t/80_odbc_diags.t
--- old/DBD-ODBC-1.48/t/80_odbc_diags.t 2014-01-06 09:55:13.000000000 +0100
+++ new/DBD-ODBC-1.52/t/80_odbc_diags.t 2015-01-17 13:49:32.000000000 +0100
@@ -61,6 +61,11 @@
BAIL_OUT("Unable to connect to the database ($DBI::errstr)\nTests skipped.\n");
exit 0;
}
+my $dbname = $h->get_info(17); # DBI::SQL_DBMS_NAME
+if ($dbname =~ /sqlite/i) {
+ plan skip_all => "sqlite core dumps with this test - I can't find anywhere to report it";
+}
+
$h->{RaiseError} = 1;
$h->{PrintError} = 0;
@@ -91,12 +96,13 @@
1;
};
ok(!$ok, "select on non-existant table fails");
-my $hd = $s || $h;
-@diags = $hd->odbc_getdiagrec(1);
-is(scalar(@diags), 3, ' and 3 diag fields returned');
-note(Data::Dumper->Dump([\@diags], [qw(diags)]));
+if ($s) {
+ @diags = $s->odbc_getdiagrec(1);
+ is(scalar(@diags), 3, ' and 3 diag fields returned');
+ note(Data::Dumper->Dump([\@diags], [qw(diags)]));
-get_fields($hd, 1);
+ get_fields($s, 1);
+}
Test::NoWarnings::had_no_warnings()
if ($has_test_nowarnings);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/82_table_info.t new/DBD-ODBC-1.52/t/82_table_info.t
--- old/DBD-ODBC-1.48/t/82_table_info.t 2013-12-17 10:33:19.000000000 +0100
+++ new/DBD-ODBC-1.52/t/82_table_info.t 2015-01-17 13:32:10.000000000 +0100
@@ -108,38 +108,38 @@
}
# test type_info('','','', '%') which should return table types only
-if ($dbh->get_info($GetInfoType{SQL_DRIVER_NAME}) =~ /sqlite/) {
- diag("SQLite is known to fail the next test because catalog, schema and table are returned as '' instead of undef");
-}
-
-my $s = $dbh->table_info('', '', '', '%');
-my $r = $s->fetchall_arrayref;
-if ($r && scalar(@$r)) { # assuming we get something back
- my $pass = 1;
- foreach my $row (@$r) {
- if (defined($row->[0])) {
- $pass = 0;
- diag("Catalog is defined as $row->[0]");
- }
-
- if (defined($row->[1])) {
- $pass = 0;
- diag("Schema is defined as $row->[1]");
- }
- if (defined($row->[2])) {
- $pass = 0;
- diag("Table is defined as $row->[2]");
- }
-
- if (!defined($row->[3])) {
- $pass = 0;
- diag("table type is not defined");
+SKIP: {
+ skip "SQLite is known to fail the next test because catalog, schema and table are returned as '' instead of undef", 1
+ if ($dbh->get_info($GetInfoType{SQL_DRIVER_NAME}) =~ /sqlite/);
+ my $s = $dbh->table_info('', '', '', '%');
+ my $r = $s->fetchall_arrayref;
+ if ($r && scalar(@$r)) { # assuming we get something back
+ my $pass = 1;
+ foreach my $row (@$r) {
+ if (defined($row->[0])) {
+ $pass = 0;
+ diag("Catalog is defined as $row->[0]");
+ }
+
+ if (defined($row->[1])) {
+ $pass = 0;
+ diag("Schema is defined as $row->[1]");
+ }
+
+ if (defined($row->[2])) {
+ $pass = 0;
+ diag("Table is defined as $row->[2]");
+ }
+
+ if (!defined($row->[3])) {
+ $pass = 0;
+ diag("table type is not defined");
+ }
}
+ ok($pass, "table type only") or diag(Dumper($r));
}
- ok($pass, "table type only") or diag(Dumper($r));
-}
-
+};
Test::NoWarnings::had_no_warnings()
if ($has_test_nowarnings);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/87_odbc_lob_read.t new/DBD-ODBC-1.52/t/87_odbc_lob_read.t
--- old/DBD-ODBC-1.48/t/87_odbc_lob_read.t 2013-12-17 10:33:30.000000000 +0100
+++ new/DBD-ODBC-1.52/t/87_odbc_lob_read.t 2015-01-17 13:40:17.000000000 +0100
@@ -17,6 +17,8 @@
}
}
+my $not_sql_server;
+
END {
if ($dbh) {
local $dbh->{PrintError} = 0;
@@ -26,7 +28,7 @@
};
}
Test::NoWarnings::had_no_warnings()
- if ($has_test_nowarnings);
+ if ($has_test_nowarnings && !$not_sql_server);
done_testing();
}
@@ -41,8 +43,9 @@
my $dbname = $h->get_info(17); # DBI::SQL_DBMS_NAME
unless ($dbname =~ /Microsoft SQL Server/i) {
+ $not_sql_server = 1;
note("Not MS SQL Server");
- exit 0;
+ plan skip_all => "Not MS SQL Server";
}
eval {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/ODBCTEST.pm new/DBD-ODBC-1.52/t/ODBCTEST.pm
--- old/DBD-ODBC-1.48/t/ODBCTEST.pm 2013-12-17 10:34:12.000000000 +0100
+++ new/DBD-ODBC-1.52/t/ODBCTEST.pm 2015-01-19 09:39:25.000000000 +0100
@@ -36,7 +36,7 @@
%TestFieldInfo = (
'COL_A' => [SQL_SMALLINT,-5, SQL_TINYINT, SQL_NUMERIC, SQL_DECIMAL, SQL_FLOAT, SQL_REAL, SQL_INTEGER],
'COL_B' => [SQL_VARCHAR, SQL_CHAR, SQL_WVARCHAR, SQL_WCHAR],
- 'COL_C' => [SQL_LONGVARCHAR, -1, SQL_WLONGVARCHAR],
+ 'COL_C' => [SQL_LONGVARCHAR, -1, SQL_WLONGVARCHAR, SQL_VARCHAR],
'COL_D' => [SQL_TYPE_TIMESTAMP, SQL_TYPE_DATE, SQL_DATE, SQL_TIMESTAMP ],
);
@@ -78,14 +78,16 @@
$fields .= "$f ";
# print "-- $fields\n";
my $row = get_type_for_column($dbh, $f);
- $fields .= $row->{TYPE_NAME};
- if ($row->{CREATE_PARAMS}) {
+ $fields .= $row->{TYPE_NAME};
+ if ($row->{CREATE_PARAMS}) {
if ($drvname =~ /OdbcFb/i) {
# Firebird ODBC driver seems to be badly broken - for
# varchars it reports max size of 32765 when it is 4000
if ($row->{TYPE_NAME} eq 'VARCHAR') {
$fields .= "(4000)";
}
+ } elsif ($drvname =~ /Pg/) {
+ ## No lengths ever for TEXT!
} elsif ($drvname =~ /lib.*db2/) {
# in DB2 a row cannot be longer than the page size which is usually 32K
# but can be as low as 4K
@@ -95,9 +97,17 @@
}
} elsif (!exists($row->{COLUMN_SIZE})) {
# Postgres 9 seems to omit COLUMN_SIZE
- $fields .= '(4000)';
- note("WARNING Your ODBC driver is broken - DBI's type_info method should return a hashref containing a key of COLUMN_SIZE and we got " .
- join(",", sort keys %$row));
+ # however see discussion at
+ # http://www.postgresql.org/message-id/5315E336.40603@vmware.com and
+ # http://www.postgresql.org/message-id/5315E622.2010904@ntlworld.com
+ # try and use old ODBC 2 PRECISION value
+ if (exists($row->{PRECISION})) {
+ $fields .= '(' . $row->{PRECISION} . ')';
+ } else {
+ $fields .= '(4000)';
+ note("WARNING Your ODBC driver is broken - DBI's type_info method should return a hashref containing a key of COLUMN_SIZE and we got " .
+ join(",", sort keys %$row));
+ }
} else {
$fields .= "($row->{COLUMN_SIZE})" if ($row->{CREATE_PARAMS} =~ /LENGTH/i);
$fields .= "($row->{COLUMN_SIZE},0)" if ($row->{CREATE_PARAMS} =~ /PRECISION,SCALE/i);
@@ -179,6 +189,9 @@
$dbh->quote($_->[1]),
$dbh->quote($_->[2]),
$_->[isDateType($row->{DATA_TYPE}) ? 3 : 4]). ")";
+ if ('Pg' eq $dbh->{Driver}{Name}) {
+ $sql =~ s/{(?:ts|d) (.+?)}/$1/g;
+ }
#diag($sql);
if (!$dbh->do($sql)) {
diag($dbh->errstr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/rt_101579.t new/DBD-ODBC-1.52/t/rt_101579.t
--- old/DBD-ODBC-1.48/t/rt_101579.t 1970-01-01 01:00:00.000000000 +0100
+++ new/DBD-ODBC-1.52/t/rt_101579.t 2015-01-17 11:36:53.000000000 +0100
@@ -0,0 +1,60 @@
+#!/usr/bin/perl -w -I./t
+#
+# rt 101579
+#
+# Between 1.43 and 1.50 DBD::ODBC changed to add check_for_unicode_param
+# function which changes bound types of SQL_VARCHAR etc to their unicode
+# equivalent if the perl scalar is unicode. Unfortunately, if the scalar was not unicode
+# or the described type was not VARCHAR it returned the SQLDescribeParam
+# described type ignoring the fact we map SQL_NUMERIC etc to SQL_VARCHAR.
+# The result is the first call to execute works and subsequent calls often return
+# string data, right truncated for numeric parameters.
+#
+use Test::More;
+use strict;
+
+use DBI;
+use_ok('ODBCTEST');
+eval "require Test::NoWarnings";
+my $has_test_nowarnings = ($@ ? undef : 1);
+
+my $dbh;
+
+BEGIN {
+ if (!defined $ENV{DBI_DSN}) {
+ plan skip_all => "DBI_DSN is undefined";
+ }
+}
+
+END {
+ if ($dbh) {
+ local $dbh->{PrintWarn} = 0;
+ local $dbh->{PrintError} = 0;
+ $dbh->do(q/drop table PERL_DBD_RT_101579/);
+ $dbh->disconnect;
+ }
+ Test::NoWarnings::had_no_warnings()
+ if ($has_test_nowarnings);
+ done_testing();
+
+}
+
+$dbh = DBI->connect();
+unless($dbh) {
+ BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
+ exit 0;
+}
+$dbh->{RaiseError} = 0;
+
+$dbh->do(q/create table PERL_DBD_RT_101579 (method varchar(500), val numeric(9,2))/)
+ or BAIL_OUT("Failed to create test table " . $dbh->errstr);
+
+my @vals = (8295.60, 181161.80, 6514.15);
+my $sth = $dbh->prepare(q/insert into PERL_DBD_RT_101579 (method, val) values(?,?)/);
+foreach my $val (@vals) {
+ eval {
+ $sth->execute('fred', $val);
+ };
+ my $ev = $@;
+ ok(!$ev, "Inserted $val");
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DBD-ODBC-1.48/t/sql_type_cast.t new/DBD-ODBC-1.52/t/sql_type_cast.t
--- old/DBD-ODBC-1.48/t/sql_type_cast.t 2013-12-17 10:35:20.000000000 +0100
+++ new/DBD-ODBC-1.52/t/sql_type_cast.t 2014-07-08 16:24:57.000000000 +0200
@@ -84,7 +84,7 @@
BAIL_OUT("Unable to connect to the database $DBI::errstr\nTests skipped.\n");
exit 0;
}
-
+$dbh->{FetchHashKeyName} = 'NAME_lc';
my ($ev, $sth);
++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#no_testing: broken upstream
#sources:
# - source1
# - source2
patches:
perl-DBD-ODBC-1.29-Makefile.diff: -p0
# bar.patch:
preamble: |-
BuildRequires: unixODBC-devel
post_prep: |-
for file in README.af README.unicode; do
perl -p -i -e "s|\r\n|\n|" "$file"
done
pushd examples
#rpmlint: wrong-file-end-of-line-encoding
find -type f -exec perl -p -i -e "s|\r\n|\n|" {} \;
#rpmlint: wrong-script-interpreter
for ex in *; do
sed -i -e 's,^#!*perl\(.*\),#!/usr/bin/perl\1,' "$ex"
sed -i -e 's,perl.exe -w,perl -w,' "$ex"
done
popd
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module