58 lines
957 B
Bash
58 lines
957 B
Bash
#! /bin/sh
|
|
|
|
trap 'rm -f __*; exit 1' 1 2
|
|
|
|
build_top=../..
|
|
bdb=$build_top/db/build_unix
|
|
|
|
colflag=0
|
|
dump_bdb=0
|
|
while :
|
|
do case "$1" in
|
|
# -b means we need to dump the BDB database
|
|
-b)
|
|
dump_bdb=1;
|
|
shift ;;
|
|
# -c means it was a column-store.
|
|
-c)
|
|
colflag=1
|
|
shift ;;
|
|
*)
|
|
break ;;
|
|
esac
|
|
done
|
|
|
|
if test $# -ne 0; then
|
|
echo 'usage: s_dumpcmp [-bc]' >&2
|
|
exit 1
|
|
fi
|
|
|
|
if test $dump_bdb -eq 1; then
|
|
if test $colflag -eq 0; then
|
|
$bdb/db_dump -p __bdb |
|
|
sed -e '1,/HEADER=END/d' \
|
|
-e '/DATA=END/d' \
|
|
-e 's/^ //' > __bdb_dump
|
|
else
|
|
$bdb/db_dump -p __bdb |
|
|
sed -e '1,/HEADER=END/d' \
|
|
-e '/DATA=END/d' \
|
|
-e 's/^ //' |
|
|
sed -n \
|
|
-e '$p' \
|
|
-e n \
|
|
-e p > __bdb_dump
|
|
fi
|
|
fi
|
|
|
|
bzext="../../ext/compressors/bzip2_compress/.libs/bzip2_compress.so"
|
|
if test -e $bzext ; then
|
|
config='extensions=["'$bzext'"]'
|
|
else
|
|
config=
|
|
fi
|
|
|
|
$build_top/wt -C "$config" dump -p file:__wt > __wt_dump
|
|
cmp __wt_dump __bdb_dump > /dev/null
|
|
exit $?
|