Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 88d4418

Browse files
committed
Update script show_binlog
Adjustment to allow correct display with 8.0.x when using without '--master' or outside replication
1 parent e33fc90 commit 88d4418

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.71.0 11-Dec-2022
2+
3+
## ADJUSTMENTS
4+
5+
* Update code of `show_binlog` script to find the right binary log
6+
with version 8.0.x, when used without `--master` outside replication.
7+
8+
19
## 1.70.0 31-Oct-2022
210

311
## NEW FEATURES

common/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.70.0
1+
1.71.0

sandbox/templates/single/show_binlog.gotxt

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@ then
1313
exit 1
1414
fi
1515

16+
base='mysql-bin'
17+
if [ "$MYSQL_VERSION_MAJOR" == "8" ]
18+
then
19+
if [ -f ./data/binlog.index ]
20+
then
21+
base="binlog"
22+
fi
23+
fi
24+
1625
pattern=$1
1726
[ -z "$pattern" ] && pattern='[0-9]*'
1827
function get_help {
1928
exit_code=$1
2029
[ -z "$exit_code" ] && exit_code=0
2130
echo "# Usage: $0 [BINLOG_PATTERN] "
22-
echo "# Where BINLOG_PATTERN is a number, or part of a number used after 'mysql-bin'"
31+
echo "# Where BINLOG_PATTERN is a number, or part of a number used after '${base}'"
2332
echo "# (The default is '[0-9]*]')"
2433
echo "# examples:"
2534
echo "# ./show_binlog 000001 | less "
@@ -33,7 +42,7 @@ then
3342
get_help 0
3443
fi
3544
# set -x
36-
last_binlog=$(ls -lotr data/mysql-bin.$pattern | tail -n 1 | awk '{print $NF}')
45+
last_binlog=$(ls -lotr data/${base}.${pattern} | tail -n 1 | awk '{print $NF}')
3746

3847
if [ -z "$last_binlog" ]
3948
then

0 commit comments

Comments
 (0)