RE: [dbi] DBD::ODBC with Perl 5.8.8

RE: [dbi] DBD::ODBC with Perl 5.8.8

am 06.03.2006 21:22:55 von jgillespie

------_=_NextPart_001_01C6415B.C0FE9C57
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

We are using Easysoft odbc-odbc-bridge-2.0.0-linux-x86-glibc with DBI
1.50

Here is what we think is the relevant portion of the trace:

>> bind_param_inout DISPATCH (DBI::st=3DHASH(0x8ac55d8) rc1/1 @5 g0
ima1 pid#30101) at t/20SqlServer.t line 180
-> bind_param_inout for DBD::ODBC::st
(DBI::st=3DHASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
bind 1 <== '' (attribs: ), type 4
<- bind_param_inout=3D 1 at t/20SqlServer.t line 180
>> bind_param DISPATCH (DBI::st=3DHASH(0x8ac55d8) rc1/1 @4 g0 ima1
pid#30101) at t/20SqlServer.t line 181
-> bind_param for DBD::ODBC::st (DBI::st=3DHASH(0x8ac55d8)~0x8ac5638 =
2
1 4)
bind 2 <== '1' (attribs: ), type 4
<- bind_param=3D 1 at t/20SqlServer.t line 181
>> execute DISPATCH (DBI::st=3DHASH(0x8ac55d8) rc1/1 @1 g0 =
ima1041
pid#30101) at t/20SqlServer.t line 183
-> execute for DBD::ODBC::st (DBI::st=3DHASH(0x8ac55d8)~0x8ac5638)
dbd_st_execute (outparams =3D 1)...
bind 1 <== undef (size -1/-1/50, ptype 4, otype 1, sqltype 4)
bind 1 <== '(null)' (len 0/51, null 1)
bind 1: CTy=3D1, STy=3DINTEGER, CD=3D51, Sc=3D1, VM=3D51.
SQLBindParameter: idx =3D 1: fParamType=3D2, name=3D1, fCtype=3D1, =
SQL_Type
=3D 4, cbColDef=3D51, scale=3D1, rgbValue =3D 8af2d70, cbValue
Max=3D51, cbValue =3D 1
Param value =3D
rebind check char Param 1 ()
bind 2 <== 1 (size 1/4/0, ptype 5, otype 1, sqltype 4)
bind 2 <== '1' (len 1/3, null 0)
bind 2: CTy=3D1, STy=3DINTEGER, CD=3D1, Sc=3D1, VM=3D1.
SQLBindParameter: idx =3D 2: fParamType=3D1, name=3D2, fCtype=3D1, =
SQL_Type
=3D 4, cbColDef=3D1, scale=3D1, rgbValue =3D 8af7680, cbValueM
ax=3D1, cbValue =3D 1
Param value =3D 1
rebind check char Param 2 (1)
dbd_st_execute (for hstmt 145710992 before)...
dbd_st_execute (for hstmt 145710992 after, rc =3D 0)...
dbd_error: err_rc=3D0 rc=3D0 s/d/e: 145710992/145541856/145540432
dbd_error: err_rc=3D0 rc=3D0 s/d/e: 0/145541856/145540432
dbd_error: err_rc=3D0 rc=3D0 s/d/e: 0/0/145540432
dbd_st_execute getting row count
dbd_st_execute got row count 1
dbd_describe 145710992 getting num fields
Numfields == 0, SQLMoreResults == 100
dbd_error: err_rc=3D100 rc=3D0 s/d/e: 145710992/145541856/145540432
dbd_error: err_rc=3D100 rc=3D0 s/d/e: 0/145541856/145540432
dbd_error: err_rc=3D100 rc=3D0 s/d/e: 0/0/145540432
dbd_describe sql 145710992: num_fields=3D0
dbd_describe skipped (no result cols) (sql f145710992)
dbd_st_execute got no rows: resetting ACTIVE, moreResults
handling 1 output parameters
out 1 has length of 1
<- execute=3D 1 at t/20SqlServer.t line 183
>> bind_param_inout DISPATCH (DBI::st=3DHASH(0x8ac55d8) rc1/1 @5 g0
ima1 pid#30101) at t/20SqlServer.t line 180
-> bind_param_inout for DBD::ODBC::st
(DBI::st=3DHASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)


-----Original Message-----
From: Martin J. Evans [mailto:martin.evans@easysoft.com]
Sent: Friday, March 03, 2006 10:03 AM
To: dbi-users@perl.org
Subject: RE: [dbi] DBD::ODBC with Perl 5.8.8

Jonathan,

The test that fails works fine for me.
What ODBC driver are you using?

Strangely, what DBD::ODBC is saying is that you bound an in/out
parameter of max size 50 then changed it to 51 but the code in
20SqlServer has a hard-wired 50 so somewhere a long the line the 50 that
got into dbdimp.c got changed to 51.

A trace of the 20SqlServer test might help.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 02-Mar-2006 Jonathan Gillespie wrote:
> Hello,
>
> I'm having problems getting DBD::ODBC 1.13 to work with perl 5.8.8
>
> I'm running CentOS 4.2 with the latest updates, it's a brand new
> install
>
> With Perl 5.8.7, DBD::ODBC installes with out a problem, but with perl
> 5.8.8 I get the following from make test:
>
> make test TEST_VERBOSE=3D1
> PERL_DL_NONLAZY=3D1 /usr/local/perl5.8.8/bin/perl=20
>"-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib',=20
>'blib/arch')" t/*.t
> t/01base.........1..5
> ok 1 - require DBI;
> ok 2 - import DBI
> ok 3 - DBI->internal is DBI::dr
> ok 4 - Install ODBC driver OK
> ok 5 - Version is not empty
> ok
> t/02simple.......1..36
> ok 1 - use DBI;
> ok 2 - use ODBCTEST;
> ok 3 - Set Auto commit
> ok 4 - Auto commit retrieved to what was set ok 5 - create test table

>ok 6 - test table exists ok 7 - insert test data ok 8 - select test
>data ok 9 - Set Long Read len ok 10 - Set Long Truncok 1 ok 11 - Set
>Print Error ok 12 - Select Long data ok 13 - Set Long Truncok 0 ok
>14 - Select Long Data failure ok 15 - prepare select from table ok 16
>- Execute select ok 17 - Col count matches correct col count ok 18 -
>Set RaiseError 0 ok 19 - Set PrintError 0 ok 20 - Error reported on
>bad query ok 21 - date check select ok 22 - date check execute ok 23
>- date check rows ok 24 - group by query prepare ok 25 - group by
>query execute ok 26 - group by query returned rows ok 27 - data
>sources test ok 28 - test ping method ok 29 - Attrib
>odbc_ignore_named_placeholders 0 to start ok 30 - Attrib
>odbc_ignore_named_placeholders set to 1 ok 31 - test connecting twice
>to the same database ok 32 - database name is returned successfully=20
>ok 33 - automatically finish when execute run again ok 34 - INVALID
>DSN Test: [unixODBC][Driver Manager]Data source name not found, and no
>default driver specified (SQL-IM002)(DBD:
> db_login/SQLConnect err=3D-1)
>#
> ok 35 - Connection with DSN=3D
> ok 36 - Connection with DSN=3D and uid and pwd are set ok
> t/03dbatt........1..24
> ok 1 - use DBI;
> ok 2 - use ODBCTEST;
> ok 3 - Set Long Read Len
> ok 4 - AutoCommit set on dbh
> ok 5 - commitTest with AutoCommit
> ok 6 - AutoCommit turned off
> ok 7 - commitTest with AutoCommit off
> ok 8 - Ensure autocommit back on
> ok 9 - sth {NAME} returns ref to array isa ARRAY ok 10 - Column test
>for table_info 0 ok 11 - Column test for table_info 1 ok 12 - Column
>test for table_info 2 ok 13 - Column test for table_info 3 ok 14 -
>Column test for table_info 4 ok 15 - must be some tables out there?
> ok 16 - tables returnes array
> ok 17 - column info returns more than one row for test table ok 18 -
>primary key count ok 19 - prepare update statement returns valid sth=20
>ok 20 - update statement has 0 columns returned ok 21 - update
>statement has 0 columns returned 2 ok 22 - Verify odbc_query_timeout
>set ok ok 23 - verify dbh setting for query_timeout passed to sth ok
>24 - verify sth query_timeout can be overridden ok
> t/05meth.........1..8
> ok 1 - use DBI;
> ok 2 - delete prepared statement
> ok 3 - Number of rows > 0
> ok 4 - Number of rows from DBI matches sth ok 5 - finished and rolled
>back ok 6 - no error ok 7 - ?
> ok 8 - ??
> ok
> t/07bind.........1..11
> ok 1 - use ODBCTEST;
> ok 2 - Create tables
> ok 3 - Table insert test
> ok 4 - Ensure long readlen set correctly ok 5 - Select tests ok 6 -
>Insert with bind tests ok 7 - select long test data ok 8 - update
>long test data ok 9 - select long test data again ok 10 - ParamValues
>test integer ok 11 - Paramvalues test string ok
> t/08bind2........1..5
> ok 1 - use ODBCTEST;
> ok 2 - use Data::Dumper;
> ok 3 - insert \#1 various test data no dates, no long data ok 4 -
>insert \#2 various test data no dates, with long data ok 5 - insert
>\#3 various test data data with dates ok
> t/09multi........1..7
> ok 1 - use strict;
> ok 2 - use DBI;
> ok 3 - use ODBCTEST;
> ok 4 - count number of result sets
> ok 5 - Multiple result sets with different column counts (less then
> more)
> ok 6 - Multiple result sets with different column counts (more then
> less)
> ok 7 - Multiple result sets with multiple cols, then second result set

>with one col ok
> t/20SqlServer....1..37
> ok 1 - use ODBCTEST;
> ok 2 - use Data::Dumper;
> ok 3 - errors on data comparison
> ok 4 - temporary table handling
> Can't change param 1 maxlen (51->50) after first bind at
>t/20SqlServer.t line 180.
># Looks like you planned 37 tests but only ran 4.
># Looks like your test died just after 4.
> dubious
> Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED
>tests 5-37
> Failed 33/37 tests, 10.81% okay
> t/30Oracle.......1..4
> ok 1 - use ODBCTEST;
> ok 2 - use Data::Dumper;
> ok 3 # skip Oracle tests not supported using Microsoft SQL Server ok
>4 # skip Oracle tests not supported using Microsoft SQL Server ok
> 2/4 skipped: Oracle tests not supported using Microsoft SQL=20
>Server
> Failed Test Stat Wstat Total Fail Failed List of Failed
>
>----------------------------------------------------------- ------------
>-
> -------
> t/20SqlServer.t 255 65280 37 66 178.38% 5-37
> 2 subtests skipped.
> Failed 1/9 test scripts, 88.89% okay. 33/137 subtests failed, 75.91%=20
>okay.
> make: *** [test_dynamic] Error 255



------_=_NextPart_001_01C6415B.C0FE9C57--

Re: [dbi] DBD::ODBC with Perl 5.8.8

am 06.03.2006 21:35:16 von Martin.Evans

As I suspected, DBD::ODBC has bumped the length to 51 then on the rebind
spotted it has grown from 50 to 51. I will try and reproduce tomorrow
and get back to you.

I've also bcc'ed support@easysoft.com so they know you are
experiencing a problem although at this stage I am thinking
the issue is in DBD::ODBC (but that may change).

Martin

Jonathan Gillespie wrote:
> We are using Easysoft odbc-odbc-bridge-2.0.0-linux-x86-glibc with DBI 1.50
>
> Here is what we think is the relevant portion of the trace:
>
> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
> ima1 pid#30101) at t/20SqlServer.t line 180
> -> bind_param_inout for DBD::ODBC::st
> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
> bind 1 <== '' (attribs: ), type 4
> <- bind_param_inout= 1 at t/20SqlServer.t line 180
> >> bind_param DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @4 g0 ima1
> pid#30101) at t/20SqlServer.t line 181
> -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638 2
> 1 4)
> bind 2 <== '1' (attribs: ), type 4
> <- bind_param= 1 at t/20SqlServer.t line 181
> >> execute DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @1 g0 ima1041
> pid#30101) at t/20SqlServer.t line 183
> -> execute for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638)
> dbd_st_execute (outparams = 1)...
> bind 1 <== undef (size -1/-1/*50*, ptype 4, otype 1, sqltype 4)
> bind 1 <== '(null)' (len 0/*51*, null 1)
> bind 1: CTy=1, STy=INTEGER, CD=51, Sc=1, VM=51.
> SQLBindParameter: idx = 1: fParamType=2, name=1, fCtype=1, SQL_Type
> = 4, cbColDef=51, scale=1, rgbValue = 8af2d70, cbValue
> Max=51, cbValue = 1
> Param value =
> rebind check char Param 1 ()
> bind 2 <== 1 (size 1/4/0, ptype 5, otype 1, sqltype 4)
> bind 2 <== '1' (len 1/3, null 0)
> bind 2: CTy=1, STy=INTEGER, CD=1, Sc=1, VM=1.
> SQLBindParameter: idx = 2: fParamType=1, name=2, fCtype=1, SQL_Type
> = 4, cbColDef=1, scale=1, rgbValue = 8af7680, cbValueM
> ax=1, cbValue = 1
> Param value = 1
> rebind check char Param 2 (1)
> dbd_st_execute (for hstmt 145710992 before)...
> dbd_st_execute (for hstmt 145710992 after, rc = 0)...
> dbd_error: err_rc=0 rc=0 s/d/e: 145710992/145541856/145540432
> dbd_error: err_rc=0 rc=0 s/d/e: 0/145541856/145540432
> dbd_error: err_rc=0 rc=0 s/d/e: 0/0/145540432
> dbd_st_execute getting row count
> dbd_st_execute got row count 1
> dbd_describe 145710992 getting num fields
> Numfields == 0, SQLMoreResults == 100
> dbd_error: err_rc=100 rc=0 s/d/e: 145710992/145541856/145540432
> dbd_error: err_rc=100 rc=0 s/d/e: 0/145541856/145540432
> dbd_error: err_rc=100 rc=0 s/d/e: 0/0/145540432
> dbd_describe sql 145710992: num_fields=0
> dbd_describe skipped (no result cols) (sql f145710992)
> dbd_st_execute got no rows: resetting ACTIVE, moreResults
> handling 1 output parameters
> out 1 has length of 1
> <- execute= 1 at t/20SqlServer.t line 183
> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
> ima1 pid#30101) at t/20SqlServer.t line 180
> -> bind_param_inout for DBD::ODBC::st
> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
>
>
> -----Original Message-----
> From: Martin J. Evans [mailto:martin.evans@easysoft.com]
> Sent: Friday, March 03, 2006 10:03 AM
> To: dbi-users@perl.org
> Subject: RE: [dbi] DBD::ODBC with Perl 5.8.8
>
> Jonathan,
>
> The test that fails works fine for me.
> What ODBC driver are you using?
>
> Strangely, what DBD::ODBC is saying is that you bound an in/out
> parameter of max size 50 then changed it to 51 but the code in
> 20SqlServer has a hard-wired 50 so somewhere a long the line the 50 that
> got into dbdimp.c got changed to 51.
>
> A trace of the 20SqlServer test might help.
>
> Martin
> --
> Martin J. Evans
> Easysoft Ltd, UK
> http://www.easysoft.com
>
>
> On 02-Mar-2006 Jonathan Gillespie wrote:
> > Hello,
> >
> > I'm having problems getting DBD::ODBC 1.13 to work with perl 5.8.8
> >
> > I'm running CentOS 4.2 with the latest updates, it's a brand new
> > install
> >
> > With Perl 5.8.7, DBD::ODBC installes with out a problem, but with perl
> > 5.8.8 I get the following from make test:
> >
> > make test TEST_VERBOSE=1
> > PERL_DL_NONLAZY=1 /usr/local/perl5.8.8/bin/perl
> >"-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib',
> >'blib/arch')" t/*.t
> > t/01base.........1..5
> > ok 1 - require DBI;
> > ok 2 - import DBI
> > ok 3 - DBI->internal is DBI::dr
> > ok 4 - Install ODBC driver OK
> > ok 5 - Version is not empty
> > ok
> > t/02simple.......1..36
> > ok 1 - use DBI;
> > ok 2 - use ODBCTEST;
> > ok 3 - Set Auto commit
> > ok 4 - Auto commit retrieved to what was set ok 5 - create test table
> >ok 6 - test table exists ok 7 - insert test data ok 8 - select test
> >data ok 9 - Set Long Read len ok 10 - Set Long Truncok 1 ok 11 - Set
> >Print Error ok 12 - Select Long data ok 13 - Set Long Truncok 0 ok
> >14 - Select Long Data failure ok 15 - prepare select from table ok 16
> >- Execute select ok 17 - Col count matches correct col count ok 18 -
> >Set RaiseError 0 ok 19 - Set PrintError 0 ok 20 - Error reported on
> >bad query ok 21 - date check select ok 22 - date check execute ok 23
> >- date check rows ok 24 - group by query prepare ok 25 - group by
> >query execute ok 26 - group by query returned rows ok 27 - data
> >sources test ok 28 - test ping method ok 29 - Attrib
> >odbc_ignore_named_placeholders 0 to start ok 30 - Attrib
> >odbc_ignore_named_placeholders set to 1 ok 31 - test connecting twice
> >to the same database ok 32 - database name is returned successfully
> >ok 33 - automatically finish when execute run again ok 34 - INVALID
> >DSN Test: [unixODBC][Driver Manager]Data source name not found, and no
> >default driver specified (SQL-IM002)(DBD:
> > db_login/SQLConnect err=-1)
> >#
> > ok 35 - Connection with DSN=
> > ok 36 - Connection with DSN= and uid and pwd are set ok
> > t/03dbatt........1..24
> > ok 1 - use DBI;
> > ok 2 - use ODBCTEST;
> > ok 3 - Set Long Read Len
> > ok 4 - AutoCommit set on dbh
> > ok 5 - commitTest with AutoCommit
> > ok 6 - AutoCommit turned off
> > ok 7 - commitTest with AutoCommit off
> > ok 8 - Ensure autocommit back on
> > ok 9 - sth {NAME} returns ref to array isa ARRAY ok 10 - Column test
> >for table_info 0 ok 11 - Column test for table_info 1 ok 12 - Column
> >test for table_info 2 ok 13 - Column test for table_info 3 ok 14 -
> >Column test for table_info 4 ok 15 - must be some tables out there?
> > ok 16 - tables returnes array
> > ok 17 - column info returns more than one row for test table ok 18 -
> >primary key count ok 19 - prepare update statement returns valid sth
> >ok 20 - update statement has 0 columns returned ok 21 - update
> >statement has 0 columns returned 2 ok 22 - Verify odbc_query_timeout
> >set ok ok 23 - verify dbh setting for query_timeout passed to sth ok
> >24 - verify sth query_timeout can be overridden ok
> > t/05meth.........1..8
> > ok 1 - use DBI;
> > ok 2 - delete prepared statement
> > ok 3 - Number of rows > 0
> > ok 4 - Number of rows from DBI matches sth ok 5 - finished and rolled
> >back ok 6 - no error ok 7 - ?
> > ok 8 - ??
> > ok
> > t/07bind.........1..11
> > ok 1 - use ODBCTEST;
> > ok 2 - Create tables
> > ok 3 - Table insert test
> > ok 4 - Ensure long readlen set correctly ok 5 - Select tests ok 6 -
> >Insert with bind tests ok 7 - select long test data ok 8 - update
> >long test data ok 9 - select long test data again ok 10 - ParamValues
> >test integer ok 11 - Paramvalues test string ok
> > t/08bind2........1..5
> > ok 1 - use ODBCTEST;
> > ok 2 - use Data::Dumper;
> > ok 3 - insert \#1 various test data no dates, no long data ok 4 -
> >insert \#2 various test data no dates, with long data ok 5 - insert
> >\#3 various test data data with dates ok
> > t/09multi........1..7
> > ok 1 - use strict;
> > ok 2 - use DBI;
> > ok 3 - use ODBCTEST;
> > ok 4 - count number of result sets
> > ok 5 - Multiple result sets with different column counts (less then
> > more)
> > ok 6 - Multiple result sets with different column counts (more then
> > less)
> > ok 7 - Multiple result sets with multiple cols, then second result set
> >with one col ok
> > t/20SqlServer....1..37
> > ok 1 - use ODBCTEST;
> > ok 2 - use Data::Dumper;
> > ok 3 - errors on data comparison
> > ok 4 - temporary table handling
> > Can't change param 1 maxlen (51->50) after first bind at
> >t/20SqlServer.t line 180.
> ># Looks like you planned 37 tests but only ran 4.
> ># Looks like your test died just after 4.
> > dubious
> > Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED
> >tests 5-37
> > Failed 33/37 tests, 10.81% okay
> > t/30Oracle.......1..4
> > ok 1 - use ODBCTEST;
> > ok 2 - use Data::Dumper;
> > ok 3 # skip Oracle tests not supported using Microsoft SQL Server ok
> >4 # skip Oracle tests not supported using Microsoft SQL Server ok
> > 2/4 skipped: Oracle tests not supported using Microsoft SQL
> >Server
> > Failed Test Stat Wstat Total Fail Failed List of Failed
> >
> >----------------------------------------------------------- ------------
> >-
> > -------
> > t/20SqlServer.t 255 65280 37 66 178.38% 5-37
> > 2 subtests skipped.
> > Failed 1/9 test scripts, 88.89% okay. 33/137 subtests failed, 75.91%
> >okay.
> > make: *** [test_dynamic] Error 255
>

Re: [dbi] DBD::ODBC with Perl 5.8.8

am 07.03.2006 15:15:33 von Martin.Evans

Hi again. I've now had a chance to take a quick look at this. I can reproduce
with DBI 1.50 and DBD::ODBC 1.13 and it happens no matter what the underlying
ODBC driver is. It appears it is something specific to at least perl 5.8.8 as:

Your bound parameter is an undef and DBD::ODBC does:

svGrow(phs->sv, 50)

but

SvLEN(phs->sv) returns 52!

and DBD::ODBC does not expect this.

Certainly does not happen in 5.8.7. I'm out of my depth for the moment on this
now. If any one has any ideas on this I'd appreciate them.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 06-Mar-2006 Martin J. Evans wrote:
> As I suspected, DBD::ODBC has bumped the length to 51 then on the rebind
> spotted it has grown from 50 to 51. I will try and reproduce tomorrow
> and get back to you.
>
> I've also bcc'ed support@easysoft.com so they know you are
> experiencing a problem although at this stage I am thinking
> the issue is in DBD::ODBC (but that may change).
>
> Martin
>
> Jonathan Gillespie wrote:
>> We are using Easysoft odbc-odbc-bridge-2.0.0-linux-x86-glibc with DBI 1.50
>>
>> Here is what we think is the relevant portion of the trace:
>>
>> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
>> ima1 pid#30101) at t/20SqlServer.t line 180
>> -> bind_param_inout for DBD::ODBC::st
>> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
>> bind 1 <== '' (attribs: ), type 4
>> <- bind_param_inout= 1 at t/20SqlServer.t line 180
>> >> bind_param DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @4 g0 ima1
>> pid#30101) at t/20SqlServer.t line 181
>> -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638 2
>> 1 4)
>> bind 2 <== '1' (attribs: ), type 4
>> <- bind_param= 1 at t/20SqlServer.t line 181
>> >> execute DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @1 g0 ima1041
>> pid#30101) at t/20SqlServer.t line 183
>> -> execute for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638)
>> dbd_st_execute (outparams = 1)...
>> bind 1 <== undef (size -1/-1/*50*, ptype 4, otype 1, sqltype 4)
>> bind 1 <== '(null)' (len 0/*51*, null 1)
>> bind 1: CTy=1, STy=INTEGER, CD=51, Sc=1, VM=51.
>> SQLBindParameter: idx = 1: fParamType=2, name=1, fCtype=1, SQL_Type
>> = 4, cbColDef=51, scale=1, rgbValue = 8af2d70, cbValue
>> Max=51, cbValue = 1
>> Param value =
>> rebind check char Param 1 ()
>> bind 2 <== 1 (size 1/4/0, ptype 5, otype 1, sqltype 4)
>> bind 2 <== '1' (len 1/3, null 0)
>> bind 2: CTy=1, STy=INTEGER, CD=1, Sc=1, VM=1.
>> SQLBindParameter: idx = 2: fParamType=1, name=2, fCtype=1, SQL_Type
>> = 4, cbColDef=1, scale=1, rgbValue = 8af7680, cbValueM
>> ax=1, cbValue = 1
>> Param value = 1
>> rebind check char Param 2 (1)
>> dbd_st_execute (for hstmt 145710992 before)...
>> dbd_st_execute (for hstmt 145710992 after, rc = 0)...
>> dbd_error: err_rc=0 rc=0 s/d/e: 145710992/145541856/145540432
>> dbd_error: err_rc=0 rc=0 s/d/e: 0/145541856/145540432
>> dbd_error: err_rc=0 rc=0 s/d/e: 0/0/145540432
>> dbd_st_execute getting row count
>> dbd_st_execute got row count 1
>> dbd_describe 145710992 getting num fields
>> Numfields == 0, SQLMoreResults == 100
>> dbd_error: err_rc=100 rc=0 s/d/e: 145710992/145541856/145540432
>> dbd_error: err_rc=100 rc=0 s/d/e: 0/145541856/145540432
>> dbd_error: err_rc=100 rc=0 s/d/e: 0/0/145540432
>> dbd_describe sql 145710992: num_fields=0
>> dbd_describe skipped (no result cols) (sql f145710992)
>> dbd_st_execute got no rows: resetting ACTIVE, moreResults
>> handling 1 output parameters
>> out 1 has length of 1
>> <- execute= 1 at t/20SqlServer.t line 183
>> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
>> ima1 pid#30101) at t/20SqlServer.t line 180
>> -> bind_param_inout for DBD::ODBC::st
>> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
>>
>>
>> -----Original Message-----
>> From: Martin J. Evans [mailto:martin.evans@easysoft.com]
>> Sent: Friday, March 03, 2006 10:03 AM
>> To: dbi-users@perl.org
>> Subject: RE: [dbi] DBD::ODBC with Perl 5.8.8
>>
>> Jonathan,
>>
>> The test that fails works fine for me.
>> What ODBC driver are you using?
>>
>> Strangely, what DBD::ODBC is saying is that you bound an in/out
>> parameter of max size 50 then changed it to 51 but the code in
>> 20SqlServer has a hard-wired 50 so somewhere a long the line the 50 that
>> got into dbdimp.c got changed to 51.
>>
>> A trace of the 20SqlServer test might help.
>>
>> Martin
>> --
>> Martin J. Evans
>> Easysoft Ltd, UK
>> http://www.easysoft.com
>>
>>
>> On 02-Mar-2006 Jonathan Gillespie wrote:
>> > Hello,
>> >
>> > I'm having problems getting DBD::ODBC 1.13 to work with perl 5.8.8
>> >
>> > I'm running CentOS 4.2 with the latest updates, it's a brand new
>> > install
>> >
>> > With Perl 5.8.7, DBD::ODBC installes with out a problem, but with perl
>> > 5.8.8 I get the following from make test:
>> >
>> > make test TEST_VERBOSE=1
>> > PERL_DL_NONLAZY=1 /usr/local/perl5.8.8/bin/perl
>> >"-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib',
>> >'blib/arch')" t/*.t
>> > t/01base.........1..5
>> > ok 1 - require DBI;
>> > ok 2 - import DBI
>> > ok 3 - DBI->internal is DBI::dr
>> > ok 4 - Install ODBC driver OK
>> > ok 5 - Version is not empty
>> > ok
>> > t/02simple.......1..36
>> > ok 1 - use DBI;
>> > ok 2 - use ODBCTEST;
>> > ok 3 - Set Auto commit
>> > ok 4 - Auto commit retrieved to what was set ok 5 - create test table
>> >ok 6 - test table exists ok 7 - insert test data ok 8 - select test
>> >data ok 9 - Set Long Read len ok 10 - Set Long Truncok 1 ok 11 - Set
>> >Print Error ok 12 - Select Long data ok 13 - Set Long Truncok 0 ok
>> >14 - Select Long Data failure ok 15 - prepare select from table ok 16
>> >- Execute select ok 17 - Col count matches correct col count ok 18 -
>> >Set RaiseError 0 ok 19 - Set PrintError 0 ok 20 - Error reported on
>> >bad query ok 21 - date check select ok 22 - date check execute ok 23
>> >- date check rows ok 24 - group by query prepare ok 25 - group by
>> >query execute ok 26 - group by query returned rows ok 27 - data
>> >sources test ok 28 - test ping method ok 29 - Attrib
>> >odbc_ignore_named_placeholders 0 to start ok 30 - Attrib
>> >odbc_ignore_named_placeholders set to 1 ok 31 - test connecting twice
>> >to the same database ok 32 - database name is returned successfully
>> >ok 33 - automatically finish when execute run again ok 34 - INVALID
>> >DSN Test: [unixODBC][Driver Manager]Data source name not found, and no
>> >default driver specified (SQL-IM002)(DBD:
>> > db_login/SQLConnect err=-1)
>> >#
>> > ok 35 - Connection with DSN=
>> > ok 36 - Connection with DSN= and uid and pwd are set ok
>> > t/03dbatt........1..24
>> > ok 1 - use DBI;
>> > ok 2 - use ODBCTEST;
>> > ok 3 - Set Long Read Len
>> > ok 4 - AutoCommit set on dbh
>> > ok 5 - commitTest with AutoCommit
>> > ok 6 - AutoCommit turned off
>> > ok 7 - commitTest with AutoCommit off
>> > ok 8 - Ensure autocommit back on
>> > ok 9 - sth {NAME} returns ref to array isa ARRAY ok 10 - Column test
>> >for table_info 0 ok 11 - Column test for table_info 1 ok 12 - Column
>> >test for table_info 2 ok 13 - Column test for table_info 3 ok 14 -
>> >Column test for table_info 4 ok 15 - must be some tables out there?
>> > ok 16 - tables returnes array
>> > ok 17 - column info returns more than one row for test table ok 18 -
>> >primary key count ok 19 - prepare update statement returns valid sth
>> >ok 20 - update statement has 0 columns returned ok 21 - update
>> >statement has 0 columns returned 2 ok 22 - Verify odbc_query_timeout
>> >set ok ok 23 - verify dbh setting for query_timeout passed to sth ok
>> >24 - verify sth query_timeout can be overridden ok
>> > t/05meth.........1..8
>> > ok 1 - use DBI;
>> > ok 2 - delete prepared statement
>> > ok 3 - Number of rows > 0
>> > ok 4 - Number of rows from DBI matches sth ok 5 - finished and rolled
>> >back ok 6 - no error ok 7 - ?
>> > ok 8 - ??
>> > ok
>> > t/07bind.........1..11
>> > ok 1 - use ODBCTEST;
>> > ok 2 - Create tables
>> > ok 3 - Table insert test
>> > ok 4 - Ensure long readlen set correctly ok 5 - Select tests ok 6 -
>> >Insert with bind tests ok 7 - select long test data ok 8 - update
>> >long test data ok 9 - select long test data again ok 10 - ParamValues
>> >test integer ok 11 - Paramvalues test string ok
>> > t/08bind2........1..5
>> > ok 1 - use ODBCTEST;
>> > ok 2 - use Data::Dumper;
>> > ok 3 - insert \#1 various test data no dates, no long data ok 4 -
>> >insert \#2 various test data no dates, with long data ok 5 - insert
>> >\#3 various test data data with dates ok
>> > t/09multi........1..7
>> > ok 1 - use strict;
>> > ok 2 - use DBI;
>> > ok 3 - use ODBCTEST;
>> > ok 4 - count number of result sets
>> > ok 5 - Multiple result sets with different column counts (less then
>> > more)
>> > ok 6 - Multiple result sets with different column counts (more then
>> > less)
>> > ok 7 - Multiple result sets with multiple cols, then second result set
>> >with one col ok
>> > t/20SqlServer....1..37
>> > ok 1 - use ODBCTEST;
>> > ok 2 - use Data::Dumper;
>> > ok 3 - errors on data comparison
>> > ok 4 - temporary table handling
>> > Can't change param 1 maxlen (51->50) after first bind at
>> >t/20SqlServer.t line 180.
>> ># Looks like you planned 37 tests but only ran 4.
>> ># Looks like your test died just after 4.
>> > dubious
>> > Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED
>> >tests 5-37
>> > Failed 33/37 tests, 10.81% okay
>> > t/30Oracle.......1..4
>> > ok 1 - use ODBCTEST;
>> > ok 2 - use Data::Dumper;
>> > ok 3 # skip Oracle tests not supported using Microsoft SQL Server ok
>> >4 # skip Oracle tests not supported using Microsoft SQL Server ok
>> > 2/4 skipped: Oracle tests not supported using Microsoft SQL
>> >Server
>> > Failed Test Stat Wstat Total Fail Failed List of Failed
>> >
>> >----------------------------------------------------------- ------------
>> >-
>> > -------
>> > t/20SqlServer.t 255 65280 37 66 178.38% 5-37
>> > 2 subtests skipped.
>> > Failed 1/9 test scripts, 88.89% okay. 33/137 subtests failed, 75.91%
>> >okay.
>> > make: *** [test_dynamic] Error 255
>>

Re: [dbi] DBD::ODBC with Perl 5.8.8

am 07.03.2006 15:32:45 von Martin.Evans

Sorry,

I meant:

svGrow(phs->sv, 50 + 1)

SvLEN(phs->sv) returns 52!

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 07-Mar-2006 Martin J. Evans wrote:
> Hi again. I've now had a chance to take a quick look at this. I can reproduce
> with DBI 1.50 and DBD::ODBC 1.13 and it happens no matter what the underlying
> ODBC driver is. It appears it is something specific to at least perl 5.8.8
> as:
>
> Your bound parameter is an undef and DBD::ODBC does:
>
> svGrow(phs->sv, 50)
>
> but
>
> SvLEN(phs->sv) returns 52!
>
> and DBD::ODBC does not expect this.
>
> Certainly does not happen in 5.8.7. I'm out of my depth for the moment on
> this
> now. If any one has any ideas on this I'd appreciate them.
>
> Martin
> --
> Martin J. Evans
> Easysoft Ltd, UK
> http://www.easysoft.com
>
>
> On 06-Mar-2006 Martin J. Evans wrote:
>> As I suspected, DBD::ODBC has bumped the length to 51 then on the rebind
>> spotted it has grown from 50 to 51. I will try and reproduce tomorrow
>> and get back to you.
>>
>> I've also bcc'ed support@easysoft.com so they know you are
>> experiencing a problem although at this stage I am thinking
>> the issue is in DBD::ODBC (but that may change).
>>
>> Martin
>>
>> Jonathan Gillespie wrote:
>>> We are using Easysoft odbc-odbc-bridge-2.0.0-linux-x86-glibc with DBI 1.50
>>>
>>> Here is what we think is the relevant portion of the trace:
>>>
>>> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
>>> ima1 pid#30101) at t/20SqlServer.t line 180
>>> -> bind_param_inout for DBD::ODBC::st
>>> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
>>> bind 1 <== '' (attribs: ), type 4
>>> <- bind_param_inout= 1 at t/20SqlServer.t line 180
>>> >> bind_param DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @4 g0 ima1
>>> pid#30101) at t/20SqlServer.t line 181
>>> -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638 2
>>> 1 4)
>>> bind 2 <== '1' (attribs: ), type 4
>>> <- bind_param= 1 at t/20SqlServer.t line 181
>>> >> execute DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @1 g0 ima1041
>>> pid#30101) at t/20SqlServer.t line 183
>>> -> execute for DBD::ODBC::st (DBI::st=HASH(0x8ac55d8)~0x8ac5638)
>>> dbd_st_execute (outparams = 1)...
>>> bind 1 <== undef (size -1/-1/*50*, ptype 4, otype 1, sqltype 4)
>>> bind 1 <== '(null)' (len 0/*51*, null 1)
>>> bind 1: CTy=1, STy=INTEGER, CD=51, Sc=1, VM=51.
>>> SQLBindParameter: idx = 1: fParamType=2, name=1, fCtype=1, SQL_Type
>>> = 4, cbColDef=51, scale=1, rgbValue = 8af2d70, cbValue
>>> Max=51, cbValue = 1
>>> Param value =
>>> rebind check char Param 1 ()
>>> bind 2 <== 1 (size 1/4/0, ptype 5, otype 1, sqltype 4)
>>> bind 2 <== '1' (len 1/3, null 0)
>>> bind 2: CTy=1, STy=INTEGER, CD=1, Sc=1, VM=1.
>>> SQLBindParameter: idx = 2: fParamType=1, name=2, fCtype=1, SQL_Type
>>> = 4, cbColDef=1, scale=1, rgbValue = 8af7680, cbValueM
>>> ax=1, cbValue = 1
>>> Param value = 1
>>> rebind check char Param 2 (1)
>>> dbd_st_execute (for hstmt 145710992 before)...
>>> dbd_st_execute (for hstmt 145710992 after, rc = 0)...
>>> dbd_error: err_rc=0 rc=0 s/d/e: 145710992/145541856/145540432
>>> dbd_error: err_rc=0 rc=0 s/d/e: 0/145541856/145540432
>>> dbd_error: err_rc=0 rc=0 s/d/e: 0/0/145540432
>>> dbd_st_execute getting row count
>>> dbd_st_execute got row count 1
>>> dbd_describe 145710992 getting num fields
>>> Numfields == 0, SQLMoreResults == 100
>>> dbd_error: err_rc=100 rc=0 s/d/e: 145710992/145541856/145540432
>>> dbd_error: err_rc=100 rc=0 s/d/e: 0/145541856/145540432
>>> dbd_error: err_rc=100 rc=0 s/d/e: 0/0/145540432
>>> dbd_describe sql 145710992: num_fields=0
>>> dbd_describe skipped (no result cols) (sql f145710992)
>>> dbd_st_execute got no rows: resetting ACTIVE, moreResults
>>> handling 1 output parameters
>>> out 1 has length of 1
>>> <- execute= 1 at t/20SqlServer.t line 183
>>> >> bind_param_inout DISPATCH (DBI::st=HASH(0x8ac55d8) rc1/1 @5 g0
>>> ima1 pid#30101) at t/20SqlServer.t line 180
>>> -> bind_param_inout for DBD::ODBC::st
>>> (DBI::st=HASH(0x8ac55d8)~0x8ac5638 1 SCALAR(0x89a2d64) 50 4)
>>>
>>>
>>> -----Original Message-----
>>> From: Martin J. Evans [mailto:martin.evans@easysoft.com]
>>> Sent: Friday, March 03, 2006 10:03 AM
>>> To: dbi-users@perl.org
>>> Subject: RE: [dbi] DBD::ODBC with Perl 5.8.8
>>>
>>> Jonathan,
>>>
>>> The test that fails works fine for me.
>>> What ODBC driver are you using?
>>>
>>> Strangely, what DBD::ODBC is saying is that you bound an in/out
>>> parameter of max size 50 then changed it to 51 but the code in
>>> 20SqlServer has a hard-wired 50 so somewhere a long the line the 50 that
>>> got into dbdimp.c got changed to 51.
>>>
>>> A trace of the 20SqlServer test might help.
>>>
>>> Martin
>>> --
>>> Martin J. Evans
>>> Easysoft Ltd, UK
>>> http://www.easysoft.com
>>>
>>>
>>> On 02-Mar-2006 Jonathan Gillespie wrote:
>>> > Hello,
>>> >
>>> > I'm having problems getting DBD::ODBC 1.13 to work with perl 5.8.8
>>> >
>>> > I'm running CentOS 4.2 with the latest updates, it's a brand new
>>> > install
>>> >
>>> > With Perl 5.8.7, DBD::ODBC installes with out a problem, but with perl
>>> > 5.8.8 I get the following from make test:
>>> >
>>> > make test TEST_VERBOSE=1
>>> > PERL_DL_NONLAZY=1 /usr/local/perl5.8.8/bin/perl
>>> >"-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib',
>>> >'blib/arch')" t/*.t
>>> > t/01base.........1..5
>>> > ok 1 - require DBI;
>>> > ok 2 - import DBI
>>> > ok 3 - DBI->internal is DBI::dr
>>> > ok 4 - Install ODBC driver OK
>>> > ok 5 - Version is not empty
>>> > ok
>>> > t/02simple.......1..36
>>> > ok 1 - use DBI;
>>> > ok 2 - use ODBCTEST;
>>> > ok 3 - Set Auto commit
>>> > ok 4 - Auto commit retrieved to what was set ok 5 - create test table
>>> >ok 6 - test table exists ok 7 - insert test data ok 8 - select test
>>> >data ok 9 - Set Long Read len ok 10 - Set Long Truncok 1 ok 11 - Set
>>> >Print Error ok 12 - Select Long data ok 13 - Set Long Truncok 0 ok
>>> >14 - Select Long Data failure ok 15 - prepare select from table ok 16
>>> >- Execute select ok 17 - Col count matches correct col count ok 18 -
>>> >Set RaiseError 0 ok 19 - Set PrintError 0 ok 20 - Error reported on
>>> >bad query ok 21 - date check select ok 22 - date check execute ok 23
>>> >- date check rows ok 24 - group by query prepare ok 25 - group by
>>> >query execute ok 26 - group by query returned rows ok 27 - data
>>> >sources test ok 28 - test ping method ok 29 - Attrib
>>> >odbc_ignore_named_placeholders 0 to start ok 30 - Attrib
>>> >odbc_ignore_named_placeholders set to 1 ok 31 - test connecting twice
>>> >to the same database ok 32 - database name is returned successfully
>>> >ok 33 - automatically finish when execute run again ok 34 - INVALID
>>> >DSN Test: [unixODBC][Driver Manager]Data source name not found, and no
>>> >default driver specified (SQL-IM002)(DBD:
>>> > db_login/SQLConnect err=-1)
>>> >#
>>> > ok 35 - Connection with DSN=
>>> > ok 36 - Connection with DSN= and uid and pwd are set ok
>>> > t/03dbatt........1..24
>>> > ok 1 - use DBI;
>>> > ok 2 - use ODBCTEST;
>>> > ok 3 - Set Long Read Len
>>> > ok 4 - AutoCommit set on dbh
>>> > ok 5 - commitTest with AutoCommit
>>> > ok 6 - AutoCommit turned off
>>> > ok 7 - commitTest with AutoCommit off
>>> > ok 8 - Ensure autocommit back on
>>> > ok 9 - sth {NAME} returns ref to array isa ARRAY ok 10 - Column test
>>> >for table_info 0 ok 11 - Column test for table_info 1 ok 12 - Column
>>> >test for table_info 2 ok 13 - Column test for table_info 3 ok 14 -
>>> >Column test for table_info 4 ok 15 - must be some tables out there?
>>> > ok 16 - tables returnes array
>>> > ok 17 - column info returns more than one row for test table ok 18 -
>>> >primary key count ok 19 - prepare update statement returns valid sth
>>> >ok 20 - update statement has 0 columns returned ok 21 - update
>>> >statement has 0 columns returned 2 ok 22 - Verify odbc_query_timeout
>>> >set ok ok 23 - verify dbh setting for query_timeout passed to sth ok
>>> >24 - verify sth query_timeout can be overridden ok
>>> > t/05meth.........1..8
>>> > ok 1 - use DBI;
>>> > ok 2 - delete prepared statement
>>> > ok 3 - Number of rows > 0
>>> > ok 4 - Number of rows from DBI matches sth ok 5 - finished and rolled
>>> >back ok 6 - no error ok 7 - ?
>>> > ok 8 - ??
>>> > ok
>>> > t/07bind.........1..11
>>> > ok 1 - use ODBCTEST;
>>> > ok 2 - Create tables
>>> > ok 3 - Table insert test
>>> > ok 4 - Ensure long readlen set correctly ok 5 - Select tests ok 6 -
>>> >Insert with bind tests ok 7 - select long test data ok 8 - update
>>> >long test data ok 9 - select long test data again ok 10 - ParamValues
>>> >test integer ok 11 - Paramvalues test string ok
>>> > t/08bind2........1..5
>>> > ok 1 - use ODBCTEST;
>>> > ok 2 - use Data::Dumper;
>>> > ok 3 - insert \#1 various test data no dates, no long data ok 4 -
>>> >insert \#2 various test data no dates, with long data ok 5 - insert
>>> >\#3 various test data data with dates ok
>>> > t/09multi........1..7
>>> > ok 1 - use strict;
>>> > ok 2 - use DBI;
>>> > ok 3 - use ODBCTEST;
>>> > ok 4 - count number of result sets
>>> > ok 5 - Multiple result sets with different column counts (less then
>>> > more)
>>> > ok 6 - Multiple result sets with different column counts (more then
>>> > less)
>>> > ok 7 - Multiple result sets with multiple cols, then second result set
>>> >with one col ok
>>> > t/20SqlServer....1..37
>>> > ok 1 - use ODBCTEST;
>>> > ok 2 - use Data::Dumper;
>>> > ok 3 - errors on data comparison
>>> > ok 4 - temporary table handling
>>> > Can't change param 1 maxlen (51->50) after first bind at
>>> >t/20SqlServer.t line 180.
>>> ># Looks like you planned 37 tests but only ran 4.
>>> ># Looks like your test died just after 4.
>>> > dubious
>>> > Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED
>>> >tests 5-37
>>> > Failed 33/37 tests, 10.81% okay
>>> > t/30Oracle.......1..4
>>> > ok 1 - use ODBCTEST;
>>> > ok 2 - use Data::Dumper;
>>> > ok 3 # skip Oracle tests not supported using Microsoft SQL Server ok
>>> >4 # skip Oracle tests not supported using Microsoft SQL Server ok
>>> > 2/4 skipped: Oracle tests not supported using Microsoft SQL
>>> >Server
>>> > Failed Test Stat Wstat Total Fail Failed List of Failed
>>> >
>>> >----------------------------------------------------------- ------------
>>> >-
>>> > -------
>>> > t/20SqlServer.t 255 65280 37 66 178.38% 5-37
>>> > 2 subtests skipped.
>>> > Failed 1/9 test scripts, 88.89% okay. 33/137 subtests failed, 75.91%
>>> >okay.
>>> > make: *** [test_dynamic] Error 255
>>>