Skip to content

Commit f48b7b9

Browse files
committed
Cyclic crash on query without database
1 parent 26fcbf8 commit f48b7b9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/admin/MySQL.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,36 @@ Remove the disk quota from the account temporarily to allow MySQL to repair the
8989
EditDomain -c diskquota,quota=20000 -c diskquota,unit=MB site34
9090
```
9191

92+
### Cyclic crash on query
93+
94+
An alternative form can occur during query with little indication of which account is triggering the crash. In these situations, (1) look for all databases that contain the table and (2) perform the non-destructive `SELECT` query against it.
95+
96+
```
97+
/usr/sbin/mysqld(_ZN7handler18ha_index_next_sameEPhPKhj+0x285)[0x561898860025]
98+
/usr/sbin/mysqld(_ZN7handler21multi_range_read_nextEPPv+0xb2)[0x561898764ee2]
99+
...
100+
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x245)[0x56189863ce55]
101+
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1a33)[0x56189863f843]
102+
/usr/sbin/mysqld(_Z10do_commandP3THD+0x107)[0x561898641737]
103+
...
104+
105+
Trying to get some variables.
106+
Some pointers may be invalid and cause the dump to abort.
107+
Query (0x7f7928010710): SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER BY post_modified_gmt DESC LIMIT 1
108+
```
109+
110+
In the above, the look for a table named "wp_posts.ibd" or "wp_posts.MYI" (*NB: WordPress uses InnoDB, so the extension is .ibd*) then apply the query. When MariaDB disconnects, it's the culprit.
111+
112+
```bash
113+
find -L /var/lib/mysql -mindepth 2 -type f -iregex '.*/wp_posts\.\(ibd\|myd\)' | cut -d/ -f5 | sed -e 's!@00!\\x!g' | xargs -0 echo -e | while read db ; do
114+
echo $db
115+
echo "SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER BY post_modified_gmt DESC LIMIT 1" | mysql $db || break
116+
done
117+
```
118+
119+
Table is corrupted. Restore from backup located within the user's home directory beneath `mysql_backups/`.
120+
121+
92122
### Row size too large
93123

94124
#### Background

0 commit comments

Comments
 (0)