New development release of DBD::ODBC 1.40_3

2012-10-08 Thread Martin J. Evans
I will probably release this as 1.41 in the next week. Please note the 
changes in behaviour.


=head2 Changes in DBD::ODBC 1.40_3 October 8 2012

  [BUG FIXES]

  Oops, changes to some rt tests fail when not run to MS SQL Server
  and they should not be run for other drivers - there was a double
  done_testing call.

  [CHANGE IN BEHAVIOUR]

  As I warned literally years ago DBD::ODBC's private function
  DescribeCol has been removed. You can use DBI's statement attributes
  like NAME, PRECISION etc, instead. All test code has been changed to
  remove calls to DescribeCol and GetTypeInfo.

  [MISCELLANEOUS]

  New example sqlserver_supplementary_chrs.pl added which shows that
  in MS SQL Server 2012 you can now store unicode characters
  over 0x (ones which are surrogate pairs).

  More documentation for odbc_out_connect_string.

=head2 Changes in DBD::ODBC 1.40_2 September 6 2012

  [BUG FIXES]

  Fixed rt 78838 - bind_param does not correctly stringify blessed
  objects when connected to MS SQL Server

  Fix issue in dbd_bind_ph where if you passed a sql type and were
  also attempting to change from in to out or vice versa or increasing
  the size of an output bound param it would not spot this error.

  Allowed the test cases to spot DB2 driver as libXXXdb2.

  [MISCELLANEOUS]

  New test cases added for some rts.

  Added Test::NoWarnings to some tests where it was missing.

=head2 Changes in DBD::ODBC 1.40_1 September 4 2012

  [BUG FIXES]

  Debian/Ubuntu have moved unixODBC into /usr/lib/i386-linux-gnu
  so look in this dir for unixODBC as well - thanks to Meastro for finding.

  Fixed rt 78838
  I had a sequence point error which is only seen with some compilers
  as it is sometimes optimized out. It could cause DBD::ODBC to omit
  adding the UID/PWD to the end of the connection string when using DSN=.
  Thanks to Zsolt Cserna for spotting it and to ilmari and Leon for
  explaining it to me.

  Fixed rt 79397
  Output bound parameters may be incorrectly bound if changed after
  bind_param_inout is called. If you start with an undef bound param
  and change it to a defined string/number less than 28 characters
  before calling execute the original undef will probably be bound.
  Thanks to runrig on perl monks for providing an example.

  [CHANGE IN BEHAVIOUR]

  If you attempt to bind an rv without amagic DBD::ODBC will now
  croak - related to rt 78838.


Patch proposal for leak in DBD::Oracle when calling 'execute_array' with UTF-8 NLS...

2012-10-08 Thread Pierre-Alain Blanc



Hello,

I've had a problem when using 'execute_array' to insert (lots of) 
records with DBD::Oracle (version 1.50): the script consumed too much 
memory and finally crashed (killed by kernel). I tried to trigger the 
garbage-collection with some code rewrite but it didn't help.
But if I told Oracle *not* to use an UTF-8 charset (changing NLS_LANG 
from (for example) "german_germany.utf8" to "german_germany.we8dec"), 
the problem disappeared.


After some investigations, I think the leak is in 'ora_st_execute_array' 
method of dbdimp.c. Please find the patch as attachment.
As I'm completly new to writing C for Perl, it may be something I did 
not understand or did not correctly fixed. Sorry if it would be the case.


Thanks & best regards,
Pierre-Alain Blanc


Index: dbdimp.c
===
--- dbdimp.c	(revision 15435)
+++ dbdimp.c	(working copy)
@@ -3839,6 +3839,7 @@
 	}
 	Safefree(phs);
 	Safefree(utf8_flgs);
+	SvREFCNT_dec(tuples_utf8_av);
 	/* Store array of bind typles, for use in OCIBindDynamic() callback. */
 	imp_sth->bind_tuples = tuples_av;
 	imp_sth->rowwise = (columns_av == NULL);