summaryrefslogtreecommitdiff
path: root/mysql-test/lib/mtr_io.pl
diff options
context:
space:
mode:
authorunknown <knielsen@ymer.(none)>2006-11-24 12:38:39 +0100
committerunknown <knielsen@ymer.(none)>2006-11-24 12:38:39 +0100
commit4d2665f01e50623d7ccc2535267c26759dcc4d0d (patch)
treee3b7198763fc307d3b135225f9de31558fdf352f /mysql-test/lib/mtr_io.pl
parenta865876b1d65f32e31d40fc55217bb0a03266a10 (diff)
downloadmariadb-git-4d2665f01e50623d7ccc2535267c26759dcc4d0d.tar.gz
Do not link /usr/lib/debug/* on Debian <=3.1, as it causes broken stack
traces in Valgrind (broken libc6-dbg). Installing libc6-dbg on Debian will still provide proper bactraces, even without setting LD_LIBRARY_PATH explicitly. mysql-test/lib/mtr_io.pl: Do not link /usr/lib/debug/* on Debian <=3.1, as it causes broken stack traces in Valgrind. mysql-test/mysql-test-run.pl: Do not link /usr/lib/debug/* on Debian <=3.1, as it causes broken stack traces in Valgrind.
Diffstat (limited to 'mysql-test/lib/mtr_io.pl')
-rw-r--r--mysql-test/lib/mtr_io.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index 984d834486c..09749bc74e3 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -13,6 +13,8 @@ sub mtr_tofile ($@);
sub mtr_tonewfile($@);
sub mtr_lastlinefromfile($);
sub mtr_appendfile_to_file ($$);
+sub mtr_grab_file($);
+
##############################################################################
#
@@ -128,6 +130,7 @@ sub unspace {
return "$quote$string$quote";
}
+# Read a whole file, stripping leading and trailing whitespace.
sub mtr_fromfile ($) {
my $file= shift;
@@ -181,5 +184,16 @@ sub mtr_appendfile_to_file ($$) {
close TOFILE;
}
+# Read a whole file verbatim.
+sub mtr_grab_file($) {
+ my $file= shift;
+ open(FILE, '<', $file)
+ or return undef;
+ local $/= undef;
+ my $data= scalar(<FILE>);
+ close FILE;
+ return $data;
+}
+
1;