Skip Menu |

This queue is for tickets about the DBD-Sybase CPAN distribution.

Report information
The Basics
Id: 93025
Status: open
Priority: 0/
Queue: DBD-Sybase

People
Owner: Nobody in particular
Requestors: sferencik [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.15
Fixed in: (no value)



Subject: main.t - "execute multiple" failing on MS SQL
In main.t, the "execute multiple" test is failing with "Invalid column name 'suid'" when run against MS SQL. In SQL Server, unsurprisingly, there is no such column in master.sysprocesses. Selecting the "suid" is in no way central to the test, so I propose to instead select the "cmd" value, which exists in both Sybase's and SQL Server's sysprocesses. Sam --- t\main#1.t 2014-02-14 10:26:22.000000000 +-0100 +++ t\main.t 2014-02-14 10:29:27.000000000 +-0100 @@ -111,13 +111,13 @@ $dbh->{syb_quoted_identifier} = 0; # Test multiple result sets, varying column names $sth = $dbh->prepare(" select uid, name from sysusers where uid = -2 -select spid, kpid, suid from master..sysprocesses where spid = \@\@spid +select spid, kpid, cmd from master..sysprocesses where spid = \@\@spid "); ok($sth, 'prepare multiple'); $rc = $sth->execute; ok($rc, 'execute multiple'); my $result_set = 0;
From: sferencik [...] gmail.com
Also, the number of tests is out of date. Here's the patch again. --- t\main#1.t 2014-02-14 10:26:22.000000000 +-0100 +++ t\main.t 2014-02-14 10:41:45.000000000 +-0100 @@ -6,13 +6,13 @@ use lib 't'; use _test; use strict; -use Test::More tests=>36; +use Test::More tests=>24; #use Test::More qw(no_plan); use Data::Dumper; BEGIN { use_ok('DBI'); use_ok('DBD::Sybase');} @@ -13,19 +13,19 @@ #use Test::More qw(no_plan); use Data::Dumper; BEGIN { use_ok('DBI'); use_ok('DBD::Sybase');} $dbh->{syb_quoted_identifier} = 0; # Test multiple result sets, varying column names $sth = $dbh->prepare(" select uid, name from sysusers where uid = -2 -select spid, kpid, suid from master..sysprocesses where spid = \@\@spid +select spid, kpid, cmd from master..sysprocesses where spid = \@\@spid "); ok($sth, 'prepare multiple'); $rc = $sth->execute; ok($rc, 'execute multiple'); my $result_set = 0;
From: sferencik [...] gmail.com
Oops, please ignore my 2nd comment; the number of tests is correct (but my main.t dies after 24 tests). The main bug description is still correct.
From: sferencik [...] gmail.com
OK, so there's another usage of suid in main.t which, I think, should go (so this works on SQL Server). Here's a complete patch of main.t with respect to the usage of "suid": --- t\main#1.t 2014-02-14 10:26:22.000000000 +-0100 +++ t\main.t 2014-02-14 12:22:21.000000000 +-0100 @@ -111,13 +111,13 @@ $dbh->{syb_quoted_identifier} = 0; # Test multiple result sets, varying column names $sth = $dbh->prepare(" select uid, name from sysusers where uid = -2 -select spid, kpid, suid from master..sysprocesses where spid = \@\@spid +select spid, kpid, cmd from master..sysprocesses where spid = \@\@spid "); ok($sth, 'prepare multiple'); $rc = $sth->execute; ok($rc, 'execute multiple'); my $result_set = 0; @@ -118,22 +118,22 @@ "); ok($sth, 'prepare multiple'); $rc = $sth->execute; ok($rc, 'execute multiple'); my $result_set = 0; my @desc = $sth->syb_describe; ok($desc[0]->{NAME} eq 'spid', 'describe NAME'); ok($desc[0]->{STATUS} =~ /CS_UPDATABLE/, 'describe STATUS'); ok($desc[0]->{TYPE} == 8, 'describe TYPE'); } -$sth = $dbh->prepare(q|select suid, suser_name(suid), cpu, physical_io +$sth = $dbh->prepare(q|select uid, suser_name(uid), cpu, physical_io from master..sysprocesses -order by suid -compute sum(cpu), sum(physical_io) by suid +order by uid +compute sum(cpu), sum(physical_io) by uid | ); ok($sth, "Prepare compute"); $rc = $sth->execute; ok($rc, "execute compute");