DBD::ODBC 1.31 release

I have just uploaded DBD::ODBC 1.31 to pause. This is the culmination of 7 development releases and I thought it was time to do an official release. Due to personal issues I am unlikely to be doing another update to DBD::ODBC in the near future but if you find issues please report them on RT and I'll try my best. The changes since 1.29 are below. There are significant changes since the last official release and a few changes in behaviour. If you didn't test a development release and it now goes wrong I'm sorry but after 7 development releases you had your chance. I'm sorry if this sounds harsh but it is notoriously difficult to get feedback on development releases, few smokers actually have a database set up (but thank you anyway) and it is next to impossible for me to cover the dozens of ODBC drivers in existence.

Thank you to all the people who have reported issues, tested releases and in particular to the DBIx::Class guys who yet again have provided invaluable testing (you know who you are and if we ever meet up it will be beers all round on me).

=head2 Changes in DBD::ODBC 1.31 June 21, 2011


Recently introduced test sql_type_cast.t cannot work with DBI less
than 1.611.

Minor change to Makefile.PL to avoid use of unitialised warning on
$ENV{LD_LIBRARY_PATH} in warning when it is not set.

=head2 Changes in DBD::ODBC 1.30_7 June 15, 2011


Some time ago (I don't know when) a few internal errors generated by
DBD::ODBC got ignored. There are about 5 of them but I seriously
doubt anyone would hit any other than the data truncated error
(which is reported by the ODBC driver anyway) and "no select
statement currently executing". You can see rt_68720.t in the t
directory for an example of the latter.


An extra argument has been added to the sub associated with
odbc_err_handler. The arguments passed to the odbc_err_handler are
now state (string), error (string), native error code (number) and
the status returned from the last ODBC API. The status will be
SQL_ERROR (-1) for errors or SQL_SUCCESS_WITH_INFO (1) for
informational messages.

=head2 Changes in DBD::ODBC 1.30_6 June 4, 2011


* When DBD::ODBC calls SQLExecDirect (the do method) it was not
reporting informational diagnostics (SQL_SUCCESS_WITH_INFO) and
not calling the error handler.

Arguably, this is a change in behaviour but one I've struggled to
resolve since in all other cases of warnings DBD::ODBC's error
handler is called. However, DBI does not call its error handler
for warnings so was DBD::ODBC wrong to call it's error in the
first place for warnings? I decided it was better to leave this as
it is but add checking of SQLExecDirect/do. Apart from anything
else if DBD::ODBC does not call its error handler for
informational diagnostics there is no way to retrieve print
statements etc from procedures.

* The odbc_describe_parameter.t test could fail with some versions
of MS SQL Server ODBC Driver. It was down to when
SQLDescribeParameter is disabled, the column_size passed to
SQLBindParameter is 0.

* pod example of odbc_err_handler incorrectly used \$err_handler
instead of \&err_handler.

=head2 Changes in DBD::ODBC 1.30_5 May 24, 2011


* The change in behavior detailed in 1.30_1 for wide character
binding was still not working properly (see
http://rt.cpan.org/Ticket/Display.html?id=67994). It was working
for SQL_CHAR described columns but not SQL_VARCHAR.

=head2 Changes in DBD::ODBC 1.30_4 May 18, 2011


* Fix issue described in
If you prepare a statement, disconnect and then try and execute the
statement you get an error but it does not tell what is wrong.


* Added support for StrictlyTyped and DiscardString to the bind_col


* Minor changes to META.yml for mailing list, dynamic_config,
homepage and keywords.

* The pod was missing = before the heads on a couple of sections in
"Private DBD::ODBC Functions"

* TreatAsLob was incorrectly documented as BindAsLob.

=head2 Changes in DBD::ODBC 1.30_3 May 17, 2011


* Made the new odbc_describe_parameters work and added test case.

=head2 Changes in DBD::ODBC 1.30_2 May 16, 2011


* Added the new odbc_describe_parameters attribute.

=head2 Changes in DBD::ODBC 1.30_1 May 12, 2011


* Fixed some compiler warnings shown with -Wall including some
printf formats that had extra/missing arguments.

* Fixed t/70execute_array.t which was missing an "order by" in the
check_data sub which could cause failures for drivers not
returning the rows in the order they were inserted.

* Minor fix to Makefile.PL to avoid issuing variable used in void


* DBD::ODBC used to quietly rollback any transactions when
disconnect was called and AutoCommit was off. This can mask a
problem and leads to different behavior when disconnect is called
vs not calling disconnect (where you get a warning). This release
issues a warning if you call disconnect and a transaction is in
progress then it is rolled back.

* DBD::ODBC used to bind char/varchar/longvarchar columns as SQL_CHAR
meaning that in the unicode build of DBD::ODBC the bound column
data would be returned 8bit in whatever character-set (codepage) the
data was in, in the database. This was inconvenient and arguably a
mistake. Columns like nchar/nvarchar etc were bound as SQL_WCHAR and
returned as Unicode. This release changes the behaviour in a unicode
build of DBD::ODBC to bind all char columns as SQL_WCHAR. This may
inconvenience a few people who expected 8bit chars back, knew the
char set and decoded them (sorry). See odbc_old_unicode to return
to old behaviour.


* added -w option to Makefile.PL to add "-Wall" to CCFLAGS and
-fno-strict-aliasing so I can find warnings.

* Cope with broken ODBC drivers that describe a parameter as SQL
type 0.


* Add "disconnect and transactions" to pod describing what DBD::ODBC
does if you call disconnect with an outstanding transaction.

* Reorganised FAQ for bound parameter issues and added a lot on
bound parameter problems.

* Added new FAQ entry for Firebird

* Removed some unused variables and added some missing function