Changeset: 7f8a33058ead for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f8a33058ead Modified Files: Branch: default Log Message:
Merge with Aug2011 branch. diffs (252 lines): diff --git a/clients/ChangeLog.Aug2011 b/clients/ChangeLog.Aug2011 --- a/clients/ChangeLog.Aug2011 +++ b/clients/ChangeLog.Aug2011 @@ -1,6 +1,14 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Mon Sep 19 2011 Sjoerd Mullender <[email protected]> +- Perl: We now distinguish properly between TABLE and GLOBAL TEMPORARY + (the latter are recognized by being in the "tmp" schema). +- Perl: fixed a bunch of syntax errors. This fixes bug 2884. With thanks + to Rémy Chibois. +- Perl: Fixed DBD::monetdb table_info and tabletype_info. This fixes + bug 2885. With thanks to Rémy Chibois. + * Tue Sep 13 2011 Sjoerd Mullender <[email protected]> - mclient: fix display of varchar columns with only NULL values. - Fixed a bug in mclient/msqldump where an internal error occurred during diff --git a/clients/perl/DBD/monetdb.pm b/clients/perl/DBD/monetdb.pm --- a/clients/perl/DBD/monetdb.pm +++ b/clients/perl/DBD/monetdb.pm @@ -233,10 +233,11 @@ SQL my $ttp = { - 'TABLE' => 't."istable" = true and t."system" = false and t."temporary" = 0' -,'SYSTEM TABLE' => 't."istable" = true and t."system" = true and t."temporary" = 0' -,'LOCAL TEMPORARY' => 't."istable" = true and t."system" = false and t."temporary" = 1' -,'VIEW' => 't."istable" = false ' + 'TABLE' => 't."type" = 0 and t."system" = false and t."temporary" = 0 and s.name <> \'tmp\'' +,'GLOBAL TEMPORARY' => 't."type" = 0 and t."system" = false and t."temporary" = 0 and s.name = \'tmp\'' +,'SYSTEM TABLE' => 't."type" = 0 and t."system" = true and t."temporary" = 0' +,'LOCAL TEMPORARY' => 't."type" = 0 and t."system" = false and t."temporary" = 1' +,'VIEW' => 't."type" = 1 ' }; @@ -248,14 +249,16 @@ select distinct , cast( null as varchar( 128 ) ) as table_schem , cast( null as varchar( 128 ) ) as table_name , case - when $ttp->{'TABLE' } then cast('TABLE' as varchar( 254 ) ) - when $ttp->{'SYSTEM TABLE' } then cast('SYSTEM TABLE' as varchar( 254 ) ) - when $ttp->{'LOCAL TEMPORARY'} then cast('LOCAL TEMPORARY' as varchar( 254 ) ) - when $ttp->{'VIEW' } then cast('VIEW' as varchar( 254 ) ) - else cast('INTERNAL TABLE TYPE' as varchar( 254 ) ) + when $ttp->{'TABLE' } then cast('TABLE' as varchar( 254 ) ) + when $ttp->{'SYSTEM TABLE' } then cast('SYSTEM TABLE' as varchar( 254 ) ) + when $ttp->{'LOCAL TEMPORARY' } then cast('LOCAL TEMPORARY' as varchar( 254 ) ) + when $ttp->{'GLOBAL TEMPORARY'} then cast('GLOBAL TEMPORARY' as varchar( 254 ) ) + when $ttp->{'VIEW' } then cast('VIEW' as varchar( 254 ) ) + else cast('INTERNAL TABLE TYPE' as varchar( 254 ) ) end as table_type , cast( null as varchar( 254 ) ) as remarks - from sys."tables" t + from sys."tables" t, sys."schemas" s + where t."schema_id" = s."id" order by table_type SQL my $sth = $dbh->prepare($sql) or return; @@ -271,11 +274,12 @@ select cast( null as varchar( 128 ) ) as , s."name" as table_schem , t."name" as table_name , case - when $ttp->{'TABLE' } then cast('TABLE' as varchar( 254 ) ) - when $ttp->{'SYSTEM TABLE' } then cast('SYSTEM TABLE' as varchar( 254 ) ) - when $ttp->{'LOCAL TEMPORARY'} then cast('LOCAL TEMPORARY' as varchar( 254 ) ) - when $ttp->{'VIEW' } then cast('VIEW' as varchar( 254 ) ) - else cast('INTERNAL TABLE TYPE' as varchar( 254 ) ) + when $ttp->{'TABLE' } then cast('TABLE' as varchar( 254 ) ) + when $ttp->{'SYSTEM TABLE' } then cast('SYSTEM TABLE' as varchar( 254 ) ) + when $ttp->{'LOCAL TEMPORARY' } then cast('LOCAL TEMPORARY' as varchar( 254 ) ) + when $ttp->{'GLOBAL TEMPORARY'} then cast('GLOBAL TEMPORARY' as varchar( 254 ) ) + when $ttp->{'VIEW' } then cast('VIEW' as varchar( 254 ) ) + else cast('INTERNAL TABLE TYPE' as varchar( 254 ) ) end as table_type , cast( null as varchar( 254 ) ) as remarks from sys."schemas" s diff --git a/clients/perl/DBD/monetdb/GetInfo.pm b/clients/perl/DBD/monetdb/GetInfo.pm --- a/clients/perl/DBD/monetdb/GetInfo.pm +++ b/clients/perl/DBD/monetdb/GetInfo.pm @@ -22,7 +22,7 @@ use DBD::monetdb(); my $sql_driver = 'monetdb'; my $sql_ver_fmt = '%02d.%02d.%04d'; # ODBC version string: ##.##.##### -my $sql_driver_ver = sprintf $sql_ver_fmt, split(/\./, $DBD::monetdb::VERSION); +my $sql_driver_ver = sprintf $sql_ver_fmt, split(/\./, $DBD::monetdb::VERSION), 0; my @Keywords = qw( BOOLEAN diff --git a/clients/perl/Mapi.pm b/clients/perl/Mapi.pm --- a/clients/perl/Mapi.pm +++ b/clients/perl/Mapi.pm @@ -25,8 +25,8 @@ use Digest::SHA qw(sha1_hex sha256_hex s sub pass_chal { my ($passwd, @challenge) = @_; - if (@challenge[2] == 9) { - my $pwhash = @challenge[5]; + if ($challenge[2] == 9) { + my $pwhash = $challenge[5]; if ($pwhash eq 'SHA512') { $passwd = sha512_hex($passwd); } elsif ($pwhash eq 'SHA256') { @@ -39,33 +39,33 @@ sub pass_chal { warn "unsupported password hash: ".$pwhash; return; } - } elsif (@challenge[2] == 8) { + } elsif ($challenge[2] == 8) { # can leave passwd cleartext } else { - warn "unsupported protocol version: ".@challenge[2]; + warn "unsupported protocol version: ".$challenge[2]; return; } - my @cyphers = split(/,/, @challenge[3]); + my @cyphers = split(/,/, $challenge[3]); my $chal; foreach (@cyphers) { if ($_ eq 'SHA512') { - $chal = "{$_}".sha512_hex($passwd.@challenge[0]); + $chal = "{$_}".sha512_hex($passwd.$challenge[0]); last; } elsif ($_ eq 'SHA256') { - $chal = "{$_}".sha256_hex($passwd.@challenge[0]); + $chal = "{$_}".sha256_hex($passwd.$challenge[0]); last; } elsif ($_ eq 'SHA1') { - $chal = "{$_}".sha1_hex($passwd.@challenge[0]); + $chal = "{$_}".sha1_hex($passwd.$challenge[0]); last; } elsif ($_ eq 'MD5') { - $chal = "{$_}".md5_hex($passwd.@challenge[0]); + $chal = "{$_}".md5_hex($passwd.$challenge[0]); last; } } if (!$chal) { # we assume v8's "plain" - $chal = "{plain}".$passwd.@challenge[0]; + $chal = "{plain}".$passwd.$challenge[0]; } return $chal; @@ -118,7 +118,7 @@ sub new { $self->{socket}->close; print "Following redirect: $prompt\n" if ($self->{trace}); my @tokens = split(/[\n\/:\?]+/, $prompt); # dirty, but it's Perl anyway - return new Mapi(@tokens[3], @tokens[4], $user, $passwd, $lang, @tokens[5], $trace); + return new Mapi($tokens[3], $tokens[4], $user, $passwd, $lang, $tokens[5], $trace); } elsif ($prompt =~ /^\^mapi:merovingian:\/\/proxy/) { # proxied redirect do { @@ -240,7 +240,7 @@ sub getRow { my $row = $self->{lines}[$self->{next}++]; my @chars = split(//, $row); - if (@chars[0] eq '!') { + if ($chars[0] eq '!') { $self->error($row); my $i = 1; while ($self->{lines}[$i] =~ '!') { @@ -249,11 +249,11 @@ sub getRow { } $self->{active} = 0; return -1 - } elsif (@chars[0] eq '&') { + } elsif ($chars[0] eq '&') { # not expected - } elsif (@chars[0] eq '%') { + } elsif ($chars[0] eq '%') { # header line - } elsif (@chars[0] eq '[') { + } elsif ($chars[0] eq '[') { # row result $self->{row} = $row; if ($self->{nrcols} < 0) { @@ -261,13 +261,13 @@ sub getRow { $self->{nrcols}++; } $self->{active} = 1; - } elsif (@chars[0] eq '=') { + } elsif ($chars[0] eq '=') { # xml result line $self->{row} = substr($row, 1); # skip = $self->{active} = 1; - } elsif (@chars[0] eq '^') { + } elsif ($chars[0] eq '^') { # ^ redirect, ie use different server - } elsif (@chars[0] eq '#') { + } elsif ($chars[0] eq '#') { # warnings etc, skip, and return what follows return $self->getRow; } @@ -293,9 +293,9 @@ sub getBlock { $self->{offset} = 0; $self->{hdrs} = []; - if (@chars[0] eq '&') { - if (@chars[1] eq '1' || @chars[1] eq 6) { - if (@chars[1] eq '1') { + if ($chars[0] eq '&') { + if ($chars[1] eq '1' || $chars[1] eq 6) { + if ($chars[1] eq '1') { # &1 id result-count nr-cols rows-in-this-block my ($dummy,$id,$cnt,$nrcols,$replysize) = split(' ', $header); $self->{id} = $id; @@ -321,7 +321,7 @@ sub getBlock { $self->{row} = $self->{lines}[$self->{next}++]; $self->{active} = 1; - } elsif (@chars[1] eq '2') { # updates + } elsif ($chars[1] eq '2') { # updates my ($dummy,$cnt) = split(' ', $header); $self->{count} = $cnt; $self->{nrcols} = 1; @@ -329,16 +329,16 @@ sub getBlock { $self->{row} = "" . $cnt; $self->{next} = $cnt; # all done return -2; - } elsif (@chars[1] eq '3') { # transaction + } elsif ($chars[1] eq '3') { # transaction # nothing todo - } elsif (@chars[1] eq '4') { # auto_commit + } elsif ($chars[1] eq '4') { # auto_commit my ($dummy,$ac) = split(' ', $header); if ($ac eq 't') { $self->{auto_commit} = 1; } else { $self->{auto_commit} = 0; } - } elsif (@chars[1] eq '5') { # prepare + } elsif ($chars[1] eq '5') { # prepare my ($dummy,$id,$cnt,$nrcols,$replysize) = split(' ', $header); # TODO parse result, rows (type, digits, scale) $self->{count} = $cnt; diff --git a/sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out.single b/sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out.single --- a/sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out.single +++ b/sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out.single @@ -47,8 +47,8 @@ function user.s0_1{autoCommit=true}():vo X_16 := bat.reverse(X_15); X_17 := algebra.kdifference(X_14,X_16); X_18 := batcalc.flt(X_17); - X_43 := batmmath.log10(X_18); - X_19 := algebra.thetauselect(X_43,1:flt,">"); + X_42 := batmmath.log10(X_18); + X_19 := algebra.thetauselect(X_42,1:flt,">"); X_21 := algebra.markT(X_19,0@0:oid); X_22 := bat.reverse(X_21); X_23 := algebra.leftjoin(X_22,X_14); _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
