Subject: | DBI-1.53's NUM_OF_FIELDS change breaks DBD-Sybase's t/exec.t |
After upgrading to DBD-1.53, I notice this failure:
ok 19 - Implicit finish handling
DBD::Sybase::st fetch warning: Number of row fields inconsistent with
NUM_OF_FIELDS, NUM_OF_FIELDS updated at t/exec.t line 149.
Use of uninitialized value in numeric eq (==) at t/exec.t line 150.
not ok 20 - Implicit finish handling
# Failed test 'Implicit finish handling'
# at t/exec.t line 150.
DBD::Sybase::st fetch warning: Number of row fields inconsistent with
NUM_OF_FIELDS, NUM_OF_FIELDS updated at t/exec.t line 150.
DBD::Sybase::db prepare failed: Server message number=2401 severity=11
state=2 line=0 server=TLDB text=Character set conversion is not
available between client character set 'utf8' and server character set
'iso_1'.
Server message number=2411 severity=10 state=1 line=0 server=TLDB
text=No conversions will be done.
Looks like it was introduced by DBI's newer, more stringent checking of
NUM_OF_FIELDS.
The following patch to DBD-Sybase has made the problem go away for me.
Index: DBD-Sybase/dbdimp.c
--- DBD-Sybase/dbdimp.c Tue Jan 9 15:42:34 2007
+++ DBD-Sybase/dbdimp.c Tue Jan 9 15:42:34 2007
@@ -3626,7 +3626,7 @@
i = imp_sth->numCols - 1;
while(i >= num_fields)
av_store(av, i--, newSV(0));
- num_fields = AvFILL(av)+1;
+ DBIc_NUM_FIELDS(imp_sth) = AvFILL(av)+1;
if(isReadonly)
SvREADONLY_on(av); /* protect against shift @$row
etc */
} else if(num_fields > imp_sth->numCols) {
@@ -3634,7 +3634,7 @@
if(isReadonly)
SvREADONLY_off(av); /* DBI sets this readonly */
av_fill(av, imp_sth->numCols - 1);
- num_fields = AvFILL(av)+1;
+ DBIc_NUM_FIELDS(imp_sth) = AvFILL(av)+1;
if(isReadonly)
SvREADONLY_on(av); /* protect against shift @$row
etc */
++clear_cache;