File: diff-and-restart-sandbox

package info (click to toggle)
percona-toolkit 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, trixie
  • size: 68,916 kB
  • sloc: perl: 241,287; sql: 22,868; sh: 19,746; javascript: 6,799; makefile: 353; awk: 38; python: 30; sed: 1
file content (27 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

die() {
   echo "$*" >&2
   exit 1
}

port="$1"
shift
[ "$port" ] || die "Usage: $0 PORT TABLES"

for table in "$@"; do
   /tmp/$port/use -e "SELECT * FROM $table" > /tmp/$table-after
done

$PERCONA_TOOLKIT_BRANCH/sandbox/test-env restart

for table in "$@"; do
   /tmp/$port/use -e "SELECT * FROM $table" > /tmp/$table-before
   echo "# diff -u /tmp/$table-before /tmp/$table-after"
   echo -n "# columns: "
   head -n 1 /tmp/$table-before
   diff -u /tmp/$table-before /tmp/$table-after
   echo
done

exit 0