|
| 1 | +# Database Version Rift Skill |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +This skill maps critical differences between MySQL and MariaDB versions to help developers implement cross-compatible diagnostics in MySQLTuner. |
| 6 | + |
| 7 | +## Replication Commands |
| 8 | + |
| 9 | +| Feature | MySQL < 8.0.22 / MariaDB < 10.5 | MySQL >= 8.0.22 | MariaDB >= 10.5 | |
| 10 | +| :--- | :--- | :--- | :--- | |
| 11 | +| **Show Slave Status** | `SHOW SLAVE STATUS` | `SHOW REPLICA STATUS` (Preferred) | `SHOW REPLICA STATUS` (Preferred) | |
| 12 | +| **Show Slave Hosts** | `SHOW SLAVE HOSTS` | `SHOW REPLICA HOSTS` | `SHOW REPLICA HOSTS` | |
| 13 | + |
| 14 | +**Strategy:** |
| 15 | +Detect version first. If version >= breakpoint, try `REPLICA`, fall back to `SLAVE` if error or empty (though strictly version check is safer). |
| 16 | + |
| 17 | +## Authentication & Security |
| 18 | + |
| 19 | +| Feature | MySQL 5.7 / MariaDB | MySQL 8.0+ | |
| 20 | +| :--- | :--- | :--- | |
| 21 | +| **PASSWORD() function**| Available | **REMOVED** (Use SHA2 functions or app-side hashing) | |
| 22 | +| **User table** | `mysql.user` (authentication_string since 5.7) | `mysql.user` (authentication_string) | |
| 23 | + |
| 24 | +**Strategy:** |
| 25 | +For password checks in MySQL 8.0+, do strictly SQL-based checks (e.g., length of auth string) or avoid logic that depends on hashing input strings via SQL. |
| 26 | + |
| 27 | +## Information Schema Differences |
| 28 | + |
| 29 | +### `information_schema.TABLES` |
| 30 | + |
| 31 | +- Usually stable, but check `Data_free` interpretation across engines. |
| 32 | + |
| 33 | +### `performance_schema` |
| 34 | + |
| 35 | +- **MySQL 5.6+**: Defaults enabled (mostly). |
| 36 | +- **MariaDB 10.0+**: Defaults varying. |
| 37 | +- **Check**: Always verify `performance_schema = ON` before querying tables. |
| 38 | + |
| 39 | +## System Variables (Renames) |
| 40 | + |
| 41 | +| Legacy Name | Modern Name (MySQL 8.0+) | Note | |
| 42 | +| :--- | :--- | :--- | |
| 43 | +| `tx_isolation` | `transaction_isolation` | Check both or `||` them. | |
| 44 | +| `query_cache_size` | *Removed* | Removed in MySQL 8.0 | |
| 45 | + |
| 46 | +**Strategy:** |
| 47 | +Use the `mysqltuner.pl` valid variable abstraction or check for existence before using. |
| 48 | + |
| 49 | +## MariaDB vs MySQL Divergence |
| 50 | + |
| 51 | +- **Thread Pool**: |
| 52 | + - **MariaDB**: Built-in, specific vars (`thread_pool_size`, `thread_pool_oversubscribe`). |
| 53 | + - **MySQL**: Enterprise only or Percona specific. |
| 54 | + - **Action**: Check `version_comment` or `version` string for "MariaDB" before recommending thread pool settings. |
| 55 | + |
| 56 | +- **Aria Engine**: |
| 57 | + - Specific to MariaDB (replacement for MyISAM for system tables). |
| 58 | + - Don't tune `aria_pagecache_buffer_size` on Oracle MySQL. |
0 commit comments