Skip to content

Commit 5dd0fc8

Browse files
committed
Skip SHA integrity test on MySQL 9.6+ (sha() removed)
MySQL 9.6 removed both md5() and sha() functions. The SHA test was running unconditionally, causing failures on 9.6. Now: - Add has_sha feature detection alongside has_md5 - Make SHA test conditional on has_sha - Add row count verification as fallback for 9.6+ - Bump cache key to v3 to fix corrupt cached tarballs
1 parent 4241f89 commit 5dd0fc8

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/ci-mysql.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/cache@v4
4444
with:
4545
path: /tmp/mysql-tarball
46-
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v2
46+
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v3
4747

4848
- name: Download MySQL
4949
run: |
@@ -90,14 +90,17 @@ jobs:
9090
if [ "$MAJOR" -gt 9 ] || { [ "$MAJOR" -eq 9 ] && [ "$MINOR" -ge 5 ]; }; then
9191
NEEDS_COMMANDS="true"
9292
fi
93-
# Check if MD5() is available (removed in MySQL 9.6+)
93+
# Check if MD5()/SHA() are available (both removed in MySQL 9.6+)
9494
HAS_MD5="true"
95+
HAS_SHA="true"
9596
if [ "$MAJOR" -gt 9 ] || { [ "$MAJOR" -eq 9 ] && [ "$MINOR" -ge 6 ]; }; then
9697
HAS_MD5="false"
98+
HAS_SHA="false"
9799
fi
98100
echo "needs_commands=$NEEDS_COMMANDS" >> "$GITHUB_OUTPUT"
99101
echo "has_md5=$HAS_MD5" >> "$GITHUB_OUTPUT"
100-
echo "MySQL $MYSQL_VERSION: needs_commands=$NEEDS_COMMANDS, has_md5=$HAS_MD5"
102+
echo "has_sha=$HAS_SHA" >> "$GITHUB_OUTPUT"
103+
echo "MySQL $MYSQL_VERSION: needs_commands=$NEEDS_COMMANDS, has_md5=$HAS_MD5, has_sha=$HAS_SHA"
101104
102105
- name: Load employees database
103106
run: |
@@ -120,6 +123,7 @@ jobs:
120123
echo "MD5 OK ($md5_ok matches)"
121124
122125
- name: Test SHA integrity
126+
if: steps.features.outputs.has_sha == 'true'
123127
run: |
124128
EXTRA_ARGS=""
125129
[ "${{ steps.features.outputs.needs_commands }}" == "true" ] && EXTRA_ARGS="--commands"
@@ -132,6 +136,18 @@ jobs:
132136
fi
133137
echo "SHA OK ($sha_ok matches)"
134138
139+
- name: Verify row counts (MySQL 9.6+ fallback)
140+
if: steps.features.outputs.has_sha == 'false'
141+
run: |
142+
SBDIR=$(ls -d ~/sandboxes/msb_*)
143+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM employees;" employees | grep -q 300024
144+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM departments;" employees | grep -q 9
145+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM dept_manager;" employees | grep -q 24
146+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM dept_emp;" employees | grep -q 331603
147+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM titles;" employees | grep -q 443308
148+
$SBDIR/use -BN -e "SELECT COUNT(*) FROM salaries;" employees | grep -q 2844047
149+
echo "Row counts OK"
150+
135151
- name: Load objects (stored procedures/functions)
136152
run: |
137153
EXTRA_ARGS=""
@@ -188,7 +204,7 @@ jobs:
188204
uses: actions/cache@v4
189205
with:
190206
path: /tmp/mysql-tarball
191-
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v2
207+
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v3
192208

193209
- name: Download MySQL
194210
run: |
@@ -314,7 +330,7 @@ jobs:
314330
uses: actions/cache@v4
315331
with:
316332
path: /tmp/mysql-tarball
317-
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v2
333+
key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v3
318334

319335
- name: Download MySQL
320336
run: |

0 commit comments

Comments
 (0)