You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
multi_sth.t uses master..sysprocesses' "suid" column which isn't available on SQL Server. Change the test so that when connecting to SQL Server it would use the "uid" column instead.
According to http://stackoverflow.com/a/8245884/1540600, "uid" = 1 is "dbo" i.e. it has the same semantics as Sybase's "suid" = 1.
--- t\multi_sth#1.t 2014-02-14 18:32:51.000000000 +-0100
+++ t\multi_sth.t 2014-02-14 18:29:22.000000000 +-0100
@@ -78,20 +78,22 @@
}
# Same thing, with placeholders.
sub test2 {
my $dbh = shift;
+ my $suidColumn = $dbh->{syb_server_version} eq 'Unknown' ? 'uid' : 'suid';
+
SKIP: {
skip '? placeholders not supported', 6 unless $dbh->{syb_dynamic_supported};
my $rc;
my $sth1 = $dbh->prepare("select * from master..sysprocesses where spid = ?");
ok(defined($sth1), 'test2 prepare1');
- my $sth2 = $dbh->prepare("select * from sysusers where suid = ?");
+ my $sth2 = $dbh->prepare("select * from sysusers where $suidColumn = ?");
ok(defined($sth2), 'test2 prepare2');
$rc = $sth1->execute(1);
ok(defined($rc), 'test2 execute1');
$rc = 0;
while(my $d = $sth1->fetch) {
@@ -92,25 +94,27 @@
ok(defined($sth2), 'test2 prepare2');
$rc = $sth1->execute(1);
ok(defined($rc), 'test2 execute1');
$rc = 0;
while(my $d = $sth1->fetch) {
}
# Same thing, with placeholders.
sub test3 {
my $dbh = shift;
+ my $suidColumn = $dbh->{syb_server_version} eq 'Unknown' ? 'uid' : 'suid';
+
SKIP: {
skip '? placeholders not supported', 6 unless $dbh->{syb_dynamic_supported};
my $rc;
my $sth1 = $dbh->prepare("select * from master..sysprocesses where spid = ?");
ok(defined($sth1), 'test3 prepare1');
- my $sth2 = $dbh->prepare("select * from sysusers where suid = ?");
+ my $sth2 = $dbh->prepare("select * from sysusers where $suidColumn = ?");
ok(defined($sth2), 'test3 prepare2');
$rc = $sth1->execute(1);
ok(defined($rc), 'test3 execute1');
# Interleaved execute()
The text was updated successfully, but these errors were encountered:
suid is the login id (at the server level) while uid is at the database level. So suid 1 is the "sa" login, whereas uid 1 is the DBO of any specific database. I don't know how MS-SQL does this - but for Sybase the suid field in sysusers allows you to link the user (in the DB) to the login (at the server level).
That said your patch is probably fine...
Migrated from rt.cpan.org#93040 (status was 'new')
Requestors:
From https://www.google.com/accounts/o8/id?id=AItOawlVEP5IYeRHpH3ZT4ELVsJ3INWz0Lpegpo on 2014-02-14 17:33:15
:
The text was updated successfully, but these errors were encountered: