Mercurial > hg > monetdb-perl
comparison MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm @ 50:96edc4137944
When processing query results, check all lines to see if a line contains an error message (i.e. starts with a '!').
This solves the problem that when an UPDATE is aborted due to transaction conflict, existing code only processes the first line of result, which contains <N> affected rows, but fails to process the second line, which contains the transaction aborted error.
Added two conditions to guard against "Use of uninitialized value" errors, one due to index-out-of-band, the other due to already closed connection.
Replaces '\t' with '\ \ '
author | Ying Zhang <y.zhang@cwi.nl> |
---|---|
date | Wed, 14 Jul 2021 22:07:16 +0200 (2021-07-14) |
parents | 44da5de4a725 |
children | 91ec04bb88c6 |
comparison
equal
deleted
inserted
replaced
49:44da5de4a725 | 50:96edc4137944 |
---|---|
25 sub connect | 25 sub connect |
26 { | 26 { |
27 my ($class, $host, $port, $user, $pass, $lang, $db) = @_; | 27 my ($class, $host, $port, $user, $pass, $lang, $db) = @_; |
28 | 28 |
29 my $h = new MonetDB::CLI::Mapi($host, $port, $user, $pass, $lang, $db, 0) | 29 my $h = new MonetDB::CLI::Mapi($host, $port, $user, $pass, $lang, $db, 0) |
30 or die "Making connection failed: $@"; | 30 or die "Making connection failed: $@"; |
31 | 31 |
32 bless { h => $h },'MonetDB::CLI::MapiPP::Cxn'; | 32 bless { h => $h },'MonetDB::CLI::MapiPP::Cxn'; |
33 } | 33 } |
34 | 34 |
35 | 35 |
54 | 54 |
55 sub DESTROY | 55 sub DESTROY |
56 { | 56 { |
57 my ($self) = @_; | 57 my ($self) = @_; |
58 | 58 |
59 $self->{h}->disconnect(); | 59 if (defined $self->{h}) { |
60 $self->{h}->disconnect(); | |
61 } | |
60 | 62 |
61 return; | 63 return; |
62 } | 64 } |
63 | 65 |
64 | 66 |