code
stringlengths
2.5k
150k
kind
stringclasses
1 value
mariadb 10.3.10 Release Upgrade Tests 10.3.10 Release Upgrade Tests ============================= ### Tested revision bad2f1569da57c4a81cc84ec2f4a79924df9c8d6 ### Test date 2018-10-04 23:04:05 ### Summary Known bug [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094). A few upgrades from MySQL and old MariaDB fail because the old versions hang on shutdown ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | recovery | 16 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 16 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 4 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 4 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 8 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 8 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 16 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 16 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 4 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 4 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 8 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 8 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 16 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 4 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 32 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 64 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 8 | 10.3.10 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 16 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 4 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 32 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 64 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 8 | 10.3.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 16 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 4 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 32 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 64 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 8 | 10.3.10 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 16 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 4 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 32 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 64 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 8 | 10.3.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 16 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.18 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.18 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.18 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.18 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.36 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.36 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.36 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.36 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.10 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.10 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.10 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.10 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.10 (inbuilt) | | - | - | - | OK | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb launchd launchd ======= In MacOS, create a file called /Library/LaunchDaemons/com.mariadb.server.plist with the following contents (edit to suit): ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.mariadb.server</string> <key>KeepAlive</key><true/> <key>RunAtLoad</key><true/> <key>LaunchOnlyOnce</key><false/> <key>ExitTimeOut</key><integer>600</integer> <key>WorkingDirectory</key><string>/usr/local/var</string> <key>Program</key><string>/usr/local/bin/mysqld</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/mysqld</string> <string>--user=_mysql</string> <string>--basedir=/usr/local/opt/mariadb</string> <string>--plugin-dir=/usr/local/opt/mariadb/lib/plugin</string> <string>--datadir=/usr/local/var/mysql</string> <string>--log-error=/usr/local/var/mysql/Data-Server.local.err</string> <string>--pid-file=/usr/local/var/mysql/Data-Server.local.pid</string> <string>--sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION</string> </array> </dict> </plist> ``` Then from a shell, run `launchctl load /Library/LaunchDaemons/com.mariadb.server.plist` and MariaDB will run immediately, and also upon reboot. See Also -------- * [Creating Launch Daemons and Agents](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) * [A launchd Tutorial](http://www.launchd.info/) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INT8 INT8 ==== `INT8` is a synonym for [BIGINT](../bigint/index). ``` CREATE TABLE t1 (x INT8); DESC t1; +-------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+------------+------+-----+---------+-------+ | x | bigint(20) | YES | | NULL | | +-------+------------+------+-----+---------+-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DOUBLE DOUBLE ====== Syntax ------ ``` DOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL] DOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL] REAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL] ``` Description ----------- A normal-size (double-precision) floating-point number (see [FLOAT](../float/index) for a single-precision floating-point number). Allowable values are: * `-1.7976931348623157E+308` *to* `-2.2250738585072014E-308` * `0` * `2.2250738585072014E-308` *to* `1.7976931348623157E+308` These are the theoretical limits, based on the IEEE standard. The actual range might be slightly smaller depending on your hardware or operating system. `M` is the total number of digits and `D` is the number of digits following the decimal point. If `M` and `D` are omitted, values are stored to the limits allowed by the hardware. A double-precision floating-point number is accurate to approximately 15 decimal places. `UNSIGNED`, if specified, disallows negative values. `ZEROFILL`, if specified, pads the number with zeros, up to the total number of digits specified by `M`. REAL and DOUBLE PRECISION are synonyms, unless the REAL\_AS\_FLOAT [SQL mode](../sql_mode/index) is enabled, in which case REAL is a synonym for [FLOAT](../float/index) rather than DOUBLE. See [Floating Point Accuracy](../floating-point-accuracy/index) for issues when using floating-point numbers. For more details on the attributes, see [Numeric Data Type Overview](../numeric-data-type-overview/index). Examples -------- ``` CREATE TABLE t1 (d DOUBLE(5,0) zerofill); INSERT INTO t1 VALUES (1),(2),(3),(4); SELECT * FROM t1; +-------+ | d | +-------+ | 00001 | | 00002 | | 00003 | | 00004 | +-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Query Limits and Timeouts Query Limits and Timeouts ========================= This article describes the different methods MariaDB provides to limit/timeout a query: [LIMIT](../select/index#limit) ------------------------------ ``` SELECT ... LIMIT row_count or SELECT ... LIMIT offset, row_count or SELECT ... LIMIT row_count OFFSET offset ``` The [LIMIT](../select/index#limit) clause restricts the number of returned rows. [LIMIT ROWS EXAMINED](../limit-rows-examined/index) --------------------------------------------------- ``` SELECT ... LIMIT ROWS EXAMINED rows_limit; ``` Stops the query after 'rows\_limit' number of rows have been examined. sql\_safe\_updates ------------------ If the [sql\_safe\_updates](../server-system-variables/index#sql_safe_updates) variable is set, one can't execute an [UPDATE](../update/index) or [DELETE](../delete/index) statement unless one specifies a key constraint in the `WHERE` clause or provide a `LIMIT` clause (or both). ``` SET @@SQL_SAFE_UPDATES=1 UPDATE tbl_name SET not_key_column=val; -> ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column ``` sql\_select\_limit ------------------ [sql\_select\_limit](../server-system-variables/index#sql_select_limit) acts as an automatic `LIMIT row_count` to any [SELECT](../select/index) query. ``` SET @@SQL_SELECT_LIMIT=1000 SELECT * from big_table; ``` The above is the same as: ``` SELECT * from big_table LIMIT 1000; ``` max\_join\_size --------------- If the [max\_join\_size](../server-system-variables/index#max_join_size) variable (also called `sql_max_join_size`) is set, then it will limit any SELECT statements that probably need to examine more than `MAX_JOIN_SIZE` rows. ``` SET @@MAX_JOIN_SIZE=1000; SELECT count(null_column) from big_table; ->ERROR 1104 (42000): The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay ``` max\_statement\_time -------------------- If the [max\_statement\_time](../server-system-variables/index#max_statement_time) variable is set, any query (excluding stored procedures) taking longer than the value of `max_statement_time` (specified in seconds) to execute will be aborted. This can be set globally, by session, as well as per user and per query. See [Aborting statements that take longer than a certain time to execute](../aborting-statements-that-take-longer-than-a-certain-time-to-execute/index). See Also -------- * [WAIT and NOWAIT](../wait-and-nowait/index) * [Aborting statements that take longer than a certain time to execute](../aborting-statements/index) * [lock\_wait\_timeout](../server-system-variables/index#lock_wait_timeout) variable Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Numeric vs String Fields Numeric vs String Fields ======================== A large numeric value is stored in far fewer bytes than the equivalent string value. It is therefore faster to move and compare numeric data, so it's best to choose numeric columns for unique id's and other similar fields. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema events_statements_summary_by_user_by_event_name Table Performance Schema events\_statements\_summary\_by\_user\_by\_event\_name Table =============================================================================== The [Performance Schema](../performance-schema/index) `events_statements_summary_by_user_by_event_name` table contains statement events summarized by user and event name. It contains the following columns: | Column | Description | | --- | --- | | `USER` | User. Used together with `EVENT_NAME` for grouping events. | | `EVENT_NAME` | Event name. Used together with `USER` for grouping events. | | `COUNT_STAR` | Number of summarized events | | `SUM_TIMER_WAIT` | Total wait time of the summarized events that are timed. | | `MIN_TIMER_WAIT` | Minimum wait time of the summarized events that are timed. | | `AVG_TIMER_WAIT` | Average wait time of the summarized events that are timed. | | `MAX_TIMER_WAIT` | Maximum wait time of the summarized events that are timed. | | `SUM_LOCK_TIME` | Sum of the `LOCK_TIME` column in the `events_statements_current` table. | | `SUM_ERRORS` | Sum of the `ERRORS` column in the `events_statements_current` table. | | `SUM_WARNINGS` | Sum of the `WARNINGS` column in the `events_statements_current` table. | | `SUM_ROWS_AFFECTED` | Sum of the `ROWS_AFFECTED` column in the `events_statements_current` table. | | `SUM_ROWS_SENT` | Sum of the `ROWS_SENT` column in the `events_statements_current` table. | | `SUM_ROWS_EXAMINED` | Sum of the `ROWS_EXAMINED` column in the `events_statements_current` table. | | `SUM_CREATED_TMP_DISK_TABLES` | Sum of the `CREATED_TMP_DISK_TABLES` column in the `events_statements_current` table. | | `SUM_CREATED_TMP_TABLES` | Sum of the `CREATED_TMP_TABLES` column in the `events_statements_current` table. | | `SUM_SELECT_FULL_JOIN` | Sum of the `SELECT_FULL_JOIN` column in the `events_statements_current` table. | | `SUM_SELECT_FULL_RANGE_JOIN` | Sum of the `SELECT_FULL_RANGE_JOIN` column in the `events_statements_current` table. | | `SUM_SELECT_RANGE` | Sum of the `SELECT_RANGE` column in the `events_statements_current` table. | | `SUM_SELECT_RANGE_CHECK` | Sum of the `SELECT_RANGE_CHECK` column in the `events_statements_current` table. | | `SUM_SELECT_SCAN` | Sum of the `SELECT_SCAN` column in the `events_statements_current` table. | | `SUM_SORT_MERGE_PASSES` | Sum of the `SORT_MERGE_PASSES` column in the `events_statements_current` table. | | `SUM_SORT_RANGE` | Sum of the `SORT_RANGE` column in the `events_statements_current` table. | | `SUM_SORT_ROWS` | Sum of the `SORT_ROWS` column in the `events_statements_current` table. | | `SUM_SORT_SCAN` | Sum of the `SORT_SCAN` column in the `events_statements_current` table. | | `SUM_NO_INDEX_USED` | Sum of the `NO_INDEX_USED` column in the `events_statements_current` table. | | `SUM_NO_GOOD_INDEX_USED` | Sum of the `NO_GOOD_INDEX_USED` column in the `events_statements_current` table. | The `*_TIMER_WAIT` columns only calculate results for timed events, as non-timed events have a `NULL` wait time. Example ------- ``` SELECT * FROM events_statements_summary_by_user_by_event_name\G ... *************************** 521. row *************************** USER: NULL EVENT_NAME: statement/com/Error COUNT_STAR: 0 SUM_TIMER_WAIT: 0 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 0 MAX_TIMER_WAIT: 0 SUM_LOCK_TIME: 0 SUM_ERRORS: 0 SUM_WARNINGS: 0 SUM_ROWS_AFFECTED: 0 SUM_ROWS_SENT: 0 SUM_ROWS_EXAMINED: 0 SUM_CREATED_TMP_DISK_TABLES: 0 SUM_CREATED_TMP_TABLES: 0 SUM_SELECT_FULL_JOIN: 0 SUM_SELECT_FULL_RANGE_JOIN: 0 SUM_SELECT_RANGE: 0 SUM_SELECT_RANGE_CHECK: 0 SUM_SELECT_SCAN: 0 SUM_SORT_MERGE_PASSES: 0 SUM_SORT_RANGE: 0 SUM_SORT_ROWS: 0 SUM_SORT_SCAN: 0 SUM_NO_INDEX_USED: 0 SUM_NO_GOOD_INDEX_USED: 0 *************************** 522. row *************************** USER: NULL EVENT_NAME: statement/com/ COUNT_STAR: 0 SUM_TIMER_WAIT: 0 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 0 MAX_TIMER_WAIT: 0 SUM_LOCK_TIME: 0 SUM_ERRORS: 0 SUM_WARNINGS: 0 SUM_ROWS_AFFECTED: 0 SUM_ROWS_SENT: 0 SUM_ROWS_EXAMINED: 0 SUM_CREATED_TMP_DISK_TABLES: 0 SUM_CREATED_TMP_TABLES: 0 SUM_SELECT_FULL_JOIN: 0 SUM_SELECT_FULL_RANGE_JOIN: 0 SUM_SELECT_RANGE: 0 SUM_SELECT_RANGE_CHECK: 0 SUM_SELECT_SCAN: 0 SUM_SORT_MERGE_PASSES: 0 SUM_SORT_RANGE: 0 SUM_SORT_ROWS: 0 SUM_SORT_SCAN: 0 SUM_NO_INDEX_USED: 0 SUM_NO_GOOD_INDEX_USED: 0 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT - Making the GetRest Library CONNECT - Making the GetRest Library ==================================== To enable the REST feature with binary distributions of MariaDB, the function calling the cpprestsdk package is not included in CONNECT, thus allowing CONNECT normal operation when the cpprestsdk package is not installed. Therefore, it must be compiled separately as a library (so or dll) that will be loaded by CONNECT when needed. This library will contain only one file shown here: ``` /************* Restget C++ Program Source Code File (.CPP) *************/ /* Adapted from the sample program of the Casablanca tutorial. */ /* Copyright Olivier Bertrand 2019. */ /***********************************************************************/ #include <cpprest/filestream.h> #include <cpprest/http_client.h> using namespace utility::conversions; // String conversions utilities using namespace web; // Common features like URIs. using namespace web::http; // Common HTTP functionality using namespace web::http::client; // HTTP client features using namespace concurrency::streams; // Asynchronous streams typedef const char* PCSZ; extern "C" int restGetFile(char* m, bool xt, PCSZ http, PCSZ uri, PCSZ fn); /***********************************************************************/ /* Make a local copy of the requested file. */ /***********************************************************************/ int restGetFile(char *m, bool xt, PCSZ http, PCSZ uri, PCSZ fn) { int rc = 0; auto fileStream = std::make_shared<ostream>(); if (!http || !fn) { strcpy(m, "Missing http or filename"); return 2; } // endif if (xt) fprintf(stderr, "restGetFile: fn=%s\n", fn); // Open stream to output file. pplx::task<void> requestTask = fstream::open_ostream(to_string_t(fn)) .then([=](ostream outFile) { *fileStream= outFile; if (xt) fprintf(stderr, "Outfile isopen=%d\n", outFile.is_open()); // Create http_client to send the request. http_client client(to_string_t(http)); if (uri) { // Build request URI and start the request. uri_builder builder(to_string_t(uri)); return client.request(methods::GET, builder.to_string()); } else return client.request(methods::GET); }) // Handle response headers arriving. .then([=](http_response response) { if (xt) fprintf(stderr, "Received response status code:%u\n", response.status_code()); // Write response body into the file. return response.body().read_to_end(fileStream->streambuf()); }) // Close the file stream. .then([=](size_t n) { if (xt) fprintf(stderr, "Return size=%zu\n", n); return fileStream->close(); }); // Wait for all the outstanding I/O to complete and handle any exceptions try { if (xt) fprintf(stderr, "Waiting\n"); requestTask.wait(); } catch (const std::exception &e) { if (xt) fprintf(stderr, "Error exception: %s\n", e.what()); sprintf(m, "Error exception: %s", e.what()); rc= 1; } // end try/catch if (xt) fprintf(stderr, "restget done: rc=%d\n", rc); return rc; } // end of restGetFile ``` This file exists in the source of CONNECT as `restget.cpp`. If you have no access to the source, use your favorite editor to make it by copy/pasting from the above. Then, on Linux, compile the GetRest.so library: ``` g++ -o GetRest.so -O3 -Wall -std=c++11 -fPIC -shared restget.cpp -lcpprest ``` Note: You can replace `-O3` by `-g` to make a debug version. This library should be placed where it can be accessed. A good place is the directory where the `libcpprest.so` is, for instance `/usr/lib64`. You can move or copy it there. On windows, using Visual Studio, make an empty win32 dll project named GetRest and add it the above file. Also add it the module definition file `restget.def`: ``` LIBRARY REST EXPORTS restGetFile @1 ``` Important: This file must be specified in the property linker input page. Once compiled, the release or debug versions can be copied in the `cpprestsdk` corresponding directories, bin or debug\bin. That is all. It is a once-off job. Once done, it will work with all new MariaDB versions featuring CONNECT version 1.07. Note: the xt tracing variable is true when connect\_xtrace setting includes the value “MONGO” (512). Caution: If your server crashes when using this feature, this is likely because the GetRest lib is linked to the wrong cpprestsdk lib (this may only apply on Windows) A Release version of GetRest must be linked to the release version of the cpprestsdk lib (cpprest\_2\_10.dll) but if you make a Debug version of GetRest, make sure it is linked to the Debug version of cpprestsdk lib (cpprest\_2\_10d.dll) This may be automatic if you use Visual Studio to make the GetRest.dll. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MyISAM MyISAM ======= MyISAM was the default [storage engine](storage-engine) from MySQL 3.23 until it was replaced by [InnoDB](../innodb/index) in MariaDB and MySQL 5.5. It's a light, non-transactional engine with great performance, is easy to copy between systems and has a small data footprint. You're encouraged to rather use the [Aria](../aria/index) storage engine for new applications, which has even better performance and the goal of being crash-safe. Until [MariaDB 10.4](../what-is-mariadb-104/index), [system tables](../system-tables/index) used the MyISAM storage engine. | Title | Description | | --- | --- | | [MyISAM Overview](../myisam-overview/index) | Light, non-transactional storage engine | | [MyISAM System Variables](../myisam-system-variables/index) | MyISAM system variables. | | [MyISAM Storage Formats](../myisam-storage-formats/index) | The MyISAM storage engine supports three different table storage formats | | [MyISAM Clients and Utilities](../myisam-clients-and-utilities/index) | Clients and utilities for working with MyISAM tables | | [MyISAM Index Storage Space](../myisam-index-storage-space/index) | Regular MyISAM tables make use of B-tree indexes | | [MyISAM Log](../myisam-log/index) | Records all changes to MyISAM tables | | [Concurrent Inserts](../concurrent-inserts/index) | Under some circumstances, MyISAM allows INSERTs and SELECTs to be executed concurrently. | | [Segmented Key Cache](../segmented-key-cache/index) | Collection of structures for regular MyISAM key caches | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore Window Functions ColumnStore Window Functions ============================ Introduction ============ MariaDB ColumnStore provides support for window functions broadly following the SQL 2003 specification. A window function allows for calculations relating to a window of data surrounding the current row in a result set. This capability provides for simplified queries in support of common business questions such as cumulative totals, rolling averages, and top 10 lists. Aggregate functions are utilized for window functions however differ in behavior from a group by query because the rows remain ungrouped. This provides support for cumulative sums and rolling averages, for example. Two key concepts for window functions are Partition and Frame: * A Partition is a group of rows, or window, that have the same value for a specific column, for example a Partition can be created over a time period such as a quarter or lookup values. * The Frame for each row is a subset of the row's Partition. The frame typically is dynamic allowing for a sliding frame of rows within the Partition. The Frame determines the range of rows for the windowing function. A Frame could be defined as the last X rows and next Y rows all the way up to the entire Partition. Window functions are applied after joins, group by, and having clauses are calculated. Syntax ====== A window function is applied in the select clause using the following syntax: ``` function_name ([expression [, expression ... ]]) OVER ( window_definition ) ``` where *window\_definition* is defined as: ``` [ PARTITION BY expression [, ...] ] [ ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ] [ frame_clause ] ``` PARTITION BY: * Divides the window result set into groups based on one or more *expressions*. * An expression may be a constant, column, and non window function expressions. * A query is not limited to a single partition by clause. Different partition clauses can be used across different window function applications. * The partition by columns do not need to be in the select list but do need to be available from the query result set. * If there is no PARTITION BY clause, all rows of the result set define the group. ORDER BY * Defines the ordering of values within the partition. * Can be ordered by multiple keys which may be a constant, column or non window function expression. * The order by columns do not need to be in the select list but need to be available from the query result set. * Use of a select column alias from the query is not supported. * ASC (default) and DESC options allow for ordering ascending or descending. * NULLS FIRST and NULL\_LAST options specify whether null values come first or last in the ordering sequence. NULLS\_FIRST is the default for ASC order, and NULLS\_LAST is the default for DESC order. and the optional *frame\_clause* is defined as: ``` { RANGE | ROWS } frame_start { RANGE | ROWS } BETWEEN frame_start AND frame_end ``` and the optional *frame\_start* and *frame\_end* are defined as (value being a numeric expression): ``` UNBOUNDED PRECEDING value PRECEDING CURRENT ROW value FOLLOWING UNBOUNDED FOLLOWING ``` RANGE/ROWS: * Defines the windowing clause for calculating the set of rows that the function applies to for calculating a given rows window function result. * Requires an ORDER BY clause to define the row order for the window. * ROWS specify the window in physical units, i.e. result set rows and must be a constant or expression evaluating to a positive numeric value. * RANGE specifies the window as a logical offset. If the the expression evaluates to a numeric value then the ORDER BY expression must be a numeric or DATE type. If the expression evaluates to an interval value then the ORDER BY expression must be a DATE data type. * UNBOUNDED PRECEDING indicates the window starts at the first row of the partition. * UNBOUNDED FOLLOWING indicates the window ends at the last row of the partition. * CURRENT ROW specifies the window start or ends at the current row or value. * If omitted, the default is ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. Supported Functions =================== | Function | Description | | --- | --- | | AVG() | The average of all input values. | | CORR(ColumnY, ColumnX) | The correlation coefficient for non-null pairs in a group. | | COUNT() | Number of input rows. | | COVAR\_POP(ColumnY, ColumnX) | The population covariance for non-null pairs in a group. | | COVAR\_SAMP(ColumnY, ColumnX) | The sample covariance for non-null pairs in a group. | | CUME\_DIST() | Calculates the cumulative distribution, or relative rank, of the current row to other rows in the same partition. Number of peer or preceding rows / number of rows in partition. | | DENSE\_RANK() | Ranks items in a group leaving no gaps in ranking sequence when there are ties. | | FIRST\_VALUE() | The value evaluated at the row that is the first row of the window frame (counting from 1); null if no such row. | | LAG() | The value evaluated at the row that is offset rows before the current row within the partition; if there is no such row, instead return default. Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null. LAG provides access to more than one row of a table at the same time without a self-join. Given a series of rows returned from a query and a position of the cursor, LAG provides access to a row at a given physical offset prior to that position. | | LAST\_VALUE() | The value evaluated at the row that is the last row of the window frame (counting from 1); null if no such row. | | LEAD() | Provides access to a row at a given physical offset beyond that position. Returns value evaluated at the row that is offset rows after the current row within the partition; if there is no such row, instead return default. Both offset and default are evaluated with respect to the current row. If omitted, offset defaults to 1 and default to null. | | MAX() | Maximum value of expression across all input values. | | MEDIAN() | An inverse distribution function that assumes a continuous distribution model. It takes a numeric or datetime value and returns the middle value or an interpolated value that would be the middle value once the values are sorted. Nulls are ignored in the calculation. **Not available in MariaDB Columnstore 1.1** | | MIN() | Minimum value of expression across all input values. | | NTH\_VALUE() | The value evaluated at the row that is the nth row of the window frame (counting from 1); null if no such row. | | NTILE() | Divides an ordered data set into a number of buckets indicated by expr and assigns the appropriate bucket number to each row. The buckets are numbered 1 through expr. The expr value must resolve to a positive constant for each partition. Integer ranging from 1 to the argument value, dividing the partition as equally as possible. | | PERCENT\_RANK() | Relative rank of the current row: (rank - 1) / (total rows - 1). | | PERCENTILE\_CONT() | An inverse distribution function that assumes a continuous distribution model. It takes a percentile value and a sort specification, and returns an interpolated value that would fall into that percentile value with respect to the sort specification. Nulls are ignored in the calculation. **Not available in MariaDB Columnstore 1.1** | | PERCENTILE\_DISC() | An inverse distribution function that assumes a discrete distribution model. It takes a percentile value and a sort specification and returns an element from the set. Nulls are ignored in the calculation. **Not available in MariaDB Columnstore 1.1** | | RANK() | Rank of the current row with gaps; same as row\_number of its first peer. | | REGR\_AVGX(ColumnY, ColumnX) | Average of the independent variable (sum(ColumnX)/N), where N is number of rows processed by the query | | REGR\_AVGY(ColumnY, ColumnX) | Average of the dependent variable (sum(ColumnY)/N), where N is number of rows processed by the query | | REGR\_COUNT(ColumnY, ColumnX) | The total number of input rows in which both column Y and column X are nonnull | | REGR\_SLOPE(ColumnY, ColumnX) | The slope of the least-squares-fit linear equation determined by the (ColumnX, ColumnY) pairs | | REGR\_INTERCEPT(ColumnY, ColumnX) | The y-intercept of the least-squares-fit linear equation determined by the (ColumnX, ColumnY) pairs | | REGR\_R2(ColumnY, ColumnX) | Square of the correlation coefficient. correlation coefficient is the regr\_intercept(ColumnY, ColumnX) for linear model | | REGR\_SXX(ColumnY, ColumnX) | REGR\_COUNT(y, x) \* VAR\_POP(x) for non-null pairs. | | REGR\_SXY(ColumnY, ColumnX) | REGR\_COUNT(y, x) \* COVAR\_POP(y, x) for non-null pairs. | | REGR\_SYY(ColumnY, ColumnX) | REGR\_COUNT(y, x) \* VAR\_POP(y) for non-null pairs. | | ROW\_NUMBER() | Number of the current row within its partition, counting from 1 | | STDDEV() STDDEV\_POP() | Computes the population standard deviation and returns the square root of the population variance. | | STDDEV\_SAMP() | Computes the cumulative sample standard deviation and returns the square root of the sample variance. | | SUM() | Sum of expression across all input values. | | VARIANCE() VAR\_POP() | Population variance of the input values (square of the population standard deviation). | | VAR\_SAMP() | Sample variance of the input values (square of the sample standard deviation). | ### Note * Regression functions (REGR\_AVGX to REGR\_YY), CORR, COVAR\_POP and COVAR\_SAMP are supported for version 1.2.0 and higher Examples ======== Example Schema -------------- The examples are all based on the following simplified sales opportunity table: ``` create table opportunities ( id int, accountName varchar(20), name varchar(128), owner varchar(7), amount decimal(10,2), closeDate date, stageName varchar(11) ) engine=columnstore; ``` Some example values are (thanks to <https://www.mockaroo.com> for sample data generation): | id | accountName | name | owner | amount | closeDate | stageName | | --- | --- | --- | --- | --- | --- | --- | | 1 | Browseblab | Multi-lateral executive function | Bob | 26444.86 | 2016-10-20 | Negotiating | | 2 | Mita | Organic demand-driven benchmark | Maria | 477878.41 | 2016-11-28 | ClosedWon | | 3 | Miboo | De-engineered hybrid groupware | Olivier | 80181.78 | 2017-01-05 | ClosedWon | | 4 | Youbridge | Enterprise-wide bottom-line Graphic Interface | Chris | 946245.29 | 2016-07-02 | ClosedWon | | 5 | Skyba | Reverse-engineered fresh-thinking standardization | Maria | 696241.82 | 2017-02-17 | Negotiating | | 6 | Eayo | Fundamental well-modulated artificial intelligence | Bob | 765605.52 | 2016-08-27 | Prospecting | | 7 | Yotz | Extended secondary infrastructure | Chris | 319624.20 | 2017-01-06 | ClosedLost | | 8 | Oloo | Configurable web-enabled data-warehouse | Chris | 321016.26 | 2017-03-08 | ClosedLost | | 9 | Kaymbo | Multi-lateral web-enabled definition | Bob | 690881.01 | 2017-01-02 | Developing | | 10 | Rhyloo | Public-key coherent infrastructure | Chris | 965477.74 | 2016-11-07 | Prospecting | The schema, sample data, and queries are available as an attachment to this article. Cumulative Sum and Running Max Example -------------------------------------- Window functions can be used to achieve cumulative / running calculations on a detail report. In this case a won opportunity report for a 7 day period adds columns to show the accumulated won amount as well as the current highest opportunity amount in preceding rows. ``` select owner, accountName, CloseDate, amount, sum(amount) over (order by CloseDate rows between unbounded preceding and current row) cumeWon, max(amount) over (order by CloseDate rows between unbounded preceding and current row) runningMax from opportunities where stageName='ClosedWon' and closeDate >= '2016-10-02' and closeDate <= '2016-10-09' order by CloseDate; ``` with example results: | owner | accountName | CloseDate | amount | cumeWon | runningMax | | --- | --- | --- | --- | --- | --- | | Bill | Babbleopia | 2016-10-02 | 437636.47 | 437636.47 | 437636.47 | | Bill | Thoughtworks | 2016-10-04 | 146086.51 | 583722.98 | 437636.47 | | Olivier | Devpulse | 2016-10-05 | 834235.93 | 1417958.91 | 834235.93 | | Chris | Linkbridge | 2016-10-07 | 539977.45 | 2458738.65 | 834235.93 | | Olivier | Trupe | 2016-10-07 | 500802.29 | 1918761.20 | 834235.93 | | Bill | Latz | 2016-10-08 | 857254.87 | 3315993.52 | 857254.87 | | Chris | Avamm | 2016-10-09 | 699566.86 | 4015560.38 | 857254.87 | Partitioned Cumulative Sum and Running Max Example -------------------------------------------------- The above example can be partitioned, so that the window functions are over a particular field grouping such as owner and accumulate within that grouping. This is achieved by adding the syntax "partition by <columns>" in the window function clause. ``` select owner, accountName, CloseDate, amount, sum(amount) over (partition by owner order by CloseDate rows between unbounded preceding and current row) cumeWon, max(amount) over (partition by owner order by CloseDate rows between unbounded preceding and current row) runningMax from opportunities where stageName='ClosedWon' and closeDate >= '2016-10-02' and closeDate <= '2016-10-09' order by owner, CloseDate; ``` with example results: | owner | accountName | CloseDate | amount | cumeWon | runningMax | | --- | --- | --- | --- | --- | --- | | Bill | Babbleopia | 2016-10-02 | 437636.47 | 437636.47 | 437636.47 | | Bill | Thoughtworks | 2016-10-04 | 146086.51 | 583722.98 | 437636.47 | | Bill | Latz | 2016-10-08 | 857254.87 | 1440977.85 | 857254.87 | | Chris | Linkbridge | 2016-10-07 | 539977.45 | 539977.45 | 539977.45 | | Chris | Avamm | 2016-10-09 | 699566.86 | 1239544.31 | 699566.86 | | Olivier | Devpulse | 2016-10-05 | 834235.93 | 834235.93 | 834235.93 | | Olivier | Trupe | 2016-10-07 | 500802.29 | 1335038.22 | 834235.93 | Ranking / Top Results --------------------- The rank window function allows for ranking or assigning a numeric order value based on the window function definition. Using the Rank() function will result in the same value for ties / equal values and the next rank value skipped. The Dense\_Rank() function behaves similarly except the next consecutive number is used after a tie rather than skipped. The Row\_Number() function will provide a unique ordering value. The example query shows the Rank() function being applied to rank sales reps by the number of opportunities for Q4 2016. ``` select owner, wonCount, rank() over (order by wonCount desc) rank from ( select owner, count(*) wonCount from opportunities where stageName='ClosedWon' and closeDate >= '2016-10-01' and closeDate < '2016-12-31' group by owner ) t order by rank; ``` with example results (note the query is technically incorrect by using closeDate < '2016-12-31' however this creates a tie scenario for illustrative purposes): | owner | wonCount | rank | | --- | --- | --- | | Bill | 19 | 1 | | Chris | 15 | 2 | | Maria | 14 | 3 | | Bob | 14 | 3 | | Olivier | 10 | 5 | If the dense\_rank function is used the rank values would be 1,2,3,3,4 and for the row\_number function the values would be 1,2,3,4,5. First and Last Values --------------------- The first\_value and last\_value functions allow determining the first and last values of a given range. Combined with a group by this allows summarizing opening and closing values. The example shows a more complex case where detailed information is presented for first and last opportunity by quarter. ``` select a.year, a.quarter, f.accountName firstAccountName, f.owner firstOwner, f.amount firstAmount, l.accountName lastAccountName, l.owner lastOwner, l.amount lastAmount from ( select year, quarter, min(firstId) firstId, min(lastId) lastId from ( select year(closeDate) year, quarter(closeDate) quarter, first_value(id) over (partition by year(closeDate), quarter(closeDate) order by closeDate rows between unbounded preceding and current row) firstId, last_value(id) over (partition by year(closeDate), quarter(closeDate) order by closeDate rows between current row and unbounded following) lastId from opportunities where stageName='ClosedWon' ) t group by year, quarter order by year,quarter ) a join opportunities f on a.firstId = f.id join opportunities l on a.lastId = l.id order by year, quarter; ``` with example results: | year | quarter | firstAccountName | firstOwner | firstAmount | lastAccountName | lastOwner | lastAmount | | --- | --- | --- | --- | --- | --- | --- | --- | | 2016 | 3 | Skidoo | Bill | 523295.07 | Skipstorm | Bill | 151420.86 | | 2016 | 4 | Skimia | Chris | 961513.59 | Avamm | Maria | 112493.65 | | 2017 | 1 | Yombu | Bob | 536875.51 | Skaboo | Chris | 270273.08 | Prior and Next Example ---------------------- Sometimes it useful to understand the previous and next values in the context of a given row. The lag and lead window functions provide this capability. By default the offset is one providing the prior or next value but can also be provided to get a larger offset. The example query is a report of opportunities by account name showing the opportunity amount, and the prior and next opportunity amount for that account by close date. ``` select accountName, closeDate, amount currentOppAmount, lag(amount) over (partition by accountName order by closeDate) priorAmount, lead(amount) over (partition by accountName order by closeDate) nextAmount from opportunities order by accountName, closeDate limit 9; ``` with example results: | accountName | closeDate | currentOppAmount | priorAmount | nextAmount | | --- | --- | --- | --- | --- | | Abata | 2016-09-10 | 645098.45 | NULL | 161086.82 | | Abata | 2016-10-14 | 161086.82 | 645098.45 | 350235.75 | | Abata | 2016-12-18 | 350235.75 | 161086.82 | 878595.89 | | Abata | 2016-12-31 | 878595.89 | 350235.75 | 922322.39 | | Abata | 2017-01-21 | 922322.39 | 878595.89 | NULL | | Abatz | 2016-10-19 | 795424.15 | NULL | NULL | | Agimba | 2016-07-09 | 288974.84 | NULL | 914461.49 | | Agimba | 2016-09-07 | 914461.49 | 288974.84 | 176645.52 | | Agimba | 2016-09-20 | 176645.52 | 914461.49 | NULL | Quartiles Example ----------------- The NTile window function allows for breaking up a data set into portions assigned a numeric value to each portion of the range. NTile(4) breaks the data up into quartiles (4 sets). The example query produces a report of all opportunities summarizing the quartile boundaries of amount values. ``` select t.quartile, min(t.amount) min, max(t.amount) max from ( select amount, ntile(4) over (order by amount asc) quartile from opportunities where closeDate >= '2016-10-01' and closeDate <= '2016-12-31' ) t group by quartile order by quartile; ``` With example results: | quartile | min | max | | --- | --- | --- | | 1 | 6337.15 | 287634.01 | | 2 | 288796.14 | 539977.45 | | 3 | 540070.04 | 748727.51 | | 4 | 753670.77 | 998864.47 | Percentile Example ------------------ The percentile functions have a slightly different syntax from other window functions as can be seen in the example below. These functions can be only applied against numeric values. The argument to the function is the percentile to evaluate. Following 'within group' is the sort expression which indicates the sort column and optionally order. Finally after 'over' is an optional partition by clause, for no partition clause use 'over ()'. The example below utilizes the value 0.5 to calculate the median opportunity amount in the rows. The values differ sometimes because percentile\_cont will return the average of the 2 middle rows for an even data set while percentile\_desc returns the first encountered in the sort. **Note that the percentile syntax is supported in MariaDB ColumnStore 1.0 but not 1.1. It is anticipated that this will be restored in MariaDB ColumnStore 1.2 after this is implemented in MariaDB server 10.3.** ``` select owner, accountName, CloseDate, amount, percentile_cont(0.5) within group (order by amount) over (partition by owner) pct_cont, percentile_disc(0.5) within group (order by amount) over (partition by owner) pct_disc from opportunities where stageName='ClosedWon' and closeDate >= '2016-10-02' and closeDate <= '2016-10-09' order by owner, CloseDate; ``` With example results: | owner | accountName | CloseDate | amount | pct\_cont | pct\_disc | | --- | --- | --- | --- | --- | --- | | Bill | Babbleopia | 2016-10-02 | 437636.47 | 437636.4700000000 | 437636.47 | | Bill | Thoughtworks | 2016-10-04 | 146086.51 | 437636.4700000000 | 437636.47 | | Bill | Latz | 2016-10-08 | 857254.87 | 437636.4700000000 | 437636.47 | | Chris | Linkbridge | 2016-10-07 | 539977.45 | 619772.1550000000 | 539977.45 | | Chris | Avamm | 2016-10-09 | 699566.86 | 619772.1550000000 | 539977.45 | | Olivier | Devpulse | 2016-10-05 | 834235.93 | 667519.1100000000 | 500802.29 | | Olivier | Trupe | 2016-10-07 | 500802.29 | 667519.1100000000 | 500802.29 | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Pseudo Columns Pseudo Columns =============== MariaDB has pseudo columns that can be used for different purposes. | Title | Description | | --- | --- | | [\_rowid](../_rowid/index) | \_rowid is an alias for the primary key column | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MEDIUMINT MEDIUMINT ========= Syntax ------ ``` MEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL] ``` Description ----------- A medium-sized integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215. `ZEROFILL` pads the integer with zeroes and assumes `UNSIGNED` (even if `UNSIGNED` is not specified). `INT3` is a synonym for `MEDIUMINT`. For details on the attributes, see [Numeric Data Type Overview](../numeric-data-type-overview/index). Examples -------- ``` CREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT ZEROFILL); DESCRIBE mediumints; +-------+--------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------------------------+------+-----+---------+-------+ | a | mediumint(9) | YES | | NULL | | | b | mediumint(8) unsigned | YES | | NULL | | | c | mediumint(8) unsigned zerofill | YES | | NULL | | +-------+--------------------------------+------+-----+---------+-------+ ``` With [strict\_mode](../sql-mode/index#strict-mode) set, the default from [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/): ``` INSERT INTO mediumints VALUES (-10,-10,-10); ERROR 1264 (22003): Out of range value for column 'b' at row 1 INSERT INTO mediumints VALUES (-10,10,-10); ERROR 1264 (22003): Out of range value for column 'c' at row 1 INSERT INTO mediumints VALUES (-10,10,10); INSERT INTO mediumints VALUES (8388608,8388608,8388608); ERROR 1264 (22003): Out of range value for column 'a' at row 1 INSERT INTO mediumints VALUES (8388607,8388608,8388608); SELECT * FROM mediumints; +---------+---------+----------+ | a | b | c | +---------+---------+----------+ | -10 | 10 | 00000010 | | 8388607 | 8388608 | 08388608 | +---------+---------+----------+ ``` With [strict\_mode](../sql-mode/index#strict-mode) unset, the default until [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/): ``` INSERT INTO mediumints VALUES (-10,-10,-10); Query OK, 1 row affected, 2 warnings (0.05 sec) Warning (Code 1264): Out of range value for column 'b' at row 1 Warning (Code 1264): Out of range value for column 'c' at row 1 INSERT INTO mediumints VALUES (-10,10,-10); Query OK, 1 row affected, 1 warning (0.08 sec) Warning (Code 1264): Out of range value for column 'c' at row 1 INSERT INTO mediumints VALUES (-10,10,10); INSERT INTO mediumints VALUES (8388608,8388608,8388608); Query OK, 1 row affected, 1 warning (0.05 sec) Warning (Code 1264): Out of range value for column 'a' at row 1 INSERT INTO mediumints VALUES (8388607,8388608,8388608); SELECT * FROM mediumints; +---------+---------+----------+ | a | b | c | +---------+---------+----------+ | -10 | 0 | 00000000 | | -10 | 0 | 00000000 | | -10 | 10 | 00000000 | | -10 | 10 | 00000010 | | 8388607 | 8388608 | 08388608 | | 8388607 | 8388608 | 08388608 | +---------+---------+----------+ ``` See Also -------- * [Numeric Data Type Overview](../numeric-data-type-overview/index) * [TINYINT](../tinyint/index) * [SMALLINT](../smallint/index) * [INTEGER](../int/index) * [BIGINT](../bigint/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Slave SQL Thread States Slave SQL Thread States ======================= This article documents thread states that are related to [replication](../replication/index) slave SQL threads. These correspond to the `Slave_SQL_State` shown by [SHOW SLAVE STATUS](../show-slave-status/index) as well as the `STATE` values listed by the [SHOW PROCESSLIST](../show-processlist/index) statement and the [Information Schema PROCESSLIST](../information-schema-processlist-table/index) as well as the `PROCESSLIST_STATE` value listed in the [Performance Schema threads Table](../performance-schema-threads-table/index). | Value | Description | | --- | --- | | Apply log event | Log event is being applied. | | Making temp file | Creating a temporary file containing the row data as part of a [LOAD DATA INFILE](../load-data-infile/index) statement. | | Reading event from the relay log | Reading an event from the [relay log](../relay-log/index) in order to process the event. | | Slave has read all relay log; waiting for the slave I/O thread to update it | All [relay log](../relay-log/index) events have been processed, now waiting for the I/O thread to write new events to the relay log. | | Waiting for work from SQL thread | In parallel replication the worker thread is waiting for more things from the SQL thread. | | Waiting for prior transaction to start commit before starting next transaction | In parallel replication the worker thread is waiting for conflicting things to end before starting executing. | | Waiting for worker threads to be idle | Happens in parallel replication when moving to a new binary log after a master restart. All slave temporary files are deleted and worker threads are restarted. | | Waiting due to global read lock | In parallel replication when worker threads are waiting for a global read lock to be released. | | Waiting for worker threads to pause for global read lock | [FLUSH TABLES WITH READ LOCK](../flush/index) is waiting for worker threads to finish what they are doing. | | Waiting while replication worker thread pool is busy | Happens in parallel replication during a [FLUSH TABLES WITH READ LOCK](../flush/index) or when changing number of parallel workers. | | Waiting for other master connection to process GTID received on multiple master connections | A worker thread noticed that there is already another thread executing the same GTID from another connection and it's waiting for the other to complete. | | Waiting for slave mutex on exit | Thread is stopping. Only occurs very briefly. | | Waiting for the next event in relay log | State before reading next event from the [relay log](../relay-log/index). | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DAYOFWEEK DAYOFWEEK ========= Syntax ------ ``` DAYOFWEEK(date) ``` Description ----------- Returns the day of the week index for the date (1 = Sunday, 2 = Monday, ..., 7 = Saturday). These index values correspond to the ODBC standard. This contrasts with `[WEEKDAY()](../weekday/index)` which follows a different index numbering (`0` = Monday, `1` = Tuesday, ... `6` = Sunday). Examples -------- ``` SELECT DAYOFWEEK('2007-02-03'); +-------------------------+ | DAYOFWEEK('2007-02-03') | +-------------------------+ | 7 | +-------------------------+ ``` ``` CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ("2007-01-30 21:31:07"), ("1983-10-15 06:42:51"), ("2011-04-21 12:34:56"), ("2011-10-30 06:31:41"), ("2011-01-30 14:03:25"), ("2004-10-07 11:19:34"); ``` ``` SELECT d, DAYNAME(d), DAYOFWEEK(d), WEEKDAY(d) from t1; +---------------------+------------+--------------+------------+ | d | DAYNAME(d) | DAYOFWEEK(d) | WEEKDAY(d) | +---------------------+------------+--------------+------------+ | 2007-01-30 21:31:07 | Tuesday | 3 | 1 | | 1983-10-15 06:42:51 | Saturday | 7 | 5 | | 2011-04-21 12:34:56 | Thursday | 5 | 3 | | 2011-10-30 06:31:41 | Sunday | 1 | 6 | | 2011-01-30 14:03:25 | Sunday | 1 | 6 | | 2004-10-07 11:19:34 | Thursday | 5 | 3 | +---------------------+------------+--------------+------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Plans - GIS MariaDB Plans - GIS =================== **Note:** This page is obsolete. The information is old, outdated, or otherwise currently incorrect. We are keeping the page for historical reasons only. **Do not** rely on the information in this article. OpenGIS compliance: * create required tables: GeometryTables, GeometryColumns, related views. * stored procedure AddGeometryColumn * prefill the spatial\_ref\_sys table. Optimizer: * optimize simple queries with Intersects(), Within, Distance()<X * add Distance\_sphere() and the related optimization. Add possible III-rd coordinate (Attitude). * Distance3D, related optimization. Precise math coordinates instead of DOUBLE-s. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb UNION UNION ===== `UNION` is used to combine the results from multiple [SELECT](../select/index) statements into a single result set. Syntax ------ ``` SELECT ... UNION [ALL | DISTINCT] SELECT ... [UNION [ALL | DISTINCT] SELECT ...] [ORDER BY [column [, column ...]]] [LIMIT {[offset,] row_count | row_count OFFSET offset}] ``` Description ----------- `UNION` is used to combine the results from multiple [SELECT](../select/index) statements into a single result set. The column names from the first `SELECT` statement are used as the column names for the results returned. Selected columns listed in corresponding positions of each SELECT statement should have the same data type. (For example, the first column selected by the first statement should have the same type as the first column selected by the other statements.) If they don't, the type and length of the columns in the result take into account the values returned by all of the SELECTs, so there is no need for explicit casting. Note that currently this is not the case for [recursive CTEs](../recursive-common-table-expressions-overview/index) - see [MDEV-12325](https://jira.mariadb.org/browse/MDEV-12325). Table names can be specified as `db_name`.`tbl_name`. This permits writing `UNION`s which involve multiple databases. See [Identifier Qualifiers](../identifier-qualifiers/index) for syntax details. UNION queries cannot be used with [aggregate functions](../functions-and-modifiers-for-use-with-group-by/index). `EXCEPT` and `UNION` have the same operation precedence and `INTERSECT` has a higher precedence, unless [running in Oracle mode](../sql_modeoracle/index), in which case all three have the same precedence. ### ALL/DISTINCT The `ALL` keyword causes duplicate rows to be preserved. The `DISTINCT` keyword (the default if the keyword is omitted) causes duplicate rows to be removed by the results. UNION ALL and UNION DISTINCT can both be present in a query. In this case, UNION DISTINCT will override any UNION ALLs to its left. **MariaDB starting with [10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)**Until [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/), all `UNION ALL` statements required the server to create a temporary table. Since [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/), the server can in most cases execute `UNION ALL` without creating a temporary table, improving performance (see [MDEV-334](https://jira.mariadb.org/browse/MDEV-334)). ### ORDER BY and LIMIT Individual SELECTs can contain their own [ORDER BY](../order-by/index) and [LIMIT](../limit/index) clauses. In this case, the individual queries need to be wrapped between parentheses. However, this does not affect the order of the UNION, so they only are useful to limit the record read by one SELECT. The UNION can have global [ORDER BY](../order-by/index) and [LIMIT](../limit/index) clauses, which affect the whole resultset. If the columns retrieved by individual SELECT statements have an alias (AS), the ORDER BY must use that alias, not the real column names. ### HIGH\_PRIORITY Specifying a query as [HIGH\_PRIORITY](../select/index#high-priority) will not work inside a UNION. If applied to the first SELECT, it will be ignored. Applying to a later SELECT results in a syntax error: ``` ERROR 1234 (42000): Incorrect usage/placement of 'HIGH_PRIORITY' ``` ### SELECT ... INTO ... Individual SELECTs cannot be written [INTO DUMPFILE](../select-into-dumpfile/index) or [INTO OUTFILE](../select-into-outfile/index). If the last SELECT statement specifies INTO DUMPFILE or INTO OUTFILE, the entire result of the UNION will be written. Placing the clause after any other SELECT will result in a syntax error. If the result is a single row, [SELECT ... INTO @var\_name](../select-into-variable/index) can also be used. **MariaDB starting with [10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/)**### Parentheses From [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/), parentheses can be used to specify precedence. Before this, a syntax error would be returned. Examples -------- `UNION` between tables having different column names: ``` (SELECT e_name AS name, email FROM employees) UNION (SELECT c_name AS name, email FROM customers); ``` Specifying the `UNION`'s global order and limiting total rows: ``` (SELECT name, email FROM employees) UNION (SELECT name, email FROM customers) ORDER BY name LIMIT 10; ``` Adding a constant row: ``` (SELECT 'John Doe' AS name, '[email protected]' AS email) UNION (SELECT name, email FROM customers); ``` Differing types: ``` SELECT CAST('x' AS CHAR(1)) UNION SELECT REPEAT('y',4); +----------------------+ | CAST('x' AS CHAR(1)) | +----------------------+ | x | | yyyy | +----------------------+ ``` Returning the results in order of each individual SELECT by use of a sort column: ``` (SELECT 1 AS sort_column, e_name AS name, email FROM employees) UNION (SELECT 2, c_name AS name, email FROM customers) ORDER BY sort_column; ``` Difference between UNION, [EXCEPT](../except/index) and [INTERSECT](../intersect/index). `INTERSECT ALL` and `EXCEPT ALL` are available from [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/). ``` CREATE TABLE seqs (i INT); INSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6); SELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | +------+ SELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 1 | | 2 | | 2 | | 3 | | 3 | | 3 | | 3 | | 4 | | 5 | | 6 | +------+ SELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 1 | | 2 | +------+ SELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 1 | | 2 | | 2 | +------+ SELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 3 | +------+ SELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3; +------+ | i | +------+ | 3 | | 3 | +------+ ``` Parentheses for specifying precedence, from [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/) ``` CREATE OR REPLACE TABLE t1 (a INT); CREATE OR REPLACE TABLE t2 (b INT); CREATE OR REPLACE TABLE t3 (c INT); INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (5),(6); INSERT INTO t3 VALUES (1),(6); ((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3); +------+ | a | +------+ | 1 | | 6 | +------+ (SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3)); +------+ | a | +------+ | 1 | | 2 | | 3 | | 4 | | 6 | +------+ ``` See Also -------- * [SELECT](../select/index) * [EXCEPT](../except/index) * [INTERSECT](../intersect/index) * [Recursive Common Table Expressions Overview](../recursive-common-table-expressions-overview/index) * [Get Set for Set Theory: UNION, INTERSECT and EXCEPT in SQL](https://www.youtube.com/watch?v=UNi-fVSpRm0) (video tutorial) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb START TRANSACTION START TRANSACTION ================= Syntax ------ ``` START TRANSACTION [transaction_property [, transaction_property] ...] | BEGIN [WORK] COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE] ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE] SET autocommit = {0 | 1} transaction_property: WITH CONSISTENT SNAPSHOT | READ WRITE | READ ONLY ``` Description ----------- The `START TRANSACTION` or `BEGIN` statement begins a new transaction. [COMMIT](../transactions-commit-statement/index) commits the current transaction, making its changes permanent. [ROLLBACK](../rollback/index) rolls back the current transaction, canceling its changes. The [SET](../set-variable/index) [autocommit](../server-system-variables/index#autocommit) statement disables or enables the default autocommit mode for the current session. START TRANSACTION and SET autocommit = 1 implicitly commit the current transaction, if any. The optional `WORK` keyword is supported for `COMMIT` and `ROLLBACK`, as are the `CHAIN` and `RELEASE` clauses. `CHAIN` and `RELEASE` can be used for additional control over transaction completion. The value of the [completion\_type](../server-system-variables/index#completion_type) system variable determines the default completion behavior. The `AND CHAIN` clause causes a new transaction to begin as soon as the current one ends, and the new transaction has the same isolation level as the just-terminated transaction. The `RELEASE` clause causes the server to disconnect the current client session after terminating the current transaction. Including the `NO` keyword suppresses `CHAIN` or `RELEASE` completion, which can be useful if the [completion\_type](../server-system-variables/index#completion_type) system variable is set to cause chaining or release completion by default. ### Access Mode The access mode specifies whether the transaction is allowed to write data or not. By default, transactions are in `READ WRITE` mode (see the [tx\_read\_only](../server-system-variables/index#tx_read_only) system variable). `READ ONLY` mode allows the storage engine to apply optimizations that cannot be used for transactions which write data. The only exception to this rule is that read only transactions can perform DDL statements on temporary tables. It is not permitted to specify both `READ WRITE` and `READ ONLY` in the same statement. `READ WRITE` and `READ ONLY` can also be specified in the `[SET TRANSACTION](../set-transaction/index)` statement, in which case the specified mode is valid for all sessions, or for all subsequent transaction used by the current session. ### autocommit By default, MariaDB runs with [autocommit](../server-system-variables/index#autocommit) mode enabled. This means that as soon as you execute a statement that updates (modifies) a table, MariaDB stores the update on disk to make it permanent. To disable autocommit mode, use the following statement: ``` SET autocommit=0; ``` After disabling autocommit mode by setting the autocommit variable to zero, changes to transaction-safe tables (such as those for InnoDB or `NDBCLUSTER`) are not made permanent immediately. You must use `COMMIT` to store your changes to disk or ROLLBACK to ignore the changes. To disable autocommit mode for a single series of statements, use the `START TRANSACTION` statement. ### DDL Statements DDL statements (`CREATE`, `ALTER`, `DROP`) and administrative statements (`FLUSH`, `RESET`, `OPTIMIZE`, `ANALYZE`, `CHECK`, `REPAIR`, `CACHE INDEX`), transaction management statements (`BEGIN`, `START TRANSACTION`) and `LOAD DATA INFILE`, cause an implicit `COMMIT` and start a new transaction. An exception to this rule are the DDL that operate on temporary tables: you can `CREATE`, `ALTER` and `DROP` them without causing any `COMMIT`, but those actions cannot be rolled back. This means that if you call `ROLLBACK`, the temporary tables you created in the transaction will remain, while the rest of the transaction will be rolled back. Transactions cannot be used in Stored Functions or Triggers. In Stored Procedures and Events BEGIN is not allowed, so you should use START TRANSACTION instead. A transaction acquires a [metadata lock](../metadata-locking/index) on every table it accesses to prevent other connections from altering their structure. The lock is released at the end of the transaction. This happens even with non-transactional storage engines (like [MEMORY](../memory-storage-engine/index) or [CONNECT](../connect/index)), so it makes sense to use transactions with non-transactional tables. ### in\_transaction The [in\_transaction](../server-system-variables/index#in_transaction) system variable is a session-only, read-only variable that returns `1` inside a transaction, and `0` if not in a transaction. ### WITH CONSISTENT SNAPSHOT The `WITH CONSISTENT SNAPSHOT` option starts a consistent read for storage engines such as [InnoDB](../innodb/index) that can do so, the same as if a START TRANSACTION followed by a SELECT from any InnoDB table was issued. See [Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT](../enhancements-for-start-transaction-with-consistent-snapshot/index). Examples -------- ``` START TRANSACTION; SELECT @A:=SUM(salary) FROM table1 WHERE type=1; UPDATE table2 SET summary=@A WHERE type=1; COMMIT; ``` See Also -------- * [Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT](../enhancements-for-start-transaction-with-consistent-snapshot/index) * [MyRocks and START TRANSACTION WITH CONSISTENT SNAPSHOT](../myrocks-and-start-transaction-with-consistent-snapshot/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Multiplication Operator (*) Multiplication Operator (\*) ============================ Syntax ------ ``` * ``` Description ----------- Multiplication operator. Examples -------- ``` SELECT 7*6; +-----+ | 7*6 | +-----+ | 42 | +-----+ SELECT 1234567890*9876543210; +-----------------------+ | 1234567890*9876543210 | +-----------------------+ | -6253480962446024716 | +-----------------------+ SELECT 18014398509481984*18014398509481984.0; +---------------------------------------+ | 18014398509481984*18014398509481984.0 | +---------------------------------------+ | 324518553658426726783156020576256.0 | +---------------------------------------+ SELECT 18014398509481984*18014398509481984; +-------------------------------------+ | 18014398509481984*18014398509481984 | +-------------------------------------+ | 0 | +-------------------------------------+ ``` See Also -------- * [Type Conversion](../type-conversion/index) * [Addition Operator (+)](../addition-operator/index) * [Subtraction Operator (-)](../subtraction-operator-/index) * [Division Operator (/)](../division-operator/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema MROONGA_STATS Table Information Schema MROONGA\_STATS Table ======================================= The [Information Schema](../information_schema/index) `MROONGA_STATS` table only exists if the [Mroonga](../mroonga/index) storage engine is installed, and contains information about its activities. | Column | Description | | --- | --- | | `VERSION` | Mroonga version. | | `rows_written` | Number of rows written into Mroonga tables. | | `rows_read` | Number of rows read from all Mroonga tables. | This table always contains 1 row. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Percona XtraBackup Overview Percona XtraBackup Overview =========================== In [MariaDB 10.1](../what-is-mariadb-101/index) and later, [Mariabackup](../mariabackup/index) is the recommended backup method to use instead of Percona XtraBackup. In [MariaDB 10.3](../what-is-mariadb-103/index), Percona XtraBackup is **not supported**. See [Percona XtraBackup Overview: Compatibility with MariaDB](index#compatibility-with-mariadb) for more information. In [MariaDB 10.2](../what-is-mariadb-102/index) and [MariaDB 10.1](../what-is-mariadb-101/index), Percona XtraBackup is only **partially supported**. See [Percona XtraBackup Overview: Compatibility with MariaDB](index#compatibility-with-mariadb) for more information. Percona XtraBackup is an open source tool for performing hot backups of MariaDB, MySQL and Percona Server databases. Percona XtraBackup can perform compressed, incremental and streaming backups. It was designed to back up [XtraDB/InnoDB](../innodb/index) tables but can also back up other [storage engines](../storage-engines/index). [Mariabackup](../mariabackup/index) is a fork of Percona XtraBackup designed to work with encrypted and compressed tables and other MariaDB enhancements. There are many bug fixes, such as [MDEV-13807](https://jira.mariadb.org/browse/MDEV-13807), and some unsafe or redundant options have been removed. [Mariabackup](../mariabackup/index) is the recommended backup method for MariaDB servers. Installing Percona XtraBackup ----------------------------- ### Installing with a Package Manager Percona XtraBackup can also be installed via a package manager on Linux. In order to do so, your system needs to be configured to install from a repository that has it. You can also configure your package manager to install it from Percona's repository by following the instructions in their documentation: * [Installing Percona XtraBackup 2.3](https://www.percona.com/doc/percona-xtrabackup/2.3/installation.html) * [Installing Percona XtraBackup 2.4](https://www.percona.com/doc/percona-xtrabackup/2.4/installation.html) #### Installing with yum/dnf On RHEL, CentOS, Fedora, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[yum](../yum/index)` or `[dnf](https://en.wikipedia.org/wiki/DNF_(software))`. Starting with RHEL 8 and Fedora 22, `yum` has been replaced by `dnf`, which is the next major version of `yum`. However, `yum` commands still work on many systems that use `dnf`. For example, to install Percona XtraBackup 2.3: ``` sudo yum install percona-xtrabackup ``` And to install Percona XtraBackup 2.4: ``` sudo yum install percona-xtrabackup-24 ``` #### Installing with apt-get On Debian, Ubuntu, and other similar Linux distributions, it is highly recommended to install the relevant [DEB package](../installing-mariadb-deb-files/index) from MariaDB's repository using `[apt-get](https://wiki.debian.org/apt-get)`. For example, to install Percona XtraBackup 2.3: ``` sudo apt-get install percona-xtrabackup ``` And to install Percona XtraBackup 2.4: ``` sudo apt-get install percona-xtrabackup-24 ``` #### Installing with zypper On SLES, OpenSUSE, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[zypper](../installing-mariadb-with-zypper/index)`. For example, to install Percona XtraBackup 2.3: ``` sudo zypper install percona-xtrabackup ``` And to install Percona XtraBackup 2.4: ``` sudo zypper install percona-xtrabackup-24 ``` Using Percona XtraBackup ------------------------ The command to use `xtrabackup` and the general syntax is: ``` xtrabackup <options> ``` or: ``` innobackupex <options> ``` ### Options Options supported by Percona XtraBackup can be found on Percona's documentation. `xtrabackup` options: * [`xtrabackup` options - Percona XtraBackup 2.3](https://www.percona.com/doc/percona-xtrabackup/2.3/xtrabackup_bin/xbk_option_reference.html) * [`xtrabackup` options - Percona XtraBackup 2.4](https://www.percona.com/doc/percona-xtrabackup/2.4/xtrabackup_bin/xbk_option_reference.html) `innobackupex` options: * [`innobackupex` options - Percona XtraBackup 2.3](https://www.percona.com/doc/percona-xtrabackup/2.3/innobackupex/innobackupex_option_reference.html) * [`innobackupex` options - Percona XtraBackup 2.4](https://www.percona.com/doc/percona-xtrabackup/2.4/innobackupex/innobackupex_option_reference.html) ### Option Files In addition to reading options from the command-line, Percona XtraBackup can also read options from [option files](../configuring-mariadb-with-option-files/index). The following options relate to how MariaDB/MySQL command-line tools handles option files. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | #### Server Option Groups Percona XtraBackup reads server options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[xtrabackup]` | Options read by [Mariabackup](../mariabackup/index) and Percona XtraBackup. | | `[mysqld]` | Options read by `mysqld`, which includes both MariaDB Server and MySQL Server. | #### Client Option Groups Percona XtraBackup reads client options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[xtrabackup]` | Options read by [Mariabackup](../mariabackup/index) and Percona XtraBackup. | | `[client]` | Options read by all MariaDB and MySQL [client programs](../clients-utilities/index), which includes both MariaDB and MySQL clients. For example, `mysqldump`. | ### Authentication and Privileges Percona XtraBackup needs to authenticate with the database server when it performs a backup operation (i.e. when the `--backup` option is specified). The user account that performs the backup needs to have the `RELOAD` , `PROCESS`, `LOCK TABLES` and `REPLICATION CLIENT` [global privileges](../grant/index#global-privileges) on the database server. For example: ``` CREATE USER 'xtrabackup'@'localhost' IDENTIFIED BY 'mypassword'; GRANT RELOAD, PROCESS, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'xtrabackup'@'localhost'; ``` The user account information can be specified with the `-user` and `--password` command-line options. For example: ``` $ xtrabackup --backup \ --target-dir=/var/mariadb/backup/ \ --user=xtrabackup --password=mypassword ``` The user account information can also be specified in a supported [client option group](#client-option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [xtrabackup] user=xtrabackup password=mypassword ``` Percona XtraBackup does not need to authenticate with the database server when preparing or restoring a backup. ### File System Permissions Percona XtraBackup has to read MariaDB's files from the file system. Therefore, when you run Percona XtraBackup as a specific operating system user, you should ensure that user account has sufficient permissions to read those files. If you are using Linux and if you installed MariaDB with a package manager, then MariaDB's files will probably be owned by the `mysql` user and the `mysql` group. Compatibility with MariaDB -------------------------- ### Compatibility with [MariaDB 10.3](../what-is-mariadb-103/index) and Later In [MariaDB 10.3](../what-is-mariadb-103/index) and later, [Mariabackup](../mariabackup/index) is the recommended backup method to use instead of Percona XtraBackup. In [MariaDB 10.3](../what-is-mariadb-103/index) and later, Percona XtraBackup is not supported. This limitation is being tracked by Percona XtraBackup bug [PXB-1550](https://jira.percona.com/browse/PXB-1550). However, it does not appear that there are plans to fix it. ### Compatibility with [MariaDB 10.2](../what-is-mariadb-102/index) In [MariaDB 10.2](../what-is-mariadb-102/index), [Mariabackup](../mariabackup/index) is the recommended backup method to use instead of Percona XtraBackup. In [MariaDB 10.2](../what-is-mariadb-102/index), Percona XtraBackup 2.4 is supported in some cases if [InnoDB page compression](../compression/index) is not used, and if [data at rest encryption](../data-at-rest-encryption/index) is not used, and if [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size) is set to `16k`. However, users should be aware that problems are likely due to the MySQL 5.7 undo log format incompatibility bug that was fixed in [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/) in [MDEV-12289](https://jira.mariadb.org/browse/MDEV-12289). Due to this bug, backups prepared with Percona XtraBackup 2.4 may fail to recover some transactions. Only if you ran the server with the setting [innodb\_undo\_logs](../xtradbinnodb-server-system-variables/index#innodb_undo_logs)=1 this would not be a problem. Percona XtraBackup 2.4 may also fail to work entirely with [MariaDB 10.2.19](https://mariadb.com/kb/en/mariadb-10219-release-notes/) and later if [innodb\_safe\_truncate=ON](../xtradbinnodb-server-system-variables/index#innodb_safe_truncate) is set due to changes in the redo log format introduced by [MDEV-14717](https://jira.mariadb.org/browse/MDEV-14717). In that case, you may see the following error: ``` InnoDB: Unsupported redo log format. The redo log was created with MariaDB 10.2.19. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html ``` ### Compatibility with [MariaDB 10.1](../what-is-mariadb-101/index) In [MariaDB 10.1](../what-is-mariadb-101/index), [Mariabackup](../mariabackup/index) is the recommended backup method to use instead of Percona XtraBackup. In [MariaDB 10.1](../what-is-mariadb-101/index), Percona XtraBackup 2.3 is supported if [InnoDB page compression](../compression/index) is not used, and if [data at rest encryption](../data-at-rest-encryption/index) is not used, and if [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size) is set to `16k`. ### Compatibility with [MariaDB 10.0](../what-is-mariadb-100/index) and Before In [MariaDB 10.0](../what-is-mariadb-100/index) and before, Percona XtraBackup 2.3 is supported. Using Percona XtraBackup for Galera SSTs ---------------------------------------- The `xtrabackup-v2` SST method uses the [Percona XtraBackup](../backup-restore-and-import-clients-percona-xtrabackup/index) utility for performing SSTs. See [xtrabackup-v2 SST method](../xtrabackup-v2-sst-method/index) for more information. See Also -------- * [Mariabackup](../mariabackup/index) * [mysqldump](../mysqldump/index) * [Percona XtraBackup documentation](http://www.percona.com/doc/percona-xtrabackup/) * [Percona JIRA](https://jira.percona.com/secure/Dashboard.jspa) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Error Log Error Log ========= The error log contains a record of critical errors that occurred during the server's operation, table corruption, start and stop information. SQL errors can also be logged in a separate file using the [SQL\_ERROR\_LOG plugin](../sql_error_log-plugin/index). Configuring the Error Log Output Destination -------------------------------------------- MariaDB always writes its error log, but the destination is configurable. ### Writing the Error Log to a File To configure the error log to be written to a file, you can set the [log\_error](../server-system-variables/index#log_error) system variable. You can configure a specific file name. However, if a specific file name is not configured, then the log will be written to the `${hostname}.err` file in the [datadir](../server-system-variables/index#datadir) directory by default. The [log\_error](../server-system-variables/index#log_error) system variable can be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example, to write the error log to the default `${hostname}.err` file, you could configure the following: ``` [mariadb] ... log_error ``` If you configure a specific file name as the [log\_error](../server-system-variables/index#log_error) system variable, and if it is not an absolute path, then it will be relative to the [datadir](../server-system-variables/index#datadir) directory. For example, if you configured the following, then the error log would be written to `mariadb.err` in the [datadir](../server-system-variables/index#datadir) directory: ``` [mariadb] ... log_error=mariadb.err ``` If it is a relative path, then the [log\_error](../server-system-variables/index#log_error) is relative to the [datadir](../server-system-variables/index#datadir) directory. However, the [log\_error](../server-system-variables/index#log_error) system variable can also be an absolute path. For example: ``` [mariadb] ... log_error=/var/log/mysql/mariadb.err ``` Another way to configure the error log file name is to set the [log-basename](../mysqld-options/index#-log-basename) option, which configures MariaDB to use a common prefix for all log files (e.g. [general query log](../general-query-log/index), [slow query log](../slow-query-log/index), error log, [binary logs](../binary-log/index), etc.). The error log file name will be built by adding a `.err` extension to this prefix. For example, if you configured the following, then the error log would still be written to `mariadb.err` in the [datadir](../server-system-variables/index#datadir) directory: ``` [mariadb] ... log-basename=mariadb log_error ``` The [log-basename](../mysqld-options/index#-log-basename) cannot be an absolute path. The log file name is relative to the [datadir](../server-system-variables/index#datadir) directory. ### Writing the Error Log to Stderr on Unix On Unix, if the [log\_error](../server-system-variables/index#log_error) system variable is not set, then errors are written to `stderr`, which usually means that the log messages are output to the terminal that started `mysqld`. If the [log\_error](../server-system-variables/index#log_error) system variable was set in an [option file](../configuring-mariadb-with-option-files/index) or on the command-line, then it can still be unset by specifying `--skip-log-error`. ### Writing the Error Log to Syslog on Unix On Unix, the error log can also be redirected to the [syslog](https://linux.die.net/man/8/rsyslogd). How this is done depends on how you [start](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index) MariaDB. #### Syslog with mysqld\_safe If you [start](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index) MariaDB with [mysqld\_safe](../mysqld_safe/index), then the error log can be redirected to the syslog. See [mysqld\_safe: Configuring MariaDB to Write the Error Log to Syslog](../mysqld_safe/index#configuring-mariadb-to-write-the-error-log-to-syslog) for more information. #### Syslog with Systemd If you [start](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index) MariaDB with [systemd](../systemd/index), then the error log can also be redirected to the syslog. See [Systemd: Configuring MariaDB to Write the Error Log to Syslog](../systemd/index#configuring-mariadb-to-write-the-error-log-to-syslog) for more information. [systemd](../systemd/index) also has its own logging system called the `journal`, and some errors may get logged there instead. See [Systemd:Systemd Journal](../systemd/index#systemd-journal) for more information. ### Writing the Error Log to Console on Windows On Windows, if the [console](../mysqld-options/index#-console) option is specified, and if the [log\_error](../server-system-variables/index#log_error) system variable is not used, then errors are written to the console. If both options are specified, then the last option takes precedence. ### Writing the Error Log to the Windows Event Viewer On Windows, error log messages are also written to the Windows Event Viewer. You can find MariaDB's error log messages by browsing **Windows Logs**, and then selecting **Application** or **Application Log**, depending on the Windows version. In [MariaDB 10.3](../what-is-mariadb-103/index) and before, you can find MariaDB's error log messages by searching for the **Source** `MySQL`. In [MariaDB 10.4](../what-is-mariadb-104/index) and later, you can find MariaDB's error log messages by searching for the **Source** `MariaDB`. Configuring the Error Log Verbosity ----------------------------------- **MariaDB starting with [10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)**In [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) and later, the default value of the [log\_warnings](../server-system-variables/index#log_warnings) system variable is `2`. **MariaDB until [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**In [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) and before, the default value of the [log\_warnings](../server-system-variables/index#log_warnings) system variable is `1`. The [log\_warnings](../server-system-variables/index#log_warnings) system variable can be used to configure the verbosity of the error log. It can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL log_warnings=3; ``` It can also be set either on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... log_warnings=3 ``` Some of the warnings included in each verbosity level are described below. The [log\_warnings](../server-system-variables/index#log_warnings) system variable only has an effect on some log messages. Some log messages are **always** written to the error log, regardless of the error log verbosity. For example, most warnings from the InnoDB storage engine are not affected by [log\_warnings](../server-system-variables/index#log_warnings). For a complete list of log messages affected by [log\_warnings](../server-system-variables/index#log_warnings), see the description of the [log\_warnings](../server-system-variables/index#log_warnings) system variable. ### Verbosity Level 0 If [log\_warnings](../server-system-variables/index#log_warnings) is `0`, then many optional warnings will not be logged. However, this does not prevent all warnings from being logged, because there are certain core warnings that will always be written to the error log. For example: * If [InnoDB strict mode](../innodb-strict-mode/index) is disabled, and if DDL is performed on a table that triggers a ["Row size too large" error](../troubleshooting-row-size-too-large-errors-with-innodb/index), then InnoDB will log a warning: ``` [Warning] InnoDB: Cannot add field col25 in table db1.tab because after adding it, the row size is 8477 which is greater than maximum allowed size (8126) for a record on index leaf page. ``` However, if [InnoDB strict mode](../innodb-strict-mode/index) is enabled, then the same message will be logged as an error. ### Verbosity Level 1 If [log\_warnings](../server-system-variables/index#log_warnings) is `1`, then many types of warnings are logged. Some useful warnings are: * Replication-related messages: ``` [Note] Error reading relay log event: slave SQL thread was killed [Note] Slave SQL thread exiting, replication stopped in log 'dbserver-2-bin.000033' at position 181420; GTID position '0-263316466-368886' [Note] Slave I/O thread exiting, read up to log 'dbserver-2-bin.000034', position 642; GTID position 0-263316466-368887 ``` * Messages related to DNS lookup failures: ``` [Warning] IP address '192.168.1.193' could not be resolved: Name or service not known ``` * Messages related to the [event scheduler](../event-scheduler/index): ``` [Note] Event Scheduler: Loaded 0 events ``` * Messages related to [unsafe statements for statement-based replication](../unsafe-statements-for-statement-based-replication/index): ``` [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. ``` Frequent warnings about [unsafe statements for statement-based replication](../unsafe-statements-for-statement-based-replication/index) can cause the error log to grow very large. MariaDB will automatically detect frequent duplicate warnings about [unsafe statements for statement-based replication](../unsafe-statements-for-statement-based-replication/index). After 10 identical warnings are detected, MariaDB will prevent that same warning from being written to the error log again for the next 5 minutes. ### Verbosity Level 2 If [log\_warnings](../server-system-variables/index#log_warnings) is `2`, then a couple other different kinds of warnings are printed. For example: * Messages related to access denied errors: ``` [Warning] Access denied for user 'root'@'localhost' (using password: YES) ``` * Messages related to connections that are aborted due to errors or timeouts: ``` [Warning] Aborted connection 35 to db: 'unconnected' user: 'user1@host1' host: '192.168.1.40' (Got an error writing communication packets) [Warning] Aborted connection 36 to db: 'unconnected' user: 'user1@host2' host: '192.168.1.230' (Got an error writing communication packets) [Warning] Aborted connection 38 to db: 'db1' user: 'user2' host: '192.168.1.60' (Unknown error) [Warning] Aborted connection 51 to db: 'db1' user: 'user2' host: '192.168.1.50' (Got an error reading communication packets) [Warning] Aborted connection 52 to db: 'db1' user: 'user3' host: '192.168.1.53' (Got timeout reading communication packets) ``` * Messages related to table handler errors: ``` [Warning] Can't find record in 'tab1'. [Warning] Can't write; duplicate key in table 'tab1'. [Warning] Lock wait timeout exceeded; try restarting transaction. [Warning] The number of locks exceeds the lock table size. [Warning] Update locks cannot be acquired during a READ UNCOMMITTED transaction. ``` * Messages related to the files used to [persist replication state](../change-master-to/index#option-persistence): + Either the default `master.info` file or the file that is configured by the [master\_info\_file](../mysqld-options/index#-master-info-file) option. + Either the default `relay-log.info` file or the file that is configured by the [relay\_log\_info\_file](../replication-and-binary-log-system-variables/index#relay_log_info_file) system variable. ``` [Note] Reading Master_info: '/mariadb/data/master.info' Relay_info:'/mariadb/data/relay-log.info' [Note] Initialized Master_info from '/mariadb/data/master.info' [Note] Reading of all Master_info entries succeded [Note] Deleted Master_info file '/mariadb/data/master.info'. [Note] Deleted Master_info file '/mariadb/data/relay-log.info'. ``` * Messages about a master's [binary log dump thread](../replication-threads/index#binary-log-dump-thread): ``` [Note] Start binlog_dump to slave_server(263316466), pos(, 4) ``` ### Verbosity Level 3 If [log\_warnings](../server-system-variables/index#log_warnings) is `3`, then a couple other different kinds of warnings are printed. For example: * Messages related to old-style language options: ``` [Warning] An old style --language value with language specific part detected: /usr/local/mysql/data/ [Warning] Use --lc-messages-dir without language specific part instead. ``` * Messages related to [progress of InnoDB online DDL](https://mariadb.org/monitoring-progress-and-temporal-memory-usage-of-online-ddl-in-innodb/): ``` [Note] InnoDB: Online DDL : Start [Note] InnoDB: Online DDL : Start reading clustered index of the table and create temporary files [Note] InnoDB: Online DDL : End of reading clustered index of the table and create temporary files [Note] InnoDB: Online DDL : Start merge-sorting index PRIMARY (1 / 3), estimated cost : 18.0263 [Note] InnoDB: Online DDL : merge-sorting has estimated 33 runs [Note] InnoDB: Online DDL : merge-sorting current run 1 estimated 33 runs [Note] InnoDB: Online DDL : merge-sorting current run 2 estimated 17 runs [Note] InnoDB: Online DDL : merge-sorting current run 3 estimated 9 runs [Note] InnoDB: Online DDL : merge-sorting current run 4 estimated 5 runs [Note] InnoDB: Online DDL : merge-sorting current run 5 estimated 3 runs [Note] InnoDB: Online DDL : merge-sorting current run 6 estimated 2 runs [Note] InnoDB: Online DDL : End of merge-sorting index PRIMARY (1 / 3) [Note] InnoDB: Online DDL : Start building index PRIMARY (1 / 3), estimated cost : 27.0395 [Note] InnoDB: Online DDL : End of building index PRIMARY (1 / 3) [Note] InnoDB: Online DDL : Completed [Note] InnoDB: Online DDL : Start merge-sorting index ux1 (2 / 3), estimated cost : 5.7895 [Note] InnoDB: Online DDL : merge-sorting has estimated 2 runs [Note] InnoDB: Online DDL : merge-sorting current run 1 estimated 2 runs [Note] InnoDB: Online DDL : End of merge-sorting index ux1 (2 / 3) [Note] InnoDB: Online DDL : Start building index ux1 (2 / 3), estimated cost : 8.6842 [Note] InnoDB: Online DDL : End of building index ux1 (2 / 3) [Note] InnoDB: Online DDL : Completed [Note] InnoDB: Online DDL : Start merge-sorting index ix1 (3 / 3), estimated cost : 6.1842 [Note] InnoDB: Online DDL : merge-sorting has estimated 3 runs [Note] InnoDB: Online DDL : merge-sorting current run 1 estimated 3 runs [Note] InnoDB: Online DDL : merge-sorting current run 2 estimated 2 runs [Note] InnoDB: Online DDL : End of merge-sorting index ix1 (3 / 3) [Note] InnoDB: Online DDL : Start building index ix1 (3 / 3), estimated cost : 9.2763 [Note] InnoDB: Online DDL : End of building index ix1 (3 / 3) [Note] InnoDB: Online DDL : Completed ``` ### Verbosity Level 4 If [log\_warnings](../server-system-variables/index#log_warnings) is `4`, then a couple other different kinds of warnings are printed. For example: * Messages related to killed connections: ``` [Warning] Aborted connection 53 to db: 'db1' user: 'user2' host: '192.168.1.50' (KILLED) ``` * Messages related to **all** closed connections: ``` [Warning] Aborted connection 56 to db: 'db1' user: 'user2' host: '192.168.1.50' (CLOSE_CONNECTION) ``` * Messages related to released connections, such as when a transaction is committed and [completion\_type](../server-system-variables/index#completion_type) is set to `RELEASE`: ``` [Warning] Aborted connection 58 to db: 'db1' user: 'user2' host: '192.168.1.50' (RELEASE) ``` ### Verbosity Level 9 If [log\_warnings](../server-system-variables/index#log_warnings) is `9`, then some **very** verbose warnings are printed. For example: * Messages about initializing plugins: ``` [Note] Initializing built-in plugins [Note] Initializing plugins specified on the command line [Note] Initializing installed plugins ``` ### MySQL's log\_error\_verbosity MariaDB does not support the [log\_error\_verbosity](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_log_error_verbosity) system variable added in MySQL 5.7. Format ------ The format consists of the date (yyyy-mm-dd) and time, the thread ID, followed by the type of error (Note, Warning or Error) and the error message, for example: ``` 2016-06-15 16:53:33 139651251140544 [Note] InnoDB: The InnoDB memory heap is disabled ``` Until [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/), the format only consisted of the date (yymmdd) and time, followed by the type of error (Note, Warning or Error) and the error message, for example: ``` 160615 16:53:08 [Note] InnoDB: The InnoDB memory heap is disabled ``` Rotating the Error Log on Unix and Linux ---------------------------------------- Unix and Linux distributions offer the [logrotate](https://linux.die.net/man/8/logrotate) utility, which makes it very easy to rotate log files. See [Rotating Logs on Unix and Linux](../rotating-logs-on-unix-and-linux/index) for more information on how to use this utility to rotate the error log. Error Messages File ------------------- Many error messages are ready from an error messages file that contains localized error messages. If the server can't find this file when it starts up, then you might see errors like the following: ``` [ERROR] Can't find messagefile '/usr/share/errmsg.sys' ``` If this error is occurring because the file is in a custom location, then you can configure this location by setting the [lc\_messages\_dir](../server-system-variables/index#lc_messages_dir) system variable either on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... lc_messages_dir=/usr/share/mysql/ ``` If you want to use a different locale for error messages, then you can also set the [lc\_messages](../server-system-variables/index#lc_messages) system variable. For example: ``` [mariadb] ... lc_messages_dir=/usr/share/mysql/ lc_messages=en_US ``` See [Setting the Language for Error Messages](../setting-the-language-for-error-messages/index) for more information. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb AUTO_INCREMENT AUTO\_INCREMENT =============== Description ----------- The `AUTO_INCREMENT` attribute can be used to generate a unique identity for new rows. When you insert a new record to the table (or upon adding an [AUTO\_INCREMENT](index) attribute with the [ALTER TABLE](../alter-table/index) statement), and the auto\_increment field is [NULL](../null-values/index) or DEFAULT (in the case of an INSERT), the value will automatically be incremented. This also applies to 0, unless the [NO\_AUTO\_VALUE\_ON\_ZERO SQL\_MODE](../sql-mode/index#no_auto_value_on_zero) is enabled. `AUTO_INCREMENT` columns start from 1 by default. The automatically generated value can never be lower than 0. Each table can have only one `AUTO_INCREMENT` column. It must defined as a key (not necessarily the `PRIMARY KEY` or `UNIQUE` key). In some storage engines (including the default [InnoDB](../innodb/index)), if the key consists of multiple columns, the `AUTO_INCREMENT` column must be the first column. Storage engines that permit the column to be placed elsewhere are [Aria](../aria/index), [MyISAM](../myisam/index), [MERGE](../merge/index), [Spider](../spider/index), [TokuDB](../tokudb/index), [BLACKHOLE](../blackhole/index), [FederatedX](../federatedx/index) and [Federated](../federated-storage-engine/index). ``` CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) ); INSERT INTO animals (name) VALUES ('dog'),('cat'),('penguin'), ('fox'),('whale'),('ostrich'); ``` ``` SELECT * FROM animals; +----+---------+ | id | name | +----+---------+ | 1 | dog | | 2 | cat | | 3 | penguin | | 4 | fox | | 5 | whale | | 6 | ostrich | +----+---------+ ``` `SERIAL` is an alias for `BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE`. ``` CREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB; SHOW CREATE TABLE t \G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `c` char(1) DEFAULT NULL, UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ``` Setting or Changing the Auto\_Increment Value --------------------------------------------- You can use an `[ALTER TABLE](../alter-table/index)` statement to assign a new value to the `auto_increment` table option, or set the [insert\_id](../server-system-variables/index#insert_id) server system variable to change the next `AUTO_INCREMENT` value inserted by the current session. `[LAST\_INSERT\_ID()](../last_insert_id/index)` can be used to see the last `AUTO_INCREMENT` value inserted by the current session. ``` ALTER TABLE animals AUTO_INCREMENT=8; INSERT INTO animals (name) VALUES ('aardvark'); SELECT * FROM animals; +----+-----------+ | id | name | +----+-----------+ | 1 | dog | | 2 | cat | | 3 | penguin | | 4 | fox | | 5 | whale | | 6 | ostrich | | 8 | aardvark | +----+-----------+ SET insert_id=12; INSERT INTO animals (name) VALUES ('gorilla'); SELECT * FROM animals; +----+-----------+ | id | name | +----+-----------+ | 1 | dog | | 2 | cat | | 3 | penguin | | 4 | fox | | 5 | whale | | 6 | ostrich | | 8 | aardvark | | 12 | gorilla | +----+-----------+ ``` InnoDB ------ Until [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/), InnoDB used an auto-increment counter that is stored in memory. When the server restarts, the counter is re-initialized to the highest value used in the table, which cancels the effects of any AUTO\_INCREMENT = N option in the table statements. From [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/), this restriction has been lifted and AUTO\_INCREMENT is persistent. See also [AUTO\_INCREMENT Handling in InnoDB](../auto_increment-handling-in-innodb/index). Setting Explicit Values ----------------------- It is possible to specify a value for an `AUTO_INCREMENT` column. If the key is primary or unique, the value must not already exist in the key. If the new value is higher than the current maximum value, the `AUTO_INCREMENT` value is updated, so the next value will be higher. If the new value is lower than the current maximum value, the `AUTO_INCREMENT` value remains unchanged. The following example demonstrates these behaviors: ``` CREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t VALUES (NULL); SELECT id FROM t; +----+ | id | +----+ | 1 | +----+ INSERT INTO t VALUES (10); -- higher value SELECT id FROM t; +----+ | id | +----+ | 1 | | 10 | +----+ INSERT INTO t VALUES (2); -- lower value INSERT INTO t VALUES (NULL); -- auto value SELECT id FROM t; +----+ | id | +----+ | 1 | | 2 | | 10 | | 11 | +----+ ``` The [ARCHIVE](../archive/index) storage engine does not allow to insert a value that is lower than the current maximum. Missing Values -------------- An AUTO\_INCREMENT column normally has missing values. This happens because if a row is deleted, or an AUTO\_INCREMENT value is explicitly updated, old values are never re-used. The REPLACE statement also deletes a row, and its value is wasted. With InnoDB, values can be reserved by a transaction; but if the transaction fails (for example, because of a ROLLBACK) the reserved value will be lost. Thus AUTO\_INCREMENT values can be used to sort results in a chronological order, but not to create a numeric sequence. Replication ----------- To make master-master or Galera safe to use `AUTO_INCREMENT` one should use the system variables [auto\_increment\_increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) and [auto\_increment\_offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset) to generate unique values for each server. CHECK Constraints, DEFAULT Values and Virtual Columns ----------------------------------------------------- **MariaDB starting with [10.2.6](https://mariadb.com/kb/en/mariadb-1026-release-notes/)**From [MariaDB 10.2.6](https://mariadb.com/kb/en/mariadb-1026-release-notes/) auto\_increment columns are no longer permitted in [CHECK constraints](../constraint/index), [DEFAULT value expressions](../create-table/index#default) and [virtual columns](../virtual-computed-columns/index). They were permitted in earlier versions, but did not work correctly. See [MDEV-11117](https://jira.mariadb.org/browse/MDEV-11117). Generating Auto\_Increment Values When Adding the Attribute ----------------------------------------------------------- ``` CREATE OR REPLACE TABLE t1 (a INT); INSERT t1 VALUES (0),(0),(0); ALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY; SELECT * FROM t1; +---+ | a | +---+ | 1 | | 2 | | 3 | +---+ ``` ``` CREATE OR REPLACE TABLE t1 (a INT); INSERT t1 VALUES (5),(0),(8),(0); ALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY; SELECT * FROM t1; +---+ | a | +---+ | 5 | | 6 | | 8 | | 9 | +---+ ``` If the [NO\_AUTO\_VALUE\_ON\_ZERO SQL\_MODE](../sql-mode/index#no_auto_value_on_zero) is set, zero values will not be automatically incremented: ``` SET SQL_MODE='no_auto_value_on_zero'; CREATE OR REPLACE TABLE t1 (a INT); INSERT t1 VALUES (3), (0); ALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY; SELECT * FROM t1; +---+ | a | +---+ | 0 | | 3 | +---+ ``` See Also -------- * [Getting Started with Indexes](../getting-started-with-indexes/index) * [Sequences](../sequences/index) - an alternative to auto\_increment available from [MariaDB 10.3](../what-is-mariadb-103/index) * [AUTO\_INCREMENT FAQ](../autoincrement-faq/index) * [LAST\_INSERT\_ID()](../last_insert_id/index) * [AUTO\_INCREMENT handling in InnoDB](../auto_increment-handling-in-innodb/index) * [BLACKHOLE and AUTO\_INCREMENT](../blackhole/index#blackhole-and-auto_increment) * [UUID\_SHORT()](../uuid_short/index) - Generate unique ids * [Generating Identifiers – from AUTO\_INCREMENT to Sequence (percona.com)](https://www.percona.com/community-blog/2018/10/12/generating-identifiers-auto_increment-sequence/) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Troubleshooting Overview InnoDB Troubleshooting Overview =============================== As with most errors, first take a look at the contents of the [MariaDB error log](../error-log/index). If dealing with a deadlock, setting the [innodb\_print\_all\_deadlocks](../xtradbinnodb-server-system-variables/index#innodb_print_all_deadlocks) option (off by default) will output details of all deadlocks to the error log. It can also help to enable the various [InnoDB Monitors](../xtradb-innodb-monitors/index) relating to the problem you are experiencing. There are four types: the standard InnoDB monitor, the InnoDB Lock Monitor, InnoDB Tablespace Monitor and the InnoDB Table Monitor. Running [CHECK TABLE](../check-table/index) will help determine whether there are errors in the table. For problems with the InnoDB Data Dictionary, see [InnoDB Data Dictionary Troubleshooting](../innodb-data-dictionary-troubleshooting/index). See Also -------- * [InnoDB Data Dictionary Troubleshooting](../innodb-data-dictionary-troubleshooting/index) * [InnoDB Recovery Modes](../xtradbinnodb-recovery-modes/index) * [Error Codes](../error-codes/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb QUARTER QUARTER ======= Syntax ------ ``` QUARTER(date) ``` Description ----------- Returns the quarter of the year for `date`, in the range 1 to 4. Returns 0 if month contains a zero value, or `NULL` if the given value is not otherwise a valid date (zero values are accepted). Examples -------- ``` SELECT QUARTER('2008-04-01'); +-----------------------+ | QUARTER('2008-04-01') | +-----------------------+ | 2 | +-----------------------+ SELECT QUARTER('2019-00-01'); +-----------------------+ | QUARTER('2019-00-01') | +-----------------------+ | 0 | +-----------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INTEGER INTEGER ======= Syntax ------ ``` INTEGER[(M)] [SIGNED | UNSIGNED | ZEROFILL] ``` Description ----------- This type is a synonym for [INT](../sql_language-data_types-int/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LOG LOG === Syntax ------ ``` LOG(X), LOG(B,X) ``` Description ----------- If called with one parameter, this function returns the natural logarithm of X. If X is less than or equal to 0, then NULL is returned. If called with two parameters, it returns the logarithm of X to the base B. If B is <= 1 or X <= 0, the function returns NULL. If any argument is `NULL`, the function returns `NULL`. The inverse of this function (when called with a single argument) is the [EXP()](../exp/index) function. Examples -------- LOG(X): ``` SELECT LOG(2); +-------------------+ | LOG(2) | +-------------------+ | 0.693147180559945 | +-------------------+ SELECT LOG(-2); +---------+ | LOG(-2) | +---------+ | NULL | +---------+ ``` LOG(B,X) ``` SELECT LOG(2,16); +-----------+ | LOG(2,16) | +-----------+ | 4 | +-----------+ SELECT LOG(3,27); +-----------+ | LOG(3,27) | +-----------+ | 3 | +-----------+ SELECT LOG(3,1); +----------+ | LOG(3,1) | +----------+ | 0 | +----------+ SELECT LOG(3,0); +----------+ | LOG(3,0) | +----------+ | NULL | +----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Virtual Machines - Fedora 19 Buildbot Setup for Virtual Machines - Fedora 19 =============================================== Base install ------------ ``` qemu-img create -f qcow2 /kvm/vms/vm-fedora19-i386-serial.qcow2 20G qemu-img create -f qcow2 /kvm/vms/vm-fedora19-amd64-serial.qcow2 20G ``` Start each VM booting from the server install iso one at a time and perform the following install steps: ``` kvm -m 2048 -hda /kvm/vms/vm-fedora19-i386-serial.qcow2 -cdrom /ds413/iso/fedora/Fedora-19-i386-DVD.iso -redir tcp:2289::22 -boot d -smp 2 -cpu qemu64 -net nic,model=virtio -net user kvm -m 2048 -hda /kvm/vms/vm-fedora19-amd64-serial.qcow2 -cdrom /ds413/iso/fedora/Fedora-19-x86_64-DVD.iso -redir tcp:2290::22 -boot d -smp 2 -cpu qemu64 -net nic,model=virtio -net user ``` Once running you can connect to the VNC server from your local host with: ``` vncviewer -via ${remote-host} localhost ``` Replace ${remote-host} with the host the vm is running on. **Note:** When you activate the install, vncviewer may disconnect with a complaint about the rect being too large. This is fine. The Fedora installer has just resized the vnc screen. Simply reconnect. Install, picking default options mostly, with the following notes: * Under "Network Configuration" set the hostnames to fedora19-amd64 and fedora19-i386 * Change "Software Selection" to "Minimal Install" (default is "Gnome Desktop") * For "Installation Destination" select the disk then click continue. * **do not** check the encryption checkbox * On "Installation Options" screen, expand the "Partition scheme configuration" box and select a "Partition type" of "Standard Partition" * While installing, set the root password and an initial user When the install is finished, you will be prompted to reboot. Go ahead and do so, but it will fail. Kill the VM (after the reboot fails) and start it up again: ``` kvm -m 2048 -hda /kvm/vms/vm-fedora19-i386-serial.qcow2 -redir tcp:2289::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user kvm -m 2048 -hda /kvm/vms/vm-fedora19-amd64-serial.qcow2 -redir tcp:2290::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user ``` Log in using the initial user created during the install: ``` ssh -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost ssh -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost ``` After logging in, add the initial user to the "wheel" group. ``` usermod -a -G wheel ${username} ``` Enable password-less sudo for the "wheel" group and serial console sudo: ``` visudo # Uncomment the line "%wheel ALL=(ALL) NOPASSWD: ALL" # Comment out this line: # Defaults requiretty ``` Edit /boot/grub/menu.lst: ``` sudo vi /etc/default/grub # Add/edit these entries: GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL="serial" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" grub2-mkconfig -o /boot/grub2/grub.cfg ``` Logout as root, and then, from the VM host server: Create a .ssh folder: ``` ssh -t -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost "mkdir -v .ssh" ssh -t -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost "mkdir -v .ssh" ``` Copy over the authorized keys file: ``` scp -P 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/authorized_keys localhost:.ssh/ scp -P 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/authorized_keys localhost:.ssh/ ``` Set permissions on the .ssh folder correctly: ``` ssh -t -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost "chmod -R go-rwx .ssh" ssh -t -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/buildbot.id_dsa localhost "chmod -R go-rwx .ssh" ``` Create the buildbot user: ``` ssh -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no localhost 'chmod -R go-rwx .ssh; sudo adduser buildbot; sudo usermod -a -G wheel buildbot; sudo mkdir ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' ssh -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no localhost 'chmod -R go-rwx .ssh; sudo adduser buildbot; sudo usermod -a -G wheel buildbot; sudo mkdir ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' ``` su to the local buildbot user and ssh to the vm to put the key in known\_hosts: For i386: ``` sudo su - buildbot ssh -p 2289 buildbot@localhost # exit, then exit again ``` For amd64: ``` sudo su - buildbot ssh -p 2290 buildbot@localhost # exit, then exit again ``` Upload the ttyS0 file and put it where it goes: ``` scp -P 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/ttyS0 buildbot@localhost: scp -P 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/ttyS0 buildbot@localhost: ssh -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost 'sudo mkdir -v /etc/event.d;sudo mv -vi ttyS0 /etc/event.d/;' ssh -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost 'sudo mkdir -v /etc/event.d;sudo mv -vi ttyS0 /etc/event.d/;' ``` Update the VM: ``` ssh -p 2289 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost ssh -p 2290 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost ``` Once logged in: ``` sudo yum update ``` Change selinux policy to `permissive`: ``` sudo vi /etc/selinux/config # change: SELINUX=enforcing # to: SELINUX=permissive ``` After updating, shut down the VM: ``` sudo shutdown -h now ``` VMs for building .rpms ---------------------- ``` for i in '/kvm/vms/vm-fedora19-i386-serial.qcow2 2289 qemu64' '/kvm/vms/vm-fedora19-amd64-serial.qcow2 2290 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/build/')" \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/thrift-0.9.0.tar.gz buildbot@localhost:/dev/shm/" \ "sudo yum -y groupinstall 'Development Tools'" \ "sudo yum -y install yum-utils" \ "sudo yum-builddep -y mariadb" \ "sudo yum -y install automake libtool flex pkgconfig gcc-c++ libevent-devel python-devel ruby-devel rpm-build" \ "sudo yum -y install cmake tar wget tree gperf readline-devel ncurses-devel zlib-devel pam-devel libaio-devel openssl-devel" \ "sudo yum -y install libxml2 libxml2-devel bison bison-devel boost-devel unixODBC-devel bzr perl perl\(DBI\)" \ "sudo yum -y remove systemtap-sdt-dev" \ "bzr co --lightweight lp:mariadb-native-client" \ "sudo mkdir -vp /usr/src/redhat/SOURCES /usr/src/redhat/SPECS /usr/src/redhat/RPMS /usr/src/redhat/SRPMS" \ "cd /usr/local/src;sudo tar zxf /dev/shm/thrift-0.9.0.tar.gz;pwd;ls" \ "cd /usr/local/src/thrift-0.9.0;echo;pwd;sudo ./configure --prefix=/usr --enable-shared=no --enable-static=yes CXXFLAGS=-fPIC CFLAGS=-fPIC && echo && echo 'now making' && echo && sleep 3 && sudo make && echo && echo 'now installing' && echo && sleep 3 && sudo make install" ; \ done ``` VMs for install testing. ------------------------ ``` for i in '/kvm/vms/vm-fedora19-i386-serial.qcow2 2289 qemu64' '/kvm/vms/vm-fedora19-amd64-serial.qcow2 2290 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/install/')" \ "sudo yum -y update" \ "sudo yum -y install patch tar libaio perl perl-Time-HiRes perl-DBI unixODBC" ; \ done ``` VMs for MySQL upgrade testing ----------------------------- ``` for i in '/kvm/vms/vm-fedora19-i386-serial.qcow2 2289 qemu64' '/kvm/vms/vm-fedora19-amd64-serial.qcow2 2290 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade/')" \ "sudo yum -y update" \ "sudo yum -y install patch tar mysql-server libtool-ltdl unixODBC" \ "sudo systemctl enable mysqld.service" \ "sudo systemctl start mysqld.service" \ 'mysql -uroot -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' ; \ done ``` VMs for MariaDB upgrade testing ------------------------------- ``` for i in '/kvm/vms/vm-fedora19-amd64-serial.qcow2 2290 qemu64' '/kvm/vms/vm-fedora19-i386-serial.qcow2 2289 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade2/')" \ 'sudo yum -y update' \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/MariaDB-${2}.repo buildbot@localhost:/tmp/MariaDB.repo" \ 'sudo rpm --verbose --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB' \ 'sudo mv -vi /tmp/MariaDB.repo /etc/yum.repos.d/' \ 'sudo yum -y remove mysql-libs' \ 'sudo yum -y install MariaDB-server MariaDB-client MariaDB-test libtool-ltdl unixODBC' \ 'sudo yum -y install cronie cronie-anacron crontabs.noarch patch tar' \ 'sudo /etc/init.d/mysql start' \ 'mysql -uroot -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' \ 'sudo rm -v /etc/yum.repos.d/MariaDB.repo' \ 'sudo yum -y update' \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/vms/MariaDB.local.repo buildbot@localhost:/tmp/" \ 'sudo mv -vi /tmp/MariaDB.local.repo /etc/yum.repos.d/'; \ done ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Comma vs JOIN Comma vs JOIN ============= A query to grab the list of phone numbers for clients who ordered in the last two weeks might be written in a couple of ways. Here are two: ``` SELECT * FROM clients, orders, phoneNumbers WHERE clients.id = orders.clientId AND clients.id = phoneNumbers.clientId AND orderPlaced >= NOW() - INTERVAL 2 WEEK; ``` ``` SELECT * FROM clients INNER JOIN orders ON clients.id = orders.clientId INNER JOIN phoneNumbers ON clients.id = phoneNumbers.clientId WHERE orderPlaced >= NOW() - INTERVAL 2 WEEK; ``` Does it make a difference? Not much as written. But you should use the second form. Why? * **Readability.** Once the WHERE clause contains more than two conditions, it becomes tedious to pick out the difference between business logic (only dates in the last two weeks) and relational logic (which fields relate clients to orders). Using the JOIN syntax with an ON clause makes the WHERE list shorter, and makes it very easy to see how tables relate to each other. * **Flexibility.** Let's say we need to see all clients even if they don't have a phone number in the system. With the second version, it's easy; just change `INNER JOIN phoneNumbers` to `LEFT JOIN phoneNumbers`. Try that with the first version, and MySQL version 5.0.12+ will issue a syntax error because of the change in precedence between the comma operator and the JOIN keyword. The solution is to rearrange the FROM clause or add parentheses to override the precedence, and that quickly becomes frustrating. * **Portability.** The changes in 5.0.12 were made to align with SQL:2003. If your queries use standard syntax, you will have an easier time switching to a different database should the need ever arise. See Also -------- * ["MySQL joins: ON vs. USING vs. Theta-style"](http://code.openark.org/blog/mysql/mysql-joins-on-vs-using-vs-theta-style) — An interesting blog entry regarding this topic. *The initial version of this article was copied, with permission, from <http://hashmysql.org/wiki/Comma_vs_JOIN> on 2012-10-05.* Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Special Functions Special Functions ================== There are many commonly used built-in functions. These are lesser used function for specific needs. | Title | Description | | --- | --- | | [Dynamic Columns Functions](../dynamic-columns-functions/index) | Functions for storing key/value pairs of data within a column. | | [Galera Functions](../galera-functions/index) | Built-in functions related to Galera. | | [Geographic Functions](../geographic-functions/index) | Geographic, as well as geometric functions. | | [JSON Functions](../json-functions/index) | Built-in functions related to JSON. | | [SEQUENCE Functions](../sequence-functions/index) | Functions that can be used on SEQUENCEs. | | [Spider Functions](../spider-functions/index) | User-defined functions available with the Spider storage engine. | | [Window Functions](../window-functions/index) | Window functions for performing calculations on a set of rows related to the current row. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Backup and Restore via dbForge Studio Backup and Restore via dbForge Studio ===================================== Without a doubt, you want your backup/restore and export/import operations to be fast, easy, and automated wherever possible. You can have it all that way with [dbForge Studio for MySQL](https://www.devart.com/dbforge/mysql/studio/). As the name implies, it is an IDE for MySQL development, management, and administration, yet it works just as perfectly as a [MariaDB GUI client](https://www.devart.com/dbforge/mysql/studio/mariadb-gui-client.html). Now, let's see how it tackles routine database backups. Create a MariaDB backup ----------------------- 1. On the **Database** menu, go to **Backup and Restore**, and click **Backup Database** to open **Database Backup Wizard**. 2. On the **General** page, specify the required connection and database, the path for the backup file to be saved to, and the output file name in the respective fields. Optionally, you can append a timestamp to the file name, enable the auto-deletion of old files, and compress your backup into an archive. After you set it all up, click **Next**. 3. On the **Backup content** page, select the content for your backup and click **Next**. 4. On the **Options** page, configure your detailed backup options—there are quite a few of those to match your requirements most precisely. Then click **Next**. 5. On the **Errors handling** page, configure the **Errors handling** and **Log settings** options. Afterwards, click **Backup** to run the backup process. Note that you have two more options here: you can select **Save Project** to save your current backup project with all the settings—or you can select **Save Command Line** to save a backup script that you can execute from the command line whenever you need. 6. After you click **Backup**, wait for the backup process to be completed. Note that you don't have to go through every wizard page to click **Backup**. You can do it whenever you've finished configuring your settings. 7. Finally, confirm the successful completion by clicking **Finish**. As you can see, it's very easy. Furthermore, you can schedule to run regular backups using **Action > Create Basic Task** in **Windows Task Scheduler**. Restore a MariaDB backup ------------------------ This is an even faster task, done in half as many steps. 1. On the **Database** menu, go to **\*Backup and Restore**, and click **Restore Database** to open the **Database Restore Wizard**. 2. On the **Database Script File** page, specify the required connection and database, as well as the path to the previously saved backup file. 3. After that, click **Restore**, and let the Studio do the rest for you. And when it's done, click **Finish**, and there you have it. You can learn more about this functionality on the dedicated [backup/restore page](https://www.devart.com/dbforge/mysql/studio/mysql-backup.html). Please note: while the page focuses on MySQL databases, everything that's described there is just as perfectly applicable to MariaDB from the same Studio with the same workflow. There is much more to dbForge Studio when it comes to MariaDB development and management. You can have a brief overview of its features and capabilities on [the Features page](https://www.devart.com/dbforge/mysql/studio/features.html). That said, if you'd love to have a single IDE that doesn't need any 3rd-party extensions because it can perfectly deal with nearly any task on its own, feel free to [download dbForge Studio for a free 30-day trial](https://www.devart.com/dbforge/mysql/studio/download.html) and give it a go in your daily work. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Bit Functions and Operators Bit Functions and Operators ============================ Operators for comparison and setting of values, and related functions. | Title | Description | | --- | --- | | [Operator Precedence](../operator-precedence/index) | Precedence of SQL operators | | [&](../bitwise_and/index) | Bitwise AND | | [<<](../shift-left/index) | Left shift | | [>>](../shift-right/index) | Shift right | | [BIT\_COUNT](../bit_count/index) | Returns the number of set bits | | [^](../bitwise-xor/index) | Bitwise XOR | | [|](../bitwise-or/index) | Bitwise OR | | [~](../bitwise-not/index) | Bitwise NOT | | [Parentheses](../parentheses/index) | Parentheses modify the precedence of other operators in an expression | | [TRUE FALSE](../true-false/index) | TRUE and FALSE evaluate to 1 and 0 | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Plans for MariaDB 10.6 Plans for MariaDB 10.6 ====================== [MariaDB 10.6](../what-is-mariadb-106/index) is stable, so no new features will be added. See [Plans for MariaDB 10.7](../plans-for-mariadb-107/index) instead. JIRA ---- We manage our development plans in JIRA, so the definitive list will be there. [This search](https://jira.mariadb.org/issues/?jql=project+%3D+MDEV+AND+issuetype+%3D+Task+AND+fixVersion+in+%2810.6%29+ORDER+BY+priority+DESC) shows what we **currently** plan for 10.6. It shows all tasks with the **Fix-Version** being 10.6. Not all these tasks will really end up in 10.6 but tasks with the "red" priorities have a much higher chance of being done in time for 10.6. Practically, you can think of these tasks as "features that **will** be in 10.6". Tasks with the "green" priorities probably won't be in 10.5. Think of them as "bonus features that would be **nice to have** in 10.6". Contributing ------------ If you want to be part of developing any of these features, see [Contributing to the MariaDB Project](../contributing-to-the-mariadb-project/index). You can also add new features to this list or to [JIRA](../jira-project-planning-and-tracking/index). See Also -------- * [Current tasks for 10.6](https://jira.mariadb.org/issues/?jql=project%20%3D%20MDEV%20AND%20issuetype%20%3D%20Task%20AND%20fixVersion%20in%20(10.6)%20ORDER%20BY%20priority%20DESC) * [10.6 Features/fixes by vote](https://jira.mariadb.org/issues/?jql=project%20%3D%20MDEV%20AND%20issuetype%20%3D%20Task%20AND%20fixVersion%20in%20(10.6)%20ORDER%20BY%20votes%20DESC%2C%20priority%20DESC) * [What is MariaDB 10.6?](../what-is-mariadb-106/index) * [What is MariaDB 10.5?](../what-is-mariadb-105/index) * [What is MariaDB 10.4?](../what-is-mariadb-104/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_InteriorRingN ST\_InteriorRingN ================= Syntax ------ ``` ST_InteriorRingN(poly,N) InteriorRingN(poly,N) ``` Description ----------- Returns the N-th interior ring for the Polygon value `poly` as a LineString. Rings are numbered beginning with 1. `ST_InteriorRingN()` and `InteriorRingN()` are synonyms. Examples -------- ``` SET @poly = 'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'; SELECT AsText(InteriorRingN(GeomFromText(@poly),1)); +----------------------------------------------+ | AsText(InteriorRingN(GeomFromText(@poly),1)) | +----------------------------------------------+ | LINESTRING(1 1,1 2,2 2,2 1,1 1) | +----------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INT1 INT1 ==== `INT1` is a synonym for [TINYINT](../tinyint/index). ``` CREATE TABLE t1 (x INT1); DESC t1; +-------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+------------+------+-----+---------+-------+ | x | tinyint(4) | YES | | NULL | | +-------+------------+------+-----+---------+-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb User-Defined Functions User-Defined Functions ======================= A user-defined function (UDF) is a way to extend MariaDB with a new function that works like a native (built-in) MariaDB function such as [ABS( )](../abs/index) or [CONCAT( )](../concat/index). Statements making use of user-defined functions are not [safe for replication](../unsafe-statements-for-replication/index). For an example, see `sql/udf_example.cc` in the source tree. For a collection of existing UDFs go to the [UDF Repository on GitHub](https://github.com/orgs/mysqludf/repositories). There are alternative ways to add a new function: writing a native function, which requires modifying and compiling the server source code; or writing a [stored function](../stored-functions/index). | Title | Description | | --- | --- | | [Creating User-Defined Functions](../creating-user-defined-functions/index) | How to create user-defined functions in C/C++. | | [User-Defined Functions Calling Sequences](../user-defined-functions-calling-sequences/index) | Declaring the functions required in a user-defined function. | | [User-Defined Functions Security](../user-defined-functions-security/index) | MariaDB imposes a number of limitations on user-defined functions for security purposes. | | [CREATE FUNCTION UDF](../create-function-udf/index) | Create a user-defined function. | | [DROP FUNCTION UDF](../drop-function-udf/index) | Drop a user-defined function. | | [mysql.func Table](../mysqlfunc-table/index) | User-defined function information | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Installing and Configuring a Multi Server ColumnStore System - 1.0.X Installing and Configuring a Multi Server ColumnStore System - 1.0.X ==================================================================== After the MariaDB ColumnStore servers have been setup based on the [Preparing for Installations](../preparing-for-columnstore-installation/index) document and the required MariaDB ColumnStore Packages have been Installed, use of the following option to configure and install MariaDB ColumnStore: * MariaDB ColumnStore Post Install Script **NOTE**: The install and setup had you install the packages on the node designed as Performance Module #1, 'pm1'. This is where the install script is run from, 'pm1' If installing on a system where there is a need to multi servers initially planned in the future, you would be a multi server install instead of a single server install. Going from one configuration to another will require a re-installation of the MariaDB ColumnStore software. **NOTE**: You can install MariaDB ColumnStore as a root user or non-root user. This is based on how you setup the servers based on "Preparing for Installation Document". If installing as root, you need to be logged in as root user in a root login shell. If you are installing as non-root, you need to be logged in as a non-root user that was setup in the "Preparing for Installation Document". ColumnStore Cluster Test Tool ----------------------------- This tool can be running before doing installation on a single-server or multi-node installs. It will verify the setup of all servers that are going to be used in the Columnstore System. [https://mariadb.com/kb/en/mariadb/mariadb-columnstore-cluster-test-tool](../mariadb/mariadb-columnstore-cluster-test-tool) The following is a transcript of a typical run of the MariaDB ColumnStore configuration script. Plain-text formatting indicates output from the script and bold text indicates responses to questions. After each question there is a short discussion of what the question is asking and what some typical answers might be. You will not see these discussions the running the actual configuration script. MariaDB ColumnStore Post Install Script, postConfigure ------------------------------------------------------ Run the script 'postConfigure' to complete the configuration and installation. This Article shows how to install on a mullti server system. ### Common Installation Examples During postConfigure, there are 2 questions that are asked where the answer given determines the path that postConfigure takes in configuring the system. Those 2 questions are as follows: ``` Select the type of server install [1=single, 2=multi] (2) > ``` and ``` Select the Type of Module Install being performed: 1. Separate - User and Performance functionalities on separate servers 2. Combined - User and Performance functionalities on the same server Enter Server Type ID [1-2] (1) > ``` The following examples illustrates some common configurations and helps to provide answers to the above questions: * Single Node - User and Performance running on 1 server - single / combined * Mutli-Node #1 - User and Performance running on some server - multi / combined * Mutli-Node #2 - User and Performance running on separate servers - multi / separate ### Running postConfigure as root user: ``` /usr/local/mariadb/columnstore/bin/postConfigure ``` ### Running postConfigure as non-root user: ``` export COLUMNSTORE_INSTALL_DIR=/home/guest/mariadb/columnstore export LD_LIBRARY_PATH=/home/guest/mariadb/columnstore/lib:/home/guest/mariadb/columnstore/mysql/lib/mysql /home/guest/mariadb/columnstore/bin/postConfigure -i /home/guest/mariadb/columnstore ``` This is the MariaDB Columnstore System Configuration and Installation tool. It will Configure the MariaDB Columnstore System and will perform a Package Installation of all of the Servers within the System that is being configured. IMPORTANT: This tool should only be run on the Parent OAM Module which is a Performance Module, preferred Module #1 Prompting instructions: Press 'enter' to accept a value in (), if available or Enter one of the options within [], if available, or Enter a new value ### Setup System Server Type Configuration There are 2 options when configuring the System Server Type: single and multi 'single' - Single-Server install is used when there will only be 1 server configured on the system. It can also be used for production systems, if the plan is to stay single-server. 'multi' - Multi-Server install is used when you want to configure multiple servers now or in the future. With Multi-Server install, you can still configure just 1 server now and add on addition servers/modules in the future. Select the type of System Server install [1=single, 2=multi] (2) > 2 ### Setup System Module Type Configuration There are 2 options when configuring the System Module Type: separate and combined 'separate' - User and Performance functionality on separate servers. 'combined' - User and Performance functionality on the same server Select the type of System Module Install [1=separate, 2=combined] (2) > 1 Seperate Server Installation will be performed. NOTE: Local Query Feature allows the ability to query data from a single Performance Module. See [Local PM Query Mode](../configuring-columnstore-local-pm-query-mode/index) for additional information. ``` Enable Local Query feature? [y,n] (n) > n NOTE: The MariaDB ColumnStore Schema Sync feature will replicate all of the schemas and InnoDB tables across the User Module nodes. This feature can be enabled or disabled, for example, if you wish to configure your own replication post installation. MariaDB ColumnStore Schema Sync feature, do you want to enable? [y,n] (y) > y Enter System Name (columnstore-1) > mymcs1 ``` Notes: You should give this system a name that will appear in various Admin utilities, etc. The name can be composed of any number of printable characters and spaces. ### Setup High Availability Data Storage Mount Configuration There are 2 options when configuring the storage: internal and external 'internal' - This is specified when a local disk is used for the DBRoot storage. High Availability Server Failover is not Supported in this mode 'external' - This is specified when the DBRoot directories are mounted. High Availability Server Failover is Supported in this mode. ``` Select the type of Data Storage [1=internal, 2=external] (1) > <Enter> ``` Notes: Choosing internal and using softlinks to point to an externally mounted storage will allow you to use any format (i.e., ext2, ext3, etc.). ### Setup the Module Configuration ``` ----- User Module Configuration ----- Enter number of User Modules [1,1024] (1) > 1 *** User Module #1 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > server-um1 Enter Nic Interface #1 IP Address of server-um1 (172.30.0.171) > Enter Nic Interface #2 Host Name (unassigned) > ----- Performance Module Configuration ----- Enter number of Performance Modules [1,1024] (1) > 1 *** Parent OAM Module Performance Module #1 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > server-pm1 Enter Nic Interface #1 IP Address of server-pm1 (172.30.0.171) > Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm1' (1) > 1 *** Performance Module #2 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > server-pm2 Enter Nic Interface #1 IP Address of server-pm1 (172.30.0.171) > Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm2' (2) > 2 ``` ### Performing Configuration Setup and MariaDB Columnstore Startup NOTE: Setting 'NumBlocksPct' to 50% Setting 'TotalUmMemory' to 25% of total memory (Combined Server Install maximum value is 16G). Value set to 4G Notes: The default maximum for a single server is 16Gb. ``` Running the MariaDB Columnstore MySQL setup scripts post-mysqld-install Successfully Completed post-mysql-install Successfully Completed Starting MariaDB ColumnStore Database Platform Starting MariaDB ColumnStore Database Platform, please wait......... DONE System Catalog Successfully Created MariaDB ColumnStore Install Successfully Completed, System is Active Enter the following command to define MariaDB ColumnStore Alias Commands . /usr/local/mariadb/columnstore/bin/columnstoreAlias Enter 'mcsmysql' to access the MariaDB Columnstore MySQL console Enter 'mcsadmin' to access the MariaDB Columnstore Admin console ``` #### MariaDB Columnstore Memory Configuration During the installation process, postConfigure will set the 2 main Memory configuration settings based on the size of memory detected on the local node. The 2 settings are in the MariaDB Columnstore Configuration file, /usr/local/mariadb/columnstore/etc Columnstore.xml. These 2 settings are: ``` 'NumBlocksPct' - Performance Module Data cache memory setting TotalUmMemory - User Module memory setting, used as temporary memory for joins ``` On a system that has the Performance Module and User Module functionality combined on the same server, this is the default settings: ``` NumBlocksPct - 50% of total memory TotalUmMemory - 25% of total memory, default maximum the percentage equal to 16G ``` On a system that has the Performance Module and User Module functionality on different servers, this is the default settings: ``` NumBlocksPct - This setting is NOT configured, and the default that the applications will then use is 70% TotalUmMemory - 50% of total memory ``` The user can choose to change these settings after the install is completed, if for instance they want to setup more memory for Joins to utilize. On a single server or combined UM/PM server, it is recommended to not have the combination of these 2 settings over 75% of total memory Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb How Mariabackup Works How Mariabackup Works ===================== This is a description of the different stages in Mariabackup, what they do and why they are needed. Note that a few items are marked with `TODO`; these are things we are working on and will be in next version of Mariabackup. Execution Stages ---------------- ### Initialization Phase * Connect to mysqld instance, find out important variables (datadir ,InnoDB pagesize, encryption keys, encryption plugin etc) * Scan the database directory, `datadir`, looking for InnoDB tablespaces, load the tablespaces (basically, it is an “open” in InnoDB sense) * If --lock-ddl-per-table is used: + Do MDL locks, for InnoDB tablespaces that we want to copy. This is to ensure that there are no ALTER, RENAME , TRUNCATE or DROP TABLE on any of the tables that we want to copy. + This is implemented with: ``` BEGIN For each affected table SELECT 1 from <table> LIMIT 0 ``` * If lock-ddl-per-table is not done, then Mariabackup would have to know all tables that were created or altered during the backup. See [MDEV-16791](https://jira.mariadb.org/browse/MDEV-16791). ### Redo Log Handling Start a dedicated thread in Mariabackup to copy InnoDB redo log (`ib_logfile*`). * This is needed to record all changes done while the backup is running. (The redo log logically is a single circular file, split into [innodb\_log\_files\_in\_group](../xtradbinnodb-server-system-variables/index#innodb_log_files_in_group) files.) * The log is also used to see detect if any truncate or online alter tables are used. * The assumption is that the copy thread will be able to keep up with server. It should always be able keep up, if the redo log is big enough. ### Copy-phase for InnoDB Tablespaces * Copy all selected tablespaces, file by file, in dedicated threads in Mariabackup without involving the mysqld server. * This is special “careful” copy, it looks for page-level consistency by checking the checksum. * The files are not point-in-time consistent as data may change during copy. * The idea is that InnoDB recovery would make it point-in-time consistent. * Copy Aria log files (TODO) ### Create a Consistent Backup Point * Execute [FLUSH TABLE WITH READ LOCK](../flush/index). This is default, but may be omitted with the `-–no-lock` parameter. The reason why `FLUSH` is needed is to ensure that all tables are in a consistent state at the exact same point in time, independent of storage engine. * If `--lock-ddl-per-table` is used and there is a user query waiting for MDL, the user query will be killed to resolve a deadlock. Note that these are only queries of type ALTER, DROP, TRUNCATE or RENAME TABLE. ([MDEV-15636](https://jira.mariadb.org/browse/MDEV-15636)) ### Last Copy Phase * Copy `.frm`, `MyISAM`, `Aria` and other storage engine files * If `MyRocks` is used, create rocksdb checkpoint via "set rocksdb\_create\_checkpoint=$rocksdb\_data\_dir/mariabackup\_rocksdb\_checkpoint " command. The result of it is a directory with hardlinks to MyRocks files. Copy the checkpoint directory to the backup (or create hardlinks in backup directory is on the same partition as data directory). Remove the checkpoint directory. * Copy tables that were created while the backup was running and do rename files that were changed during backup (since [MDEV-16791](https://jira.mariadb.org/browse/MDEV-16791)) * Copy the rest of InnoDB redo log, stop redo-log-copy thread * Copy changes to Aria log files (They are append only, so this is easy to do) (TODO) * Write some metadata info (binlog position) ### Release Locks * If [FLUSH TABLE WITH READ LOCK](../flush/index) was done: + execute: `UNLOCK TABLES` * If `--lock-ddl-per-table` was done: + execute `COMMIT` ### Handle Log Tables (TODO) * If log tables exists: + Take MDL lock for log tables + Copy part of log tables that wasn't copied before + Unlock log tables Notes ----- * If [FLUSH TABLE WITH READ LOCK](../flush/index) is not used, then only InnoDB tables will be consistent (not the privilege tables in the mysql database or the binary log). The backup point depends on the content of the redo log within the backup itself. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INSERT SELECT INSERT SELECT ============= Syntax ------ ``` INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ] ``` Description ----------- With `INSERT ... SELECT`, you can quickly insert many rows into a table from one or more other tables. For example: ``` INSERT INTO tbl_temp2 (fld_id) SELECT tbl_temp1.fld_order_id FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100; ``` `tbl_name` can also be specified in the form `db_name`.`tbl_name` (see [Identifier Qualifiers](../identifier-qualifiers/index)). This allows to copy rows between different databases. If the new table has a primary key or UNIQUE indexes, you can use [IGNORE](../ignore/index) to handle duplicate key errors during the query. The newer values will not be inserted if an identical value already exists. `[REPLACE](../replace/index)` can be used instead of `INSERT` to prevent duplicates on `UNIQUE` indexes by deleting old values. In that case, `ON DUPLICATE KEY UPDATE` cannot be used. `INSERT ... SELECT` works for tables which already exist. To create a table for a given resultset, you can use [CREATE TABLE ... SELECT](../create-table/index). See Also -------- * [INSERT](../insert/index) * [INSERT DELAYED](../insert-delayed/index) * [HIGH\_PRIORITY and LOW\_PRIORITY](../high_priority-and-low_priority/index) * [Concurrent Inserts](../concurrent-inserts/index) * [INSERT - Default & Duplicate Values](../insert-default-duplicate-values/index) * [INSERT IGNORE](../insert-ignore/index) * [INSERT ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Galera Cluster System Variables Galera Cluster System Variables =============================== This page documents system variables related to [Galera Cluster](../galera/index). For options that are not system variables, see [Galera Options](../mysqld-options/index#galera-options). See [Server System Variables](../server-system-variables/index) for a complete list of system variables and instructions on setting them. Also see the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `wsrep_auto_increment_control` * **Description:** If set to `1` (the default), will automatically adjust the [auto\_increment\_increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) and [auto\_increment\_offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset) variables according to the size of the cluster, and when the cluster size changes. This avoids replication conflicts due to [auto\_increment](../auto_increment/index). In a primary-replica environment, can be set to `OFF`. * **Commandline:** `--wsrep-auto-increment-control[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `ON` --- #### `wsrep_causal_reads` * **Description:** If set to `ON` (`OFF` is default), enforces [read-committed](../set-transaction/index#read-committed) characteristics across the cluster. In the case that a primary applies an event more quickly than a replica, the two could briefly be out-of-sync. With this variable set to `ON`, the replica will wait for the event to be applied before processing further queries. Setting to `ON` also results in larger read latencies. Deprecated by [wsrep\_sync\_wait=1](#wsrep_sync_wait). * **Commandline:** `--wsrep-causal-reads[={0|1}]` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_certification_rules` * **Description:** Certification rules to use in the cluster. Possible values are: + `strict`: Stricter rules that could result in more certification failures. For example with foreign keys, certification failure could result if different nodes receive non-conflicting insertions at about the same time that point to the same row in a parent table + `optimized`: relaxed rules that allow more concurrency and cause less certification failures. * **Commandline:** `--wsrep-certifcation-rules` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Enumeration * **Default Value:** `strict` * **Valid Values:** `strict`, `optimized` * **Introduced:** [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/), [MariaDB 10.3.13](https://mariadb.com/kb/en/mariadb-10313-release-notes/), [MariaDB 10.2.22](https://mariadb.com/kb/en/mariadb-10222-release-notes/), [MariaDB 10.1.38](https://mariadb.com/kb/en/mariadb-10138-release-notes/) --- #### `wsrep_certify_nonPK` * **Description:** When set to `ON` (the default), Galera will still certify transactions for tables with no [primary key](../getting-started-with-indexes/index#primary-key). However, this can still cause undefined behavior in some circumstances. It is recommended to define primary keys for every InnoDB table when using Galera. * **Commandline:** `--wsrep-certify-nonPK[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `ON` --- #### `wsrep_cluster_address` * **Description:** The addresses of cluster nodes to connect to when starting up. + Good practice is to specify all possible cluster nodes, in the form `gcomm://<node1 or ip:port>,<node2 or ip2:port>,<node3 or ip3:port>`. + Specifying an empty ip (`gcomm://`) will cause the node to start a new cluster (which should not be done in the my.cnf file, as after each restart the server will not rejoin the current cluster). + The variable can be changed at runtime in some configurations, and will result in the node closing the connection to any current cluster, and connecting to the new address. + If specifying a port, note that this is the Galera port, not the MariaDB port. + For example: - `gcomm://192.168.0.1,192.168.0.2,192.168.0.3` - `gcomm://192.168.0.1:1234,192.168.0.2:1234,192.168.0.3:1234?gmcast.listen_addr=tcp://0.0.0.0:1234` + See also [gmcast.listen\_addr](../wsrep_provider_options/index#gmcastlisten_addr) * **Commandline:** `--wsrep-cluster-address=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** String --- #### `wsrep_cluster_name` * **Description:** The name of the cluster. Nodes cannot connect to clusters with a different name, so needs to be identical on all nodes in the same cluster. The variable can be set dynamically, but note that doing so may be unsafe and cause an outage, and that the wsrep provider is unloaded and loaded. * **Commandline:** `--wsrep-cluster-name=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** `my_wsrep_cluster` --- #### `wsrep_convert_LOCK_to_trx` * **Description:** Converts [LOCK/UNLOCK TABLES](../lock-tables-and-unlock-tables/index) statements to [BEGIN](../start-transaction/index) and [COMMIT](../commit/index). Used mainly for getting older applications to work with a multi-primary setup, use carefully, as can result in extremely large writesets. * **Commandline:** `--wsrep-convert-LOCK-to-trx[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_data_home_dir` * **Description:** Directory where wsrep provider will store its internal files. * **Commandline:** `--wsrep-data-home-dir=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** String * **Default Value:** The [datadir](../server-system-variables/index#datadir) variable value. --- #### `wsrep_dbug_option` * **Description:** Unused. The mechanism to pass the DBUG options to the wsrep provider hasn't been implemented. * **Commandline:** `--wsrep-dbug-option=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String --- #### `wsrep_debug` * **Description:** WSREP debug level logging. Before [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/) was a boolean, which when set to `ON` (`OFF` was default), ensured debug messages would be logged to the [error log](../error-log/index) as well. Before [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/), DDL logging was only logged on the originating node. From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/), it is logged on other nodes as well. * **Commandline:** `--wsrep-debug[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Enumeration (>= [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)), Boolean (<= [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)) * **Default Value:** `NONE` (>= [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)), `OFF` (<= [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)) * **Valid Values**: (>= [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)) `NONE`, `SERVER`, `TRANSACTION`, `STREAMING`, `CLIENT` --- #### `wsrep_desync` * **Description:** When a node receives more write-sets than it can apply, the transactions are placed in a received queue. If the node's received queue has too many write-sets waiting to be applied (as defined by the `[gcs.fc\_limit](../wsrep_provider_options/index#gcsfc_limit)` WSREP provider option), then the node would usually engage Flow Control. However, when this option is set to `ON`, Flow Control will be disabled for the desynced node. The desynced node works through the received queue until it reaches a more manageable size. The desynced node continues to receive write-sets from the other nodes in the cluster. The other nodes in the cluster do not wait for the desynced node to catch up, so the desynced node can fall even further behind the other nodes in the cluster. You can check if a node is desynced by checking if the `[wsrep\_local\_state\_comment](../galera-cluster-status-variables/index#wsrep_local_state_comment)` status variable is equal to `Donor/Desynced`. * **Commandline:** `--wsrep-desync[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_dirty_reads` * **Description:** By default, when not synchronized with the group ([wsrep\_ready](../galera-cluster-status-variables/index#wsrep_ready)=OFF) a node will reject all queries other than SET and SHOW. If `wsrep_dirty_reads` is set to `1`, queries which do not change data, like SELECT queries (dirty reads), creating of prepare statement, etc. will be accepted by the node. * **Commandline:** `--wsrep-dirty-reads[={0|1}]` * **Scope:** Global,Session * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` * **Valid Values:** `ON`, `OFF` * **Introduced:** [MariaDB Galera 5.5.42](https://mariadb.com/kb/en/mariadb-galera-cluster-5542-release-notes/), [MariaDB Galera 10.0.16](https://mariadb.com/kb/en/mariadb-galera-cluster-10016-release-notes/), [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `wsrep_drupal_282555_workaround` * **Description:** If set to `ON`, a workaround for [Drupal/MySQL/InnoDB bug #282555](https://www.drupal.org/node/282555) is enabled. This is a bug where, in some cases, when inserting a `DEFAULT` value into an [AUTO\_INCREMENT](../auto_increment/index) column, a duplicate key error may be returned. * **Commandline:** `--wsrep-drupal-282555-workaround[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_forced_binlog_format` * **Description:** A [binary log format](../binary-log-formats/index) that will override any session binlog format settings. * **Commandline:** `--wsrep-forced-binlog-format=value` * **Scope:** Global * **Dynamic:** Yes * **Default Value:** `NONE` * **Data Type:** Enum * **Valid Values:** `STATEMENT`, `ROW`, `MIXED` or `NONE` (which resets the forced binlog format state). --- #### `wsrep_gtid_domain_id` * **Description:** This system variable defines the [GTID](../gtid/index) domain ID that is used for [wsrep GTID mode](../using-mariadb-gtids-with-mariadb-galera-cluster/index#wsrep-gtid-mode). + When `[wsrep\_gtid\_mode](#wsrep_gtid_mode)` is set to `ON`, `wsrep_gtid_domain_id` is used in place of `[gtid\_domain\_id](../gtid/index#gtid_domain_id)` for all Galera Cluster write sets. + When `[wsrep\_gtid\_mode](#wsrep_gtid_mode)` is set to `OFF`, `wsrep_gtid_domain_id` is simply ignored to allow for backward compatibility. + There are some additional requirements that need to be met in order for this mode to generate consistent [GTIDs](../gtid/index). For more information, see [Using MariaDB GTIDs with MariaDB Galera Cluster](../using-mariadb-gtids-with-mariadb-galera-cluster/index). * **Commandline:** `--wsrep-gtid-domain-id=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `4294967295` * **Introduced:** [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) --- #### `wsrep_gtid_mode` * **Description:** [Wsrep GTID mode](../using-mariadb-gtids-with-mariadb-galera-cluster/index#wsrep-gtid-mode) attempts to keep [GTIDs](../gtid/index) consistent for Galera Cluster write sets on all cluster nodes. [GTID](../gtid/index) state is initially copied to a joiner node during an [SST](../introduction-to-state-snapshot-transfers-ssts/index). If you are planning to use Galera Cluster with [MariaDB replication](../high-availability-performance-tuning-mariadb-replication/index), then wsrep GTID mode can be helpful. + When `wsrep_gtid_mode` is set to `ON`, `[wsrep\_gtid\_domain\_id](#wsrep_gtid_domain_id)` is used in place of `[gtid\_domain\_id](../gtid/index#gtid_domain_id)` for all Galera Cluster write sets. + When `wsrep_gtid_mode` is set to `OFF`, `[wsrep\_gtid\_domain\_id](#wsrep_gtid_domain_id)` is simply ignored to allow for backward compatibility. + There are some additional requirements that need to be met in order for this mode to generate consistent [GTIDs](../gtid/index). For more information, see [Using MariaDB GTIDs with MariaDB Galera Cluster](../using-mariadb-gtids-with-mariadb-galera-cluster/index). * **Commandline:** `--wsrep-gtid-mode[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) --- #### `wsrep_gtid_seq_no` * **Description:** Internal server usage, manually set WSREP GTID seqno. * **Commandline:** None * **Scope:** Session only * **Dynamic:** Yes * **Data Type:** `numeric` * **Range:** `0` to `18446744073709551615` * **Introduced:** [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/) --- #### `wsrep_ignore_apply_errors` * **Description:** Bitmask determining whether errors are ignored, or reported back to the provider. + 0: No errors are skipped. + 1: Ignore some DDL errors (DROP DATABASE, DROP TABLE, DROP INDEX, ALTER TABLE). + 2: Skip DML errors (Only ignores DELETE errors). + 4: Ignore all DDL errors. * **Commandline:** `--wsrep-ignore-apply-errors` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Numeric * **Default Value:** `7` * **Range:** `0` to `7` * **Introduced:** [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) --- #### `wsrep_load_data_splitting` * **Description:** If set to `ON` (the default for [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) and before), [LOAD DATA INFILE](../load-data/index) supports big data files by introducing transaction splitting. The setting has been deprecated in Galera 4, and defaults to `OFF` from [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/). * **Commandline:** `--wsrep-load-data-splitting[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` (>= [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)), `ON` (<= [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)) * **Introduced:** [MariaDB Galera 5.5.32](https://mariadb.com/kb/en/mariadb-galera-cluster-5532-release-notes/), [MariaDB Galera 10.0.7](https://mariadb.com/kb/en/mariadb-galera-cluster-1007-release-notes/), [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `wsrep_log_conflicts` * **Description:** If set to `ON` (`OFF` is default), details of conflicting MDL as well as InnoDB locks in the cluster will be logged. * **Commandline:** `--wsrep-log-conflicts[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_max_ws_rows` * **Description:** Maximum permitted number of rows per writeset. Before [MariaDB Galera 10.0.27](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-release-notes/) and [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/) this variable was ignored internally and had no effect on the node. From [MariaDB Galera 10.0.27](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-release-notes/) and [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/) support for this variable has been added and in order to be backward compatible the default value has been changed to `0`, which essentially allows writesets to be any size. * **Commandline:** `--wsrep-max-ws-rows=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Numeric * **Default Value:** + `0` (>= [MariaDB Galera 10.0.27](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-release-notes/), [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/)) + `131072` (<= [MariaDB Galera 10.0.26](https://mariadb.com/kb/en/mariadb-galera-cluster-10026-release-notes/), [MariaDB 10.1.16](https://mariadb.com/kb/en/mariadb-10116-release-notes/)) * **Range:** `0` to `1048576` --- #### `wsrep_max_ws_size` * **Description:** Maximum permitted size in bytes per writeset. Writesets exceeding this will be rejected. Note that versions from and before [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/) and [MariaDB Galera 10.0.27](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-release-notes/) permitted the maximum to be set beyond 2GB, which was rejected by Galera. * **Commandline:** `--wsrep-max-ws-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Numeric * **Default Value:** + `2147483647` (2GB, >= [MariaDB Galera 10.0.27](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-release-notes/), [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/)) + `1073741824` (1GB, <= [MariaDB Galera 10.0.26](https://mariadb.com/kb/en/mariadb-galera-cluster-10026-release-notes/), [MariaDB 10.1.16](https://mariadb.com/kb/en/mariadb-10116-release-notes/)) * **Range:** `1024` to `2147483647` --- #### `wsrep_mode` * **Description:** Turns on WSREP features which are not part of default behavior. + BINLOG\_ROW\_FORMAT\_ONLY: Only ROW [binlog format](../binary-log-formats/index) is supported. + DISALLOW\_LOCAL\_GTID: Nodes can have GTIDs for local transactions in a number of scenarios. If DISALLOW\_LOCAL\_GTID is set, these operations produce an error ERROR HY000: Galera replication not supported. Scenarios include: - A DDL statement is executed with wsrep\_OSU\_method=RSU set. - A DML statement writes to a non-InnoDB table. - A DML statement writes to an InnoDB table with wsrep\_on=OFF set. + REPLICATE\_ARIA: Whether or not DML updates for [Aria](../aria/index) tables will be replicated. This functionality is experimental and should not be relied upon in production systems. + REPLICATE\_MYISAM: Whether or not DML updates for [MyISAM](../myisam/index) tables will be replicated. This functionality is experimental and should not be relied upon in production systems. + REQUIRED\_PRIMARY\_KEY: Table should have PRIMARY KEY defined. + STRICT\_REPLICATION: Same as the old [wsrep\_strict\_ddl](#wsrep_strict_ddl) setting. * **Commandline:** `--wsrep-mode=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Enumeration * **Default Value:** (Empty) * **Valid Values:** `BINLOG_ROW_FORMAT_ONLY`, `DISALLOW_LOCAL_GTID`, `REQUIRED_PRIMARY_KEY`, `REPLICATE_ARIA`, `REPLICATE_MYISAM` and `STRICT_REPLICATION` * **Introduced:** [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) --- #### `wsrep_mysql_replication_bundle` * **Description:** Determines the number of replication events that are grouped together. Experimental implementation aimed to assist with bottlenecks when a single replica faces a large commit time delay. If set to `0` (the default), there is no grouping. * **Commandline:** `--wsrep-mysql-replication-bundle=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** Numeric * **Default Value:** `0` * **Range:** `0` to `1000` --- #### `wsrep_node_address` * **Description:** Specifies the node's network address, in the format `ip address[:port]`. As of [MariaDB 10.1.8](https://mariadb.com/kb/en/mariadb-1018-release-notes/), supports IPv6. The default behavior is for the node to pull the address of the first network interface on the system and the default Galera port. This autoguessing can be unreliable, particularly in the following cases: + cloud deployments + container deployments + servers with multiple network interfaces. + servers running multiple nodes. + network address translation (NAT). + clusters with nodes in more than one region. * **See also** [wsrep\_provider\_options -> gmcast.listen\_addr](../wsrep_provider_options/index#gmcastlisten_addr) * **Commandline:** `--wsrep-node-address=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** String * **Default Value:** Primary network address, usually `eth0` with a default port of 4567, or `0.0.0.0` if no IP address. --- #### `wsrep_node_incoming_address` * **Description:** This is the address from which the node listens for client connections. If an address is not specified or it's set to `AUTO` (default), mysqld uses either [--bind-address](../server-system-variables/index#bind_address) or [--wsrep-node-address](#wsrep_node_address), or tries to get one from the list of available network interfaces, in the same order. See also [wsrep\_provider\_options -> gmcast.listen\_addr](../wsrep_provider_options/index#gmcastlisten_addr). * **Commandline:** `--wsrep-node-incoming-address=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** String * **Default Value:** `AUTO` --- #### `wsrep_node_name` * **Description:** Name of this node. This name can be used in [wsrep\_sst\_donor](#wsrep_sst_donor) as a preferred donor. Note that multiple nodes in a cluster can have the same name. * **Commandline:** `--wsrep-node-name=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** The server's hostname. --- #### `wsrep_notify_cmd` * **Description:** Command to be executed each time the node state or the cluster membership changes. Can be used for raising an alarm, configuring load balancers and so on. See the [Codership Notification Script page](https://galeracluster.com/library/documentation/notification-cmd.html) for more details. * **Commandline:** `--wsrep-notify-command=value` * **Scope:** Global * **Dynamic:** + No (>= [MariaDB 10.5.9](https://mariadb.com/kb/en/mariadb-1059-release-notes/), [MariaDB 10.4.18](https://mariadb.com/kb/en/mariadb-10418-release-notes/), [MariaDB 10.3.28](https://mariadb.com/kb/en/mariadb-10328-release-notes/), [MariaDB 10.2.37](https://mariadb.com/kb/en/mariadb-10237-release-notes/)) + Yes (<= [MariaDB 10.5.8](https://mariadb.com/kb/en/mariadb-1058-release-notes/), [MariaDB 10.4.17](https://mariadb.com/kb/en/mariadb-10417-release-notes/), [MariaDB 10.3.27](https://mariadb.com/kb/en/mariadb-10327-release-notes/), [MariaDB 10.2.36](https://mariadb.com/kb/en/mariadb-10236-release-notes/)) * **Data Type:** String * **Default Value:** Empty --- #### `wsrep_on` * **Description:** Whether or not wsrep replication is enabled. If the global value is set to `OFF` (the default since [MariaDB 10.1](../what-is-mariadb-101/index)), it is not possible to load the provider and join the node in the cluster. If only the session value is set to `OFF`, the operations from that particular session are not replicated in the cluster, but other sessions and applier threads will continue as normal. The session value of the variable does not affect the node's membership and thus, regardless of its value, the node keeps receiving updates from other nodes in the cluster. Before [MariaDB 10.1](../what-is-mariadb-101/index), even though this variable is `ON` by default, its value gets automatically adjusted based on whether mandatory configurations to turn on Galera replication have been specified. Since [MariaDB 10.1](../what-is-mariadb-101/index), it is set to `OFF` by default and must be turned on to enable Galera replication. * **Commandline:** `--wsrep-on[={0|1}]` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` (>= [MariaDB 10.1](../what-is-mariadb-101/index)), `ON` (<= MariaDB Galera Cluster 10.0), * **Valid Values:** `ON`, `OFF` --- #### `wsrep_OSU_method` * **Description:** Online schema upgrade method. The default is `TOI`, specifying the setting without the optional parameter will set to `RSU`. + `TOI`: Total Order Isolation. In each cluster node, DDL is processed in the same order regarding other transactions, guaranteeing data consistency. However, affected parts of the database will be locked for the whole cluster. + `RSU`: Rolling Schema Upgrade. DDL processing is only done locally on the node, and the user needs perform the changes manually on each node. The node is desynced from the rest of the cluster while the processing takes place to avoid the blocking other nodes. Schema changes [*must* be backwards compatible in the same way as for ROW based replication](../replication-when-the-master-and-slave-have-different-table-definitions/index) to avoid breaking replication when the DDL processing is complete on the single node, and replication recommences. * **Commandline:** `--wsrep-OSU-method[=value]` * **Scope:** Global, Session (since [MariaDB Galera 10.0.19](https://mariadb.com/kb/en/mariadb-galera-cluster-10019-release-notes/)) * **Dynamic:** Yes * **Data Type:** Enum * **Default Value:** `TOI` * **Valid Values:** `TOI`, `RSU` --- #### `wsrep_patch_version` * **Description:** Wsrep patch version, for example `wsrep_25.10`. * **Commandline:** None * **Scope:** Global * **Dynamic:** No * **Data Type:** String * **Default Value:** None * **Introduced:** [MariaDB 10.1.5](https://mariadb.com/kb/en/mariadb-1015-release-notes/) --- #### `wsrep_provider` * **Description:** Location of the wsrep library, usually `/usr/lib/libgalera_smm.so` on Debian and Ubuntu, and `/usr/lib64/libgalera_smm.so` on Red Hat/CentOS. * **Commandline:** `--wsrep-provider=value` * **Scope:** Global + No (>= [MariaDB 10.5.9](https://mariadb.com/kb/en/mariadb-1059-release-notes/), [MariaDB 10.4.18](https://mariadb.com/kb/en/mariadb-10418-release-notes/), [MariaDB 10.3.28](https://mariadb.com/kb/en/mariadb-10328-release-notes/), [MariaDB 10.2.37](https://mariadb.com/kb/en/mariadb-10237-release-notes/)) + Yes (<= [MariaDB 10.5.8](https://mariadb.com/kb/en/mariadb-1058-release-notes/), [MariaDB 10.4.17](https://mariadb.com/kb/en/mariadb-10417-release-notes/), [MariaDB 10.3.27](https://mariadb.com/kb/en/mariadb-10327-release-notes/), [MariaDB 10.2.36](https://mariadb.com/kb/en/mariadb-10236-release-notes/)) * **Data Type:** String * **Default Value:** None --- #### `wsrep_provider_options` * **Description:** Semicolon (;) separated list of wsrep options (see [wsrep\_provider\_options](../wsrep_provider_options/index)). * **Commandline:** `--wsrep-provider-options=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** String * **Default Value:** Empty --- #### `wsrep_recover` * **Description:** If set to `ON` when the server starts, the server will recover the sequence number of the most recent write set applied by Galera, and it will be output to `stderr`, which is usually redirected to the [error log](../error-log/index). At that point, the server will exit. This sequence number can be provided to the `[wsrep\_start\_position](#wsrep_start_position)` system variable. * **Commandline:** `--wsrep-recover[={0|1}]` * **Scope:** Global * **Dynamic:** No * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_reject_queries` * **Description:** Variable to set to reject queries from client connections, useful for maintenance. The node continues to apply write-sets, but an `Error 1047: Unknown command` error is generated by a client query. + `NONE` - Not set. Queries will be processed as normal. + `ALL` - All queries from client connections will be rejected, but existing client connections will be maintained. + `ALL_KILL` All queries from client connections will be rejected, and existing client connections, including the current one, will be immediately killed. * **Commandline:** `--wsrep-reject-queries[=value]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Enum * **Default Value:** `NONE` * **Valid Values:** `NONE`, `ALL`, `ALL_KILL` * **Introduced:** [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/), [MariaDB 10.2.14](https://mariadb.com/kb/en/mariadb-10214-release-notes/), [MariaDB 10.1.32](https://mariadb.com/kb/en/mariadb-10132-release-notes/) --- #### `wsrep_replicate_myisam` * **Description:** Whether or not DML updates for [MyISAM](../myisam/index) tables will be replicated. This functionality is still experimental and should not be relied upon in production systems. Deprecated in [MariaDB 10.6](../what-is-mariadb-106/index), and removed in [MariaDB 10.7](../what-is-mariadb-107/index), use [wsrep\_mode](#wsrep_mode) instead. * **Commandline:** `--wsrep-replicate-myisam[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Default Value:** `OFF` * **Data Type:** Boolean * **Valid Values:** `ON`, `OFF` * **Deprecated:** [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) * **Removed:** [MariaDB 10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/) --- #### `wsrep_restart_slave` * **Description:** If set to ON, the replica is restarted automatically, when node joins back to cluster. * **Commandline:** `--wsrep-restart-slave[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Default Value:** `OFF` * **Data Type:** Boolean --- #### `wsrep_retry_autocommit` * **Description:** Number of times autocommited queries will be retried due to cluster-wide conflicts before returning an error to the client. If set to `0`, no retries will be attempted, while a value of `1` (the default) or more specifies the number of retries attempted. Can be useful to assist applications using autocommit to avoid deadlocks. * **Commandline:** `--wsrep-retry-autocommit=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** Numeric * **Default Value:** `1` * **Range:** `0` to `10000` --- #### `wsrep_slave_FK_checks` * **Description:** If set to ON (the default), the applier replica thread performs foreign key constraint checks. * **Commandline:** `--wsrep-slave-FK-checks[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** ON * **Introduced:** [MariaDB Galera 5.5.39](https://mariadb.com/kb/en/mariadb-galera-cluster-5539-release-notes/), [MariaDB Galera 10.0.12](https://mariadb.com/kb/en/mariadb-galera-cluster-10012-release-notes/) --- #### `wsrep_slave_threads` * **Description:** Number of replica threads used to apply Galera write sets in parallel. The Galera replica threads are able to determine which write sets are safe to apply in parallel. However, if your cluster nodes seem to have frequent consistency problems, then setting the value to `1` will probably fix the problem. See [About Galera Replication: Galera Replica Threads](../about-galera-replication/index#galera-slave-threads) for more information. * **Commandline:** `--wsrep-slave-threads=`# * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Numeric * **Default Value:** `1` * **Range:** `1` to `512` --- #### `wsrep_slave_UK_checks` * **Description:** If set to ON, the applier replica thread performs secondary index uniqueness checks. * **Commandline:** `--wsrep-slave-UK-checks[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** OFF * **Introduced:** [MariaDB Galera 5.5.39](https://mariadb.com/kb/en/mariadb-galera-cluster-5539-release-notes/), [MariaDB Galera 10.0.12](https://mariadb.com/kb/en/mariadb-galera-cluster-10012-release-notes/) --- #### `wsrep_sr_store` * **Description:** Storage for streaming replication fragments. * **Commandline:** `--wsrep-sr-store=val` * **Scope:** Global * **Dynamic:** No * **Data Type:** Enum * **Default Value:** `table` * **Valid Values:** `table`, `none` * **Introduced:** [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) --- #### `wsrep_sst_auth` * **Description:** Username and password of the user to use for replication. Unused if [wsrep\_sst\_method](#wsrep_sst_method) is set to `rsync`, while for other methods it should be in the format `<user>:<password>`. The contents are masked in logs and when querying the value with [SHOW VARIABLES](../show-variables/index). See [Introduction to State Snapshot Transfers (SSTs)](../introduction-to-state-snapshot-transfers-ssts/index) for more information. * **Commandline:** `--wsrep-sst-auth=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** (Empty) --- #### `wsrep_sst_donor` * **Description:** Comma-separated list (from 5.5.33) or name (as per [wsrep\_node\_name](index#wsrep_node_name)) of the servers as donors, or the source of the state transfer, in order of preference. The donor-selection algorithm, in general, prefers a donor capable of transferring only the missing transactions (IST) to the joiner node, instead of the complete state (SST). Thus, it starts by looking for an IST-capable node in the given donor list followed by rest of the nodes in the cluster. In case multiple candidate nodes are found outside the specified donor list, the node in the same segment ([gmcast.segment](../wsrep_provider_options/index#gmcastsegment)) as the joiner is preferred. If none of the existing nodes in the cluster can serve the missing transactions through IST, the algorithm moves on to look for a suitable node to transfer the entire state (SST). It first looks at the nodes specified in the donor list (irrespective of their segment). If no suitable donor is still found, the rest of the donor nodes are checked for suitability only if the donor list has a "terminating-comma". Note that a stateless node (the Galera arbitrator) can never be a donor. See [Introduction to State Snapshot Transfers (SSTs)](../introduction-to-state-snapshot-transfers-ssts/index) for more information. * **Commandline:** `--wsrep-sst-donor=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** --- #### `wsrep_sst_donor_rejects_queries` * **Description:** If set to `ON` (`OFF` is default), the donor node will reject incoming queries, returning an `UNKNOWN COMMAND` error code. Can be used for informing load balancers that a node is unavailable. * **Commandline:** `--wsrep-sst-donor-rejects-queries[={0|1}]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** Boolean * **Default Value:** `OFF` --- #### `wsrep_sst_method` * **Description:** Method used for taking the [state snapshot transfer (SST)](../introduction-to-state-snapshot-transfers-ssts/index). See [Introduction to State Snapshot Transfers (SSTs): SST Methods](../introduction-to-state-snapshot-transfers-ssts/index#sst-methods) for more information. * **Commandline:** `--wsrep-sst-method=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** `rsync` * **Valid Values:** `rsync`, `mysqldump`, `xtrabackup`, `xtrabackup-v2`, `mariabackup` --- #### `wsrep_sst_receive_address` * **Description:** This is the address where other nodes (donor) in the cluster connect to in order to send the state-transfer updates. If an address is not specified or its set to `AUTO` (default), mysqld uses [--wsrep\_node\_address](index#wsrep_node_address)'s value as the receiving address. However, if [--wsrep\_node\_address](index#wsrep_node_address) is not set, it uses address from either [--bind-address](../server-system-variables/index#bind_address) or tries to get one from the list of available network interfaces, in the same order. Note: setting it to `localhost` will make it impossible for nodes running on other hosts to reach this node. See [Introduction to State Snapshot Transfers (SSTs)](../introduction-to-state-snapshot-transfers-ssts/index) for more information. * **Commandline:** `--wsrep-sst-receive-address=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** `AUTO` --- #### `wsrep_start_position` * **Description:** The start position that the node should use in the format: `UUID:seq_no`. The proper value to use for this position can be recovered with `[wsrep\_recover](#wsrep_recover)`. * **Commandline:** `--wsrep-start-position=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** String * **Default Value:** `00000000-0000-0000-0000-000000000000:-1` --- #### `wsrep_strict_ddl` * **Description:** If set, reject DDL statements on affected tables not supporting Galera replication. This is done by checking if the table is InnoDB, which is the only table currently fully supporting Galera replication. MyISAM tables will not trigger the error if the experimental [wsrep\_replicate\_myisam](#wsrep_replicate_myisam) setting is `ON`. If set, should be set on all tables in the cluster. Affected DDL statements include: [CREATE TABLE](../create-table/index) (e.g. CREATE TABLE t1(a int) engine=Aria) [ALTER TABLE](../alter-table/index) [TRUNCATE TABLE](../truncate-table/index) [CREATE VIEW](../create-view/index) [CREATE TRIGGER](../create-trigger/index) [CREATE INDEX](../create-index/index) [DROP INDEX](../drop-index/index) [RENAME TABLE](../rename-table/index) [DROP TABLE](../drop-table/index) Statements in [procedures](../stored-procedures/index), [events](../event-scheduler/index), and [functions](../stored-functions/index) are permitted as the affected tables are only known at execution. Furthermore, the various USER, ROLE, SERVER and DATABASE statements are also allowed as they do not have an affected table. Deprecated in [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) and removed in [MariaDB 10.7](../what-is-mariadb-107/index). Use [wsrep\_mode=STRICT\_REPLICATION](#wsrep_mode) instead. * **Commandline:** `--wsrep-strict-ddl[={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/) * **Deprecated:** [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) * **Removed:** [MariaDB 10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/) --- #### `wsrep_sync_wait` * **Description:** Setting this variable ensures causality checks will take place before executing an operation of the type specified by the value, ensuring that the statement is executed on a fully synced node. While the check is taking place, new queries are blocked on the node to allow the server to catch up with all updates made in the cluster up to the point where the check was begun. Once reached, the original query is executed on the node. This can result in higher latency. Note that when [wsrep\_dirty\_reads](#wsrep_dirty_reads) is ON, values of wsrep\_sync\_wait become irrelevant. Sample usage (for a critical read that must have the most up-to-date data) `SET SESSION wsrep_sync_wait=1; SELECT ...; SET SESSION wsrep_sync_wait=0;` + `0` - Disabled (default) + `1` - READ (SELECT and BEGIN/START TRANSACTION). Up until [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/), [MariaDB Galera 10.0.31](https://mariadb.com/kb/en/mariadb-galera-cluster-10031-release-notes/) and [MariaDB Galera 5.5.56](https://mariadb.com/kb/en/mariadb-galera-cluster-5556-release-notes/), also SHOW). This is the same as [wsrep\_causal\_reads=1](#wsrep_causal_reads). + `2` - UPDATE and DELETE; + `3` - READ, UPDATE and DELETE; + `4` - INSERT and REPLACE; + `5` - READ, INSERT and REPLACE; + `6` - UPDATE, DELETE, INSERT and REPLACE; + `7` - READ, UPDATE, DELETE, INSERT and REPLACE; + `8` - SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `9` - READ and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `10` - UPDATE, DELETE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `11` - READ, UPDATE, DELETE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `12` - INSERT, REPLACE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `13` - READ, INSERT, REPLACE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `14` - UPDATE, DELETE, INSERT, REPLACE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `15` - READ, UPDATE, DELETE, INSERT, REPLACE and SHOW (from [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) * **Commandline:** `--wsrep-sync-wait=`# * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** Numeric * **Default Value:** `0` * **Range:** + `0` to `15` (>= [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB Galera 10.0.32](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-release-notes/), [MariaDB Galera 5.5.57](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-release-notes/)) + `0` to `7` (<= [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/), [MariaDB Galera 10.0.31](https://mariadb.com/kb/en/mariadb-galera-cluster-10031-release-notes/), [MariaDB Galera 5.5.56](https://mariadb.com/kb/en/mariadb-galera-cluster-5556-release-notes/)) * **Introduced:** [MariaDB Galera 10.0.13](https://mariadb.com/kb/en/mariadb-galera-cluster-10013-release-notes/), [MariaDB Galera 5.5.39](https://mariadb.com/kb/en/mariadb-galera-cluster-5539-release-notes/) --- #### `wsrep_trx_fragment_size` * **Description:** Size of transaction fragments for streaming replication (measured in units as specified by [wsrep\_trx\_fragment\_unit](#wsrep_trx_fragment_unit)) * **Commandline:** `--wsrep-trx-fragment-size=`# * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** numeric * **Default Value:** `0` * **Range:** `0` to `2147483647` * **Introduced:** [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) --- #### `wsrep_trx_fragment_unit` * **Description:** Unit for streaming replication transaction fragments' size: + `bytes`: transaction’s binlog events buffer size in bytes + `rows`: number of rows affected by the transaction + `statements`: number of SQL statements executed in the multi-statement transaction * **Commandline:** `--wsrep-trx-fragment-unit=value` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** enum * **Default Value:** `bytes` * **Valid Values:** `bytes`, `rows` or `statements` * **Introduced:** [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore Insert ColumnStore Insert ================== The INSERT statement allows you to add data to tables. Syntax ------ ``` INSERT INTO tbl_name [(col,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),... ``` The following statement inserts a row with all column values into the *customer* table: ``` INSERT INTO customer (custno, custname, custaddress, phoneno, cardnumber, comments) VALUES (12, ‘JohnSmith’, ‘100 First Street, Dallas’, ‘(214) 555-1212’,100, ‘On Time’) ``` The following statement inserts two rows with all column values into the *customer* table: ``` INSERT INTO customer (custno, custname, custaddress, phoneno, cardnumber, comments) VALUES (12, ‘JohnSmith’, ‘100 First Street, Dallas’, ‘(214) 555-1212’,100, ‘On Time’), (13, ‘John Q Public’, ‘200 Second Street, Dallas’, ‘(972) 555-1234’, 200, ‘LatePayment’); ``` ### INSERT SELECT With INSERT ... SELECT, you can quickly insert many rows into a table from one or more other tables. * ColumnStore ignores the ON DUPLICATE KEY clause. * Non-transactional INSERT ... SELECT is directed to ColumnStores cpimport tool by default, which significantly increases performance. * Transactional INSERT ... SELECT statements (that is with AUTOCOMMIT off or after a START TRANSACTION) are processed through normal DML processes. ### Autoincrement Autoincrement is not supported by MariaDB ColumnStore. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Developer Meeting - Athens - Saturday, 12 Nov 2011 MariaDB Developer Meeting - Athens - Saturday, 12 Nov 2011 =========================================================== Agenda and notes from day 2 of the MariaDB Developer Meeting in Athens, Greece. Agenda ------ | Time | Main Track | Side Track | | --- | --- | --- | | 09:00‑10:00 | Email & Hacking time (Public) | | | 10:00-11:00 | GIS in MariaDB: Current status, upcoming milestones. (Public) | | | 11:00‑11:15 | Small break | | | 11:15-12:30 | Replication in MariaDB (Public) | | | 12:30‑13:30 | Lunch | | | 13:30‑14:00 | Email and hacking time. | | | 14:00‑15:15 | Xentio Presentation (Public) | | | 15:15‑15:45 | Coffee break | | | 15:45-16:30 | [MariaDB 5.3](../what-is-mariadb-53/index): Technical Status (Public) | | | 16:30-17:30 | [MariaDB 5.5](../what-is-mariadb-55/index): Planning (features, release theme, release dates, etc...) (Public) | | [Printed Schedule](http://askmonty.org/blog/wp-content/uploads/2011/11/MariaDB-%CE%B5%CF%86%CE%B7%CE%BC%CE%B5%CF%81%CE%AF%CE%B4%CE%B1-12-Nov-2011.pdf) (pdf) Notes ----- | Title | Description | | --- | --- | | [Athens - Replication in MariaDB - notes](../athens-replication-in-mariadb-notes/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | | [MariaDB Replication](../standard-replication/index) | Documentation on standard primary and replica replication. | | [Athens - Xentio Presentation - notes](../athens-xentio-presentation-notes/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | | [Athens - MariaDB 5.3: Technical Status - notes](../athens-mariadb-53-technical-status-notes/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Code Coverage with dgcov Code Coverage with dgcov ======================== The dgcov tool helps you check the coverage for new code **MariaDB starting with [10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)**dgcov.pl script is part of the [mysql-test](../mysql-test/index) framework (and any packages that include mysql-test). Overview -------- The dgcov program runs gcov for code coverage analysis, aggregates the coverage data, and (optionally) reports coverage only for those lines that are changed by the commit(s). Commits are specified in the `git diff` format. If no commits are specified, the default is to work on all uncommitted changes, if any, otherwise on the last commit (in other words, on `git diff HEAD` or `git diff HEAD^`). It's recommended that a developer [runs dgcov on their new code](../code-coverage/index) before pushing it into a MariaDB repository. Usage ----- ``` ./dgcov.pl --help ./dgcov.pl [options] [<commit> [<commit>]] ``` Options and Variables --------------------- | Short Option | Long Option | Description | | --- | --- | --- | | `-h` | `--help` | Print help and exit | | `-v` | `--verbose` | Show commands run. | | `-p` | `--purge` | Delete all test coverage information, to prepare for a new coverage test. | | `-o` | `--only-gcov` | Stop after running gcov, don't run git | | `-s` | `--skip-gcov` | Do not run gcov, assume .gcov files are already in place | | `-g` | `--generate` | Create .dgcov files for all source files | How to Prepare the Code for dgcov --------------------------------- Prior to running this tool, MariaDB should be built with ``` cmake -DENABLE_GCOV=ON ``` and the testsuite should be run. dgcov will report the coverage for all lines modified in the specified commits. Output ------ Output .dgcov files have a conventional gcov format: lines not covered are prefixed with `#####`, lines without generated code are prefixed with `-`, and other lines are prefixed with the number of times they were executed. See `info gcov` for more information. The patch-like coverage for commits uses gcov format (as above) for lines, changed in these commits, and no prefix at all for lines that were not changed. Examples -------- Checking the coverage for all unpushed commits: ``` dgcov.pl @{u} HEAD ``` Checking the coverate for all uncommitted changes: ``` dgcov.pl HEAD ``` Checking the coverage for a specific commit 1234567: ``` dgcov.pl 1234567^ 1234567 ``` [mysql-test-run](../mysql-test-run/index) can invoke dgcov automatically: ``` ./mtr --gcov ``` in the latter case the coverate for the uncommitted changes (or the last commit) will be not printed to the stdout, but will be put into `var/last_changes.dgcov` file. Caveats ------- Note that to be able to run gcov with the [mysql-test](../mysql-test/index) framework you need to have gcc version 4.8 or newer. References ---------- * dgcov was created by Kristian Nielsen and was first [announced here](http://kristiannielsen.livejournal.com/1885.html). * dgcov was re-implemented to aggregate the data and to work for git and cmake by Sergei Golubchik. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_GeomFromGeoJSON ST\_GeomFromGeoJSON =================== **MariaDB starting with [10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)**ST\_GeomFromGeoJSON was added in [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) Syntax ------ ``` ST_GeomFromGeoJSON(g[, option]) ``` Description ----------- Given a GeoJSON input *g*, returns a geometry object. The *option* specifies what to do if *g* contains geometries with coordinate dimensions higher than 2. | Option | Description | | --- | --- | | 1 | Return an error (the default) | | 2 - 4 | The document is accepted, but the coordinates for higher coordinate dimensions are stripped off. | Note that this function did not work correctly before [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) - see [MDEV-12180](https://jira.mariadb.org/browse/MDEV-12180). Examples -------- ``` SET @j = '{ "type": "Point", "coordinates": [5.3, 15.0]}'; SELECT ST_AsText(ST_GeomFromGeoJSON(@j)); +-----------------------------------+ | ST_AsText(ST_GeomFromGeoJSON(@j)) | +-----------------------------------+ | POINT(5.3 15) | +-----------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Sample Platform X3 implementation for Transactional and Analytical Workloads Sample Platform X3 implementation for Transactional and Analytical Workloads ============================================================================ **MariaDB Platform X3** responds to business design challenges by integrating: * MariaDB Server, the leading enterprise open source database; * MariaDB ColumnStore, a columnar database for on-demand analytical processing; and * MariaDB MaxScale, the world's most advanced database proxy. MariaDB Server powers website and application workloads as a modern RDBMS. MariaDB Platform X3 extends MariaDB Server's capabilities to include: * Transactional workloads (OLTP); * Analytical workloads (OLAP); and * the combination of the two as Hybrid Transactional and Analytical Processing (HTAP) queries. This guide has been written for the DBA, developer and operator to help you stand up Platform X3 for HTAP queries, unleashing the ability to perform analysis across events as they are happening. It is also a deployment that can scale from the small cluster of the examples below to accommodate more transactions, larger analytical processing and high availability. Platform X3 Query Routing and Data Streaming -------------------------------------------- When MariaDB Platform X3 is deployed for HTAP, web and mobile services send queries to MariaDB MaxScale. In turn, MaxScale distributes these queries according to their purpose, transactional queries are sent to MariaDB Servers for OLTP workloads, and analytical queries are sent to MariaDB ColumnStore for OLAP operations. On the back-end, changes made to the MariaDB Servers are sent through MaxScale streaming data adapters to ColumnStore, ensuring that ColumnStore remains up-to-date. Platform X3 Scaleout -------------------- MariaDB Platform X3 can operate from individual servers, but as your application grows more complicated and your database workload increases, each component can scale out to suit your particular infrastructure needs. For OLTP operations, our sample Platform X3 deployment we start with four MariaDB Servers, configured to run as one master and three slaves synchronized with each other in a MariaDB Replication cluster. In scaling OLTP, you can increases the number of MariaDB Servers, allowing for high availability, replication backups and failover. For OLAP operations, our sample deployment uses five MariaDB ColumnStore nodes, two of which are configured as User Modules (UM's) and three as Performance Modules (PM's). In scaling OLAP, you can increase the number of UM's to handle more incoming queries or increase the number of PM's to better handle the processing of those queries. To manage network communication between the application and our deployment and between the database servers we use two MaxScale servers, one to handle the back-end data streaming and the other to handle selective query proxying from your application. In scaling for the network load, you can add MaxScale servers to the first to handle a larger database write load or to the second to manage a greater number of queries from your application. Sample Use Cases ---------------- ### Retail Store Example A retail store wants to amplify sales by providing a personalized shopping experience. When a customer checks out at a cash register or online, the customer is presented promotions tailored to the customer's interests. These offers may also be integrated across channels, available when the known customer visits the website, shops by mobile phone app, or be included in the next personalized email sent to the customer. At a technical level, when an OLTP query is performed to process the customer's purchase, the customer's past and current purchase history is analyzed with an OLAP query to provide promotions tailored to the customer's buying history. ### Retail Bank Example A retail bank maintains a customer database that includes their account information and a transaction activities ledger. When a customer makes a deposit or a withdrawal, the application updates the transaction activities ledger of their account. The customer can access their account information and activity through the bank's online portal. Additionally, the application generates reports analyzing transaction activities. These reports are adapted for categories of customers (business, student, regular checking, savings) or for types of transactions (cash deposits, checks, ATM deposits, in-branch deposits, transfers, withdrawals). These reports can be run by the customers on their individual accounts or by the bank's back office on all customer activities. In this scenario, queries listing account information and general transaction activities are OLTP operations. Reports analyzing transaction activities run by the customer for individual accounts or by the bank on all customers are OLAP operations. ### Internet of Things Example A chain of convenience stores maintains an IoT (Internet of Things) network in which each store records data on its milk inventory levels and sensor data such as refrigerator temperature. The central office continuously monitors inventory levels to trigger replenishment on an as-needed basis. The maintenance teams and store also receive real-time alerts if issues arise with the cooling system, speeding repair and reducing product losses. A holistic, whole-picture view of supply levels and status allows the chain to keep costs low and the customer experience consistent. At a technical level, purchasing of a milk carton or container triggers an OLTP query, and inventory reporting is an OLAP query. OLTP data is used for logging, and analysis of OLAP data drives understanding of product losses, replenishment patterns, and equipment failures. Sample Deployment ----------------- The following sections detail how to implement a sample deployment of Platform X3 for HTAP. The first steps cover server installation and deployment; the next cover configuration for [Replication](#configure-for-replication), [Data Streaming](#configure-for-data-streaming), and [Application Traffic](#configure-for-application-traffic), and lastly [Testing](#test-htap-application-traffic) with OLTP and OLAP queries and with DML statements. ### Deploy MariaDB Servers Our sample deployment calls for four servers running MariaDB Server to handle OLTP workloads, which we've named `Server-1` to `Server-4`. These are shown at the left of our sample deployment diagram, in orange. We use InnoDB as the storage engine on these servers. These four servers run MariaDB Server 10.3, installed per the instructions at: [Getting and Upgrading MariaDB](../getting-installing-and-upgrading-mariadb/index). ### Deploy MariaDB ColumnStore Servers Our sample deployment calls for five servers to run MariaDB ColumnStore to handle OLAP workloads. Two of these servers operate as User Module servers, named `UM-1` and `UM-2`, and receive application traffic from MaxScale. The other three operate as Performance Module servers, named `PM-1` through `PM-3`, and perform distributed query processing. These servers run MariaDB ColumnStore 1.2.2 and are installed using the non-root and non-distributed installation method, as per the instructions at: [Preparing and Installing MariaDB ColumnStore](../preparing-and-installing-mariadb-columnstore-12x/index). ### Deploy MariaDB MaxScale Servers Our sample deployment calls for two servers to run MariaDB MaxScale. The first server, named `MaxScale-1`, handles data streaming from the MariaDB Servers to the MariaDB ColumnStore servers. The second, named `MaxScale-2`, selectively proxies application traffic to the respective servers for OLTP and OLAP workloads. These servers run MariaDb MaxScale 2.3.1, installed per the instructions at: [Installing MariaDB MaxScale](mariadb-enterprise/mariadb-maxscale-23-mariadb-maxscale-installation-guide). ### Configure for Replication Once we have the server software installed on the respective hosts, we can begin configuring them for use. To start, our sample deployment calls for the four MariaDB Servers to synchronize data using MariaDB Replication. This allows for high availability on OLTP operations, replication backup and failover. In MariaDB Replication, one server operates as the master receiving all writes from the application and replicating changes to the cluster. The other servers operate as slaves, receiving reads from the application and only accepting writes from the master server. For our sample deployment, `Server-1` operates as the replication master while `Server-2` through `Server-4` operates as the replication slaves. #### Configure `Server-1` (master) Add the following lines to the `[mysqld]` section of `/etc/my.cnf.d/server.cnf`: ``` [mysqld] server_id = 1 log_bin = mariadb-bin binlog_format = ROW gtid_strict_mode = 1 log_error log-slave-updates ``` In streaming data from MariaDB Server to ColumnStore for analysis, MaxScale requires that the Servers format the binary log events by each row modified by a statement, rather than by operation. So, when deploying a cluster for HTAP, ensure that the `[binlog\_format](../server-system-variables/index#binlog_format)` system variable on the MariaDB Servers is always set to the `ROW` value. For more information on these server system variables and others, see [Server System Variables](../server-system-variables/index). #### Configure `Server-2` (slave) Add the following lines to the `[mysqld]` section of `/etc/my.cnf.d/server.cnf`: ``` [mysqld] server_id = 2 log-bin = mariadb-bin binlog-format = ROW gtid_strict_mode = 1 log_error log-slave-updates ``` #### Configure `Server-3` (slave) Add the following lines to the `[mysqld]` section of `/etc/my.cnf.d/server.cnf`: ``` [mysqld] server_id = 3 log-bin = mariadb-bin binlog-format = ROW gtid_strict_mode = 1 log_error log-slave-updates ``` #### Configure `Server-4` (slave) Add the following lines to the `[mysqld]` section of `/etc/my.cnf.d/server.cnf`: ``` [mysqld] server_id = 4 log-bin = mariadb-bin binlog-format = ROW gtid_strict_mode = 1 log_error log-slave-updates ``` #### Restart `Server-1` to `Server-4` Restart all four MariaDB Servers. Log into each server (`Server-1`, `Server-2`, `Server-3` and `Server-4`), and issue the restart command to `systemctl` on each server: ``` # systemctl restart mariadb.service ``` #### Create a replication user on `Server-1` When MariaDB Servers run as replication slaves, they replicate data through client connections with the master server. In order for these servers to establish client connections, create a replication user on the master server, `Server-1`, and grant the user the relevant privileges to retrieve the data. Connect to the master MariaDB Server through the client: ``` $ mysql -u root -p -h <Server-1-ip> -P 3306 ``` Once connected, reset the master: ``` RESET MASTER; ``` Then, create a replication user for MaxScale and the slave MariaDB Servers and grant the relevant privileges to the user: ``` CREATE USER 'repl'@'%' IDENTIFIED BY 'pass'; GRANT REPLICATION SLAVE ON *.* TO 'repl'; GRANT SELECT ON mysql.user TO 'repl'; GRANT SELECT ON mysql.db TO 'repl'; GRANT SELECT ON mysql.tables_priv TO 'repl'; GRANT SELECT ON mysql.roles_mapping TO 'repl'; GRANT SHOW DATABASES ON *.* TO 'repl'; GRANT REPLICATION CLIENT ON *.* TO 'repl'; ``` For more information on MariaDB Replication, see [Performance Tuning with MariaDB Replication](../high-availability-performance-tuning-mariadb-replication/index). #### Configure and start replication on `Server-2` to `Server-4` With each slave MariaDB Server in your deployment, configure it to replicate data from the master server and start the replication process. Perform the following operations on each slave server, (that is, `Server-2` through `Server-4`). First, connect to the slave server: ``` $ mysql -u root -h <slave-server-ip> -P 3306 -p ``` If replication is currently running, reset the master so you can update its configuration: ``` RESET MASTER; ``` Issue a `[CHANGE MASTER TO](../change-master-to/index)` statement to configure the slave to replicate from `Server-1`: ``` CHANGE MASTER TO MASTER_HOST='Server-1-ip', MASTER_USER='repl', MASTER_PASSWORD='pass'; ``` Then, start the replication slave: ``` START SLAVE; ``` You can verify that replication is working using a `[SHOW SLAVE STATUS](../show-slave-status/index)` statement. ``` SHOW SLAVE STATUS; ``` ### Configure for data streaming In HTAP deployments the only queries issued to MariaDB ColumnStore are those specific to OLAP workloads, which does not include writes. In order to update ColumnStore with new data written to the MariaDB Servers, configure MaxScale on the back-end to stream writes to ColumnStore. #### Configure MaxScale Our sample deployment calls for a MaxScale server to handle data streaming between the MariaDB Servers and the MariaDB ColumnStore cluster. On the `MaxScale-1` server, edit the `/etc/maxscale.cnf` configuration file, adding the following lines to set it up for data streaming to ColumnStore using the Avro Listener. First, configure the replication router. Set it to use the particular `server_id` and the binary log: ``` [replication-router] type = service router = binlogrouter user = repl password = pass server_id = 5 master_id = 1 Binlogdir = /var/lib/maxscale Mariadb10-compatibility = 1 filestem = mariadb-bin ``` Then, configure the replication listener: ``` [replication-listener] type = listener service = replication-router protocol = MySQLClient port = 6603 ``` MaxScale now listens for configuration connections on port 6603. This allows a MariaDB client to set up replication using commands similar to those that manage a replication slave server. It only uses the user and password to authentication the configuration connection, (the credentials for connecting to the Server are specified in the [configuration](#configure-maxscale-as-a-slave) below). Next, configure the router for the Avro service. ``` [avro-router] type = service router = avrorouter source = replication-router avrodir = /var/lib/maxscale ``` This generates JSON files from the binary logs it receives from the master MariaDB Server and stores them in the `avodir` directory (that is, `/var/lib/maxscale/`) using the replication router. Then, configure the listener for the Avro service to use a specific port: ``` [avro-listener] type = listener service = avro-router protocol = cdc port = 4001 ``` Once this is done, save the file and restart MaxScale to apply the new configuration: ``` # sudo systemctl restart maxscale ``` Lastly, using the `maxctrl` utility, create a user for the Avro Router to capture data changes. This user handles streaming data MaxScale retrieves from the MariaDB Servers to ColumnStore. ``` # maxctrl call command cdc add_user avro-router cdcuser cdc ``` For more information on the Avro Router, see: [Avro Router](../mariadb-maxscale-21-avrorouter/index). #### Configure MaxScale as a slave When the MaxScale server streams data to MariaDB ColumnStore it retrieves it from the master server using the same process that the slaves use in MariaDB Replication. In effect it operates as a replication slave, only instead of writing data locally, it streams the writes to the ColumnStore User Modules. Connect to MaxScale using the MariaDB Client. Unlike when connecting to MariaDB Servers previously, use port 6603, (which you configured above in the `/etc/maxscale.cnf` file as the replication listener port). ``` $ mysql -h <MaxScale-1-ip> -P 6603 -u repl -p ``` Issue a `[CHANGE MASTER TO](../change-master-to/index)` statement to use the master MariaDB Server host (that is, the IP address to Server-1) and the port for client connections, (which defaults to 3306). Set the user and password as defined for the replication router in `/etc/maxscale.cnf` above. ``` CHANGE MASTER TO MASTER_HOST='<Server-1-ip>', MASTER_PORT=3306, MASTER_USER='repl', MASTER_PASSWORD='pass', MASTER_LOG_FILE='mariadb-bin.000001'; ``` Then, start the slave: ``` START SLAVE; ``` Once you've started the replication slave process on MaxScale, you can check it using the `[SHOW SLAVE STATUS](../show-slave-status/index)` statement, just as you would when checking the status of a slave MariaDB Server. ``` SHOW SLAVE STATUS; ``` If there are no errors, `MaxScale-1` is now running as a replication slave to `Server-1`. #### Configure the CDC user On the master MariaDB Server, (that is, `Server-1`), create a user for the CDC service. The CDC Data Adapter authenticates with this user when retrieving data from the MariaDB Servers. Connect using the MariaDB Client to `Server-1`: ``` $ mysql -u root -p -h <Server-1-ip> ``` Then, issue the following statements to create the CDC user and grant it the necessary privileges: ``` CREATE USER 'cdcuser'@'%' IDENTIFIED BY 'cdc'; GRANT REPLICATION SLAVE ON *.* TO 'cdcuser'; GRANT SELECT ON mysql.user TO 'cdcuser'; GRANT SELECT ON mysql.db TO 'cdcuser'; GRANT SELECT ON mysql.tables_priv TO 'cdcuser'; GRANT SELECT ON mysql.roles_mapping TO 'cdcuser'; GRANT SHOW DATABASES ON *.* TO 'cdcuser'; GRANT REPLICATION CLIENT ON *.* TO 'cdcuser'; ``` #### Install the CDC Streaming Data Adapter The MaxScale CDC Streaming Data Adapter allows you to stream binary log events from MariaDB Servers to MariaDB ColumnStore clusters. In order to use it, install the ColumnStore Bulk Write SDK and the MaxScale CDC Adapter packages on a dedicated host or on any MaxScale server that you want to use for data streaming, (`MaxScale-1` in our sample deployment). Downloads are available at: [Downloads](https://mariadb.com/downloads/#mariadbax-axdataadapters). Note these packages conflict with ColumnStore installations. Don't install them on any of your ColumnStore servers. To install the ColumnStore Bulk Write SDK, download the RPM package from MariaDB, then install the EPEL releases and package dependencies using YUM: ``` $ wget https://downloads.mariadb.com/Data-Adapters/mariadb-columnstore-api/1.2.2/centos/x86_64/7/Mariadb-columnstore-api-1.2.2-1-x86_64-centos7-cpp.rpm $ sudo yum install epel-release $ sudo yum install -y libuv libxml2 snappy python34 $ sudo yum install -y mariadb-columnstore-api-1.2.2-1-x86_64-centos7-cpp.rpm ``` To install the CDC Data Adapter, download the RPM package from MariaDB, then install it using YUM: ``` $ wget https://downloads.mariadb.com/Data-Adapters/mariadb-streaming-data-adapters/cdc-data-adapter/1.2.2/centos-7/mariadb-columnstore-maxscale-cdc-adapters-1.2.2-1-x86_64-centos7.rpm $ sudo yum install -y mariadb-columnstore-maxscale-cdc-adapters-1.2.2-1-x86_64-centos7.rpm ``` For more information on installing the Data Adapter, see [Data Adapters Installation](../columnstore-streaming-data-adapters/index#installation). #### Configure the CDC Data Adapter With the CDC Data Adapter installed you can configure it to stream data to MariaDB ColumnStore. This is done by copying the `Columnstore.xml` configuration file from one of the ColumnStore nodes to the `MaxScale-1` server, where the CDC Data Adapter can use it. ``` $ scp root@columnstore-host:/home/mysql/columnstore/etc/Columnstore.xml \ ~/Columnstore.xml $ sudo mv Columnstore.xml /etc ``` Note, installing MaxScale and the CDC Data Adapter as root creates the `/var/lib/mxs_adapter/` directory. If you intend to run `mxs_adapter` as a non-root user, ensure that the user can read and write from this directory. If not, change the ownership to that of your user. For instance, ``` $ sudo chown ec2-user /var/lib/mxs_adapter ``` Lastly, check the firewall and SELinux. ColumnStore uses ports 8600 to 8630, as well as ports 8700 and 8800. The CDC Data Adapter uses the same ports to stream data from `MaxScale-1` to ColumnStore. Check each server to ensure that there is no firewall blocking these ports. Additionally, ensure that SELinux has a policy allowing these connections or that it is running in permissive mode. #### Verify data streaming Once you've installed and configured the MaxScale and the CDC Data Adapter, you can run checks to verify that it is properly configured and able to communicate and stream data from the MariaDB Servers to the MariaDB ColumnStore cluster. Using the `mxs_adapter` utility, you can connect to MaxScale and test data streaming. In order to test this feature, you first need to create tables to store the data the CDC Data Adapter transfers. First, connect to the master MariaDB Server, `Server-1`, and create an InnoDB table to use in storing test data: ``` CREATE TABLE test.t6(a INT, b INT) ENGINE=InnoDB; ``` Then, connect to one of the User Modules and create a ColumnStore table with the same name and schema: ``` CREATE TABLE test.t6(a INT, b INT) ENGINE=ColumnStore; ``` In order to stream data from the MariaDB Servers to ColumnStore,call the `mxs_adapter` utility. From the `MaxScale-1` server, run the following command: ``` $ mxs_adapter -c /etc/ColumnStore.xml -u cdcuser -p cdc \ -h localhost -P 4001 -r 2 -d -n -z test t6 ``` Use the username and password for the CDC user created in the previous section. In the MaxScale configuration, we set port 4001 for the listener service. The last two arguments tell it to stream the `t6` table on the `test` database. If you want to stream multiple tables, replace these arguments with a `-f` option that gives the path to a table list file. Format the file for one table per line, separating the database name and table name by a tab. For instance, ``` $ cat tbl.lst test t6 test t7 test t8 ``` When you start streaming data, the `mxs_adapter` utility begins printing logging messages to stdout. As you add data to the MariaDB Servers, you can check this output to see binary events streaming over to ColumnStore. To test this, begin inserting data onto the `test.t6` table on the `Server-1` server. This is the master server in the MariaDB Replication and the only one that accepts write operations. ``` INSERT INTO test.t6 VALUES (1,1); INSERT INTO test.t6 VALUES (1,2); INSERT INTO test.t6 VALUES (1,3); INSERT INTO test.t6 VALUES (1,4); INSERT INTO test.t6 VALUES (1,5); ``` Then, issue a `[SELECT](../select/index)` statement to see what data is available on the MariaDB Servers for the OLTP operations: ``` SELECT * FROM test.t6; +----+----+ | a | b | +----+----+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 1 | 5 | +----+----+ 5 rows in set (0.010 sec) ``` By checking the logging messages coming from the `mxs_adapter` utility, you can watch these `[INSERT](../insert/index)` statements as they stream from the MariaDB Servers through MaxScale to ColumnStore: ``` 2018-11-23 18:39:09 [main] Started thread 0x176b470 2018-11-23 18:39:09 [main] Started 1 threads 2018-11-23 18:39:09 [test.t6] Requesting data for table: test.t6 2018-11-23 18:39:09 [test.t6] INSERT INTO `test`.`t6` (`a`,`b`) VALUES (1,1) 2018-11-23 18:39:09 [test.t6] DML average: 12ms 2018-11-23 18:39:19 [test.t6] Read timeout 2018-11-23 18:39:22 [test.t6] INSERT INTO `test`.`t6` (`a`,`b`) VALUES (1,2) 2018-11-23 18:39:22 [test.t6] DML average: 4ms 2018-11-23 18:39:24 [test.t6] INSERT INTO `test`.`t6` (`a`,`b`) VALUES (1,3) 2018-11-23 18:39:24 [test.t6] DML average: 4ms 2018-11-23 18:39:26 [test.t6] INSERT INTO `test`.`t6` (`a`,`b`) VALUES (1,4) 2018-11-23 18:39:26 [test.t6] DML average: 4ms 2018-11-23 18:39:28 [test.t6] INSERT INTO `test`.`t6` (`a`,`b`) VALUES (1,5) 2018-11-23 18:39:28 [test.t6] DML average: 9ms ``` Then, you can issue a similar `[SELECT](../select/index)` statement to the `test.t6` table on either of the User Modules for MariaDB ColumnStore to see that the data is now available for OLAP operations: ``` SELECT * FROM test.t6; +----+----+ | a | b | +----+----+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 1 | 5 | +----+----+ 5 rows in set (0.010 sec) ``` Next, test out other write operations using either an `[UPDATE](../update/index)` or `[DELETE](../delete/index)` statement on `Server-1`: ``` UPDATE test.t6 SET a = 2 WHERE b > 3; SELECT * FROM test.t6; +----+----+ | a | b | +----+----+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 | +----+----+ 5 rows in set (0.000 sec) ``` Using the logging messages from the CDC Data Adapter, you can watch the binary events for this operation stream through MaxScale: ``` 2018-11-23 18:44:18 [test.t6] Read timeout 2018-11-23 18:44:22 [test.t6] UPDATE `test`.`t6` SET `a` = 2, `b` = 4 WHERE `a` = 1 AND `b` = 4 2018-11-23 18:44:22 [test.t6] DML average: 12ms 2018-11-23 18:44:22 [test.t6] UPDATE `test`.`t6` SET `a` = 2, `b` = 5 WHERE `a` = 1 AND `b` = 5 2018-11-23 18:44:22 [test.t6] DML average: 13ms 2018-11-23 18:44:27 [test.t6] Read timeout ``` As you can see from the logging messages, MaxScale detected the `[UPDATE](../update/index)` statement and streamed it through the CDC Data Adapter to ColumnStore. The CDC Data Adapter then begins logging `Read timeout` messages to indicate that it is done streaming and is waiting on additional binary events from the MariaDB Servers. You can confirm that the data was successfully transferred by issuing a `[SELECT](../select/index)` statement to one of the MariaDB ColumnStore User Modules: ``` SELECT * FROM test.t6; +----+----+ | a | b | +----+----+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 | +----+----+ 5 rows in set (0.011 sec) ``` Notice that rows 4 and 5 now contain new values. ### Configure for Application Traffic When your application issues queries to Platform X3 for HTAP operations, it doesn't connect to either the MariaDB Servers or to the MariaDB ColumnStore User Modules directly. Instead, it connects to a MaxScale server configured to selectively routes queries, ensuring that OLTP operations execute on MariaDB Servers and OLAP operations execute on ColumnStore. In order to better illustrate how MaxScale distributes queries between the servers, we are going to install a sample banking database and show how to process payments and analyze loan data. Our sample database contains the following tables: * `account` - each record describes the static characteristics of an account * `client` - each record describes the characteristics of a client * `client_accts` - each record relates together a client with an account * `loan` - each record describes a loan granted for a given account With the configuration so far, our sample deployment will streams these new tables from the MariaDB Serves to ColumnStore through the CDC Data Adapter running on `MaxScale-1`. We'll then configure the second MaxScale server to selectively route your application traffic for HTAP operations. #### Prepare MariaDB Server and MariaDB ColumnStore to receive traffic from MaxScale Create a read user for MaxScale on the master MariaDB Server `Server-1` and the ColumnStore User Modules. Grant it the necessary privileges to operate. ``` CREATE USER 'maxscale' IDENTIFIED BY 'pass'; GRANT SELECT ON mysql.user TO 'maxscale'; GRANT SELECT ON mysql.db TO 'maxscale'; GRANT SELECT ON mysql.tables_priv TO 'maxscale'; GRANT SHOW DATABASES ON *.* TO 'maxscale'; ``` Then, create a write user for MaxScale on the same servers. ``` CREATE USER 'maxuser'@'%' IDENTIFIED BY 'maxpwd'; GRANT ALL ON *.* TO 'maxuser'@'%'; ``` #### Create the schema Download and unzip the sample dataset onto both Server-1 and a ColumnStore User Module from [test-db](https://drive.google.com/a/mariadb.com/file/d/1At6q7qSKJkCe-NcwDCQrkjpDisXVOIDn/view?usp=sharing). This file is `test-db.zip`, which unzips into the `test-db/` directory . It contains following SQL and CSV files: ``` $ unzip test-db.zip $ ls test-db/ create-db-cs.sql create-db-innodb.sql account.csv client_accts.csv client.csv loan.csv ``` On the master MariaDB Server, `Server-1`, change into the unzipped directory and launch the client as the write user `maxuser` you created above for MaxScale: ``` $ cd test-db $ mysql -u 'maxuser' -p ``` Use the `[SOURCE](../source/index)` command to load the `create-db-innodb.sql` file, initializing the base database: ``` SOURCE create-db-innodb.sql; ``` Then, modify the schema to add a balance column to the `bank.loan` table. This column will be used in the ColumnStore examples below. ``` SET sql_log_bin = 0; ALTER TABLE bank.loan ADD COLUMN balance decimal(10,2); SET sql_log_bin = 1; ``` On a ColumnStore User Module, connect from the same directory and with the same user: ``` $ cd test-db $ mysql -u 'maxuser' -p ``` Then, use the `[SOURCE](../source/index)` command to load the `create-db-cs.sql` file: ``` SOURCE create-db-cs.sql; ``` At this point, we have created the bank database and tables, and have loaded the data into the MariaDB Servers, (though we only wrote to `Server-1`, as the master server it has replicated the data out to the slaves). We have also created the bank database and tables in MariaDB ColumnStore. The tables on MariaDB ColumnStore are empty at this point. #### Streaming Data from MariaDB Servers to MariaDB ColumnStore Next, we will start streaming data via the `mxs_adapter` utility, so that the data we've loaded on the MariaDB Servers can stream to MariaDB ColumnStore. On `MaxScale-1`, create a TSV (tab-separated) file named bank.lst with the bank database tables we want to stream: ``` $ cat bank.lst bank account bank client bank client_accts bank loan ``` Now, start the `mxs_adapter` utility designating this file with the `-f` option for this file: ``` $ mxs_adapter -c /etc/Columnstore.xml -u cdcuser -p cdc \ -h <maxscale-1-host> -P 4001 -r 50 -d -n -f bank.lst ``` When you run the `mxs_adapter` utility, it streams logging messages about the operations it's performing to stdout. You can monitor this information to see the binary events its streaming from the MariaDB Servers to MariaDB ColumnStore. ``` 2018-11-28 03:56:49 [bank.client_accts] client_id: 13971 2018-11-28 03:56:49 [bank.client_accts] account_id: 11362 2018-11-28 03:56:49 [bank.client_accts] ca_type: OWNER 2018-11-28 03:56:49 [bank.client_accts] ca_id: 13690 2018-11-28 03:56:49 [bank.client_accts] client_id: 13998 2018-11-28 03:56:49 [bank.client_accts] account_id: 11382 2018-11-28 03:56:49 [bank.client_accts] ca_type: OWNER 2018-11-28 03:56:49 [bank.client_accts] ca_id: 0 2018-11-28 03:56:49 [bank.client_accts] client_id: 2018-11-28 03:56:49 [bank.client_accts] account_id: 2018-11-28 03:56:49 [bank.client_accts] ca_type: 2018-11-28 03:56:52 [bank.account] Read timeout 2018-11-28 03:56:57 [bank.loan] Read timeout 2018-11-28 03:56:58 [bank.client] Flushing batch 2018-11-28 03:56:58 [bank.client] 21 rows, 0 transactions inserted over 10.1008 seconds. GTID = 0-1-23:5371 2018-11-28 03:56:59 [bank.client_accts] Flushing batch 2018-11-28 03:56:59 [bank.client_accts] 21 rows, 0 transactions inserted over 10.1153 seconds. GTID = 0-1-27:5371 2018-11-28 03:57:02 [bank.account] Read timeout ``` When all the loaded data has been streamed from the MariaDB Servers to ColumnStore, you'll begin to see `Read timeout` messages in the output. This means that the `mxs_adapter` utility is now waiting on additional binary events to occur on the MariaDB Servers. At this point, if you issue a `[SELECT COUNT(\*)](../count/index)` statements to MariaDB ColumnStore, you should get following result-sets: ``` SELECT COUNT(*) FROM bank.account; +----------+ | COUNT(*) | +----------+ | 4502 | +----------+ 1 row in set (0.057 sec) SELECT COUNT(*) FROM bank.client; +----------+ | COUNT(*) | +----------+ | 5371 | +----------+ 1 row in set (0.051 sec) SELECT COUNT(*) FROM bank.loan; +----------+ | COUNT(*) | +----------+ | 684 | +----------+ 1 row in set (0.056 sec) SELECT COUNT(*) FROM bank.client_accts; +----------+ | COUNT(*) | +----------+ | 5371 | +----------+ 1 row in set (0.027 sec) ``` The MariaDB Servers and ColumnStore now contain the same data. #### Configure HTAP routing Our sample deployment proxies application traffic through a second MariaDB MaxScale server for the selective routing of HTAP queries. Specifically, it involves configuring the MaxScale-2 server so that: * All `[INSERT](../insert/index)`, `[UPDATE](../update/index)`, `[DELETE](../delete/index)` statements always route to `Server-1` for (OLTP) * All `[SELECT](../select/index)` queries on the loan table always route to MariaDB ColumnStore (OLAP) * All remaining read queries will route to any MariaDB Server. Below is a diagram of the `MaxScale-2` server configuration: Here is the configuration file you should have in `/etc/maxscale.cnf` on `MaxScale-2` to achieve the above. ``` [maxscale] threads = auto sql_mode = default ## Identify the Master MariaDB Server: Server-1 [sw-db1] type = server address = <MariaDB-Server-1-IP> port = 3306 protocol = MariaDBBackend ## Identify the Slave MariaDB Server: Server-2 [sw-db2] type = server address = <MariaDB-Server-2-IP> port = 3306 protocol = MariaDBBackend ## Identify the Slave MariaDB Server: Server-3 [sw-db3] type = server address = <MariaDB-Server-3-IP> port = 3306 protocol = MariaDBBackend ## Identify the Columnstore Server: UM-1 [sw-mcs-um1] type = server address = <MariaDB-UM-1-IP> port = 3306 protocol = MariaDBBackend ## Monitor all servers [MariaDB-Monitor] type = monitor module = mariadbmon servers = sw-db1,sw-db2,sw-db3,sw-mcs-um1 user = maxuser password = maxpwd monitor_interval = 10000 ## Service to talk to the servers. [MDB-Service] type = service router = readwritesplit servers = sw-db1,sw-db2 user = maxuser password = maxpwd ## Listener that clients use to access the MariaDB Servers. [MDB-Listener] type = listener service = MDB-Service protocol = MariaDBClient port = 4009 ## The MDB-Service abstracted as a server [MDB-Service-as-server] type = server address = 127.0.0.1 port = 4009 protocol = MariaDBBackend ## Service to talk to the ColumnStore UM [CS-Service] type = service router = readconnroute router_options = running servers = sw-mcs-um1 user = maxuser password = maxpwd ## Listener that clients use to access the CS-Service. [CS-Listener] type = listener service = CS-Service protocol = MariaDBClient port = 4010 ## CS-Service abstracted as a server [CS-Service-as-server] type = server address = 127.0.0.1 port = 4010 protocol = MariaDBBackend ## Filter the _datamart_ queries to the ColumnStore server and rest of the queries to the MariaDB Servers [target-selector] type = filter module = namedserverfilter match01 = (?i)SELECT.*loan target01 = CS-Service-as-server match02 = .* target02 = MDB-Service-as-server ## Filter to replace loan table name without database qualifier, with bank.loan, so that the connection to ColumnStore knows which database to use [loan-table-filter] type = filter module = regexfilter options = ignorecase match = \sloan\s replace = /* */ bank.loan /* */ log_trace = true log_file = /tmp/regexfilter.log ## Combines the two services as one [HTAP-Service] type = service Router = schemarouter ignore_databases_regex = .* servers = MDB-Service-as-server,CS-Service-as-server Preferred_server = MDB-Service-as-server user = maxuser password = maxpwd filters = target-selector ## Listener clients use to access the combined service [HTAP-Listener] type = listener service = HTAP-Service protocol = MariaDBClient port = 4011 ``` Then, start MaxScale: ``` # systemctl start maxscale ``` ### Test HTAP Application Traffic With the MariaDB Servers, ColumnStore and MaxScale servers configured and deployed, you can begin testing the sample HTAP deployment. The application connects to the second MaxScale server, `MaxScale-2`, on port 4011, where it performs selective query routing: * All `[INSERT](../insert/index)`, `[UPDATE](../update/index)`, `[DELETE](../delete/index)` queries always route to `Server-1` (OLTP) * All `[SELECT](../select/index)` queries on loans table always route to MariaDB ColumnStore (OLAP) * All remaining read queries route to any MariaDB Server (OLTP) #### Connect from application to MaxScale HTAP Service From your application server use the MariaDB Client to connect to the MaxScale HTAP Service. ``` $ mysql -h <maxscale2-host> -P 4011 -u maxuser -p ``` These are the same command-line options as you would use to connect to a MariaDB Server, but instead of an individual server, you connect to MaxScale, which sends the queries to the Servers or to one of the ColumnStore UM's. Use the password '`maxpwd`' value that you previously set for this user. #### Transactional queries The MariaDB MaxScale server configuration above designates queries on tables other than bank.loan as transactional and routes them to the MariaDB Servers rather than ColumnStore. You can identify which server cluster the query executes on using the `[version\_comment](../server-system-variables/index#version_comment)` system variable. ``` SELECT *, @@version_comment FROM bank.account LIMIT 5; +------------+-------------+------------------+------------+-------------------+ | account_id | district_id | frequency | a_d | @@version_comment | +------------+-------------+------------------+------------+-------------------+ | 576 | 55 | POPLATEK MESICNE | 1993-01-01 | MariaDB Server | | 3818 | 74 | POPLATEK MESICNE | 1993-01-01 | MariaDB Server | | 704 | 55 | POPLATEK MESICNE | 1993-01-01 | MariaDB Server | | 2378 | 16 | POPLATEK MESICNE | 1993-01-01 | MariaDB Server | | 2632 | 24 | POPLATEK MESICNE | 1993-01-02 | MariaDB Server | +------------+-------------+------------------+------------+-------------------+ 5 rows in set (0.039 sec) ``` Since MaxScale routes this query as a transactional operation, the `[version\_comment](../server-system-variables/index#version_comment)` system variable returns MariaDB Server. #### Analytical queries The MariaDB MaxScale server configuration above designates queries on the bank.loans table as analytical queries and routes them to the MariaDB ColumnStore User Modules rather than the MariaDB Servers. You can identify which server cluster the query executes on using the `[version\_comment](../server-system-variables/index#version_comment)` system variable. ``` SELECT loan_id, account_id, amount, duration, payments, @@version_comment FROM loan LIMIT 5; +---------+------------+-----------+----------+----------+---------------------+ | loan_id | account_id | amount | duration | payments | @@version_comment | +---------+------------+-----------+----------+----------+---------------------+ | 0 | 0 | 0.00 | 0 | 0.00 | Columnstore 1.2.1-1 | | 5314 | 1787 | 96396.00 | 12 | 8033.00 | Columnstore 1.2.1-1 | | 5316 | 1801 | 165960.00 | 36 | 4610.00 | Columnstore 1.2.1-1 | | 6863 | 9188 | 127080.00 | 60 | 2118.00 | Columnstore 1.2.1-1 | | 5325 | 1843 | 105804.00 | 36 | 2939.00 | Columnstore 1.2.1-1 | +---------+------------+-----------+----------+----------+---------------------+ ``` Since MaxScale routes the query as an analytical operation, the `[version\_comment](../server-system-variables/index#version_comment)` system variable indicates a ColumnStore server. #### DML Statements The MariaDB MaxScale server configuration above designates data manipulation statements such as `[INSERT](../insert/index)`, `[UPDATE](../update/index)` and `[DELETE](../delete/index)` as transactional and routes these statements to the MariaDB Servers. The other MaxScale server then streams the changes over to ColumnStore. Issue an `[UPDATE](../update/index)` statement to set the initial balance for a loan: ``` UPDATE bank.loan SET balance = amount WHERE loan_id = 5314; ``` Then, query the updated row to see the changes on ColumnStore: ``` SELECT loan_id, account_id, amount, payments, @@version_comment FROM bank.loan WHERE loan_id = 5314; +---------+------------+----------+----------+-----------+---------------------+ | loan_id | account_id | amount | payments | balance | @@version_comment | +---------+------------+----------+----------+-----------+---------------------+ | 5314 | 1787 | 96396.00 | 8033.00 | 96369.00 | Columnstore 1.2.1-1 | +---------+------------+----------+----------+-----------+---------------------+ 1 row in set (0.113 sec) ``` The loan balance has been set to its initial value of the received funds. As you can see, the account holder has made payments on the loan. This amount should be removed from the balance to reflect their paying it down. Issue another `[UPDATE](../update/index)` statement to modify the balance, removing payments made on the account: ``` UPDATE bank.loan SET balance = balance - payments WHERE loan_id = 5314; ``` Then, query the loan to view the updated rows on ColumnStore: ``` SELECT loan_id, account_id, amount, payments, @@version_comment FROM bank.loan WHERE loan_id = 5314; +---------+------------+----------+----------+----------+---------------------+ | loan_id | account_id | amount | payments | balance | @@version_comment | +---------+------------+----------+----------+----------+---------------------+ | 5314 | 1787 | 96396.00 | 8033.00 | 88336.00 | Columnstore 1.2.1-1 | +---------+------------+----------+----------+----------+---------------------+ 1 row in set (0.094 sec) ``` The loan balance has now been reduced to reflect account payments. MaxScale has also streamed the data from the changes over to ColumnStore. For More Information -------------------- ### Obtaining the Products When you're ready to install MariaDB Platform X3, go to [Downloads](https://mariadb.com/downloads) and select Platform X3. If you use an RPM or APT based distribution of Linux, you can configure your server repositories to install it through the package manager. ### Documentation Documentation for MariaDB products is available in the [Library](../library). For the documentation on specific products, see the links below: * **[MariaDB Server Documentation](../library/documentation/index)** + **[Getting Started](../getting-installing-and-upgrading-mariadb/index)** + **[SQL Statements](../sql-statements-structure/index)** + **[SQL Functions](../built-in-functions/index)** + **[MariaDB Replication](../high-availability-performance-tuning-mariadb-replication/index)** + **[Server System Variables](../server-system-variables/index)** * **[MariadB ColumnStore Documentation](../mariadb-columnstore/index)** + **[Getting Started](../columnstore-getting-started/index)** + **[ColumnStore Streaming Data Adapters](../columnstore-streaming-data-adapters/index)** * **[MariaDB MaxScale Documentation](mariadb-enterprise/maxscale)** Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb mysqld Options mysqld Options ============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadbd` is a symlink to `mysqld`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadbd` is the name of the binary, with `mysqld` a symlink . This page lists all of the options for `mysqld` / `mariadbd`, ordered by topic. For a full alphabetical list of all mysqld options, as well as server and status variables, see [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). In many cases, the entry here is a summary, and links to the full description. By convention, [server variables](../server-system-variables/index) have usually been specified with an underscore in the configuration files, and a dash on the command line. You can however specify underscores as dashes - they are interchangeable. See [mysqld startup options](../mysqld-startup-options/index) for which files and groups mysqld reads for it's default options. Option Prefixes --------------- #### `--autoset-*` * **Description:** Sets the option value automatically. Only supported for certain options. Available in [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/) and later. #### `--disable-*` * **Description:** For all boolean options, disables the setting (equivalent to setting it to `0`). Same as `--skip`. #### `--enable-*` * **Description:** For all boolean options, enables the setting (equivalent to setting it to `1`). #### `--loose-*` * **Description:** Don't produce an error if the option doesn't exist. #### `--maximum-*` * **Description:** Sets the maximum value for the option. #### `--skip-*` * **Description:** For all boolean options, disables the setting (equivalent to setting it to `0`). Same as `--disable`. Option File Options ------------------- #### `--defaults-extra-file` * **Commandline:** `--defaults-extra-file=name` * **Description:** Read this extra option file after all other option files are read. + See [Configuring MariaDB with Option Files](../configuring-mariadb-with-option-files/index). --- #### `--defaults-file` * **Commandline:** `--defaults-file=name` * **Description:** Only read options from the given option file. + See [Configuring MariaDB with Option Files](../configuring-mariadb-with-option-files/index). --- #### `--defaults-group-suffix` * **Commandline:** `--defaults-group-suffix=name` * **Description:** In addition to the default option groups, also read option groups with the given suffix. + See [Configuring MariaDB with Option Files](../configuring-mariadb-with-option-files/index). --- #### `--no-defaults` * **Commandline:** `--no-defaults` * **Description:** Don't read options from any option file. + See [Configuring MariaDB with Option Files](../configuring-mariadb-with-option-files/index). --- #### `--print-defaults` * **Commandline:** `--print-defaults` * **Description:** Read options from option files, print all option values, and then exit the program. + See [Configuring MariaDB with Option Files](../configuring-mariadb-with-option-files/index). --- Compatibility Options --------------------- The following options have been added to MariaDB to make it more compliant with other MariaDB and MySQL versions: #### `-a, --ansi` * **Description:** Use ANSI SQL syntax instead of MySQL syntax. This mode will also set [transaction isolation level](../set-transaction-isolation-level/index#isolation-levels) [serializable](../set-transaction-isolation-level/index#serializable). --- #### `--new` * **Description:** Use new functionality that will exist in next version of MariaDB. This function exists to make it easier to prepare for an upgrade. For version 5.1 this functions enables the LIST and RANGE partitions functions for ndbcluster. --- #### `--old-style-user-limits` * **Description:** Enable old-style user limits (before MySQL 5.0.3, user resources were counted per each user+host vs. per account). --- #### `--safe-mode` * **Description:** Disable some potential unsafe optimizations. For 5.2, [INSERT DELAYED](../insert-delayed/index) is disabled, [myisam\_recover\_options](../myisam-system-variables/index#myisam_recover_options) is set to DEFAULT (automatically recover crashed MyISAM files) and the [query cache](../query-cache/index) is disabled. For [Aria](../aria/index) tables, disable bulk insert optimization to enable one to use [aria\_read\_log](../aria_read_log/index) to recover tables even if tables are deleted (good for testing recovery). --- #### `--skip-new` * **Description:** Disables [--new](#-new) in 5.2. In 5.1 used to disable some new potentially unsafe functions. --- ### Compatibility Options and System Variables * [--old](../server-system-variables/index#old) * [--old-alter-table](../server-system-variables/index#old_alter_table) * [--old-mode](../server-system-variables/index#old_mode) * [--old-passwords](../server-system-variables/index#old_passwords) * [--show-old-temporals](../server-system-variables/index#show_old_temporals) Locale Options -------------- #### `--character-set-client-handshake` * **Commandline:** `--character-set-client-handshake` * **Description:** Don't ignore client side character set value sent during handshake. --- #### `--default-character-set` * **Commandline:** `--default-character-set=name` * **Description:** Still available as an option for setting the default character set for clients and their connections, it was deprecated and removed in [MariaDB 10.2](../what-is-mariadb-102/index) as a server option. Use [character-set-server](../server-system-variables/index#character_set_server) instead. --- #### `--language` * **Description:** This option can be used to set the server's language for error messages. This option can be specified either as a language name or as the path to the directory storing the language's [error message file](../error-log/index#error-messages-file). See [Server Locales](../server-locale/index) for a list of supported locales and their associated languages. + This option is deprecated. Use the `[lc\_messages](../server-system-variables/index#lc_messages)` and `[lc\_messages\_dir](../server-system-variables/index#lc_messages_dir)` system variables instead. + See [Setting the Language for Error Messages](../setting-the-language-for-error-messages/index) for more information. --- ### Locale Options and System Variables * [character-set-filesystem](../server-system-variables/index#character_set_filesystem) * [character-set-client](../server-system-variables/index#character_set_client) * [character-set-connection](../server-system-variables/index#character_set_connection) * [character-set-database](../server-system-variables/index#character_set_database) * [character-set-filesystem](../server-system-variables/index#character_set_filesystem) * [character-set-results](../server-system-variables/index#character_set_results) * [character-set-server](../server-system-variables/index#character_set_server) * [character-set-system](../server-system-variables/index#character_set_system) * [character-sets-dir](../server-system-variables/index#character_sets_dir) * [collation-connection](../server-system-variables/index#collation_connection) * [collation-database](../server-system-variables/index#collation_database) * [collation-server](../server-system-variables/index#collation_server) * [default-week-format](../server-system-variables/index#default_week_format) * [default-time-zone](../server-system-variables/index#time_zone) * [lc-messages](../server-system-variables/index#lc_messages) * [lc-messages-dir](../server-system-variables/index#lc_messages_dir) * [lc-time-names](../server-system-variables/index#lc_time_names) Windows Options --------------- #### `--console` * **Description:** Windows-only option that keeps the console window open and for writing log messages to stderr and stdout. If specified together with [--log-error](../server-system-variables/index#log_error), the last option will take precedence. --- #### `--install` * **Description:** Windows-only option that installs the `mysqld` process as a Windows service. + The Windows service created with this option [auto-starts](https://docs.microsoft.com/en-us/windows/desktop/Services/automatically-starting-services). If you want a service that is [started on demand](https://docs.microsoft.com/en-us/windows/desktop/Services/starting-services-on-demand), then use the `[--install-manual](#install-manual)` option. + This option takes a service name as an argument. If this option is provided without a service name, then the service name defaults to "MySQL". + This option is deprecated and may be removed in a future version. See [MDEV-19358](https://jira.mariadb.org/browse/MDEV-19358) for more information. --- #### `--install-manual` * **Description:** Windows-only option that installs the `mysqld` process as a Windows service. + The Windows service created with this option is [started on demand](https://docs.microsoft.com/en-us/windows/desktop/Services/starting-services-on-demand). If you want a service that [auto-starts](https://docs.microsoft.com/en-us/windows/desktop/Services/automatically-starting-services), use the `[--install](#install)` option. + This option takes a service name as an argument. If this option is provided without a service name, then the service name defaults to "MySQL". + This option is deprecated and may be removed in a future version. See [MDEV-19358](https://jira.mariadb.org/browse/MDEV-19358) for more information. --- #### `--remove` * **Description:** Windows-only option that removes the Windows service created by the `[--install](#install)` or `[--install-manual](#install-manual)` options. + This option takes a service name as an argument. If this option is provided without a service name, then the service name defaults to "MySQL". + This option is deprecated and may be removed in a future version. See [MDEV-19358](https://jira.mariadb.org/browse/MDEV-19358) for more information. --- #### `--slow-start-timeout` * **Description:** Windows-only option that defines the maximum number of milliseconds that the service control manager should wait before trying to kill the Windows service during startup. Defaults to `15000`. --- #### `--standalone` * **Description:** Windows-only option that has no effect. Kept for compatibility reasons. --- ### Windows Options and System Variables The following options and system variables are related to using MariaDB on Windows: * `[--named-pipe](../server-system-variables/index#named_pipe)` Replication and Binary Logging Options -------------------------------------- The following options are related to [replication](../replication/index) and the [binary log](../binary-log/index): #### `--abort-slave-event-count` * **Commandline:** `--abort-slave-event-count=#` * **Description:** Option used by mysql-test for debugging and testing of replication. --- #### `--binlog-do-db` * **Commandline:** `--binlog-do-db=name` * **Description:** This option allows you to configure a [replication master](../replication/index) to write statements and transactions affecting databases that match a specified name into its [binary log](../binary-log/index). Since the filtered statements or transactions will not be present in the [binary log](../binary-log/index), its replication slaves will not be able to replicate them. + This option will **not** work with cross-database updates with [statement-based logging](../binary-log-formats/index#statement-based-logging). See the [Statement-Based Logging](../replication-filters/index#statement-based-logging) section for more information. + This option can **not** be set dynamically. + When setting it on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), the option does not accept a comma-separated list. If you would like to specify multiple filters, then you need to specify the option multiple times. + See [Replication Filters](../replication-filters/index) for more information. --- #### `--binlog-ignore-db` * **Commandline:** `--binlog-ignore-db=name` * **Description:** This option allows you to configure a [replication master](../replication/index) to **not** write statements and transactions affecting databases that match a specified name into its [binary log](../binary-log/index). Since the filtered statements or transactions will not be present in the [binary log](../binary-log/index), its replication slaves will not be able to replicate them. + This option will **not** work with cross-database updates with [statement-based logging](../binary-log-formats/index#statement-based-logging). See the [Statement-Based Logging](../replication-filters/index#statement-based-logging) section for more information. + This option can **not** be set dynamically. + When setting it on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), the option does not accept a comma-separated list. If you would like to specify multiple filters, then you need to specify the option multiple times. + See [Replication Filters](../replication-filters/index) for more information. --- #### `--binlog-row-event-max-size` * **Commandline:** `--binlog-row-event-max-size=#` * **Description:** The maximum size of a row-based [binary log](../binary-log/index) event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256. * **Default value** + `8192` (>= [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)) + `1024` (<= [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)) --- #### `--disconnect-slave-event-count` * **Commandline:** `--disconnect-slave-event-count=#` * **Description:** Option used by mysql-test for debugging and testing of replication. --- #### `--flashback` * **Commandline:** `--flashback` * **Description:** Setup the server to use flashback. This enables the [binary log](../binary-log/index) and sets `binlog_format=ROW`. * **Introduced:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `--init-rpl-role` * **Commandline:** `--init-rpl-role=name` * **Description:** Set the replication role. --- #### `--log-basename` * **Commandline:** `--log-basename=name` * **Description:** Basename for all log files and the .pid file. This sets all log file names at once (in 'datadir') and is normally the only option you need for specifying log files. This is especially recommended to be set if you are using [replication](../replication/index) as it ensures that your log file names are not dependent on your host name. Sets names for [log-bin](../replication-and-binary-log-server-system-variables/index#log_bin), [log-bin-index](../replication-and-binary-log-server-system-variables/index#log_bin_index), [relay-log](../replication-and-binary-log-server-system-variables/index#relay_log), [relay-log-index](../replication-and-binary-log-server-system-variables/index#relay_log_index), [general-log-file](../server-system-variables/index#general_log_file), `--log-slow-query-log-file`, `--log-error-file`, and [pid-file](../server-system-variables/index#pid_file). * **Introduced:** [MariaDB 5.2](../what-is-mariadb-52/index) --- #### `--log-bin-trust-routine-creators` * **Commandline:** `--log-bin-trust-routine-creators` * **Description:** Deprecated, use [log-bin-trust-function-creators](../replication-and-binary-log-server-system-variables/index#log_bin_trust_function_creators). --- #### `--master-host` * **Commandline:** `--master-host=name` * **Description:** Master hostname or IP address for replication. If not set, the slave thread will not be started. Note that the setting of master-host will be ignored if there exists a valid master.info file. --- #### `--master-info-file` * **Commandline:** `--master-info-file=name` * **Description:** Name and location of the file where the `MASTER_LOG_FILE` and `MASTER_LOG_POS` options (i.e. the [binary log](../binary-log/index) position on the master) and most other `[CHANGE MASTER](../change-master-to/index)` options are written. The [slave's I/O thread](../replication-threads/index#slave-io-thread) keeps this [binary log](../binary-log/index) position updated as it downloads events. + See [CHANGE MASTER TO: Option Persistence](../change-master-to/index#option-persistence) for more information. --- #### `--master-password` * **Commandline:** `--master-password=name` * **Description:** The password the slave thread will authenticate with when connecting to the master. If not set, an empty password is assumed. The value in master.info will take precedence if it can be read. --- #### `--master-port` * **Commandline:** `--master-port=#` * **Description:** The port the master is listening on. If not set, the compiled setting of MYSQL\_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read. --- #### `--master-retry-count` * **Commandline:** `--master-retry-count=#` * **Description:** Number of times a slave will attempt to connect to a master before giving up. The retry interval is determined by the MASTER\_CONNECT\_RETRY option for the CHANGE MASTER statement. A value of 0 means the slave will not stop attempting to reconnect. Reconnects are triggered when a slave has timed out. See [slave\_net\_timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout). * **Default Value:** `86400` * **Range - 32 bit:** `0 to 4294967295` * **Range - 64 bit:** `0 to 18446744073709551615` --- #### `--master-ssl` * **Commandline:** `--master-ssl` * **Description:** Enable the slave to [connect to the master using TLS](../secure-connections-overview/index). --- #### `--master-ssl-ca` * **Commandline:** `--master-ssl-ca[=name]` * **Description:** Master TLS CA file. Only applies if you have enabled [master-ssl](#-master-ssl). --- #### `--master-ssl-capath` * **Commandline:** `--master-ssl-capath[=name]` * **Description:** Master TLS CA path. Only applies if you have enabled [master-ssl](#-master-ssl). --- #### `--master-ssl-cert` * **Commandline:** `--master-ssl-cert[=name]` * **Description:** Master TLS certificate file name. Only applies if you have enabled [master-ssl](#-master-ssl). --- #### `--master-ssl-cipher` * **Commandline:** `--master-ssl-cipher[=name]` * **Description:** Master TLS cipher. Only applies if you have enabled [master-ssl](#-master-ssl). --- #### `--master-ssl-key` * **Commandline:** `--master-ssl-key[=name]` * **Description:** Master TLS keyfile name. Only applies if you have enabled [master-ssl](#-master-ssl). --- #### `--master-user` * **Commandline:** `--master-user=name` * **Description:** The username the slave thread will use for authentication when connecting to the master. The user must have FILE privilege. If the master user is not set, user test is assumed. The value in master.info will take precedence if it can be read. --- #### `--max-binlog-dump-events` * **Commandline:** `--max-binlog-dump-events=#` * **Description:** Option used by mysql-test for debugging and testing of replication. --- #### `--replicate-rewrite-db` * **Commandline:** `--replicate-rewrite-db=master_database->slave_database` * **Description:** This option allows you to configure a [replication slave](../replication/index) to rewrite database names. It uses the format `master_database->slave_database`. If a slave encounters a [binary log](../binary-log/index) event in which the default database (i.e. the one selected by the `[USE](../use/index)` statement) is `master_database`, then the slave will apply the event in `slave_database` instead. + This option will **not** work with cross-database updates with [statement-based logging](../binary-log-formats/index#statement-based-logging). See the [Statement-Based Logging](../replication-filters/index#statement-based-logging) section for more information. + This option only affects statements that involve tables. This option does not affect statements involving the database itself, such as `[CREATE DATABASE](../create-database/index)`, `[ALTER DATABASE](../alter-database/index)`, and `[DROP DATABASE](../drop-database/index)`. + This option can **not** be set dynamically. + When setting it on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), the option does not accept a comma-separated list. If you would like to specify multiple filters, then you need to specify the option multiple times. + See [Replication Filters](../replication-filters/index) for more information. --- #### `--replicate-same-server-id` * **Commandline:** `--replicate-same-server-id` * **Description:** In replication, if set to 1, do not skip events having our server id. Default value is 0 (to break infinite loops in circular replication). Can't be set to 1 if [log-slave-updates](../replication-and-binary-log-server-system-variables/index#log_slave_updates) is used. --- #### `--sporadic-binlog-dump-fail` * **Commandline:** `--sporadic-binlog-dump-fail` * **Description:** Option used by mysql-test for debugging and testing of replication. --- #### `--sysdate-is-now` * **Commandline:** `--sysdate-is-now` * **Description:** Non-default option to alias [SYSDATE()](../sysdate/index) to [NOW()](../now/index) to make it safe for [replication](../replication/index). Since 5.0, SYSDATE() has returned a `dynamic' value different for different invocations, even within the same statement. --- ### Replication and Binary Logging Options and System Variables The following options and system variables are related to [replication](../replication/index) and the [binary log](../binary-log/index): * [auto-increment-increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) * [auto-increment-offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset) * [binlog-annotate-row-events](../replication-and-binary-log-server-system-variables/index#binlog_annotate_row_events) * [binlog-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_cache_size) * [binlog-checksum](../replication-and-binary-log-server-system-variables/index#binlog_checksum) * [binlog-commit-wait-count](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_count) * [binlog-commit-wait-usec](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_usec) * [binlog-direct-non-transactional-updates|](../replication-and-binary-log-server-system-variables/index#binlog_direct_non_transactional_updates) * [binlog-expire-logs-seconds](../replication-and-binary-log-server-system-variables/index#binlog_expire_logs_seconds) * [binlog-file-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_file_cache_size) * [binlog-format](../replication-and-binary-log-server-system-variables/index#binlog_format) * [binlog-optimize-thread-scheduling](../replication-and-binary-log-server-system-variables/index#binlog_optimize_thread_scheduling) * [binlog-row-image](../replication-and-binary-log-server-system-variables/index#binlog_row_image) * [binlog-row-metadata](../replication-and-binary-log-server-system-variables/index#binlog_row_metadata) * [binlog-stmt-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_stmt_cache_size) * [default-master-connection](../replication-and-binary-log-server-system-variables/index#default_master_connection) * [gtid-cleanup-batch-size](../global-transaction-id/index#gtid_cleanup_batch_size) * [gtid-domain-id](../global-transaction-id/index#gtid_domain_id) * [gtid-ignore-duplicates](../global-transaction-id/index#gtid_ignore_duplicates) * [gtid-strict-mode](../global-transaction-id/index#gtid_strict_mode) * [init-slave](../replication-and-binary-log-server-system-variables/index#init_slave) * [log-bin](../replication-and-binary-log-server-system-variables/index#log_bin) * [log-bin-compress](../replication-and-binary-log-server-system-variables/index#log_bin_compress) * [log-bin-compress-min-len](../replication-and-binary-log-server-system-variables/index#log_bin_compress_min_len) * [log-bin-index](../replication-and-binary-log-server-system-variables/index#log_bin_index) * [log-bin-trust-function-creators](../replication-and-binary-log-server-system-variables/index#log_bin_trust_function_creators) * [log-slave-updates](../replication-and-binary-log-server-system-variables/index#log_slave_updates) * [master-verify-checksum](../replication-and-binary-log-server-system-variables/index#master_verify_checksum) * [max-binlog-cache-size](../replication-and-binary-log-server-system-variables/index#max_binlog_cache_size) * [max-binlog-size](../replication-and-binary-log-server-system-variables/index#max_binlog_size) * [max-binlog-stmt-cache-size](../replication-and-binary-log-server-system-variables/index#max_binlog_stmt_cache_size) * [max-relay-log-size](../replication-and-binary-log-server-system-variables/index#max_relay_log_size) * [read-binlog-speed-limit](../replication-and-binary-log-server-system-variables/index#read_binlog_speed_limit) * [relay-log](../replication-and-binary-log-server-system-variables/index#relay_log) * [relay-log-index](../replication-and-binary-log-server-system-variables/index#relay_log_index) * [relay-log-info-file](../replication-and-binary-log-server-system-variables/index#relay_log_info_file) * [relay-log-purge](../replication-and-binary-log-server-system-variables/index#relay_log_purge) * [relay-log-recovery](../replication-and-binary-log-server-system-variables/index#relay_log_recovery) * [relay-log-space-limit](../replication-and-binary-log-server-system-variables/index#relay_log_space_limit) * [replicate-annotate-row-events](../replication-and-binary-log-server-system-variables/index#replicate_annotate_row_events) * [replicate-do-db](../replication-and-binary-log-server-system-variables/index#replicate_do_db) * [replicate-do-table](../replication-and-binary-log-server-system-variables/index#replicate_do_table) * [replicate-events-marked-for-skip](../replication-and-binary-log-server-system-variables/index#replicate_events_marked_for_skip) * [replicate-ignore-db](../replication-and-binary-log-server-system-variables/index#replicate_ignore_db) * [replicate-ignore-table](../replication-and-binary-log-server-system-variables/index#replicate_ignore_table) * [replicate-wild-do-table](../replication-and-binary-log-server-system-variables/index#replicate_wild_do_table) * [replicate-wild-ignore-table](../replication-and-binary-log-server-system-variables/index#replicate_wild_ignore_table) * [report-host](../replication-and-binary-log-server-system-variables/index#report_host) * [report-password](../replication-and-binary-log-server-system-variables/index#report_password) * [report-port](../replication-and-binary-log-server-system-variables/index#report_port) * [report-user](../replication-and-binary-log-server-system-variables/index#report_user) * [rpl-recovery-rank](../replication-and-binary-log-server-system-variables/index#rpl_recovery_rank) * [server-id](../replication-and-binary-log-server-system-variables/index#server_id) * [slave-compressed-protocol](../replication-and-binary-log-server-system-variables/index#slave_compressed_protocol) * [slave-ddl-exec-mode](../replication-and-binary-log-server-system-variables/index#slave_ddl_exec_mode) * [slave-domain-parallel-threads](../replication-and-binary-log-server-system-variables/index#slave_domain_parallel_threads) * [slave-exec-mode](../replication-and-binary-log-server-system-variables/index#slave_exec_mode) * [slave-load-tmpdir](../replication-and-binary-log-server-system-variables/index#slave_load_tmpdir) * [slave-max-allowed-packet](../replication-and-binary-log-server-system-variables/index#slave_max_allowed_packet) * [slave-net-timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout) * [slave-parallel-max-queued](../replication-and-binary-log-server-system-variables/index#slave_parallel_max_queued) * [slave-parallel-threads](../replication-and-binary-log-server-system-variables/index#slave_parallel_threads) * [slave-run-triggers-for-rbr](../replication-and-binary-log-server-system-variables/index#slave_run_triggers_for_rbr) * [slave-skip-errors](../replication-and-binary-log-server-system-variables/index#slave_skip_errors) * [slave-sql-verify-checksum](../replication-and-binary-log-server-system-variables/index#slave_sql_verify_checksum) * [slave-transaction-retries](../replication-and-binary-log-server-system-variables/index#slave_transaction_retries) * [slave\_transaction\_retry\_errors](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_errors) * [slave\_transaction\_retry\_interval](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_interval) * [slave-type-conversions](../replication-and-binary-log-server-system-variables/index#slave_type_conversions) * [sync-binlog](../replication-and-binary-log-server-system-variables/index#sync_binlog) * [sync-master-info](../replication-and-binary-log-server-system-variables/index#sync_master_info) * [sync-relay-log](../replication-and-binary-log-server-system-variables/index#sync_relay_log) * [sync-relay-log-info](../replication-and-binary-log-server-system-variables/index#sync_relay_log_info) ### Semisynchronous Replication Options and System Variables The options and system variables related to [Semisynchronous Replication](../semisynchronous-replication/index) are described [here](../semisynchronous-replication/index#system-variables). Optimizer Options ----------------- #### `--record-buffer` * **Commandline:** `--record-buffer=#` * **Description:** Old alias for [read\_buffer\_size](../server-system-variables/index#read_buffer_size). * **Removed:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `--table-cache` * **Commandline:** `--table-open-cache=#` * **Description:** Removed; use [--table-open-cache](../server-system-variables/index#table_open_cache) instead. * **Removed:** [MariaDB 5.1.3](https://mariadb.com/kb/en/mariadb-513-release-notes/) --- ### Optimizer Options and System Variables * [alter-algorithm](../server-system-variables/index#alter_algorithm) * [analyze-sample-percentage](../server-system-variables/index#analyze_sample_percentage) * [big-tables](../server-system-variables/index#big_tables) * [bulk-insert-buffer-size](../server-system-variables/index#bulk_insert_buffer_size) * [expensive-subquery-limit](../server-system-variables/index#expensive_subquery_limit) * [join-buffer-size](../server-system-variables/index#join_buffer_size) * [join-buffer-space-limit](../server-system-variables/index#join_buffer_space_limit) * [join-cache-level](../server-system-variables/index#join_cache_level) * [max-heap-table-size](../server-system-variables/index#max_heap_table_size) * [max-join-size](../server-system-variables/index#max_join_size) * [max-seeks-for-key](../server-system-variables/index#max_seeks_for_key) * [max-sort-length](../server-system-variables/index#max_sort_length) * [mrr-buffer-size](../server-system-variables/index#mrr_buffer_size) * [optimizer-max-sel-arg-weight](../server-system-variables/index#optimizer_max_sel_arg_weight) * [optimizer-prune-level](../server-system-variables/index#optimizer_prune_level) * [optimizer-search-depth](../server-system-variables/index#optimizer_search_depth) * [optimizer-selectivity-sampling-limit](../server-system-variables/index#optimizer_selectivity_sampling_limit) * [optimizer-switch](../server-system-variables/index#optimizer_switch) * [optimizer-trace](../server-system-variables/index#optimizer_trace) * [optimizer-trace-max-mem-size](../server-system-variables/index#optimizer_trace_max_mem_size) * [optimizer-use-condition-selectivity](../server-system-variables/index#optimizer_use_condition_selectivity) * [query-alloc-block-size](../server-system-variables/index#query_alloc_block_size) * [query-prealloc-size](../server-system-variables/index#query_prealloc_size) * [range-alloc-block-size](../server-system-variables/index#range_alloc_block_size) * [read-buffer-size](../server-system-variables/index#read_buffer_size) * [rowid-merge-buff-size](../server-system-variables/index#rowid_merge_buff_size) * [table-definition-cache](../server-system-variables/index#table_definition_cache) * [table-open-cache](../server-system-variables/index#table_open_cache) * [table-open-cache-instances](../server-system-variables/index#table_open_cache_instances) * [tmp-disk-table-size](../server-system-variables/index#tmp_disk_table_size) * [tmp-memory-table-size](../server-system-variables/index#tmp_memory_table_size) * [tmp-table-size](../server-system-variables/index#tmp_table_size) * [use-stat-tables](../server-system-variables/index#use_stat_tables) Storage Engine Options ---------------------- #### `--skip-bdb` * **Commandline:** `----skip-bdb` * **Description:** Deprecated option; Exists only for compatibility with very old my.cnf files. * **Removed:** [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/) --- #### `--external-locking` * **Commandline:** `--external-locking` * **Description:** Use system (external) locking (disabled by default). With this option enabled you can run [myisamchk](../myisamchk/index) to test (not repair) tables while the server is running. Disable with [--skip-external-locking](../server-system-variables/index#skip_external_locking). From [MariaDB 10.2.40](https://mariadb.com/kb/en/mariadb-10240-release-notes/), [MariaDB 10.3.31](https://mariadb.com/kb/en/mariadb-10331-release-notes/), [MariaDB 10.4.21](https://mariadb.com/kb/en/mariadb-10421-release-notes/), [MariaDB 10.5.12](https://mariadb.com/kb/en/mariadb-10512-release-notes/), [MariaDB 10.6.4](https://mariadb.com/kb/en/mariadb-1064-release-notes/) and all later version, this effects InnoDB and can be used to prevent multiple instances running on the same data. --- ### MyISAM Storage Engine Options The options related to the [MyISAM](../myisam-storage-engine/index) storage engine are described below. #### `--log-isam` * **Commandline:** `--log-isam[=file_name]` * **Description:** Enable the [MyISAM log](../myisam-log/index), which logs all MyISAM changes to file. If no filename is provided, the default, *myisam.log* is used. --- #### MyISAM Storage Engine Options and System Variables Some options and system variables related to the [MyISAM](../myisam-storage-engine/index) storage engine can be found [here](../myisam-system-variables/index). Direct links to many of them can be found below. * [concurrent-insert](../server-system-variables/index#concurrent_insert) * [delayed-insert-limit](../server-system-variables/index#delayed_insert_limit) * [delayed-insert-timeout](../server-system-variables/index#delayed_insert_timeout) * [delayed-queue-size](../server-system-variables/index#delayed_queue_size) * [keep-files-on-create](../server-system-variables/index#keep_files_on_create) * [key-buffer-size](../myisam-system-variables/index#key_buffer_size) * [key-cache-age-threshold](../myisam-system-variables/index#key_cache_age_threshold) * [key-cache-block-size](../myisam-system-variables/index#key_cache_block_size) * [key-cache-division-limit](../myisam-system-variables/index#key_cache_division_limit) * [key-cache-file-hash-size](../myisam-system-variables/index#key_cache_file_hash_size) * [key-cache-segments](../myisam-system-variables/index#key_cache_segments) * [myisam-block-size](../myisam-server-system-variables/index#myisam_block_size) * [myisam-data-pointer-size](../myisam-server-system-variables/index#myisam_data_pointer_size) * [myisam-max-sort-file-size](../myisam-server-system-variables/index#myisam_max_sort_file_size) * [myisam-mmap-size](../myisam-server-system-variables/index#myisam_mmap_size) * [myisam-recover-options](../myisam-server-system-variables/index#myisam_recover_options) * [myisam-repair-threads](../myisam-server-system-variables/index#myisam_repair_threads) * [myisam-sort-buffer-size](../myisam-server-system-variables/index#myisam_sort_buffer_size) * [myisam-stats-method](../myisam-server-system-variables/index#myisam_stats_method) * [myisam-use-mmap](../myisam-server-system-variables/index#myisam_use_mmap) ### InnoDB Storage Engine Options The options related to the [InnoDB](../innodb/index) storage engine are described below. #### `--innodb` * **Commandline:** `--innodb=value`, `--skip-innodb` * **Description:** This variable controls whether or not to load the InnoDB storage engine. Possible values are `ON`, `OFF`, `FORCE` or `FORCE_PLUS_PERMANENT` (from [MariaDB 5.5](../what-is-mariadb-55/index)). If set to `OFF` (the same as --skip-innodb), since InnoDB is the default storage engine, the server will not start unless another storage engine has been chosen with [--default-storage-engine](../server-system-variables/index#default_storage_engine). `FORCE` means that the storage engine must be successfully loaded, or else the server won't start. `FORCE_PLUS_PERMANENT` enables the plugin, but if plugin cannot initialize, the server will not start. In addition, the plugin cannot be uninstalled while the server is running. --- #### `--innodb-cmp` * **Commandline:** `--innodb-cmp` * **Description:** * **Default:** `ON` --- #### `--innodb-cmp-reset` * **Commandline:** `--innodb-cmp-reset` * **Description:** * **Default:** `ON` --- #### `--innodb-cmpmem` * **Commandline:** `--innodb-cmpmem` * **Description:** * **Default:** `ON` --- #### `--innodb-cmpmem-reset` * **Commandline:** `--innodb-cmpmem-reset` * **Description:** * **Default:** `ON` --- #### `--innodb-file-io-threads` * **Commandline:** `--innodb-file-io-threads` * **Description:** * **Default:** `4` * **Removed:** [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) --- #### `--innodb-index-stats` * **Commandline:** `--innodb-index-stats` * **Description:** * **Default:** `ON` * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `--innodb-lock-waits` * **Commandline:** `--innodb-lock-waits` * **Description:** * **Default:** `ON` --- #### `--innodb-locks` * **Commandline:** `--innodb-locks` * **Description:** * **Default:** `ON` --- #### `--innodb-rseg` * **Commandline:** `--innodb-rseg` * **Description:** * **Default:** `ON` * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `--innodb-status-file` * **Commandline:** `--innodb-status-file` * **Description:** * **Default:** `FALSE` --- #### `--innodb-sys-indexes` * **Commandline:** `--innodb-sys-indexes` * **Description:** * **Default:** `ON` --- #### `--innodb-sys-stats` * **Commandline:** `--innodb-sys-stats` * **Description:** * **Default:** `ON` * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `--innodb-sys-tables` * **Commandline:** `--innodb-sys-tables` * **Description:** * **Default:** `ON` --- #### `--innodb-table-stats` * **Commandline:** `--innodb-table-stats` * **Description:** * **Default:** `ON` * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `--innodb-trx` * **Commandline:** `--innodb-trx` * **Description:** * **Default:** `ON` --- #### InnoDB Storage Engine Options and System Variables Some options and system variables related to the [InnoDB](../innodb/index) storage engine can be found [here](../innodb-system-variables/index). Direct links to many of them can be found below. * [ignore-builtin-innodb](../innodb-system-variables/index#ignore_builtin_innodb) * [innodb-adaptive-checkpoint](../innodb-system-variables/index#innodb_adaptive_checkpoint) * [innodb-adaptive-flushing](../innodb-system-variables/index#innodb_adaptive_flushing) * [innodb-adaptive-flushing-lwm](../innodb-system-variables/index#innodb_adaptive_flushing_lwm) * [innodb-adaptive-flushing-method](../innodb-system-variables/index#innodb_adaptive_flushing_method) * [innodb-adaptive-hash-index](../innodb-system-variables/index#innodb_adaptive_hash_index) * [innodb-adaptive-hash-index-partitions](../innodb-system-variables/index#innodb_adaptive_hash_index_partitions) * [innodb-adaptive-hash-index-parts](../innodb-system-variables/index#innodb_adaptive_hash_index_parts) * [innodb-adaptive-max-sleep-delay](../innodb-system-variables/index#innodb_adaptive_max_sleep_delay) * [innodb-additional-mem-pool-size](../innodb-system-variables/index#innodb_additional_mem_pool_size) * [innodb-api-bk-commit-interval](../innodb-system-variables/index#innodb_api_bk_commit_interval) * [innodb-api-disable-rowlock](../innodb-system-variables/index#innodb_api_disable_rowlock) * [innodb-api-enable-binlog](../innodb-system-variables/index#innodb_api_enable_binlog) * [innodb-api-enable-mdl](../innodb-system-variables/index#innodb_api_enable_mdl) * [innodb-api-trx-level](../innodb-system-variables/index#innodb_api_trx_level) * [innodb-auto-lru-dump](../innodb-system-variables/index#innodb_auto_lru_dump) * [innodb-autoextend-increment](../innodb-system-variables/index#innodb_autoextend_increment) * [innodb-autoinc-lock-mode](../innodb-system-variables/index#innodb_autoinc_lock_mode) * [innodb-background-scrub-data-check-interval](../innodb-system-variables/index#innodb_background_scrub_data_check_interval) * [innodb-background-scrub-data-compressed](../innodb-system-variables/index#innodb_background_scrub_data_compressed) * [innodb-background-scrub-data-interval](../innodb-system-variables/index#innodb_background_scrub_data_interval) * [innodb-background-scrub-data-uncompressed](../innodb-system-variables/index#innodb_background_scrub_data_uncompressed) * [innodb-blocking-buffer-pool-restore](../innodb-system-variables/index#innodb_blocking_buffer_pool_restore) * [innodb-buf-dump-status-frequency](../innodb-system-variables/index#innodb_buf_dump_status_frequency) * [innodb-buffer-pool-chunk-size](../innodb-system-variables/index#innodb_buffer_pool_chunk_size) * [innodb-buffer-pool-dump-at-shutdown](../innodb-system-variables/index#innodb_buffer_pool_dump_at_shutdown) * [innodb-buffer-pool-dump-now](../innodb-system-variables/index#innodb_buffer_pool_dump_now) * [innodb-buffer-pool-dump-pct](../innodb-system-variables/index#innodb_buffer_pool_dump_pct) * [innodb-buffer-pool-evict](../innodb-system-variables/index#innodb_buffer_pool_evict) * [innodb-buffer-pool-filename](../innodb-system-variables/index#innodb_buffer_pool_filename) * [innodb-buffer-pool-instances](../innodb-system-variables/index#innodb_buffer_pool_instances) * [innodb-buffer-pool-load-abort](../innodb-system-variables/index#innodb_buffer_pool_load_abort) * [innodb-buffer-pool-load-at-startup](../innodb-system-variables/index#innodb_buffer_pool_load_at_startup) * [innodb-buffer-pool-load-now](../innodb-system-variables/index#innodb_buffer_pool_load_now) * [innodb-buffer-pool-load-pages-abort](../innodb-system-variables/index#innodb_buffer_pool_load_pages_abort) * [innodb-buffer-pool-populate](../innodb-system-variables/index#innodb_buffer_pool_populate) * [innodb-buffer-pool-restore-at-startup](../innodb-system-variables/index#innodb_buffer_pool_restore_at_startup) * [innodb-buffer-pool-shm-checksum](../innodb-system-variables/index#innodb_buffer_pool_shm_checksum) * [innodb-buffer-pool-shm-key](../innodb-system-variables/index#innodb_buffer_pool_shm_key) * [innodb-buffer-pool-size](../innodb-system-variables/index#innodb_buffer_pool_size) * [innodb-change-buffer-max-size](../innodb-system-variables/index#innodb_change_buffer_max_size) * [innodb-change-buffering](../innodb-system-variables/index#innodb_change_buffering) * [innodb-change-buffering-debug](../innodb-system-variables/index#innodb_change_buffering_debug) * [innodb-checkpoint-age-target](../innodb-system-variables/index#innodb_checkpoint_age_target) * [innodb-checksum-algorithm](../innodb-system-variables/index#innodb_checksum_algorithm) * [innodb-checksums](../innodb-system-variables/index#innodb_checksums) * [innodb-cleaner-lsn-age-factor](../innodb-system-variables/index#innodb_cleaner_lsn_age_factor) * [innodb-cmp-per-index-enabled](../innodb-system-variables/index#innodb_cmp_per_index_enabled) * [innodb-commit-concurrency](../innodb-system-variables/index#innodb_commit_concurrency) * [innodb-compression-algorithm](../innodb-system-variables/index#innodb_compression_algorithm) * [innodb-compression-failure-threshold-pct](../innodb-system-variables/index#innodb_compression_failure_threshold_pct) * [innodb-compression-level](../innodb-system-variables/index#innodb_compression_level) * [innodb-compression-pad-pct-max](../innodb-system-variables/index#innodb_compression_pad_pct_max) * [innodb-concurrency-tickets](../innodb-system-variables/index#innodb_concurrency_tickets) * [innodb-corrupt-table-action](../innodb-system-variables/index#innodb_corrupt_table_action) * [innodb-data-file-path](../innodb-system-variables/index#innodb_data_file_path) * [innodb-data-home-dir](../innodb-system-variables/index#innodb_data_home_dir) * [innodb-deadlock-detect](../innodb-system-variables/index#innodb_deadlock_detect) * [innodb-deadlock-report](../innodb-system-variables/index#innodb_deadlock_report) * [innodb-default-encryption-key-id](../innodb-system-variables/index#innodb_default_encryption_key_id) * [innodb-default-page-encryption-key](../innodb-system-variables/index#innodb_default_page_encryption_key) * [innodb-default-row-format](../innodb-system-variables/index#innodb_default_row_format) * [innodb-defragment](../innodb-system-variables/index#innodb_defragment) * [innodb-defragment-fill-factor](../innodb-system-variables/index#innodb_defragment_fill_factor) * [innodb-defragment-fill-factor-n-recs](../innodb-system-variables/index#innodb_defragment_fill_factor_n_recs) * [innodb-defragment-frequency](../innodb-system-variables/index#innodb_defragment_frequency) * [innodb-defragment-n-pages](../innodb-system-variables/index#innodb_defragment_n_pages) * [innodb-defragment-stats-accuracy](../innodb-system-variables/index#innodb_defragment_stats_accuracy) * [innodb-dict-size-limit](../innodb-system-variables/index#innodb_dict_size_limit) * [innodb\_disable\_sort\_file\_cache](../innodb-system-variables/index#innodb_disable_sort_file_cache) * [innodb-doublewrite](../innodb-system-variables/index#innodb_doublewrite) * [innodb-doublewrite-file](../innodb-system-variables/index#innodb_doublewrite_file) * [innodb-empty-free-list-algorithm](../innodb-system-variables/index#innodb_empty_free_list_algorithm) * [innodb-enable-unsafe-group-commit](../innodb-system-variables/index#innodb_enable_unsafe_group_commit) * [innodb-encrypt-log](../innodb-system-variables/index#innodb_encrypt_log) * [innodb-encrypt-tables](../innodb-system-variables/index#innodb_encrypt_tables) * [innodb-encrypt-temporary-tables](../innodb-system-variables/index#innodb_encrypt_tables) * [innodb-encryption-rotate-key-age](../innodb-system-variables/index#innodb_encryption_rotate_key_age) * [innodb-encryption-rotation\_iops](../innodb-system-variables/index#innodb_encryption_rotation_iops) * [innodb-encryption-threads](../innodb-system-variables/index#innodb_encryption_threads) * [innodb-extra-rsegments](../innodb-system-variables/index#innodb_extra_rsegments) * [innodb-extra-undoslots](../innodb-system-variables/index#innodb_extra_undoslots) * [innodb-fake-changes](../innodb-system-variables/index#innodb_fake_changes) * [innodb-fast-checksum](../innodb-system-variables/index#innodb_fast_checksum) * [innodb-fast-shutdown](../innodb-system-variables/index#innodb_fast_shutdown) * [innodb-fatal-semaphore-wait-threshold](../innodb-system-variables/index#innodb_fatal_semaphore_wait_threshold) * [innodb-file-format](../innodb-system-variables/index#innodb_file_format) * [innodb-file-format-check](../innodb-system-variables/index#innodb_file_format_check) * [innodb-file-format-max](../innodb-system-variables/index#innodb_file_format_max) * [innodb-file-per-table](../innodb-system-variables/index#innodb_file_per_table) * [innodb-fill-factor](../innodb-system-variables/index#innodb_fill_factor) * [innodb-flush-log-at-trx-commit](../innodb-system-variables/index#innodb_flush_log_at_trx_commit) * [innodb-flush-method](../innodb-system-variables/index#innodb_flush_method) * [innodb-flush-neighbor-pages](../innodb-system-variables/index#innodb_flush_neighbor_pages) * [innodb-flush-neighbors](../innodb-system-variables/index#innodb_flush_neighbors) * [innodb-flush-sync](../innodb-system-variables/index#innodb_flush_sync) * [innodb-flushing-avg-loops](../innodb-system-variables/index#innodb_flushing_avg_loops) * [innodb-force-load-corrupted](../innodb-system-variables/index#innodb_force_load_corrupted) * [innodb-force-primary-key](../innodb-system-variables/index#innodb_force_primary_key) * [innodb-force-recovery](../innodb-system-variables/index#innodb_force_recovery) * [innodb-foreground-preflush](../innodb-system-variables/index#innodb_foreground_preflush) * [innodb-ft-aux-table](../innodb-system-variables/index#innodb_ft_aux_table) * [innodb-ft-cache-size](../innodb-system-variables/index#innodb_ft_cache_size) * [innodb-ft-enable-diag-print](../innodb-system-variables/index#innodb_ft_enable_diag_print) * [innodb-ft-enable-stopword](../innodb-system-variables/index#innodb_ft_enable_stopword) * [innodb-ft-max-token-size](../innodb-system-variables/index#innodb_ft_max_token_size) * [innodb-ft-min-token-size](../innodb-system-variables/index#innodb_ft_min_token_size) * [innodb-ft-num-word-optimize](../innodb-system-variables/index#innodb_ft_num_word_optimize) * [innodb-ft-result-cache-limit](../innodb-system-variables/index#innodb_ft_result_cache_limit) * [innodb-ft-server-stopword-table](../innodb-system-variables/index#innodb_ft_server_stopword_table) * [innodb-ft-sort-pll-degree](../innodb-system-variables/index#innodb_ft_sort_pll_degree) * [innodb-ft-total-cache-size](../innodb-system-variables/index#innodb_ft_total_cache_size) * [innodb-ft-user-stopword-table](../innodb-system-variables/index#innodb_ft_user_stopword_table) * [innodb-ibuf-accel-rate](../innodb-system-variables/index#innodb_ibuf_accel_rate) * [innodb-ibuf-active-contract](../innodb-system-variables/index#innodb_ibuf_active_contract) * [innodb-ibuf-max-size](../innodb-system-variables/index#innodb_ibuf_max_size) * [innodb-idle-flush-pct](../innodb-system-variables/index#innodb_idle_flush_pct) * [innodb-immediate-scrub-data-uncompressed](../innodb-system-variables/index#innodb_immediate_scrub_data_uncompressed) * [innodb-import-table-from-xtrabackup](../innodb-system-variables/index#innodb_import_table_from_xtrabackup) * [innodb-instant-alter-column-allowed](../innodb-system-variables/index#innodb_instant_alter_column_allowed) * [innodb-instrument-semaphores](../innodb-system-variables/index#innodb_instrument_semaphores) * [innodb-io-capacity](../innodb-system-variables/index#innodb_io_capacity) * [innodb-io-capacity-max](../innodb-system-variables/index#innodb_io_capacity_max) * [innodb-large-prefix](../innodb-system-variables/index#innodb_large_prefix) * [innodb-lazy-drop-table](../innodb-system-variables/index#innodb_lazy_drop_table) * [innodb-lock-schedule-algorithm](../innodb-system-variables/index#innodb_lock_schedule_algorithmt) * [innodb-locking-fake-changes](../innodb-system-variables/index#innodb_locking_fake_changes) * [innodb-locks-unsafe-for-binlog](../innodb-system-variables/index#innodb_locks_unsafe_for_binlog) * [innodb-log-arch-dir](../innodb-system-variables/index#innodb_log_arch_dir) * [innodb-log-arch-expire-sec](../innodb-system-variables/index#innodb_log_arch_expire_sec) * [innodb-log-archive](../innodb-system-variables/index#innodb_log_archive) * [innodb-log-block-size](../innodb-system-variables/index#innodb_log_block_size) * [innodb-log-buffer-size](../innodb-system-variables/index#innodb_log_buffer_size) * [innodb-log-checksum-algorithm](../innodb-system-variables/index#innodb_log_checksum_algorithm) * [innodb-log-checksums](../innodb-system-variables/index#innodb_log_checksums) * [innodb-log-compressed-pages](../innodb-system-variables/index#innodb_log_compressed_pages) * [innodb-log-file-buffering](../innodb-system-variables/index#innodb_log_file_buffering) * [innodb-log-file-size](../innodb-system-variables/index#innodb_log_file_size) * [innodb-log-files-in-group](../innodb-system-variables/index#innodb_log_files_in_group) * [innodb-log-group-home-dir](../innodb-system-variables/index#innodb_log_group_home_dir) * [innodb-log-optimize-ddl](../innodb-system-variables/index#innodb_log_optimize_ddl) * [innodb-log-write-ahead-size](../innodb-system-variables/index#innodb_log_write_ahead_size) * [innodb-lru-flush-size](../innodb-system-variables/index#innodb_lru_flush_size) * [innodb-lru-scan-depth](../innodb-system-variables/index#innodb_lru_scan_depth) * [innodb-max-bitmap-file-size](../innodb-system-variables/index#innodb_max_bitmap_file_size) * [innodb-max-changed-pages](../innodb-system-variables/index#innodb_max_changed_pages) * [innodb-max-dirty-pages-pct](../innodb-system-variables/index#innodb_max_dirty_pages_pct) * [innodb-max-dirty-pages-pct-lwm](../innodb-system-variables/index#innodb_max_dirty_pages_pct_lwm) * [innodb-max-purge-lag](../innodb-system-variables/index#innodb_max_purge_lag) * [innodb-max-purge-lag-delay](../innodb-system-variables/index#innodb_max_purge_lag_delay) * [innodb-max-purge-lag-wait](../innodb-system-variables/index#innodb_max_purge_lag_wait) * [innodb-max-undo-log-size](../innodb-system-variables/index#innodb_max_undo_log_size) * [innodb-merge-sort-block-size](../innodb-system-variables/index#innodb_merge_sort_block_size) * [innodb-mirrored-log-groups](../innodb-system-variables/index#innodb_mirrored_log_groups) * [innodb-monitor-disable](../innodb-system-variables/index#innodb_monitor_disable) * [innodb-monitor-enable](../innodb-system-variables/index#innodb_monitor_enable) * [innodb-monitor-reset](../innodb-system-variables/index#innodb_monitor_reset) * [innodb-monitor-reset-all](../innodb-system-variables/index#innodb_monitor_reset_all) * [innodb-mtflush-threads](../innodb-system-variables/index#innodb_mtflush_threads) * [innodb-numa-interleave](../innodb-system-variables/index#innodb_numa_interleave) * [innodb-old-blocks-pct](../innodb-system-variables/index#innodb_old_blocks_pct) * [innodb-old-blocks-time](../innodb-system-variables/index#innodb_old_blocks_time) * [innodb-online-alter-log-max-size](../innodb-system-variables/index#innodb_online_alter_log_max_size) * [innodb-open-files](../innodb-system-variables/index#innodb_open_files) * [innodb-optimize-fulltext-only](../innodb-system-variables/index#innodb_optimize_fulltext_only) * [innodb-page-cleaners](../innodb-system-variables/index#innodb_page_cleaners) * [innodb-page-size](../innodb-system-variables/index#innodb_page_size) * [innodb-pass-corrupt-table](../innodb-system-variables/index#innodb_pass_corrupt_table) * [innodb-prefix-index-cluster-optimization](../innodb-system-variables/index#innodb_prefix_index_cluster_optimization) * [innodb-print-all-deadlocks](../innodb-system-variables/index#innodb_print_all_deadlocks) * [innodb-purge-batch-size](../innodb-system-variables/index#innodb_purge_batch_size) * [innodb-purge-rseg-truncate-frequency](../innodb-system-variables/index#innodb_purge_rseg_truncate_frequency) * [innodb-purge-threads](../innodb-system-variables/index#innodb_purge_threads) * [innodb-random-read-ahead](../innodb-system-variables/index#innodb_random_read_ahead) * [innodb-read-ahead](../innodb-system-variables/index#innodb_read_ahead) * [innodb-read-ahead-threshold](../innodb-system-variables/index#innodb_read_ahead_threshold) * [innodb-read-io-threads](../innodb-system-variables/index#innodb_read_io_threads) * [innodb-read-only](../innodb-system-variables/index#innodb_read_only) * [innodb-recovery-update-relay-log](../innodb-system-variables/index#innodb_recovery_update_relay_log) * [innodb-replication-delay](../innodb-system-variables/index#innodb_replication_delay) * [innodb-rollback-on-timeout](../innodb-system-variables/index#innodb_rollback_on_timeout) * [innodb-rollback-segments](../innodb-system-variables/index#innodb_rollback_segments) * [innodb-safe-truncate](../innodb-system-variables/index#innodb_safe_truncate) * [innodb-sched-priority-cleaner](../innodb-system-variables/index#innodb_sched_priority_cleaner) * [innodb-scrub-log](../innodb-system-variables/index#innodb_scrub_log) * [innodb-scrub-log-interval](../innodb-system-variables/index#innodb_scrub_log_interval) * [innodb-scrub-log-speed](../innodb-system-variables/index#innodb_scrub_log_speed) * [innodb-show-locks-held](../innodb-system-variables/index#innodb_show_locks_held) * [innodb-show-verbose-locks](../innodb-system-variables/index#innodb_show_verbose_locks) * [innodb-sort-buffer-size](../innodb-system-variables/index#innodb_sort_buffer_size) * [innodb-spin-wait-delay](../innodb-system-variables/index#innodb_spin_wait_delay) * [innodb-stats-auto-recalc](../innodb-system-variables/index#innodb_stats_auto_recalc) * [innodb-stats-auto-update](../innodb-system-variables/index#innodb_stats_auto_update) * [innodb-stats-include-delete-marked](../innodb-system-variables/index#innodb_stats_include_delete_marked) * [innodb-stats-method](../innodb-system-variables/index#innodb_stats_method) * [innodb-stats-modified-counter](../innodb-system-variables/index#innodb_stats_modified_counter) * [innodb-stats-on-metadata](../innodb-system-variables/index#innodb_stats_on_metadata) * [innodb-stats-persistent](../innodb-system-variables/index#innodb_stats_persistent) * [innodb-stats-persistent-sample-pages](../innodb-system-variables/index#innodb_stats_persistent_sample_pages) * [innodb-stats-sample-pages](../innodb-system-variables/index#innodb_stats_sample_pages) * [innodb-stats-transient-sample-pages](../innodb-system-variables/index#innodb_stats_transient_sample_pages) * [innodb-stats-traditional](../innodb-system-variables/index#innodb_stats_traditional) * [innodb-stats-update-need-lock](../innodb-system-variables/index#innodb_stats_update_need_lock) * [innodb-status-output](../innodb-system-variables/index#innodb_status_output) * [innodb-status-output-locks](../innodb-system-variables/index#innodb_status_output_locks) * [innodb-strict-mode](../innodb-system-variables/index#innodb_strict_mode) * [innodb-support-xa](../innodb-system-variables/index#innodb_support_xa) * [innodb-sync-array-size](../innodb-system-variables/index#innodb_sync_array_size) * [innodb-sync-spin-loops](../innodb-system-variables/index#innodb_sync_spin_loops) * [innodb-table-locks](../innodb-system-variables/index#innodb_table_locks) * [innodb-temp-data-file-path](../innodb-system-variables/index#innodb_temp_data_file_path) * [innodb-thread-concurrency](../innodb-system-variables/index#innodb_thread_concurrency) * [innodb-thread-concurrency-timer-based](../innodb-system-variables/index#innodb_thread_concurrency_timer_based) * [innodb-thread-sleep-delay](../innodb-system-variables/index#innodb_thread_sleep_delay) * [innodb-tmpdir](../innodb-system-variables/index#innodb_tmpdir) * [innodb-track-changed-pages](../innodb-system-variables/index#innodb_track_changed_pages) * [innodb-track-redo-log-now](../innodb-system-variables/index#innodb_track_redo_log_now) * [innodb-undo-directory](../innodb-system-variables/index#innodb_undo_directory) * [innodb-undo-log-truncate](../innodb-system-variables/index#innodb_undo_log_truncate) * [innodb-undo-logs](../innodb-system-variables/index#innodb_undo_logs) * [innodb-undo-tablespaces](../innodb-system-variables/index#innodb_undo_tablespaces) * [innodb-use-atomic-writes](../innodb-system-variables/index#innodb_use_atomic_writes) * [innodb-use-fallocate](../innodb-system-variables/index#innodb_use_fallocate) * [innodb-use-global-flush-log-at-trx-commit](../innodb-system-variables/index#innodb_use_global_flush_log_at_trx_commit) * [innodb-use-mtflush](../innodb-system-variables/index#innodb_use_mtflush) * [innodb-use-native\_aio](../innodb-system-variables/index#innodb_use_native_aio) * [innodb-use-purge-thread](../innodb-system-variables/index#innodb_use_purge_thread) * [innodb-use-stacktrace](../innodb-system-variables/index#innodb_use_stacktrace) * [innodb-use-sys-malloc](../innodb-system-variables/index#innodb_use_sys_malloc) * [innodb-use-sys-stats-table](../innodb-system-variables/index#innodb_use_sys_stats_table) * [innodb-use-trim](../innodb-system-variables/index#innodb_use_trim) * [innodb-write-io-threads](../innodb-system-variables/index#innodb_write_io_threads) * [skip-innodb](#-innodb) * [skip-innodb-checksums](../innodb-system-variables/index#innodb_checksums) * [skip-innodb-doublewrite](../innodb-system-variables/index#innodb_doublewrite) ### Aria Storage Engine Options The options related to the [Aria](../aria/index) storage engine are described below. #### `--aria-log-dir-path` * **Commandline:** `--aria-log-dir-path=value` * **Description:** Path to the directory where transactional log should be stored * **Default:** `SAME AS DATADIR` --- #### Aria Storage Engine Options and System Variables Some options and system variables related to the [Aria](../aria/index) storage engine can be found [here](../aria-system-variables/index). Direct links to many of them can be found below. * [aria-block-size](../aria-system-variables/index#aria_block_size) * [aria-checkpoint-interval](../aria-system-variables/index#aria_checkpoint_interval) * [aria-checkpoint-log-activity](../aria-system-variables/index#aria_checkpoint_log_activity) * [aria-encrypt-tables](../aria-system-variables/index#aria_encrypt_tables) * [aria-force-start-after-recovery-failures](../aria-system-variables/index#aria_force_start_after_recovery_failures) * [aria-group-commit](../aria-system-variables/index#aria_group_commit) * [aria-group-commit-interval](../aria-system-variables/index#aria_group_commit_interval) * [aria-log-file-size](../aria-system-variables/index#aria_log_file_size) * [aria-log-purge-type](../aria-system-variables/index#aria_log_purge_type) * [aria-max-sort-file-size](../aria-system-variables/index#aria_max_sort_file_size) * [aria-page-checksum](../aria-system-variables/index#aria_page_checksum) * [aria-pagecache-age-threshold](../aria-system-variables/index#aria_pagecache_age_threshold) * [aria-pagecache-buffer-size](../aria-system-variables/index#aria_pagecache_buffer_size) * [aria-pagecache-division-limit](../aria-system-variables/index#aria_pagecache_division_limit) * [aria-pagecache-file-hash-size](../aria-system-variables/index#aria_pagecache_file_hash_size) * [aria-recover](../aria-system-variables/index#aria_recover) * [aria-recover-options](../aria-system-variables/index#aria_recover_options) * [aria-repair-threads](../aria-system-variables/index#aria_repair_threads) * [aria-sort-buffer-size](../aria-system-variables/index#aria_sort_buffer_size) * [aria-stats-method](../aria-system-variables/index#aria_stats_method) * [aria-sync-log-dir](../aria-system-variables/index#aria_sync_log_dir) * [aria-used-for-temp-tables](../aria-system-variables/index#aria_used_for_temp_tables) * [deadlock-search-depth-long](../aria-system-variables/index#deadlock_search_depth_long) * [deadlock-search-depth-short](../aria-system-variables/index#deadlock_search_depth_short) * [deadlock-timeout-long](../aria-system-variables/index#deadlock_timeout_long) * [deadlock-timeout-short](../aria-system-variables/index#deadlock_timeout_short) ### MyRocks Storage Engine Options The options and system variables related to the [MyRocks](../myrocks/index) storage engine can be found [here](../myrocks-system-variables/index). ### S3 Storage Engine Options The options and system variables related to the [S3](../s3-storage-engine/index) storage engine can be found [here](../s3-storage-engine-system-variables/index). ### CONNECT Storage Engine Options The options related to the [CONNECT](../connect/index) storage engine are described below. #### CONNECT Storage Engine Options and System Variables Some options and system variables related to the [CONNECT](../connect/index) storage engine can be found [here](../connect-system-variables/index). Direct links to many of them can be found below. * [connect-class-path](../connect-system-variables/index#connect_class_path) * [connect-cond-push](../connect-system-variables/index#connect_cond_push) * [connect-conv-size](../connect-system-variables/index#connect_conv_size) * [connect-default-depth](../connect-system-variables/index#connect_default_depth) * [connect-default-prec](../connect-system-variables/index#connect_default_prec) * [connect-enable-mongo](../connect-system-variables/index#connect_enable_mongo) * [connect-exact-info](../connect-system-variables/index#connect_exact_info) * [connect-force\_bson](../connect-system-variables/index#connect_force_bson) * [connect-indx-map](../connect-system-variables/index#connect_indx_map) * [connect-java-wrapper](../connect-system-variables/index#connect_java_wrapper) * [connect-json-all-path](../connect-system-variables/index#connect_json_all_path) * [connect-json-grp-size](../connect-system-variables/index#connect_json_grp_size) * [connect-json-null](../connect-system-variables/index#connect_json_null) * [connect-jvm-path](../connect-system-variables/index#connect_jvm_path) * [connect-type-conv](../connect-system-variables/index#connect_type_conv) * [connect-use-tempfile](../connect-system-variables/index#connect_use_tempfile) * [connect-work-size](../connect-system-variables/index#connect_work_size) * [connect-xtrace](../connect-system-variables/index#connect_xtrace) ### Spider Storage Engine Options The options and system variables related to the [Spider](../spider/index) storage engine can be found [here](../spider-server-system-variables/index). ### Mroonga Storage Engine Options The options and system variables related to the [Mroonga](../mroonga/index) storage engine can be found [here](../mroonga-system-variables/index). ### TokuDB Storage Engine Options The options and system variables related to the [TokuDB](../tokudb/index) storage engine can be found [here](../tokudb-system-variables/index). Performance Schema Options -------------------------- The options related to the [Performance Schema](../performance-schema/index) are described below. #### `--performance-schema-consumer-events-stages-current` * **Commandline:** `--performance-schema-consumer-events-stages-current` * **Description:** Enable the [events-stages-current](../performance-schema-events_stages_current-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-stages-history` * **Commandline:** `--performance-schema-consumer-events-stages-history` * **Description:** Enable the [events-stages-history](../performance-schema-events_stages_history-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-stages-history-long` * **Commandline:** `--performance-schema-consumer-events-stages-history-long` * **Description:** Enable the [events-stages-history-long](../performance-schema-events_stages_history_long-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-statements-current` * **Commandline:** `--performance-schema-consumer-events-statements-current` * **Description:** Enable the [events-statements-current](../performance-schema-events_statements_current-table/index) consumer. Use `--skip-performance-schema-consumer-events-statements-current` to disable. * **Default:** `ON` --- #### `--performance-schema-consumer-events-statements-history` * **Commandline:** `--performance-schema-consumer-events-statements-history` * **Description:** Enable the [events-statements-history](../performance-schema-events_statements_history-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-statements-history-long` * **Commandline:** `--performance-schema-consumer-events-statements-history-long` * **Description:** Enable the [events-statements-history-long](../performance-schema-events_statements_history_long-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-waits-current` * **Commandline:** `--performance-schema-consumer-events-waits-current` * **Description:** Enable the [events-waits-current](../performance-schema-events_waits_current-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-waits-history` * **Commandline:** `--performance-schema-consumer-events-waits-history` * **Description:** Enable the [events-waits-history](../performance-schema-events_waits_history-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-events-waits-history-long` * **Commandline:** `--performance-schema-consumer-events-waits-history-long` * **Description:** Enable the [events-waits-history-long](../performance-schema-events_waits_history_long-table/index) consumer. * **Default:** `OFF` --- #### `--performance-schema-consumer-global-instrumentation` * **Commandline:** `--performance-schema-consumer-global-instrumentation` * **Description:** Enable the global-instrumentation consumer. Use `--skip-performance-schema-consumer-global-instrumentation` to disable. * **Default:** `ON` --- #### `--performance-schema-consumer-statements-digest` * **Commandline:** `--performance-schema-consumer-statements-digest` * **Description:** Enable the statements-digest consumer. Use `--skip-performance-schema-consumer-statements-digest` to disable. * **Default:** `ON` --- #### `--performance-schema-consumer-thread-instrumentation` * **Commandline:** `--performance-schema-consumer-thread-instrumentation` * **Description:** Enable the statements-thread-instrumentation. Use `--skip-performance-schema-thread-instrumentation` to disable. * **Default:** `ON` --- ### Performance Schema Options and System Variables Some options and system variables related to the [Performance Schema](../performance-schema/index) can be found [here](../performance-schema-system-variables/index). Direct links to many of them can be found below. * [performance-schema](../performance-schema-system-variables/index#performance_schema) * [performance-schema-accounts-size](../performance-schema-system-variables/index#performance_schema_accounts_size) * [performance-schema-digests-size](../performance-schema-system-variables/index#performance_schema_digests_size) * [performance-schema-events-stages-history-long-size](../performance-schema-system-variables/index#performance_schema_events_stages_history_long_size) * [performance-schema-events-stages-history-size](../performance-schema-system-variables/index#performance_schema_events_stages_history_size) * [performance-schema-events-statements-history-long-size](../performance-schema-system-variables/index#performance_schema_events_statements_history_long_size) * [performance-schema-events-statements-history-size](../performance-schema-system-variables/index#performance_schema_events_statements_history_size) * [performance-schema-events-waits-history-long-size](../performance-schema-system-variables/index#performance_schema_events_waits_history_long_size) * [performance-schema-events-waits-history-size](../performance-schema-system-variables/index#performance_schema_events_waits_history_size) * [performance-schema-hosts-size](../performance-schema-system-variables/index#performance_schema_hosts_size) * [performance-schema-max-cond-classes](../performance-schema-system-variables/index#performance_schema_max_cond_classes) * [performance-schema-max-cond-instances](../performance-schema-system-variables/index#performance_schema_max_cond_instances) * [performance-schema-max-digest-length](../performance-schema-system-variables/index#performance_schema_max_digest_length) * [performance-schema-max-file-classes](../performance-schema-system-variables/index#performance_schema_max_file_classes) * [performance-schema-max-file-handles](../performance-schema-system-variables/index#performance_schema_max_file_handles) * [performance-schema-max-file-instances](../performance-schema-system-variables/index#performance_schema_max_file_instances) * [performance-schema-max-mutex-classes](../performance-schema-system-variables/index#performance_schema_max_mutex_classes) * [performance-schema-max-mutex-instances](../performance-schema-system-variables/index#performance_schema_max_mutex_instances) * [performance-schema-max-rwlock-classes](../performance-schema-system-variables/index#performance_schema_max_rwlock_classes) * [performance-schema-max-rwlock-instances](../performance-schema-system-variables/index#performance_schema_max_rwlock_instances) * [performance-schema-max-socket-classes](../performance-schema-system-variables/index#performance_schema_max_socket_classes) * [performance-schema-max-socket-instances](../performance-schema-system-variables/index#performance_schema_max_socket_instances) * [performance-schema-max-stage-classes](../performance-schema-system-variables/index#performance_schema_max_stage_classes) * [performance-schema-max-statement-classes](../performance-schema-system-variables/index#performance_schema_max_statement_classes) * [performance-schema-max-table-handles](../performance-schema-system-variables/index#performance_schema_max_table_handles) * [performance-schema-max-table-instances](../performance-schema-system-variables/index#performance_schema_max_table_instances) * [performance-schema-max-thread-classes](../performance-schema-system-variables/index#performance_schema_max_thread_classes) * [performance-schema-max-thread-instances](../performance-schema-system-variables/index#performance_schema_max_thread_instances) * [performance-schema-session-connect-attrs-size](../performance-schema-system-variables/index#performance_schema_session_connect_attrs_size) * [performance-schema-setup-actors-size](../performance-schema-system-variables/index#performance_schema_setup_actors_size) * [performance-schema-setup-objects-size](../performance-schema-system-variables/index#performance_schema_setup_objects_size) * [performance-schema-users-size](../performance-schema-system-variables/index#performance_schema_users_size) Galera Cluster Options ---------------------- The options related to [Galera Cluster](../galera/index) are described below. #### `--wsrep-new-cluster` * **Commandline:** `--wsrep-new-cluster` * **Description:** Bootstrap a cluster. It works by overriding the current value of wsrep\_cluster\_address. It is recommended not to add this option to the config file as this will trigger bootstrap on every server start. --- ### Galera Cluster Options and System Variables Some options and system variables related to [Galera Cluster](../galera/index) can be found [here](../galera-cluster-system-variables/index). Direct links to many of them can be found below. * [wsrep-auto-increment-control](../galera-cluster-system-variables/index#wsrep_auto_increment_control) * [wsrep-causal-reads](../galera-cluster-system-variables/index#wsrep_causal_reads) * [wsrep-certify-nonPK](../galera-cluster-system-variables/index#wsrep_certify_nonpk) * [wsrep-cluster-address](../galera-cluster-system-variables/index#wsrep_cluster_address) * [wsrep-cluster-name](../galera-cluster-system-variables/index#wsrep_cluster_name) * [wsrep-convert-LOCK-to-trx](../galera-cluster-system-variables/index#wsrep_convert_lock_to_trx) * [wsrep-data-home-dir](../galera-cluster-system-variables/index#wsrep_data_home_dir) * [wsrep-dbug-option](../galera-cluster-system-variables/index#wsrep_dbug_option) * [wsrep-debug](../galera-cluster-system-variables/index#wsrep_debug) * [wsrep-desync](../galera-cluster-system-variables/index#wsrep_desync) * [wsrep-dirty-reads](../galera-cluster-system-variables/index#wsrep_dirty_reads) * [wsrep-drupal-282555-workaround](../galera-cluster-system-variables/index#wsrep_drupal_282555_workaround) * [wsrep-forced-binlog-format](../galera-cluster-system-variables/index#wsrep_forced_binlog_format) * [wsrep-gtid-domain-id](../galera-cluster-system-variables/index#wsrep_gtid_domain_id) * [wsrep-gtid-mode](../galera-cluster-system-variables/index#wsrep_gtid_mode) * [wsrep-ignore-apply-errors](../galera-cluster-system-variables/index#wsrep_ignore_apply_errors) * [wsrep-load-data-splitting](../galera-cluster-system-variables/index#wsrep_load_data_splitting) * [wsrep-log-conflicts](../galera-cluster-system-variables/index#wsrep_log_conflicts) * [wsrep-max-ws-rows](../galera-cluster-system-variables/index#wsrep_max_ws_rows) * [wsrep-max-ws-size](../galera-cluster-system-variables/index#wsrep_max_ws_size) * [wsrep-mode](../galera-cluster-system-variables/index#wsrep_mode) * [wsrep-mysql-replication-bundle](../galera-cluster-system-variables/index#wsrep_mysql_replication_bundle) * [wsrep-node-address](../galera-cluster-system-variables/index#wsrep_node_address) * [wsrep-node-incoming-address](../galera-cluster-system-variables/index#wsrep_node_incoming_address) * [wsrep-node-name](../galera-cluster-system-variables/index#wsrep_node_name) * [wsrep-notify-cmd](../galera-cluster-system-variables/index#wsrep_notify_cmd) * [wsrep-on](../galera-cluster-system-variables/index#wsrep_on) * [wsrep-OSU-method](../galera-cluster-system-variables/index#wsrep_osu_method) * [wsrep-provider](../galera-cluster-system-variables/index#wsrep_provider) * [wsrep-provider-options](../galera-cluster-system-variables/index#wsrep_provider_options) * [wsrep-recover](../galera-cluster-system-variables/index#wsrep_recover) * [wsrep-reject\_queries](../galera-cluster-system-variables/index#wsrep_reject_queries) * [wsrep-retry-autocommit](../galera-cluster-system-variables/index#wsrep_retry_autocommit) * [wsrep-slave-FK-checks](../galera-cluster-system-variables/index#wsrep_slave_fk_checks) * [wsrep-slave-threads](../galera-cluster-system-variables/index#wsrep_slave_threads) * [wsrep-slave-UK-checks](../galera-cluster-system-variables/index#wsrep_slave_uk_checks) * [wsrep-sr-store](../galera-cluster-system-variables/index#wsrep_sr_store) * [wsrep-sst-auth](../galera-cluster-system-variables/index#wsrep_sst_auth) * [wsrep-sst-donor](../galera-cluster-system-variables/index#wsrep_sst_donor) * [wsrep-sst-donor-rejects-queries](../galera-cluster-system-variables/index#wsrep_sst_donor_rejects_queries) * [wsrep-sst-method](../galera-cluster-system-variables/index#wsrep_sst_method) * [wsrep-sst-receive-address](../galera-cluster-system-variables/index#wsrep_sst_receive_address) * [wsrep-start-position](../galera-cluster-system-variables/index#wsrep_start_position) * [wsrep-strict-ddl](../galera-cluster-system-variables/index#wsrep_strict_ddl) * [wsrep-sync-wait](../galera-cluster-system-variables/index#wsrep_sync_wait) * [wsrep-trx\_fragment\_size](../galera-cluster-system-variables/index#wsrep_trx_fragment_size) * [wsrep-trx\_fragment\_unit](../galera-cluster-system-variables/index#wsrep_trx_fragment_unit) Options When Debugging mysqld ----------------------------- #### `--debug-assert-if-crashed-table` * **Description:** Do an assert in handler::print\_error() if we get a crashed table. --- #### `--debug-binlog-fsync-sleep` * **Description:** `--debug-binlog-fsync-sleep=#`If not set to zero, sets the number of micro-seconds to sleep after running fsync() on the [binary log](../binary-log/index) to flush transactions to disk. This can thus be used to artificially increase the perceived cost of such an fsync(). --- #### `--debug-crc-break` * **Description:** `--debug-crc-break=#`Call my\_debug\_put\_break\_here() if crc matches this number (for debug). --- #### `--debug-flush` * **Description:** Default debug log with flush after write. --- #### `--debug-no-sync` * **Description:** `debug-no-sync[=#]`Disables system sync calls. Only for running tests or debugging! --- #### `--debug-sync-timeout` * **Description:** `debug-sync-timeout[=#]`Enable the debug sync facility and optionally specify a default wait timeout in seconds. A zero value keeps the facility disabled. --- #### `--gdb` * **Description:** Set up signals usable for debugging. --- #### `--silent-startup` * **Description:** Don't print Notes to the [error log](../error-log/index) during startup. * **Introduced:** [MariaDB 10.1.8](https://mariadb.com/kb/en/mariadb-1018-release-notes/) --- #### `--sync-sys` * **Description:** Enable/disable system sync calls. Syncs should only be turned off (`--disable-sync-sys`) when running tests or debugging! Replaced by [debug-no-sync](#-debug-no-sync) from [MariaDB 5.5](../what-is-mariadb-55/index). * **Removed:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `--thread-alarm` * **Description:** Enable/disable system thread alarm calls. Should only be turned off (`--disable-thread-alarm`) when running tests or debugging! --- ### Debugging Options and System Variables * [core-file](../server-system-variables/index#core_file) * [debug](../server-system-variables/index#debug) * [debug-no-thread-alarm](../server-system-variables/index#debug_no_thread_alarm) Other Options ------------- #### `--allow-suspicious-udfs` * **Commandline:** `--allow-suspicious-udfs` * **Description:** Allows use of [user-defined functions](../user-defined-functions/index) consisting of only one symbol `x()` without corresponding `x_init()` or `x_deinit()`. That also means that one can load any function from any library, for example `exit()` from `libc.so`. Not recommended unless you require old UDF's with one symbol that cannot be recompiled --- #### `--bootstrap` * **Commandline:** `--bootstrap` * **Description:** Used by mysql installation scripts, such as [mysql\_install\_db](../mysql_install_db/index) to execute SQL scripts before any privilege or system tables exist. Do no use while an existing MariaDB instance is running. --- #### `--chroot` * **Commandline:** `--chroot=name` * **Description:** Chroot mysqld daemon during startup. --- #### `--des-key-file` * **Commandline:** `--des-key-file=name` * **Description:** Load keys for [des\_encrypt()](../des_encrypt/index) and des\_encrypt from given file. --- #### `--exit-info` * **Commandline:** `--exit-info[=#]` * **Description:** Used for debugging. Use at your own risk. --- #### `--getopt-prefix-matching` * **Commandline:** `--getopt-prefix-matching={0|1}` * **Description:** Makes it possible to disable historical "unambiguous prefix" matching in the command-line option parsing. * **Default:** TRUE * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `--help` * **Commandline:** `--help` * **Description:** Displays help with many commandline options described, and exits. --- #### `--log-ddl-recovery` * **Commandline:** `--log-ddl-recovery=name` * **Description:** Path to file used for recovery of DDL statements after a crash. * **Default Value:** `ddl-recover.log` * **Introduced:** [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/) #### `--log-short-format` * **Commandline:** `--log-short-format` * **Description:** Don't log extra information to update and [slow-query](../slow-query-log/index) logs. --- #### `--log-slow-file` * **Commandline:** `--log-slow-file=name` * **Description:** Log [slow queries](../slow-query-log/index) to given log file. Defaults logging to hostname-slow.log --- #### `--log-slow-time` * **Commandline:** `--log-slow-time=#` * **Description:** Log all queries that have taken more than [long-query-time](../server-system-variables/index#long_query_time) seconds to execute to the slow query log, if active. The argument will be treated as a decimal value with microsecond precision. --- #### `--log-tc` * **Commandline:** `--log-tc=name` * **Description:** Defines the path to the memory-mapped file-based transaction coordinator log, which is only used if the [binary log](../binary-log/index) is disabled. If you have two or more XA-capable storage engines enabled, then a transaction coordinator log must be available. See [Transaction Coordinator Log](../transaction-coordinator-log/index) for more information. Also see the the `[log\_tc\_size](../server-system-variables/index#log_tc_size)` system variable and the `[--tc-heuristic-recover](#-tc-heuristic-recover)` option. * **Default Value:** `tc.log` --- #### `--master-connect-retry` * **Commandline:** `--master-connect-retry=#` * **Description:** Deprecated in 5.1.17 and removed in 5.5. The number of seconds the slave thread will sleep before retrying to connect to the master, in case the master goes down or the connection is lost. --- #### `--memlock` * **Commandline:** `--memlock` * **Description:** Lock mysqld in memory. --- #### `--ndb-use-copying-alter-table` * **Commandline:** `--ndb-use-copying-alter-table` * **Description:** Force ndbcluster to always copy tables at alter table (should only be used if on-line alter table fails). --- #### `--one-thread` * **Commandline:** `--one-thread` * **Description:** (Deprecated): Only use one thread (for debugging under Linux). Use [thread-handling=no-threads](../thread-pool-system-and-status-variables/index#thread_handling) instead. * **Removed:** [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) --- #### `--plugin-load` * **Commandline:** `--plugin-load=name` * **Description:** This option can be used to configure the server to load specific [plugins](../mariadb-plugins/index). This option uses the following format: + Plugins can be specified in the format `name=library`, where `name` is the plugin name and `library` is the plugin library. This format installs a single plugin from the given plugin library. + Plugins can also be specified in the format `library`, where `library` is the plugin library. This format installs all plugins from the given plugin library. + Multiple plugins can be specified by separating them with semicolons. * Special care must be taken when specifying the `[--plugin-load](index#-plugin-load)` option multiple times, or when specifying both the `[--plugin-load](index#-plugin-load)` option and the `[--plugin-load-add](index#-plugin-load-add)` option together. The `[--plugin-load](index#-plugin-load)` option resets the plugin load list, and this can cause unexpected problems if you are not aware. The `[--plugin-load-add](index#-plugin-load-add)` option does **not** reset the plugin load list, so it is much safer to use. See [Plugin Overview: Specifying Multiple Plugin Load Options](../plugin-overview/index#specifying-multiple-plugin-load-options) for more information. * See [Plugin Overview: Installing a Plugin with Plugin Load Options](../plugin-overview/index#installing-a-plugin-with-plugin-load-options) for more information. --- #### `--plugin-load-add` * **Commandline:** `--plugin-load-add=name` * **Description:** This option can be used to configure the server to load specific [plugins](../mariadb-plugins/index). This option uses the following format: + Plugins can be specified in the format `name=library`, where `name` is the plugin name and `library` is the plugin library. This format installs a single plugin from the given plugin library. + Plugins can also be specified in the format `library`, where `library` is the plugin library. This format installs all plugins from the given plugin library. + Multiple plugins can be specified by separating them with semicolons. * Special care must be taken when specifying both the `[--plugin-load](index#-plugin-load)` option and the `[--plugin-load-add](index#-plugin-load-add)` option together. The `[--plugin-load](index#-plugin-load)` option resets the plugin load list, and this can cause unexpected problems if you are not aware. The `[--plugin-load-add](index#-plugin-load-add)` option does **not** reset the plugin load list, so it is much safer to use. See [Plugin Overview: Specifying Multiple Plugin Load Options](../plugin-overview/index#specifying-multiple-plugin-load-options) for more information. * See [Plugin Overview: Installing a Plugin with Plugin Load Options](../plugin-overview/index#installing-a-plugin-with-plugin-load-options) for more information. * **Introduced:** [MariaDB 10.0.1](https://mariadb.com/kb/en/mariadb-1001-release-notes/) --- #### `--port-open-timeout` * **Commandline:** `--port-open-timeout=#` * **Description:** Maximum time in seconds to wait for the port to become free. (Default: No wait). --- #### `--safe-user-create` * **Commandline:** `--safe-user-create` * **Description:** Don't allow new user creation by the user who has no write privileges to the [mysql.user](../mysqluser-table/index) table. --- #### `--safemalloc-mem-limit` * **Commandline:** `--safemalloc-mem-limit=#` * **Description:** Simulate memory shortage when compiled with the ``--`with-debug=full` option. --- #### `--show-slave-auth-info` * **Commandline:** `--show-slave-auth-info` * **Description:** Show user and password in SHOW SLAVE HOSTS on this master. --- #### `--skip-grant-tables` * **Commandline:** `--skip-grant-tables` * **Description:** Start without grant tables. This gives all users FULL ACCESS to all tables, which is useful in case of a lost root password. Use [mysqladmin flush-privileges](../mysqladmin/index), [mysqladmin reload](../mysqladmin/index) or [FLUSH PRIVILEGES](../flush/index) to resume using the grant tables. --- #### `--skip-host-cache` * **Commandline:** `--skip-host-cache` * **Description:** Don't cache host names. --- #### `--skip-partition` * **Commandline:** `--skip-partition`, `--disable-partition` * **Description:** Disables user-defined [partitioning](../managing-mariadb-partitioning/index). Previously partitioned tables cannot be accessed or modifed. Tables can still be seen with [SHOW TABLES](../show-tables/index) or by viewing the [INFORMATION\_SCHEMA.TABLES table](../information-schema-tables-table/index). Tables can be dropped with [DROP TABLE](../drop-table/index), but this only removes .frm files, not the associated .par files, which will need to be removed manually. --- #### `--skip-slave-start` * **Commandline:** `--skip-slave-start` * **Description:** If set, slave is not autostarted. --- #### `--skip-ssl` * **Commandline:** `--skip-ssl` * **Description:** Disable [TLS connections](../secure-connections-overview/index). --- #### `--skip-symlink` * **Commandline:** `--skip-symlink` * **Description:** Don't allow symlinking of tables. Deprecated and removed in [MariaDB 5.5](../what-is-mariadb-55/index). Use [symbolic-links](#-symbolic-links) with the `skip` [option prefix](#option-prefixes) instead. * **Removed:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `--skip-thread-priority` * **Commandline:** `--skip-thread-priority` * **Description:** Don't give threads different priorities. Deprecated and removed in [MariaDB 10.0](../what-is-mariadb-100/index). * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `--sql-bin-update-same` * **Commandline:** `--sql-bin-update-same=#` * **Description:** The update log was deprecated in version 5.0 and replaced by the [binary log](../binary-log/index), so this option did nothing since then. Deprecated and removed in [MariaDB 5.5](../what-is-mariadb-55/index). * **Removed:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `--ssl` * **Commandline:** `--ssl` * **Description:** Enable [TLS for connection](../secure-connections-overview/index) (automatically enabled with other flags). Disable with '``--`skip-ssl`'. --- #### `--stack-trace` * **Commandline:** `--stack-trace`, `--skip-stack-trace` * **Description:** Print a stack trace on failure. Enabled by default, disable with `-skip-stack-trace`. --- #### `--symbolic-links` * **Commandline:** `--symbolic-links` * **Description:** Enables symbolic link support. When set, the [have\_symlink](../server-system-variables/index#have_symlink) system variable shows as `YES`. Silently ignored in Windows. Use `--skip-symbolic-links` to disable. --- #### `--tc-heuristic-recover` * **Commandline:** `--tc-heuristic-recover=name` * **Description:** If [manual heuristic recovery](../heuristic-recovery-with-the-transaction-coordinator-log/index) is needed, this option defines the decision to use in the heuristic recovery process. Manual heuristic recovery may be needed if the [transaction coordination log](../transaction-coordinator-log/index) is missing or if it doesn't contain all prepared transactions. This option can be set to `OFF`, `COMMIT`, or `ROLLBACK`. The default is `OFF`. See also the `[--log-tc](index#-log-tc)` server option and the `[log\_tc\_size](../server-system-variables/index#log_tc_size)` system variable. --- #### `--temp-pool` * **Commandline:** `--temp-pool` * **Description:** Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file. Defaults to `1` until [MariaDB 10.5.6](https://mariadb.com/kb/en/mariadb-1056-release-notes/), use `--skip-temp-pool` to disable. Deprecated and defaults to `0` from [MariaDB 10.5.7](https://mariadb.com/kb/en/mariadb-1057-release-notes/), as benchmarking shows it causes a heavy mutex contention. --- #### `--test-expect-abort` * **Commandline:** `--test-expect-abort` * **Description:** Expect that server aborts with 'abort'; Don't write out server variables on 'abort'. Useful only for test scripts. --- #### `--test-ignore-wrong-options` * **Commandline:** `--test-ignore-wrong-options` * **Description:** Ignore wrong enums values in command line arguments. Useful only for test scripts. --- #### `--user` * **Commandline:** `--user=name` * **Description:** Run mysqld daemon as user. --- #### `--verbose` * **Commandline:** `-v`, `--verbose` * **Description:** Used with [help](#help) option for detailed help. --- Other Options and System Variables ---------------------------------- * [allow-suspicious-udfs](../server-system-variables/index#allow-suspicious-udfs) * [automatic-sp-privileges](../server-system-variables/index#automatic_sp_privileges) * [back-log](../server-system-variables/index#back_log) * [basedir](../server-system-variables/index#basedir) * [check-constraint-checks](../server-system-variables/index#check_constraint_checks) * [column-compression-threshold](../storage-engine-independent-column-compression/index#column_compression_threshold) * [column-compression-zlib-level](../storage-engine-independent-column-compression/index#column_compression_zlib_level) * [column-compression-zlib-strategy](../storage-engine-independent-column-compression/index#column_compression_zlib_strategy) * [column-compression-zlib-wrap](../storage-engine-independent-column-compression/index#column_compression_zlib_wrap) * [completion-type](../server-system-variables/index#completion_type) * [connect-timeout](../server-system-variables/index#connect_timeout) * [datadir](../server-system-variables/index#datadir) * [date-format](../server-system-variables/index#date_format) * [datetime-format](../server-system-variables/index#datetime_format) * [deadlock-search-depth-long](../aria-server-system-variables/index#deadlock_search_depth_long) * [deadlock-search-depth-short](../aria-server-system-variables/index#deadlock_search_depth_short) * [deadlock-timeout-long](../aria-server-system-variables/index#deadlock_timeout_long) * [deadlock-timeout-short](../aria-server-system-variables/index#deadlock_timeout_short) * [default-password-lifetime](../server-system-variables/index#default_password_lifetime) * [default-regex-flags](../server-system-variables/index#default_regex_flags) * [default-storage-engine](../server-system-variables/index#default_storage_engine) * [default-table-type](../server-system-variables/index#default_table_type) * [delay-key-write](../server-system-variables/index#delay_key_write) * [disconnect-on-expired-password](../server-system-variables/index#disconnect_on_expired_password) * [div-precision-increment](../server-system-variables/index#div_precision_increment) * [enable-named-pipe](../server-system-variables/index#named_pipe) * [encrypt-binlog](../server-system-variables/index#encrypt_binlog) * [encrypt-tmp-disk-tables](../server-system-variables/index#encrypt_tmp_disk_tables) * [encrypt-tmp-files](../server-system-variables/index#encrypt_tmp_files) * [encryption-algorithm](../server-system-variables/index#encryption_algorithm) * [engine-condition-pushdown](../server-system-variables/index#engine_condition_pushdown) * [eq-range-index-dive-limit](../server-system-variables/index#eq_range_index_dive_limit) * [event-scheduler](../server-system-variables/index#event_scheduler) * [expire-logs-days](../server-system-variables/index#expire_logs_days) * [explicit-defaults-for-timestamp](../server-system-variables/index#explicit_defaults_for_timestamp) * [extra-max-connections](../thread-pool-system-and-status-variables/index#extra_max_connections) * [extra-port](../thread-pool-system-and-status-variables/index#extra_port) * [flush](../server-system-variables/index#flush) * [flush-time](../server-system-variables/index#flush_time) * [ft-boolean-syntax](../server-system-variables/index#ft_boolean_syntax) * [ft-max-word-len](../server-system-variables/index#ft_max_word_len) * [ft-min-word-len](../server-system-variables/index#ft_min_word_len) * [ft-query-expansion-limit](../server-system-variables/index#ft_query_expansion_limit) * [ft-stopword-file](../server-system-variables/index#ft_stopword_file) * [general-log](../server-system-variables/index#general_log) * [general-log-file](../server-system-variables/index#general_log_file) * [group-concat-max-len](../server-system-variables/index#group_concat_max_len) * [histogram-size](../server-system-variables/index#histogram_size) * [histogram-type](../server-system-variables/index#histogram_type) * [host-cache-size](../server-system-variables/index#host_cache_size) * [idle-readonly-transaction-timeout](../server-system-variables/index#idle_readonly_transaction_timeout) * [idle-transaction-timeout](../server-system-variables/index#idle_transaction_timeout) * [idle-write-transaction-timeout](../server-system-variables/index#idle_write_transaction_timeout) * [ignore-db-dirs](../server-system-variables/index#ignore_db_dirs) * [in-predicate-conversion-threshold](../server-system-variables/index#in_predicate_conversion_threshold) * [init-connect](../server-system-variables/index#init_connect) * [init-file](../server-system-variables/index#init_file) * [interactive-timeout](../server-system-variables/index#interactive_timeout) * [large-pages](../server-system-variables/index#large_pages) * [local-infile](../server-system-variables/index#local_infile) * [lock-wait-timeout](../server-system-variables/index#lock_wait_timeout) * [log](../server-system-variables/index#log) * [log-disabled-statements](../server-system-variables/index#log_disabled_statements) * [log-error](../server-system-variables/index#log_error) * [log-output](../server-system-variables/index#log_output) * [log-queries-not-using-indexes](../server-system-variables/index#log_queries_not_using_indexes) * [log-slow-admin-statements](../server-system-variables/index#log_slow_admin_statements) * [log-slow-disabled-statements](../server-system-variables/index#log_slow_disabled_statements) * [log-slow-filter](../server-system-variables/index#log_slow_filter) * [log-slow-queries](../server-system-variables/index#log_slow_queries) * [log-slow-rate-limit](../server-system-variables/index#log_slow_rate_limit) * [log-slow-verbosity](../server-system-variables/index#log_slow_verbosity) * [log-tc-size](../server-system-variables/index#log_tc_size) * [log-warnings](../server-system-variables/index#log_warnings) * [long-query-time](../server-system-variables/index#long_query_time) * [low-priority-updates](../server-system-variables/index#low_priority_updates) * [lower-case-table-names](../server-system-variables/index#lower_case_table_names) * [max-allowed-packet](../server-system-variables/index#max_allowed_packet) * [max-connections](../server-system-variables/index#max_connections) * [max-connect-errors](../server-system-variables/index#max_connect_errors) * [max-delayed-threads](../server-system-variables/index#max_delayed_threads) * [max-digest-length](../server-system-variables/index#max_digest_length%22) * [max-error-count](../server-system-variables/index#max_error_count) * [max-length-for-sort-data](../server-system-variables/index#max_length_for_sort_data) * [max-long-data-size](../server-system-variables/index#max_long_data_size) * [max-password-errors](../server-system-variables/index#max_password_errors) * [max-prepared-stmt-count](../server-system-variables/index#max_prepared_stmt_count) * [max-recursive-iterations](../server-system-variables/index#max_recursive_iterations) * [max-rowid-filter-size](../server-system-variables/index#max_rowid_filter_size) * [max-session-mem-used](../server-system-variables/index#max_session_mem_used) * [max-sp-recursion-depth](../server-system-variables/index#max_sp_recursion_depth) * [max-statement-time](../server-system-variables/index#max_statement_time) * [max-tmp-tables](../server-system-variables/index#max_tmp_tables) * [max-user-connections](../server-system-variables/index#max_user_connections) * [max-write-lock-count](../server-system-variables/index#max_write_lock_count) * [metadata-locks-cache-size](../server-system-variables/index#metadata_locks_cache_size) * [metadata-locks-hash-instances](../server-system-variables/index#metadata_locks_hash_instances) * [min-examined-row-limit](../server-system-variables/index#min_examined_row_limit) * [mrr-buffer-size](../server-system-variables/index#mrr_buffer_size) * [multi-range-count](../server-system-variables/index#multi_range_count) * [--mysql56-temporal-format](../server-system-variables/index#mysql56_temporal_format) * [net-buffer-length](../server-system-variables/index#net_buffer_length) * [net-read-timeout](../server-system-variables/index#net_read_timeout) * [net-retry-count](../server-system-variables/index#net_retry_count) * [net-write-timeout](../server-system-variables/index#net_write_timeout) * [open-files-limit](../server-system-variables/index#open_files_limit) * [pid-file](../server-system-variables/index#pid_file) * [plugin-dir](../server-system-variables/index#plugin_dir) * [plugin-maturity](../server-system-variables/index#plugin_maturity) * [port](../server-system-variables/index#port) * [preload-buffer-size](../server-system-variables/index#preload_buffer_size) * [profiling-history-size](../server-system-variables/index#profiling_history_size) * [progress-report-time](../server-system-variables/index#progress_report_time) * [proxy-protocol-networks](../server-system-variables/index#proxy_protocol_networks) * [query-cache-limit](../server-system-variables/index#query_cache_limit) * [query-cache-min-res-unit](../server-system-variables/index#query_cache_min_res_unit) * [query-cache-strip-comments](../server-system-variables/index#query_cache_strip_comments) * [query-cache-wlock-invalidate](../server-system-variables/index#query_cache_wlock_invalidate) * [read-rnd-buffer-size](../server-system-variables/index#read_rnd_buffer_size) * [read-only](../server-system-variables/index#read_only) * [require-secure-transport](../server-system-variables/index#require_secure_transport) * [safe-show-database](../server-system-variables/index#safe_show_database) * [secure-auth](../server-system-variables/index#secure_auth) * [secure-file-priv](../server-system-variables/index#secure_file_priv) * [secure-timestamp](../server-system-variables/index#secure_timestamp) * [session-track-schema](../server-system-variables/index#session_track_schema) * [session-track-state-change](../server-system-variables/index#session_track_state_change) * [session-track-system-variables](../server-system-variables/index#session_track_system_variables) * [session-track-transaction-info](../server-system-variables/index#session_track_transaction_info) * [skip-automatic-sp-privileges](../server-system-variables/index#automatic_sp_privileges) * [skip-external-locking](../server-system-variables/index#skip_external_locking) * [skip-large-pages](../server-system-variables/index#large_pages) * [skip-log-error](../server-system-variables/index#log_error) * [skip-name-resolve](../server-system-variables/index#skip_name_resolve) * [skip-networking](../server-system-variables/index#skip_networking) * [skip-show-database](../server-system-variables/index#skip_show_database) * [slow-launch-time](../server-system-variables/index#slow_launch_time) * [slow-query-log](../server-system-variables/index#slow_query_log) * [slow-query-log-file](../server-system-variables/index#slow_query_log_file) * [socket](../server-system-variables/index#socket) * [sort-buffer-size](../server-system-variables/index#sort_buffer_size) * [sql-if-exists](../server-system-variables/index#sql_if_exists) * [sql-mode](../server-system-variables/index#sql_mode) * [ssl-ca](../ssl-server-system-variables/index#ssl_ca) * [ssl-capath](../ssl-server-system-variables/index#ssl_capath) * [ssl-cert](../ssl-server-system-variables/index#ssl_cert) * [ssl-cipher](../ssl-server-system-variables/index#ssl_cipher) * [ssl-crl](../ssl-server-system-variables/index#ssl_crl) * [ssl-crlpath](../ssl-server-system-variables/index#ssl_crlpath) * [ssl-key](../ssl-server-system-variables/index#ssl_key) * [standards\_compliant\_cte](../server-system-variables/index#standards_compliant_cte) * [stored-program-cache](../server-system-variables/index#stored_program_cache) * [strict\_password\_validation](../server-system-variables/index#strict_password_validation) * [sync-frm](../server-system-variables/index#sync_frm) * [system-versioning-alter-history](../system-versioned-tables/index#system_versioning_alter_history) * [system-versioning-asof](../system-versioned-tables/index#system_versioning_asof) * [system-versioning-innodb-algorithm-simple](../system-versioned-tables/index#system_versioning_innodb_algorithm_simple) * [table-lock-wait-timeout](../server-system-variables/index#table_lock_wait_timeout) * [tcp-keepalive-interval](../server-system-variables/index#tcp_keepalive_interval) * [tcp-keepalive-probes](../server-system-variables/index#tcp_keepalive_probes) * [tcp-keepalive-time](../server-system-variables/index#tcp_keepalive_time) * [tcp-nodelay](../server-system-variables/index#tcp_nodelay) * [thread-cache-size](../server-system-variables/index#thread_cache_size) * [thread-concurrency](../server-system-variables/index#thread_concurrency) * [thread-handling](../server-system-variables/index#thread_handling) * [thread-pool-dedicated-listener](../thread-pool-system-and-status-variables/index#thread_pool_dedicated_listener) * [thread-pool-exact-stats](../thread-pool-system-and-status-variables/index#thread_pool_exact_stats) * [thread-pool-idle-timeout](../thread-pool-system-and-status-variables/index#thread_pool_idle_timeout) * [thread-pool-max-threads](../thread-pool-system-and-status-variables/index#thread_pool_max_threads) * [thread-pool-min-threads](../thread-pool-system-and-status-variables/index#thread_pool_min_threads) * [thread-pool-oversubscribe](../thread-pool-system-and-status-variables/index#thread_pool_oversubscribe) * [thread-pool-prio-kickup-timer](../thread-pool-system-and-status-variables/index#thread_pool_prio_kickup_timer) * [thread-pool-priority](../thread-pool-system-and-status-variables/index#thread_pool_priority) * [thread-pool-size](../thread-pool-system-and-status-variables/index#thread_pool_size) * [thread-pool-stall-limit](../thread-pool-system-and-status-variables/index#thread_pool_stall_limit) * [thread-stack](../server-system-variables/index#thread_stack) * [timed-mutexes](../server-system-variables/index#timed_mutexes) * [time-format](../server-system-variables/index#time_format) * [tls-version](../ssl-server-system-variables/index#tls_version) * [tmpdir](../server-system-variables/index#tmpdir) * [transaction-isolation](../server-system-variables/index#tx_isolation) * [transaction-alloc-block-size](../server-system-variables/index#transaction_alloc_block_size) * [transaction-prealloc-size](../server-system-variables/index#transaction_prealloc_size) * [transaction-read-only](../server-system-variables/index#tx_read_only) * [updatable-views-with-limit](../server-system-variables/index#updatable_views_with_limit) * [userstat](../server-system-variables/index#userstat) * [version](../server-system-variables/index#version) * [wait-timeout](../server-system-variables/index#wait_timeout) Authentication Plugins - Options and System Variables ----------------------------------------------------- ### Authentication Plugin - `ed25519` The options related to the `[ed25519](../authentication-plugin-ed25519/index)` authentication plugin can be found [here](../authentication-plugin-ed25519/index#options). ### Authentication Plugin - `gssapi` The system variables related to the `[gssapi](../authentication-plugin-gssapi/index)` authentication plugin can be found [here](../authentication-plugin-gssapi/index#system-variables). The options related to the `[gssapi](../authentication-plugin-gssapi/index)` authentication plugin can be found [here](../authentication-plugin-gssapi/index#options). ### Authentication Plugin - `named_pipe` The options related to the `[named\_pipe](../authentication-plugin-named-pipe/index)` authentication plugin can be found [here](../authentication-plugin-named-pipe/index#options). ### Authentication Plugin - `pam` The system variables related to the `[pam](../authentication-plugin-pam/index)` authentication plugin can be found [here](../authentication-plugin-pam/index#system-variables). The options related to the `[pam](../authentication-plugin-pam/index)` authentication plugin can be found [here](../authentication-plugin-pam/index#options). ### Authentication Plugin - `unix_socket` The options related to the `[unix\_socket](../authentication-plugin-unix-socket/index)` authentication plugin can be found [here](../authentication-plugin-unix-socket/index#options). Encryption Plugins - Options and System Variables ------------------------------------------------- ### Encryption Plugin - `aws_key_management` The system variables related to the `[aws\_key\_management](../aws-key-management-encryption-plugin/index)` encryption plugin can be found [here](../aws-key-management-encryption-plugin/index#system-variables). The options elated to the `[aws\_key\_management](../aws-key-management-encryption-plugin/index)` encryption plugin can be found [here](../aws-key-management-encryption-plugin/index#options). ### Encryption Plugin - `file_key_management` The system variables related to the `[file\_key\_management](../file-key-management-encryption-plugin/index)` encryption plugin can be found [here](../file-key-management-encryption-plugin/index#system-variables). The options related to the `[file\_key\_management](../file-key-management-encryption-plugin/index)` encryption plugin can be found [here](../file-key-management-encryption-plugin/index#options). Password Validation Plugins - Options and System Variables ---------------------------------------------------------- ### Password Validation Plugin - `simple_password_check` The system variables related to the `[simple\_password\_check](../simple_password_check/index)` password validation plugin can be found [here](../simple_password_check/index#system-variables). The options related to the `[simple\_password\_check](../simple_password_check/index)` password validation plugin can be found [here](../simple_password_check/index#options). ### Password Validation Plugin - `cracklib_password_check` The system variables related to the `[cracklib\_password\_check](../cracklib_password_check/index)` password validation plugin can be found [here](../cracklib_password_check/index#system-variables). The options related to the `[cracklib\_password\_check](../cracklib_password_check/index)` password validation plugin can be found [here](../cracklib_password_check/index#options). Audit Plugins - Options and System Variables -------------------------------------------- ### Audit Plugin - `server_audit` Options and system variables related to the `[server\_audit](../mariadb-audit-plugin/index)` audit plugin can be found [here](../server_audit-system-variables/index). ### Audit Plugin - `SQL_ERROR_LOG` The system variables related to the `[SQL\_ERROR\_LOG](../sql-error-log-plugin/index)` audit plugin can be found [here](../sql-error-log-plugin/index#system-variables). The options related to the `[SQL\_ERROR\_LOG](../sql-error-log-plugin/index)` audit plugin can be found [here](../sql-error-log-plugin/index#options). ### Audit Plugin - QUERY\_RESPONSE\_TIME\_AUDIT The options related to the `[QUERY\_RESPONSE\_TIME\_AUDIT](../query-response-time-plugin/index)` audit plugin can be found [here](../query-response-time-plugin/index#options). Daemon Plugins - Options and System Variables --------------------------------------------- ### Daemon Plugin - `handlersocket` The options for the HandlerSocket plugin are all described on the [HandlerSocket Configuration Option](../handlersocket-configuration-options/index) page. Information Schema Plugins - Options and System Variables --------------------------------------------------------- ### Information Schema Plugin - `DISKS` The options related to the `[DISKS](../disks-plugin/index)` information schema plugin can be found [here](../disks-plugin/index#options). ### Information Schema Plugin - `feedback` The system variables related to the `[feedback](../feedback-plugin/index)` plugin can be found [here](../feedback-plugin/index#system-variables). The options related to the `[feedback](../feedback-plugin/index)` plugin can be found [here](../feedback-plugin/index#options). ### Information Schema Plugin - `LOCALES` The options related to the `[LOCALES](../locales-plugin/index)` information schema plugin can be found [here](../locales-plugin/index#options). ### Information Schema Plugin - `METADATA_LOCK_INFO` The options related to the `[METADATA\_LOCK\_INFO](../metadata_lock_info/index)` information schema plugin can be found [here](../metadata_lock_info/index#options). ### Information Schema Plugin - `QUERY_CACHE_INFO` The options related to the `[QUERY\_CACHE\_INFO](../query-cache-information-plugin/index)` information schema plugin can be found [here](../query-cache-information-plugin/index#options). ### Information Schema Plugin - `QUERY_RESPONSE_TIME` The system variables related to the `[QUERY\_RESPONSE\_TIME](../query-response-time-plugin/index)` information schema plugin can be found [here](../query-response-time-plugin/index#system-variables). The options related to the `[QUERY\_RESPONSE\_TIME](../query-response-time-plugin/index)` information schema plugin can be found [here](../query-response-time-plugin/index#options). ### Information Schema Plugin - `user_variables` The options related to the `[user\_variables](../user-variables-plugin/index)` information schema plugin can be found [here](../user-variables-plugin/index#options). ### Information Schema Plugin - `WSREP_MEMBERSHIP` The options related to the `[WSREP\_MEMBERSHIP](../wsrep_info-plugin/index)` information schema plugin can be found [here](../wsrep_info-plugin/index#options). ### Information Schema Plugin - `WSREP_STATUS` The options related to the `[WSREP\_STATUS](../wsrep_info-plugin/index)` information schema plugin can be found [here](../wsrep_info-plugin/index#options). Replication Plugins - Options and System Variables -------------------------------------------------- ### Replication Plugin - `rpl_semi_sync_master` The system variables related to the `[rpl\_semi\_sync\_master](../semisynchronous-replication/index)` replication plugin can be found [here](../semisynchronous-replication/index#system-variables). The options related to the `[rpl\_semi\_sync\_master](../semisynchronous-replication/index)` replication plugin can be found [here](../semisynchronous-replication/index#options). ### Replication Plugin - `rpl_semi_sync_slave` The system variables related to the `[rpl\_semi\_sync\_slave](../semisynchronous-replication/index)` replication plugin can be found [here](../semisynchronous-replication/index#system-variables). The options related to the `[rpl\_semi\_sync\_slave](../semisynchronous-replication/index)` replication plugin can be found [here](../semisynchronous-replication/index#options). Default Values -------------- You can verify the default values for an option by doing: ``` mysqld --no-defaults --help --verbose ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb SET ROLE SET ROLE ======== Syntax ------ ``` SET ROLE { role | NONE } ``` Description ----------- The `SET ROLE` statement enables a [role](../roles/index), along with all of its associated permissions, for the current session. To unset a role, use `NONE` . If a role that doesn't exist, or to which the user has not been assigned, is specified, an `ERROR 1959 (OP000): Invalid role specification` error occurs. An automatic SET ROLE is implicitly performed when a user connects if that user has been assigned a default role. See [SET DEFAULT ROLE](../set-default-role/index). Example ------- ``` SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | NULL | +--------------+ SET ROLE staff; SELECT CURRENT_ROLE; +--------------+ | CURRENT_ROLE | +--------------+ | staff | +--------------+ SET ROLE NONE; SELECT CURRENT_ROLE(); +----------------+ | CURRENT_ROLE() | +----------------+ | NULL | +----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema INNODB_SYS_DATAFILES Table Information Schema INNODB\_SYS\_DATAFILES Table =============================================== **MariaDB until [10.5](../what-is-mariadb-105/index)**The `INNODB_SYS_DATAFILES` table was added in [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/), and removed in [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/). The [Information Schema](../information_schema/index) `INNODB_SYS_DATAFILES` table contains information about InnoDB datafile paths. It was intended to provide metadata for tablespaces inside InnoDB tables, which was never implemented in MariaDB and was removed in [MariaDB 10.6](../what-is-mariadb-106/index). The `PROCESS` [privilege](../grant/index) is required to view the table. It contains the following columns: | Column | Description | | --- | --- | | `SPACE` | Numeric tablespace. Matches the [INNODB\_SYS\_TABLES.SPACE](../information-schema-innodb_sys_tables-table/index) value. | | `PATH` | Tablespace datafile path. | Example ------- ``` SELECT * FROM INNODB_SYS_DATAFILES; +-------+--------------------------------+ | SPACE | PATH | +-------+--------------------------------+ | 19 | ./test/t2.ibd | | 20 | ./test/t3.ibd | ... | 68 | ./test/animals.ibd | | 69 | ./test/animal_count.ibd | | 70 | ./test/t.ibd | +-------+--------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MyRocks System Variables MyRocks System Variables ======================== This page documents system variables related to the [MyRocks](../myrocks/index) storage engine. See [Server System Variables](../server-system-variables/index) for a complete list of system variables and instructions on setting them. See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `rocksdb_access_hint_on_compaction_start` * **Description:** DBOptions::access\_hint\_on\_compaction\_start for RocksDB. Specifies the file access pattern, applied to all input files, once a compaction starts. * **Commandline:** `--rocksdb-access-hint-on-compaction-start=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `0` to `3` --- #### `rocksdb_advise_random_on_open` * **Description:** DBOptions::advise\_random\_on\_open for RocksDB. * **Commandline:** `--rocksdb-advise-random-on-open={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_allow_concurrent_memtable_write` * **Description:** DBOptions::allow\_concurrent\_memtable\_write for RocksDB. * **Commandline:** `--rocksdb-allow-concurrent-memtable-write={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_allow_mmap_reads` * **Description:** DBOptions::allow\_mmap\_reads for RocksDB * **Commandline:** `--rocksdb-allow-mmap-reads={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_allow_mmap_writes` * **Description:** DBOptions::allow\_mmap\_writes for RocksDB * **Commandline:** `--rocksdb-allow-mmap-writes={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_allow_to_start_after_corruption` * **Description:** Allow server still to start successfully even if RocksDB corruption is detected. * **Commandline:** `--rocksdb-allow-to-start-after-corruption={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.15](https://mariadb.com/kb/en/mariadb-10215-release-notes/) --- #### `rocksdb_background_sync` * **Description:** Turns on background syncs for RocksDB * **Commandline:** `--rocksdb-background-sync={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` * **Removed:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_base_background_compactions` * **Description:** DBOptions::base\_background\_compactions for RocksDB * **Commandline:** `--rocksdb-base-background-compactions=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `-1` to `64` * **Removed:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_blind_delete_primary_key` * **Description:** Deleting rows by primary key lookup, without reading rows (Blind Deletes). Blind delete is disabled if the table has secondary key. * **Commandline:** `--rocksdb-blind-delete-primary-key={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_block_cache_size` * **Description:** Block\_cache size for RocksDB (block size 1024) * **Commandline:** `--rocksdb-block-cache-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `536870912` * **Range:** `1024` to `9223372036854775807` To see the statistics of block cache usage, check `SHOW ENGINE ROCKSDB STATUS` output (search for lines starting with `rocksdb.block.cache`). One can check the size of data of the block cache in `DB_BLOCK_CACHE_USAGE` column of the `INFORMATION_SCHEMA.ROCKSDB_DBSTATS` table. --- #### `rocksdb_block_restart_interval` * **Description:** BlockBasedTableOptions::block\_restart\_interval for RocksDB * **Commandline:** `--rocksdb-block-restart-interval=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `16` * **Range:** `1` to `2147483647` --- #### `rocksdb_block_size` * **Description:** BlockBasedTableOptions::block\_size for RocksDB * **Commandline:** `--rocksdb-block-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `4096` * **Range:** `1` to `18446744073709551615` --- #### `rocksdb_block_size_deviation` * **Description:** BlockBasedTableOptions::block\_size\_deviation for RocksDB * **Commandline:** `--rocksdb-block-size-deviation=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `10` * **Range:** `0` to `2147483647` --- #### `rocksdb_bulk_load` * **Description:** Use bulk-load mode for inserts. This disables unique\_checks and enables rocksdb\_commit\_in\_the\_middle. * **Commandline:** `--rocksdb-bulk-load={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_bulk_load_allow_sk` * **Description:** Allow bulk loading of sk keys during bulk-load. Can be changed only when bulk load is disabled. * **Commandline:** `--rocksdb-bulk-load_allow_sk={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_bulk_load_allow_unsorted` * **Description:** Allow unsorted input during bulk-load. Can be changed only when bulk load is disabled. * **Commandline:** `--rocksdb-bulk-load_allow_unsorted={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_bulk_load_size` * **Description:** Maximum number of records in a batch for bulk-load mode. * **Commandline:** `--rocksdb-bulk-load-size=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1000` * **Range:** `1` to `1073741824` --- #### `rocksdb_bytes_per_sync` * **Description:** DBOptions::bytes\_per\_sync for RocksDB. * **Commandline:** `--rocksdb-bytes-per-sync=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_cache_dump` * **Description:** Include RocksDB block cache content in core dump. * **Commandline:** `--rocksdb-cache-dump={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_cache_high_pri_pool_ratio` * **Description:** Specify the size of block cache high-pri pool. * **Commandline:** `--rocksdb-cache-high-pri-pool-ratio=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `double` * **Default Value:** `0.000000` * **Range:** `0` to `1` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_cache_index_and_filter_blocks` * **Description:** BlockBasedTableOptions::cache\_index\_and\_filter\_blocks for RocksDB. * **Commandline:** `--rocksdb-cache-index-and-filter-blocks={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_cache_index_and_filter_with_high_priority` * **Description:** cache\_index\_and\_filter\_blocks\_with\_high\_priority for RocksDB. * **Commandline:** `--rocksdb-cache-index-and-filter-with-high-priority={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_checksums_pct` * **Description:** Percentage of rows to be checksummed. * **Commandline:** `--rocksdb-checksums-pct=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `100` * **Range:** `0` to `100` --- #### `rocksdb_collect_sst_properties` * **Description:** Enables collecting SST file properties on each flush. * **Commandline:** `--rocksdb-collect-sst-properties={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_commit_in_the_middle` * **Description:** Commit rows implicitly every rocksdb\_bulk\_load\_size, on bulk load/insert, update and delete. * **Commandline:** `--rocksdb-commit-in-the-middle={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_commit_time_batch_for_recovery` * **Description:** TransactionOptions::commit\_time\_batch\_for\_recovery for RocksDB. * **Commandline:** `--rocksdb-commit-time-batch-for-recovery={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_compact_cf` * **Description:** Compact column family. * **Commandline:** `--rocksdb-compact-cf=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_compaction_readahead_size` * **Description:** DBOptions::compaction\_readahead\_size for RocksDB. * **Commandline:** `--rocksdb-compaction-readahead-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_compaction_sequential_deletes` * **Description:** RocksDB will trigger compaction for the file if it has more than this number sequential deletes per window. * **Commandline:** `--rocksdb-compaction-sequential-deletes=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `2000000` --- #### `rocksdb_compaction_sequential_deletes_count_sd` * **Description:** Counting SingleDelete as rocksdb\_compaction\_sequential\_deletes. * **Commandline:** `--rocksdb-compaction-sequential-deletes-count-sd={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_compaction_sequential_deletes_file_size` * **Description:** Minimum file size required for compaction\_sequential\_deletes. * **Commandline:** `--rocksdb-compaction-sequential-deletes-file-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `-1` to `9223372036854775807` --- #### `rocksdb_compaction_sequential_deletes_window` * **Description:** Size of the window for counting rocksdb\_compaction\_sequential\_deletes. * **Commandline:** `--rocksdb-compaction-sequential-deletes-window=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `2000000` --- #### `rocksdb_concurrent_prepare` * **Description:** DBOptions::concurrent\_prepare for RocksDB. * **Commandline:** `--rocksdb-coconcurrent-prepare={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `1` * **Removed:** [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.15](https://mariadb.com/kb/en/mariadb-10215-release-notes/) --- #### `rocksdb_create_checkpoint` * **Description:** Checkpoint directory. * **Commandline:** `--rocksdb-create-checkpoint=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_create_if_missing` * **Description:** DBOptions::create\_if\_missing for RocksDB. * **Commandline:** `--rocksdb-create-if-missing={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_create_missing_column_families` * **Description:** DBOptions::create\_missing\_column\_families for RocksDB. * **Commandline:** `--rocksdb-create-missing-column-families={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_datadir` * **Description:** RocksDB data directory. * **Commandline:** `--rocksdb-datadir[=value]` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** `./#rocksdb` --- #### `rocksdb_db_write_buffer_size` * **Description:** DBOptions::db\_write\_buffer\_size for RocksDB. * **Commandline:** `--rocksdb-db-write-buffer-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_deadlock_detect` * **Description:** Enables deadlock detection. * **Commandline:** `--rocksdb-deadlock-detect={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_deadlock_detect_depth` * **Description:** Number of transactions deadlock detection will traverse through before assuming deadlock. * **Commandline:** `--rocksdb-deadlock-detect-depth=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `50` * **Range:** `2` to `18446744073709551615` --- #### `rocksdb_debug_manual_compaction_delay` * **Description:** For debugging purposes only. Sleeping specified seconds for simulating long running compactions. * **Commandline:** `--rocksdb-debug_manual_compaction_delay=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `4294967295` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_debug_optimizer_no_zero_cardinality` * **Description:** If cardinality is zero, override it with some value. * **Commandline:** `--rocksdb-debug-optimizer-no-zero-cardinality={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_debug_ttl_ignore_pk` * **Description:** For debugging purposes only. If true, compaction filtering will not occur on PK TTL data. This variable is a no-op in non-debug builds. * **Commandline:** `--rocksdb-debug-ttl-ignore-pk={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_debug_ttl_read_filter_ts` * **Description:** For debugging purposes only. Overrides the TTL read filtering time to time + debug\_ttl\_read\_filter\_ts. A value of 0 denotes that the variable is not set. This variable is a no-op in non-debug builds. * **Commandline:** `--rocksdb-debug-ttl-read-filter-ts=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `-3600` to `3600` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_debug_ttl_rec_ts` * **Description:** For debugging purposes only. Overrides the TTL of records to now() + debug\_ttl\_rec\_ts. The value can be +/- to simulate a record inserted in the past vs a record inserted in the 'future'. A value of 0 denotes that the variable is not set. This variable is a no-op in non-debug builds. * **Commandline:** `--rocksdb-debug-ttl-read-filter-ts=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `-3600` to `3600` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_debug_ttl_snapshot_ts` * **Description:** For debugging purposes only. Sets the snapshot during compaction to now() + debug\_set\_ttl\_snapshot\_ts. The value can be positive or negative to simulate a snapshot in the past vs a snapshot created in the 'future'. A value of 0 denotes that the variable is not set. This variable is a no-op in non-debug builds. * **Commandline:** `--rocksdb-debug-ttl-snapshot-ts=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `-3600` to `3600` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_default_cf_options` * **Description:** Default cf options for RocksDB. * **Commandline:** `--rocksdb-default-cf-options=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_delayed_write_rate` * **Description:** DBOptions::delayed\_write\_rate. * **Commandline:** `--rocksdb-delayed-write-rate=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` (Previously `16777216`) * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_delete_cf` * **Description:** Delete column family. * **Commandline:** `--rocksdb-delete-cf=val` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty string) * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_delete_obsolete_files_period_micros` * **Description:** DBOptions::delete\_obsolete\_files\_period\_micros for RocksDB. * **Commandline:** `--rocksdb-delete-obsolete-files-period-micros=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `21600000000` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_enable_2pc` * **Description:** Enable two phase commit for MyRocks. When set, MyRocks will keep its data consistent with the [binary log](../binary-log/index) (in other words, the server will be a crash-safe master). The consistency is achieved by doing two-phase XA commit with the binary log. * **Commandline:** `--rocksdb-enable-2pc={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_enable_bulk_load_api` * **Description:** Enables using SstFileWriter for bulk loading. * **Commandline:** `--rocksdb-enable-bulk-load-api={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_enable_insert_with_update_caching` * **Description:** Whether to enable optimization where we cache the read from a failed insertion attempt in [INSERT ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index). * **Commandline:** `--rocksdb-enable-insert-with-update-caching={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_enable_thread_tracking` * **Description:** DBOptions::enable\_thread\_tracking for RocksDB. * **Commandline:** `--rocksdb-enable-thread-tracking={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_enable_ttl` * **Description:** Enable expired TTL records to be dropped during compaction. * **Commandline:** `--rocksdb-enable-ttl={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_enable_ttl_read_filtering` * **Description:** For tables with TTL, expired records are skipped/filtered out during processing and in query results. Disabling this will allow these records to be seen, but as a result rows may disappear in the middle of transactions as they are dropped during compaction. Use with caution. * **Commandline:** `--rocksdb-enable-ttl-read-filtering={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_enable_write_thread_adaptive_yield` * **Description:** DBOptions::enable\_write\_thread\_adaptive\_yield for RocksDB. * **Commandline:** `--rocksdb-enable-write-thread-adaptive-yield={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_error_if_exists` * **Description:** DBOptions::error\_if\_exists for RocksDBB. * **Commandline:** `--rocksdb-error-if-exists={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_error_on_suboptimal_collation` * **Description:** Raise an error instead of warning if a sub-optimal collation is used. * **Commandline:** `--rocksdb-error-on-suboptimal-collation={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_flush_log_at_trx_commit` * **Description:** Sync on transaction commit. Similar to [innodb\_flush\_log\_at\_trx\_commit](../innodb-system-variables/index#innodb_flush_log_at_trx_commit). One can check the flushing by examining the [rocksdb\_wal\_synced](../myrocks-status-variables/index#rocksdb_wal_synced) and [rocksdb\_wal\_bytes](../myrocks-status-variables/index#rocksdb_wal_bytes) status variables. + **1**: Always sync on commit (the default). + **0**: Never sync. + **2**: Sync based on a timer controlled via rocksdb-background-sync. * **Commandline:** `--rocksdb-flush-log-at-trx-commit=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `0` to `2` --- #### `rocksdb_flush_memtable_on_analyze` * **Description:** Forces memtable flush on ANALZYE table to get accurate cardinality. * **Commandline:** `--rocksdb-flush-memtable-on-analyze={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` * **Removed:** [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.15](https://mariadb.com/kb/en/mariadb-10215-release-notes/) --- #### `rocksdb_force_compute_memtable_stats` * **Description:** Force to always compute memtable stats. * **Commandline:** `--rocksdb-force-compute-memtable-stats={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_force_compute_memtable_stats_cachetime` * **Description:** Time in usecs to cache memtable estimates. * **Commandline:** `--rocksdb-force-compute-memtable-stats-cachetime=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `60000000` * **Range:** `0` to `2147483647` --- #### `rocksdb_force_flush_memtable_and_lzero_now` * **Description:** Acts similar to force\_flush\_memtable\_now, but also compacts all L0 files. * **Commandline:** `--rocksdb-force-flush-memtable-and-lzero-now={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_force_flush_memtable_now` * **Description:** Forces memstore flush which may block all write requests so be careful. * **Commandline:** `--rocksdb-force-flush-memtable-now={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_force_index_records_in_range` * **Description:** Used to override the result of records\_in\_range() when [FORCE INDEX](../force-index/index) is used. * **Commandline:** `--rocksdb-force-index-records-in-range=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `2147483647` --- #### `rocksdb_git_hash` * **Description:** Git revision of the RocksDB library used by MyRocks. * **Commandline:** `--rocksdb-git-hash=value=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** As per git revision. --- #### `rocksdb_hash_index_allow_collision` * **Description:** BlockBasedTableOptions::hash\_index\_allow\_collision for RocksDB. * **Commandline:** `--rocksdb-hash-index-allow-collision={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_ignore_unknown_options` * **Description:** Enable ignoring unknown options passed to RocksDB. * **Commandline:** `--rocksdb-ignore-unknown-options={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.15](https://mariadb.com/kb/en/mariadb-10215-release-notes/) --- #### `rocksdb_index_type` * **Description:** BlockBasedTableOptions::index\_type for RocksDB. * **Commandline:** `--rocksdb-index-type=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `enum` * **Default Value:** `kBinarySearch` * **Valid Values:** `kBinarySearch`, `kHashSearch` --- #### `rocksdb_info_log_level` * **Description:** Filter level for info logs to be written mysqld error log. Valid values include 'debug\_level', 'info\_level', 'warn\_level', 'error\_level' and 'fatal\_level'. * **Commandline:** `--rocksdb-info-log-level=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `enum` * **Default Value:** `error_level` * **Valid Values:** `error_level`, `debug_level`, `info_level`, `warn_level`, `fatal_level` --- #### `rocksdb_io_write_timeout` * **Description:** Timeout for experimental I/O watchdog. * **Commandline:** `--rocksdb-io-write-timeout=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Valid Values:** `0` to `4294967295` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_is_fd_close_on_exec` * **Description:** DBOptions::is\_fd\_close\_on\_exec for RocksDB. * **Commandline:** `--rocksdb-is-fd-close-on-exec={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_keep_log_file_num` * **Description:** DBOptions::keep\_log\_file\_num for RocksDB. * **Commandline:** `--rocksdb-keep-log-file-num=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1000` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_large_prefix` * **Description:** Support large index prefix length of 3072 bytes. If off, the maximum index prefix length is 767. * **Commandline:** `--rocksdb-large_prefix={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_lock_scanned_rows` * **Description:** Take and hold locks on rows that are scanned but not updated. * **Commandline:** `--rocksdb-lock-scanned-rows={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_lock_wait_timeout` * **Description:** Number of seconds to wait for lock. * **Commandline:** `--rocksdb-lock-wait-timeout=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `1` to `1073741824` --- #### `rocksdb_log_dir` * **Description:** DBOptions::log\_dir for RocksDB. Where the log files are stored. An empty value implies `rocksdb_datadir` is used as the directory. * **Commandline:** `--rocksdb-log-dir=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty) * **Introduced:** [MariaDB 10.9.1](https://mariadb.com/kb/en/mariadb-1091-release-notes/) --- #### `rocksdb_log_file_time_to_roll` * **Description:** DBOptions::log\_file\_time\_to\_roll for RocksDB. * **Commandline:** `--rocksdb-log-file-time-to_roll=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_manifest_preallocation_size` * **Description:** DBOptions::manifest\_preallocation\_size for RocksDB. * **Commandline:** `--rocksdb-manifest-preallocation-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `4194304` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_manual_compaction_threads` * **Description:** How many rocksdb threads to run for manual compactions. * **Commandline:** `--rocksdb-manual-compation-threads=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `128` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_manual_wal_flush` * **Description:** DBOptions::manual\_wal\_flush for RocksDB. * **Commandline:** `--rocksdb-manual-wal-flush={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_master_skip_tx_api` * **Description:** Skipping holding any lock on row access. Not effective on slave. * **Commandline:** `--rocksdb-master-skip-tx-api={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_max_background_compactions` * **Description:** DBOptions::max\_background\_compactions for RocksDB. * **Commandline:** `--rocksdb-max-background-compactions=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `1` to `64` * **Removed:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_max_background_flushes` * **Description:** DBOptions::max\_background\_flushes for RocksDB. * **Commandline:** `--rocksdb-max-background-flushes=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `1` to `64` * **Removed:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_max_background_jobs` * **Description:** DBOptions::max\_background\_jobs for RocksDB. * **Commandline:** `--rocksdb-max-background-jobs=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `2` * **Range:** `-1` to `64` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_max_latest_deadlocks` * **Description:** Maximum number of recent deadlocks to store. * **Commandline:** `--rocksdb-max-latest-deadlocks=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `5` * **Range:** `0` to `4294967295` --- #### `rocksdb_max_log_file_size` * **Description:** DBOptions::max\_log\_file\_size for RocksDB. * **Commandline:** `--rocksdb-max-log-file-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_max_manifest_file_size` * **Description:** DBOptions::max\_manifest\_file\_size for RocksDB. * **Commandline:** `--rocksdb-manifest-log-file-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1073741824` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_max_manual_compactions` * **Description:** Maximum number of pending + ongoing number of manual compactions.. * **Commandline:** `--rocksdb-manual_compactions=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `10` * **Range:** `0` to `4294967295` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_max_open_files` * **Description:** DBOptions::max\_open\_files for RocksDB. * **Commandline:** `--rocksdb-max-open-files=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `-2` * **Range:** `-2` to `2147483647` --- #### `rocksdb_max_row_locks` * **Description:** Maximum number of locks a transaction can have. * **Commandline:** `--rocksdb-max-row-locks=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1048576` * **Range:** + `1` to `1073741824` (>= [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/)) + `1` to `1048576` (<= [MariaDB 10.3.9](https://mariadb.com/kb/en/mariadb-1039-release-notes/), [MariaDB 10.2.17](https://mariadb.com/kb/en/mariadb-10217-release-notes/)) --- #### `rocksdb_max_subcompactions` * **Description:** DBOptions::max\_subcompactions for RocksDB. * **Commandline:** `--rocksdb-max-subcompactions=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `1` to `64` --- #### `rocksdb_max_total_wal_size` * **Description:** DBOptions::max\_total\_wal\_size for RocksDB. The maximum size limit for write-ahead-log files. Once this limit is reached, RocksDB forces the flushing of memtables. * **Commandline:** `--rocksdb-max-total-wal-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_merge_buf_size` * **Description:** Size to allocate for merge sort buffers written out to disk during inplace index creation. * **Commandline:** `--rocksdb-merge-buf-size=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `67108864` * **Range:** `100` to `18446744073709551615` --- #### `rocksdb_merge_combine_read_size` * **Description:** Size that we have to work with during combine (reading from disk) phase of external sort during fast index creation. * **Commandline:** `--rocksdb-merge-combine-read-size=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1073741824` * **Range:** `100` to `18446744073709551615` --- #### `rocksdb_merge_tmp_file_removal_delay_ms` * **Description:** Fast index creation creates a large tmp file on disk during index creation. Removing this large file all at once when index creation is complete can cause trim stalls on Flash. This variable specifies a duration to sleep (in milliseconds) between calling chsize() to truncate the file in chunks. The chunk size is the same as merge\_buf\_size. * **Commandline:** `--rocksdb-merge-tmp-file-removal-delay-ms=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_new_table_reader_for_compaction_inputs` * **Description:** DBOptions::new\_table\_reader\_for\_compaction\_inputs for RocksDB. * **Commandline:** `--rocksdb-new-table-reader-for-compaction-inputs={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_no_block_cache` * **Description:** BlockBasedTableOptions::no\_block\_cache for RocksDB. * **Commandline:** `--rocksdb-no-block-cache={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_override_cf_options` * **Description:** Option overrides per cf for RocksDB. Note that the `rocksdb-override-cf-options` syntax is quite strict, and any typos will result in a parse error, and the MyRocks plugin will not be loaded. Depending on your configuration, the server may still start. If it does start, you can use this command to check if the plugin is loaded: `select * from information_schema.plugins where plugin_name='ROCKSDB'` (note that you need the "ROCKSDB" plugin. Other auxiliary plugins like "ROCKSDB\_TRX" might still get loaded). Another way is to detect the error is check the error log. * **Commandline:** `--rocksdb-override-cf-options=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_paranoid_checks` * **Description:** DBOptions::paranoid\_checks for RocksDB. * **Commandline:** `--rocksdb-paranoid-checks={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_pause_background_work` * **Description:** Disable all rocksdb background operations. * **Commandline:** `--rocksdb-pause-background-work={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_perf_context_level` * **Description:** Perf Context Level for rocksdb internal timer stat collection. * **Commandline:** `--rocksdb-perf-context-level=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `5` --- #### `rocksdb_persistent_cache_path` * **Description:** Path for BlockBasedTableOptions::persistent\_cache for RocksDB. * **Commandline:** `--rocksdb-persistent-cache-path=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_persistent_cache_size_mb` * **Description:** Size of cache in MB for BlockBasedTableOptions::persistent\_cache for RocksDB. * **Commandline:** `--rocksdb-persistent-cache-size-mb=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_pin_l0_filter_and_index_blocks_in_cache` * **Description:** pin\_l0\_filter\_and\_index\_blocks\_in\_cache for RocksDB. * **Commandline:** `--rocksdb-pin-l0-filter-and-index-blocks-in-cache={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_print_snapshot_conflict_queries` * **Description:** Logging queries that got snapshot conflict errors into \*.err log. * **Commandline:** `--rocksdb-print-snapshot-conflict-queries={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_rate_limiter_bytes_per_sec` * **Description:** DBOptions::rate\_limiter bytes\_per\_sec for RocksDB. * **Commandline:** `--rocksdb-rate-limiter-bytes-per-sec=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_read_free_rpl_tables` * **Description:** List of tables that will use read-free replication on the slave (i.e. not lookup a row during replication). * **Commandline:** `--rocksdb-read-free-rpl-tables=value` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** (Empty) * **Removed:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_records_in_range` * **Description:** Used to override the result of records\_in\_range(). Set to a positive number to override. * **Commandline:** `--rocksdb-records-in-range=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `2147483647` --- #### `rocksdb_remove_mariabackup_checkpoint` * **Description:** Remove [mariabackup](../mariabackup/index) checkpoint. * **Commandline:** `--rocksdb-remove-mariabackup-checkpoint={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.8](https://mariadb.com/kb/en/mariadb-1038-release-notes/), [MariaDB 10.2.16](https://mariadb.com/kb/en/mariadb-10216-release-notes/) --- #### `rocksdb_reset_stats` * **Description:** Reset the RocksDB internal statistics without restarting the DB. * **Commandline:** `--rocksdb-reset-stats={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_rollback_on_timeout` * **Description:** Whether to roll back the complete transaction or a single statement on lock wait timeout (a single statement by default). * **Commandline:** `--rocksdb-rollback-on-timeout={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_seconds_between_stat_computes` * **Description:** Sets a number of seconds to wait between optimizer stats recomputation. Only changed indexes will be refreshed. * **Commandline:** `--rocksdb-seconds-between-stat-computes=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `3600` * **Range:** `0` to `4294967295` --- #### `rocksdb_signal_drop_index_thread` * **Description:** Wake up drop index thread. * **Commandline:** `--rocksdb-signal-drop-index-thread={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_sim_cache_size` * **Description:** Simulated cache size for RocksDB. * **Commandline:** `--rocksdb-sim-cache-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_skip_bloom_filter_on_read` * **Description:** Skip using bloom filter for reads. * **Commandline:** `--rocksdb-skip-bloom-filter-on_read={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_skip_fill_cache` * **Description:** Skip filling block cache on read requests. * **Commandline:** `--rocksdb-skip-fill-cache={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_skip_unique_check_tables` * **Description:** Skip unique constraint checking for the specified tables. * **Commandline:** `--rocksdb-skip-unique-check-tables=value` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** `.*` --- #### `rocksdb_sst_mgr_rate_bytes_per_sec` * **Description:** DBOptions::sst\_file\_manager rate\_bytes\_per\_sec for RocksDB * **Commandline:** `--rocksdb-sst-mgr-rate-bytes-per-sec=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_stats_dump_period_sec` * **Description:** DBOptions::stats\_dump\_period\_sec for RocksDB. * **Commandline:** `--rocksdb-stats-dump-period-sec=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `600` * **Range:** `0` to `2147483647` --- #### `rocksdb_stats_level` * **Description:** Statistics Level for RocksDB. Default is 0 (kExceptHistogramOrTimers). * **Commandline:** `--rocksdb-stats-level=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `4` * **Introduced:** [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) --- #### `rocksdb_stats_recalc_rate` * **Description:** The number of indexes per second to recalculate statistics for. 0 to disable background recalculation. * **Commandline:** `--rocksdb-stats-recalc_rate=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `4294967295` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/) [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- #### `rocksdb_store_row_debug_checksums` * **Description:** Include checksums when writing index/table records. * **Commandline:** `--rocksdb-store-row-debug-checksums={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_strict_collation_check` * **Description:** Enforce case sensitive collation for MyRocks indexes. * **Commandline:** `--rocksdb-strict-collation-check={0|1}` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_strict_collation_exceptions` * **Description:** List of tables (using regex) that are excluded from the case sensitive collation enforcement. * **Commandline:** `--rocksdb-strict-collation-exceptions=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_supported_compression_types` * **Description:** Compression algorithms supported by RocksDB. Note that RocksDB does not make use of [MariaDB 10.7](../what-is-mariadb-107/index) [compression-plugins](../compression-plugins/index). * **Commandline:** `--rocksdb-supported-compression-types=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** `Snappy,Zlib,ZSTDNotFinal` --- #### `rocksdb_table_cache_numshardbits` * **Description:** DBOptions::table\_cache\_numshardbits for RocksDB. * **Commandline:** `--rocksdb-table-cache-numshardbits=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `6` * **Range:** `0` to `19` --- #### `rocksdb_table_stats_sampling_pct` * **Description:** Percentage of entries to sample when collecting statistics about table properties. Specify either 0 to sample everything or percentage [1..100]. By default 10% of entries are sampled. * **Commandline:** `--rocksdb-table-stats-sampling-pct=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `10` * **Range:** `0` to `100` --- #### `rocksdb_tmpdir` * **Description:** Directory for temporary files during DDL operations. * **Commandline:** `--rocksdb-tmpdir[=value]` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_trace_sst_api` * **Description:** Generate trace output in the log for each call to the SstFileWriter. * **Commandline:** `--rocksdb-trace-sst-api={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_two_write_queues` * **Description:** DBOptions::two\_write\_queues for RocksDB. * **Commandline:** `--rocksdb-two-write-queues={0|1}` * **Scope:** Global, * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` * **Introduced:** [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.15](https://mariadb.com/kb/en/mariadb-10215-release-notes/) --- #### `rocksdb_unsafe_for_binlog` * **Description:** Allowing statement based binary logging which may break consistency. * **Commandline:** `--rocksdb-unsafe-for-binlog={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_update_cf_options` * **Description:** Option updates per column family for RocksDB. * **Commandline:** `--rocksdb-update-cf-options=value` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `varchar` * **Default Value:** (Empty) * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_use_adaptive_mutex` * **Description:** DBOptions::use\_adaptive\_mutex for RocksDB. * **Commandline:** `--rocksdb-use-adaptive-mutex={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_use_clock_cache` * **Description:** Use ClockCache instead of default LRUCache for RocksDB. * **Commandline:** `--rocksdb-use-clock-cache={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_use_direct_io_for_flush_and_compaction` * **Description:** DBOptions::use\_direct\_io\_for\_flush\_and\_compaction for RocksDB. * **Commandline:** `--rocksdb-use-direct-io-for-flush-and-compaction={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` * **Introduced:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_use_direct_reads` * **Description:** DBOptions::use\_direct\_reads for RocksDB. * **Commandline:** `--rocksdb-use-direct-reads={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_use_direct_writes` * **Description:** DBOptions::use\_direct\_writes for RocksDB. * **Commandline:** `--rocksdb-use-direct-reads={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` * **Removed:** [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) --- #### `rocksdb_use_fsync` * **Description:** DBOptions::use\_fsync for RocksDB. * **Commandline:** `--rocksdb-use-fsync={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_validate_tables` * **Description:** Verify all .frm files match all RocksDB tables (0 means no verification, 1 means verify and fail on error, and 2 means verify but continue. * **Commandline:** `--rocksdb-validate-tables=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `0` to `2` --- #### `rocksdb_verify_row_debug_checksums` * **Description:** Verify checksums when reading index/table records. * **Commandline:** `--rocksdb-verify-row-debug-checksums={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_wal_bytes_per_sync` * **Description:** DBOptions::wal\_bytes\_per\_sync for RocksDB. * **Commandline:** `--rocksdb-wal-bytes-per-sync=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_wal_dir` * **Description:** DBOptions::wal\_dir for RocksDB. Directory where the write-ahead-log files are stored. * **Commandline:** `--rocksdb-wal-dir=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (Empty) --- #### `rocksdb_wal_recovery_mode` * **Description:** DBOptions::wal\_recovery\_mode for RocksDB. Default is kAbsoluteConsistency. Records that are not yet committed are stored in the Write-Ahead-Log (WAL). If the server is not cleanly shut down, the recovery mode will determine the WAL recovery behavior. + **1**: kAbsoluteConsistency. Will not start if any corrupted entries (including incomplete writes) are detected (the default). + **0**: kTolerateCorruptedTailRecords. Ignores any errors found at the end of the WAL + **2**: kPointInTimeRecovery. Replay of the WAL is halted after finding an error. The system will be recovered to the latest consistent point-in-time. Data from a replica can used to replay past the point-in-time. + **3**: kSkipAnyCorruptedRecords. A risky option where any corrupted entries are skipped while subsequent healthy WAL entries are applied. * **Commandline:** `--rocksdb-wal-recovery-mode=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1` * **Range:** `0` to `3` --- #### `rocksdb_wal_size_limit_mb` * **Description:** DBOptions::WAL\_size\_limit\_MB for RocksDB. Write-ahead-log files are moved to an archive directory once their memtables are flushed. This variable specifies the largest size, in MB, that the archive can be. * **Commandline:** `--rocksdb-wal-size-limit-mb=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_wal_ttl_seconds` * **Description:** DBOptions::WAL\_ttl\_seconds for RocksDB. Oldest time, in seconds, that a write-ahead-log file should exist. * **Commandline:** `--rocksdb-wal-ttl-seconds=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `9223372036854775807` --- #### `rocksdb_whole_key_filtering` * **Description:** BlockBasedTableOptions::whole\_key\_filtering for RocksDB. If set (the default), the bloomfilter to use the whole key (rather than only the prefix) for filtering is enabled. Lookups should use the whole key for matching to make best use of this setting. * **Commandline:** `--rocksdb-whole-key-filtering={0|1}` * **Scope:** Global * **Dynamic:** No * **Data Type:** `boolean` * **Default Value:** `ON` --- #### `rocksdb_write_batch_max_bytes` * **Description:** Maximum size of write batch in bytes. 0 means no limit. * **Commandline:** `--rocksdb-write-batch-max-bytes=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `18446744073709551615` --- #### `rocksdb_write_disable_wal` * **Description:** WriteOptions::disableWAL for RocksDB. * **Commandline:** `--rocksdb-write-disable-wal={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_write_ignore_missing_column_families` * **Description:** WriteOptions::ignore\_missing\_column\_families for RocksDB. * **Commandline:** `--rocksdb-write-ignore-missing-column-families={0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- #### `rocksdb_write_policy` * **Description:** DBOptions::write\_policy for RocksDB. * **Commandline:** `--rocksdb-write-policy=val` * **Scope:** Global * **Dynamic:** No * **Data Type:** `enum` * **Default Value:** `write_committed` * **Valid Values:** `write_committed`, `write_prepared`, `write_unprepared` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/), [MariaDB 10.2.18](https://mariadb.com/kb/en/mariadb-10218-release-notes/) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Kubernetes Overview for MariaDB Users Kubernetes Overview for MariaDB Users ===================================== Kubernetes, or K8s, is software to orchestrate containers. It is released under the terms of an open source license, Apache License 2.0. Kubernetes was originally developed by Google. Currently it is maintained by the Cloud Native Computing Foundation (CNCF), with the status of Graduated Project. For information about how to setup a learning environment or a production environment, see [Getting started](https://kubernetes.io/docs/setup/) in Kubernetes documentation. Architecture ------------ Kubernetes runs in a **cluster**. A cluster runs a **workload**: a set of servers that are meant to work together (web servers, database servers, etc). A Kubernetes cluster consists of the following components: * **Nodes** run containers with the servers needed by our applications. * **Controllers**constantly check the cluster nodes current state, and compare it with the desired state. * A **Control Plane** is a set of different components that store the cluster desired state and take decisions about the nodes. The Control Plane provides an API that is used by the controllers. For more information on Kubernetes architecture, see [Concepts](https://kubernetes.io/docs/concepts/) and [Kubernetes Components](https://kubernetes.io/docs/concepts/overview/components/) in Kubernetes documentation. ### Nodes A node is a system that is responsible to run one or more pods. A pod is a set of containers that run a Kubernetes workload or part of it. All containers that run in the same pod are also located on the same node. Usually identical pods run on different nodes for fault tolerance. For more details, see [Nodes](https://kubernetes.io/docs/concepts/architecture/nodes/) in the Kubernetes documentation. Every node must necessarily have the following components: * **kubelet** * **kube-proxy** * A **container runtime** #### kubelet kubelet has a set of **PodSpecs** which describe the desired state of pods. It checks that the current state of the pods matches the desired state. It especially takes care that containers don't crash. #### kube-proxy In a typical Kubernetes cluster, several containers located in different pods need to connect to other containers, located in the same pods (for performance and fault tolerance reasons). Therefore, when we develop and deploy an application, we can't know in advance the IPs of the containers to which it will have to connect. For example, an application server may need to connect to MariaDB, but the MariaDB IP will be different for every pod. The main purpose of kube-proxy is to implement the concept of Kubernetes **services**. When an application needs to connect to MariaDB, it will connect to the MariaDB service. kube-proxy will receive the request and will redirect it to a running MariaDB container in the same pod. #### Container Runtime Kubernetes manages the containers in a pod via a container runtime, or container manager, that supports the Kubernetes Container Runtime Interface (CRI). Container runtimes that meet this requisite are listed in the [Container runtimes](https://kubernetes.io/docs/setup/production-environment/container-runtimes/) page in the Kubernetes documentation. More information about the Container Runtime Interface can be found [on GitHub](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md). Originally, Kubernetes used Docker as a container runtime. This was later deprecated, but Docker images can still be used using any container runtime. ### Controllers Controllers constantly check if there are differences between the pod's current state and their desired state. When differences are found, controllers try to fix them. Each node type controls one or more resource types. Several types of controllers are needed to run a cluster. Most of the actions taken by the controllers user the API server in the Control Plane. However, this is not necessarily true for custom controllers. Also, some actions cannot be performed via the Control Plane. For example, if some nodes crashed, adding new nodes involves taking actions outside of the Kubernetes cluster, and controllers will have to do this themselves. It is possible to write custom controllers to perform checks that require knowledge about a specific technology. For example, a MariaDB custom controller may want to check if [replication](../standard-replication/index) is working by issuing [SHOW REPLICA STATUS](../show-replica-status/index) commands. This logic is specific to the way MariaDB works, and can only be implemented in a customer controller. Custom controllers are usually part of operators. For more information, see [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/) in the Kubernetes documentation. ### Control Plane The control plane consists of the following components. For more information about the control plane, see [Control Plane Components](https://kubernetes.io/docs/concepts/overview/components/) in Kubernetes documentation. #### API Server An API Server exposes API functions both internally and externally. It is essential to coordinate Kubernetes components so that they react to node's change of state, and it allows the user to send commands. The default implementation of the API Server is kube-apiserver. It is able to scale horizontally and to balance the load between its instances. #### kube-controller-manager Most controllers run in this component. #### etcd etcd contains all data used by a Kubernetes cluster. It is a good idea to take regular backups of etcd data. #### kube-scheduler When a new pod is created, kube-scheduler decides which node should host it. The decision is made based on several criteria, like the resource requirements for the pod. #### cloud-controller-manager cloud-controller-manager implements the logic and API of a cloud provider. It receives requests from the API Server and performs specific actions, like creating an instance in AWS. It also runs controllers that are specific to a cloud vendor. ### Clients and Tools Kubernetes comes with a set of tools that allow us to communicate with the API server and test a cluster. #### kubectl kubectl allows communication with the API server and run commands on a Kubernetes cluster. #### kubeadm kubeadm allows creating a Kubernetes cluster that is ready to receive commands from kubectl. #### kind and minikube These tools are meant to create and manage test clusters on a personal machine. They work on Linux, MacOS and Windows. kind creates a cluster that consists of Docker containers, therefore it requires Docker to be installed. minikube runs a single-node cluster on the local machine. Kubernetes Resources and References ----------------------------------- * [Kubernetes website](https://kubernetes.io/). * [Kubernetes](https://en.wikipedia.org/wiki/Kubernetes) on Wikipedia. * [Kubernetes organization](https://github.com/kubernetes) on GitHub. * [OperatorHub.io](https://operatorhub.io/) * [Kubernetes Community Forums](https://discuss.kubernetes.io/). * (video) [MariaDB database clusters on Kubernetes](https://mariadb.org/fest2020/kubernetes/), by Pengfei Ma, at MariaDB Server Fest 2020. * Series of posts by Anel Husakovic on the MariaDB Foundation blog: + [Start MariaDB in K8s](https://mariadb.org/start-mariadb-in-k8s/) + [MariaDB & K8s: Communication between containers/Deployments](https://mariadb.org/mariadb-k8s-communication-between-containers-deployments/) + [MariaDB & K8s: Create a Secret and use it in MariaDB deployment](https://mariadb.org/mariadb-k8s-create-a-secret-and-use-it-in-mariadb-deployment/) + [MariaDB & K8s: Deploy MariaDB and WordPress using Persistent Volumes](https://mariadb.org/mariadb-k8s-deploy-mariadb-and-wordpress-using-persistent-volumes/) + [Create statefulset MariaDB application in K8s](https://mariadb.org/create-statefulset-mariadb-application-in-k8s/) + [MariaDB replication using containers](https://mariadb.org/mariadb-replication-using-containers/) + [MariaDB & K8s: How to replicate MariaDB in K8s](https://mariadb.org/mariadb-k8s-how-to-replicate-mariadb-in-k8s/) --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Relational Databases: Basic Terms Relational Databases: Basic Terms ================================= The relational database model uses certain terms to describe its components: * *Data* are the values kept in the database. On their own, the data means very little. `CA 684-213` is an example of data in a DMV (Division of Motor Vehicles) database. * *Information* is processed data. For example, `CA 684-213` is the car registration number of a car belonging to Lyndon Manson, in a DMV database. * A *database* is a collection of *tables*, also called *entities*. * Each table is made up of *records* (the horizontal rows in the table, also called *tuples*). Each record should be unique, and can be stored in any order in the table. * Each record is made up of *fields* (which are the vertical columns of the table, also called *attributes*). Basically, a record is one fact (for example, one customer or one sale). * These fields can be of various *types*. MariaDB has many types (see [Data Types](../data-types/index) for a list), but generally types fall into three kinds: character, numeric, and date. For example, a customer name is a character field, a customer's birthday is a date field, and a customer's number of children is a numeric field. * The range of allowed values for a field is called the *domain* (also called a *field specification*). For example, a credit card field may be limited to only the values `Mastercard`, `Visa` and `Amex`. * A field is said to contain a *null* value when it contains nothing at all. Null fields can create complexities in calculations and have consequences for data accuracy. For this reason, many fields are specifically set not to contain null values. * A *key* accesses specific records in a table. * An *index* is a mechanism to improve the performance of a database. Indexes are often confused with keys. Indexes are, strictly speaking, part of the physical structure, and keys are part of the logical structure. You'll often see the terms used interchangeably, however, including throughout this Knowledge Base. * A *view* is a virtual table made up of a subset of the actual tables. * A *one-to-one* (1:1) relationship is where for each instance of the first table in a relationship, only one instance of the second table exists, An example of this would be a case where a chain of stores carries a vending machine. Each vending machine can only be in one store, and each store carries only one vending machine. * A *one-to-many* (1:N) relationship is where for each instance of the first table in a relationship, many instances of the second table exist. This is a common kind of relationship. An example is the relationship between a sculptor and their sculptures. Each sculptor may have created many sculptures, but each sculpture has been created by only one sculptor. * A *many-to-many* (M:N) relationship occurs where, for each instance of the first table, there are many instances of the second table, and for each instance of the second table, there are many instances of the first. For example, a student can have many lecturers, and a lecturer can have many students. * A *mandatory* relationship exists where for each instance of the first table in a relationship, one or more instances of the second *must* exist. For example, for a music group to exist, there must exist at least one musician in that group. * An *optional* relationship is where for each instance of the first table in a relationship, there *may* exist instances of the second. For example, if an author can be listed in the database without having written a book (in other words, a prospective author), that relationship is optional. The reverse isn't necessarily true though. For example, for a book to be listed, it must have an author. * *Data integrity* refers to the condition where data is accurate, valid, and consistent. An example of poor integrity would be if a customer telephone number is stored differently in two different locations. Another is where a course record contains a reference to a lecturer who is no longer present at the school. [Database normalization](../database-normalization/index) is a technique that assists you to minimize the risk of these sorts of problems. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb myisamlog myisamlog ========= `myisamlog` processes and returns the contents of a [MyISAM log file](../myisam-log/index). Invoke `myisamlog` like this: ``` shell> myisamlog [options] [log_file [tbl_name] ...] shell> isamlog [options] [log_file [tbl_name] ...] ``` The default operation is update (`-u`). If a recovery is done (`-r`), all writes and possibly updates and deletes are done and errors are only counted. The default log file name is `myisam.log` for `myisamlog` and `isam.log` for `isamlog` if no `log_file` argument is given. If tables are named on the command line, only those tables are updated. `myisamlog` supports the following options: | Option | Description | | --- | --- | | `-?`, `-I` | Display a help message and exit. | | `-c *N*` | Execute only *`N`* commands. | | `-f *N*` | Specify the maximum number of open files. | | `-i` | Display extra information before exiting. | | `-o *offset*` | Specify the starting offset. | | `-p *N*` | Remove *`N`* components from path. | | `-r` | Perform a recovery operation. | | `-R *record\_pos\_file record\_pos*` | Specify record position file and record position. | | `-u` | Displays update operations. | | `-v` | Verbose mode. Print more output about what the program does. This option can be given multiple times (*-vv*, *-vvv*) to produce more and more output. | | `-w *write\_file*` | Specify the write file. | | `-V` | Display version information. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Metadata Locking Metadata Locking ================ MariaDB supports metadata locking. This means that when a transaction (including [XA transactions](../xa-transactions/index)) uses a table, it locks its metadata until the end of transaction. Non-transactional tables are also locked, as well as views and objects which are related to locked tables/views (stored functions, triggers, etc). When a connection tries to use a DDL statement (like an [ALTER TABLE](../alter-table/index)) which modifies a table that is locked, that connection is queued, and has to wait until it's unlocked. Using savepoints and performing a partial rollback does not release metadata locks. [LOCK TABLES ... WRITE](../transactions-lock/index) are also queued. Some wrong statements which produce an error may not need to wait for the lock to be freed. The metadata lock's timeout is determined by the value of the [lock\_wait\_timeout](../server-system-variables/index#lock_wait_timeout) server system variable (in seconds). However, note that its default value is 31536000 (1 year, MariaDB <= 10.2.3), or 86400 (1 day, MariaDB >= 10.2.4). If this timeout is exceeded, the following error is returned: ``` ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction ``` If the [metadata\_lock\_info](../metadata-lock-info/index) plugin is installed, the [Information Schema](../information-schema/index) [metadata\_lock\_info](../information-schema-metadata_lock_info-table/index) table stores information about existing metadata locks. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5](../what-is-mariadb-105/index), the [Performance Schema metadata\_locks](../performance-schema-metadata_locks-table/index) table contains metadata lock information. Example ------- Let's use the following MEMORY (non-transactional) table: ``` CREATE TABLE t (a INT) ENGINE = MEMORY; ``` Connection 1 starts a transaction, and INSERTs a row into t: ``` START TRANSACTION; INSERT INTO t SET a=1; ``` `t`'s metadata is now locked by connection 1. Connection 2 tries to alter `t`, but has to wait: ``` ALTER TABLE t ADD COLUMN b INT; ``` Connection 2's prompt is blocked now. Now connection 1 ends the transaction: ``` COMMIT; ``` ...and connection 2 finally gets the output of its command: ``` Query OK, 1 row affected (35.23 sec) Records: 1 Duplicates: 0 Warnings: 0 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Hardware Optimization Hardware Optimization ===================== Better hardware is one of the easiest ways to improve performance. As a general rule of thumb, hardware should be improved in the following order: Memory ------ Memory is the most important factor as it allows you to adjust the [Server System Variables](../server-system-variables/index). More memory means larger key and table caches can be stored in memory so that disk access, an order of magnitude slower, is reduced. Simply adding more memory may not result in drastic improvements if the server variables are not set to make use of the extra available memory. Using more RAM slots on the motherboard increases the bus frequency, and there will be more latency between the RAM and the CPU. So, using the highest RAM size per slot is preferable. Disks ----- Fast disk access is critical, as ultimately it's where the data resides. The key figure is the disk seek time, a measurement of how fast the physical disk can move to access the data, so choose disks with as low a seek time as possible. You can also add dedicated disks for temporary files and transaction logs. Fast Ethernet ------------- CPU --- Although hardware bottlenecks often fall elsewhere, faster processors allow calculations to be performed more quickly, and the results sent back to the client more quickly. Besides processor speed, the processor's bus speed and cache size are also important factors to consider. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb REGEXP_SUBSTR REGEXP\_SUBSTR ============== Syntax ------ ``` REGEXP_SUBSTR(subject,pattern) ``` Description ----------- Returns the part of the string `subject` that matches the regular expression `pattern`, or an empty string if `pattern` was not found. The function follows the case sensitivity rules of the effective [collation](../data-types-character-sets-and-collations/index). Matching is performed case insensitively for case insensitive collations, and case sensitively for case sensitive collations and for binary data. The collation case sensitivity can be overwritten using the (?i) and (?-i) PCRE flags. MariaDB uses the [PCRE regular expression](../pcre-regular-expressions/index) library for enhanced regular expression performance, and `REGEXP_SUBSTR` was introduced as part of this enhancement. The [default\_regex\_flags](../server-system-variables/index#default_regex_flags) variable addresses the remaining compatibilities between PCRE and the old regex library. Examples -------- ``` SELECT REGEXP_SUBSTR('ab12cd','[0-9]+'); -> 12 SELECT REGEXP_SUBSTR( 'See https://mariadb.org/en/foundation/ for details', 'https?://[^/]*'); -> https://mariadb.org ``` ``` SELECT REGEXP_SUBSTR('ABC','b'); -> B SELECT REGEXP_SUBSTR('ABC' COLLATE utf8_bin,'b'); -> SELECT REGEXP_SUBSTR(BINARY'ABC','b'); -> SELECT REGEXP_SUBSTR('ABC','(?i)b'); -> B SELECT REGEXP_SUBSTR('ABC' COLLATE utf8_bin,'(?+i)b'); -> B ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Using Encryption and Compression Tools With Mariabackup Using Encryption and Compression Tools With Mariabackup ======================================================= [Mariabackup](../backup-restore-and-import-clients-mariadb-backup/index) supports streaming to stdout with the `--stream=xbstream` option. This option allows easy integration with popular encryption and compression tools. Below are several examples. Encrypting and Decrypting Backup With openssl --------------------------------------------- The following example creates an AES-encrypted backup, protected with the password "mypass" and stores it in a file "backup.xb.enc": ``` mariabackup --user=root --backup --stream=xbstream | openssl enc -aes-256-cbc -k mypass > backup.xb.enc ``` To decrypt and unpack this backup into the current directory, the following command can be used: ``` openssl enc -d -aes-256-cbc -k mypass -in backup.xb.enc | mbstream -x ``` Compressing and Decompressing Backup With gzip ---------------------------------------------- This example compresses the backup without encrypting: ``` mariabackup --user=root --backup --stream=xbstream | gzip > backupstream.gz ``` We can decompress and unpack the backup as follows: ``` gunzip -c backupstream.gz | mbstream -x ``` Compressing and Encrypting Backup, Using gzip and openssl --------------------------------------------------------- This example adds a compression step before the encryption, otherwise looks almost identical to the previous example: ``` mariabackup --user=root --backup --stream=xbstream | gzip | openssl enc -aes-256-cbc -k mypass > backup.xb.gz.enc ``` We can decrypt, decompress and unpack the backup as follow (note `gzip -d` in the pipeline): ``` openssl enc -d -aes-256-cbc -k mypass -in backup.xb.gz.enc |gzip -d| mbstream -x ``` Compressing and Encrypting with 7Zip ------------------------------------ 7zip archiver is a popular utility (especially on Windows) that supports reading from standard output, with the -`-si` option, and writing to stdout with the `-so` option, and can thus be used together with Mariabackup. Compressing backup with the 7z command line utility works as follows: ``` mariabackup --user=root --backup --stream=xbstream | 7z a -si backup.xb.7z ``` Uncompress and unpack the archive with ``` 7z e backup.xb.7z -so |mbstream -x ``` 7z also has builtin AES-256 encryption. To encrypt the backup from the previous example using password SECRET, add `-pSECRET` to the 7z command line. Encrypting With GPG ------------------- Encryption ``` mariabackup --user=root --backup --stream=xbstream | gpg -c --passphrase SECRET --batch --yes -o backup.xb.gpg ``` Decrypt, unpack ``` gpg --decrypt --passphrase SECRET --batch --yes backup.xb.gpg | mbstream -x ``` Interactive Input for Passphrases --------------------------------- Most of the described tools also provide a way to enter a passphrase interactively (although 7zip does not seem to work well when reading input from stdin). Please consult documentation of the tools for more info. Writing extra status files -------------------------- By default files like `[xtrabackup\_checkpoints](../files-created-by-mariabackup/index#xtrabackup_checkpoints)` are also written to the output stream only, and so would not be available for taking further incremental backups without prior extraction from the compressed or encrypted stream output file. To avoid this these files can additionally be written to a directory that can then be used as input for further incremental backups using the `[--extra-lsndir=...](../mariabackup-options/index#-extra-lsndir)` option. See also e.g: [Combining incremental backups with streaming output](../incremental-backup-and-restore-with-mariabackup/index#combining-with-stream-output) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb REPEAT LOOP REPEAT LOOP =========== Syntax ------ ``` [begin_label:] REPEAT statement_list UNTIL search_condition END REPEAT [end_label] ``` The statement list within a `REPEAT` statement is repeated until the search\_condition is true. Thus, a `REPEAT` always enters the loop at least once. statement\_list consists of one or more statements, each terminated by a semicolon (i.e., `;`) statement delimiter. A `REPEAT` statement can be [labeled](../labels/index). end\_label cannot be given unless begin\_label also is present. If both are present, they must be the same. See [Delimiters](../delimiters/index) in the [mysql](../mysql-client/index) client for more on client delimiter usage. ``` DELIMITER // CREATE PROCEDURE dorepeat(p1 INT) BEGIN SET @x = 0; REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT; END // CALL dorepeat(1000)// SELECT @x// +------+ | @x | +------+ | 1001 | +------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Setting up a Replica with Mariabackup Setting up a Replica with Mariabackup ===================================== The terms *master* and *slave* have historically been used in replication, but the terms terms *primary* and *replica* are now preferred. The old terms are used still used in parts of the documentation, and in MariaDB commands, although [MariaDB 10.5](../what-is-mariadb-105/index) has begun the process of renaming. The documentation process is ongoing. See [MDEV-18777](https://jira.mariadb.org/browse/MDEV-18777) to follow progress on this effort. Mariabackup makes it very easy to set up a [replica](../high-availability-performance-tuning-mariadb-replication/index) using a [full backup](../full-backup-and-restore-with-mariabackup/index). This page documents how to set up a replica from a backup. If you are using [MariaDB Galera Cluster](../galera/index), then you may want to try one of the following pages instead: * [Configuring MariaDB Replication between MariaDB Galera Cluster and MariaDB Server](../using-mariadb-replication-with-mariadb-galera-cluster-configuring-mariadb-r/index) * [Configuring MariaDB Replication between Two MariaDB Galera Clusters](../configuring-mariadb-replication-between-two-mariadb-galera-clusters/index) Backup the Database and Prepare It ---------------------------------- The first step is to simply take and prepare a fresh [full backup](../full-backup-and-restore-with-mariabackup/index) of a database server in the [replication topology](../replication-overview/index#common-replication-setups). If the source database server is the desired replication primary, then we do not need to add any additional options when taking the full backup. For example: ``` $ mariabackup --backup \ --target-dir=/var/mariadb/backup/ \ --user=mariabackup --password=mypassword ``` If the source database server is a [replica](../high-availability-performance-tuning-mariadb-replication/index) of the desired primary, then we should add the [--slave-info](../mariabackup-options/index#-slave-info) option, and possibly the [--safe-slave-backup](../mariabackup-options/index#-safe-slave-backup) option. For example: ``` $ mariabackup --backup \ --slave-info --safe-slave-backup \ --target-dir=/var/mariadb/backup/ \ --user=mariabackup --password=mypassword ``` And then we would prepare the backup as you normally would. For example: ``` $ mariabackup --prepare \ --target-dir=/var/mariadb/backup/ ``` Copy the Backup to the New Replica ---------------------------------- Once the backup is done and prepared, we can copy it to the new replica. For example: ``` $ rsync -avP /var/mariadb/backup dbserver2:/var/mariadb/backup ``` Restore the Backup on the New Replica ------------------------------------- At this point, we can restore the backup to the [datadir](../server-system-variables/index#datadir), as you normally would. For example: ``` $ mariabackup --copy-back \ --target-dir=/var/mariadb/backup/ ``` And adjusting file permissions, if necessary: ``` $ chown -R mysql:mysql /var/lib/mysql/ ``` Create a Replication User on the Primary ---------------------------------------- Before the new replica can begin replicating from the primary, we need to [create a user account](../create-user/index) on the primary that the replica can use to connect, and we need to [grant](../grant/index) the user account the [REPLICATION SLAVE](../grant/index#global-privileges) privilege. For example: ``` CREATE USER 'repl'@'dbserver2' IDENTIFIED BY 'password'; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'dbserver2'; ``` Configure the New Replica ------------------------- Before we start the server on the new replica, we need to configure it. At the very least, we need to ensure that it has a unique [server\_id](../replication-and-binary-log-system-variables/index#server_id) value. We also need to make sure other replication settings are what we want them to be, such as the various [GTID system variables](../gtid/index#system-variables-for-global-transaction-id), if those apply in the specific environment. Once configuration is done, we can [start the MariaDB Server process](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index) on the new replica. Start Replication on the New Replica ------------------------------------ At this point, we need to get the replication coordinates of the primary from the original backup directory. If we took the backup on the primary, then the coordinates will be in the [xtrabackup\_binlog\_info](../files-created-by-mariabackup/index#xtrabackup_binlog_info) file. If we took the backup on another replica and if we provided the [--slave-info](../mariabackup-options/index#-slave-info) option, then the coordinates will be in the file [xtrabackup\_slave\_info](../files-created-by-mariabackup/index#xtrabackup_slave_info) file. Mariabackup dumps replication coordinates in two forms: [GTID](../gtid/index) coordinates and [binary log](../binary-log/index) file and position coordinates, like the ones you would normally see from [SHOW MASTER STATUS](../show-master-status/index) output. We can choose which set of coordinates we would like to use to set up replication. For example: ``` mariadb-bin.000096 568 0-1-2 ``` Regardless of the coordinates we use, we will have to set up the primary connection using [CHANGE MASTER TO](../change-master-to/index) and then start the replication threads with [START SLAVE](../start-slave/index). ### GTIDs If we want to use GTIDs, then we will have to first set [gtid\_slave\_pos](../gtid/index#gtid_slave_pos) to the [GTID](../gtid/index) coordinates that we pulled from either the [xtrabackup\_binlog\_info](../files-created-by-mariabackup/index#xtrabackup_binlog_info) file or the [xtrabackup\_slave\_info](../files-created-by-mariabackup/index#xtrabackup_slave_info) file in the backup directory. For example: ``` $ cat xtrabackup_binlog_info mariadb-bin.000096 568 0-1-2 ``` And then we would set `MASTER_USE_GTID=slave_pos` in the [CHANGE MASTER TO](../change-master-to/index) command. For example: ``` SET GLOBAL gtid_slave_pos = "0-1-2"; CHANGE MASTER TO MASTER_HOST="dbserver1", MASTER_PORT=3306, MASTER_USER="repl", MASTER_PASSWORD="password", MASTER_USE_GTID=slave_pos; START SLAVE; ``` ### File and Position If we want to use the [binary log](../binary-log/index) file and position coordinates, then we would set `MASTER_LOG_FILE` and `MASTER_LOG_POS` in the [CHANGE MASTER TO](../change-master-to/index) command to the file and position coordinates that we pulled; either the [xtrabackup\_binlog\_info](../files-created-by-mariabackup/index#xtrabackup_binlog_info) file or the [xtrabackup\_slave\_info](../files-created-by-mariabackup/index#xtrabackup_slave_info) file in the backup directory, depending on whether the backup was taken from the primary or from a replica of the primary. For example: ``` CHANGE MASTER TO MASTER_HOST="dbserver1", MASTER_PORT=3306, MASTER_USER="repl", MASTER_PASSWORD="password", MASTER_LOG_FILE='mariadb-bin.000096', MASTER_LOG_POS=568; START SLAVE; ``` Check the Status of the New Replica ----------------------------------- We should be done setting up the replica now, so we should check its status with [SHOW SLAVE STATUS](../show-slave-status/index). For example: ``` SHOW SLAVE STATUS\G ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Redistribute Data ColumnStore Redistribute Data ============================= Introduction ============ When new PM nodes are added to a running instance it may be desirable to redistribute the data in current nodes across all of the nodes. This is not strictly required as ongoing data ingestion will prioritize the new empty nodes for data loading to rebalance the system. An important point is that the operation works at Partition granularity, so a minimal data set is 64M rows in a a table for this to run. Usage ===== A command redistributeData is available in the admin console to initiate a data distribution: ``` mcsadmin> redistributeData start redistributedata Tue Dec 13 04:42:31 2016 redistributeData START Source dbroots: 1 2 Destination dbroots: 1 2 WriteEngineServer returned status 1: Cleared. WriteEngineServer returned status 2: Redistribute is started. ``` The command has 3 possible options: * Start : start a new redistribution to redistribute data equally amongst the current set of DBRoots in the system. * Stop : abort a redistribution leaving the system in a usable state. * Status : return status information on an active redistribution. The start command can take an option of Remove. The Start Remove option is used to remove all data from the enumerated list of dbroots and redistribute the data to the remaining dbroots. This should be done before taking a dbroot out of service in order to preserve the data on that dbroot. The dbroot list is a space delimited list of integers representing the dbroots to be emptied. As mentioned above, the operation works at partition granularity, which means that a minimal move is 64 million rows. Any table smaller than that will not be redistributed and there may be as much as one full Partition difference in the resulting balance. The redistribute logic does not currently consolidate individually deleted records. Redistribute can take a long time. During this time, it is required that all data manipulation including bulk inserts are suspended. SuspendDatabaseWrites must be called before redistributedata and ResumeDatabaseWrites should be called when the redistribution is complete. If "redistributeData stop" is called, all processing stops where it's at, but in a usable state. "redistributeData status" can be used to see how much has been done. A further "redistributeData start" will start over using the new state of the system. This may lead to a less optimal distribution, so stop-start sequences aren't recommended. While the system is working, "redistributeData status" can be called to see what's happening. a -r <count> option can be used on the status command line to repeat the call and act as a monitor. To see how much data resides on any given DBRoot for a table, you can use a query like: ``` select count(*) from <table> where idbdbroot(<any column>)=<dbrootnum>; ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb REPAIR TABLE REPAIR TABLE ============ Syntax ------ ``` REPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... [QUICK] [EXTENDED] [USE_FRM] ``` Description ----------- `REPAIR TABLE` repairs a possibly corrupted table. By default, it has the same effect as ``` myisamchk --recover tbl_name ``` or ``` aria_chk --recover tbl_name ``` See [aria\_chk](../aria_chk/index) and [myisamchk](../myisamchk/index) for more. `REPAIR TABLE` works for [Archive](../archive/index), [Aria](../aria/index), [CSV](../csv/index) and [MyISAM](../myisam/index) tables. For [InnoDB](../innodb/index), see [recovery modes](../innodb-recovery-modes/index). For CSV, see also [Checking and Repairing CSV Tables](../checking-and-repairing-csv-tables/index). For Archive, this statement also improves compression. If the storage engine does not support this statement, a warning is issued. This statement requires [SELECT and INSERT privileges](../grant/index) for the table. By default, `REPAIR TABLE` statements are written to the [binary log](../binary-log/index) and will be [replicated](../replication/index). The `NO_WRITE_TO_BINLOG` keyword (`LOCAL` is an alias) will ensure the statement is not written to the binary log. From [MariaDB 10.3.19](https://mariadb.com/kb/en/mariadb-10319-release-notes/), `REPAIR TABLE` statements are not logged to the binary log if [read\_only](../server-system-variables/index#read_only) is set. See also [Read-Only Replicas](../read-only-replicas/index). When an index is recreated, the storage engine may use a configurable buffer in the process. Incrementing the buffer speeds up the index creation. [Aria](../aria/index) and [MyISAM](../myisam/index) allocate a buffer whose size is defined by `[aria\_sort\_buffer\_size](../aria-server-system-variables/index#aria_sort_buffer_size)` or `[myisam\_sort\_buffer\_size](../myisam-server-system-variables/index#myisam_sort_buffer_size)`, also used for `[ALTER TABLE](../alter-table/index)`. `REPAIR TABLE` is also supported for partitioned tables. However, the `USE_FRM` option cannot be used with this statement on a partitioned table. `[ALTER TABLE ... REPAIR PARTITION](../alter-table/index)` can be used to repair one or more partitions. The [Aria](../aria/index) storage engine supports [progress reporting](../progress-reporting/index) for this statement. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BIT_OR BIT\_OR ======= Syntax ------ ``` BIT_OR(expr) [over_clause] ``` Description ----------- Returns the bitwise OR of all bits in `expr`. The calculation is performed with 64-bit ([BIGINT](../bigint/index)) precision. It is an [aggregate function](../aggregate-functions/index), and so can be used with the [GROUP BY](../group-by/index) clause. If no rows match, `BIT_OR` will return a value with all bits set to `0`. NULL values have no effect on the result unless all results are NULL, which is treated as no match. From [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/), `BIT_OR` can be used as a [window function](../window-functions/index) with the addition of the *over\_clause*. Examples -------- ``` CREATE TABLE vals (x INT); INSERT INTO vals VALUES(111),(110),(100); SELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals; +------------+-----------+------------+ | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) | +------------+-----------+------------+ | 100 | 111 | 101 | +------------+-----------+------------+ ``` As an [aggregate function](../aggregate-functions/index): ``` CREATE TABLE vals2 (category VARCHAR(1), x INT); INSERT INTO vals2 VALUES ('a',111),('a',110),('a',100), ('b','000'),('b',001),('b',011); SELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals GROUP BY category; +----------+------------+-----------+------------+ | category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) | +----------+------------+-----------+------------+ | a | 100 | 111 | 101 | | b | 0 | 11 | 10 | +----------+------------+-----------+------------+ ``` No match: ``` SELECT BIT_OR(NULL); +--------------+ | BIT_OR(NULL) | +--------------+ | 0 | +--------------+ ``` See Also -------- * [BIT\_AND](../bit_and/index) * [BIT\_XOR](../bit_xor/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb SAVEPOINT SAVEPOINT ========= Syntax ------ ``` SAVEPOINT identifier ROLLBACK [WORK] TO [SAVEPOINT] identifier RELEASE SAVEPOINT identifier ``` Description ----------- InnoDB supports the SQL statements `SAVEPOINT`, `ROLLBACK TO SAVEPOINT`, `RELEASE SAVEPOINT` and the optional `WORK` keyword for `ROLLBACK`. Each savepoint must have a legal [MariaDB identifier](../identifier-names/index). A savepoint is a named sub-transaction. Normally [ROLLBACK](../rollback/index) undoes the changes performed by the whole transaction. When used with the TO clause, it undoes the changes performed after the specified savepoint, and erases all subsequent savepoints. However, all locks that have been acquired after the save point will survive. RELEASE SAVEPOINT does not rollback or commit any changes, but removes the specified savepoint. When the execution of a trigger or a stored function begins, it is not possible to use statements which reference a savepoint which was defined from out of that stored program. When a [COMMIT](../commit/index) (including implicit commits) or a ROLLBACK statement (with no TO clause) is performed, they act on the whole transaction, and all savepoints are removed. Errors ------ If COMMIT or ROLLBACK is issued and no transaction was started, no error is reported. If SAVEPOINT is issued and no transaction was started, no error is reported but no savepoint is created. When ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT is called for a savepoint that does not exist, an error like this is issued: ``` ERROR 1305 (42000): SAVEPOINT svp_name does not exist ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema events_waits_history_long Table Performance Schema events\_waits\_history\_long Table ===================================================== The `events_waits_history_long` table by default contains the ten thousand most recent completed wait events. This number can be adjusted by setting the [performance\_schema\_events\_waits\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_waits_history_long_size) system variable when the server starts up. The table structure is identical to the [events\_waits\_current](../performance-schema-events_waits_current-table/index) table structure, and contains the following columns: | Column | Description | | --- | --- | | `THREAD_ID` | Thread associated with the event. Together with `EVENT_ID` uniquely identifies the row. | | `EVENT_ID` | Thread's current event number at the start of the event. Together with`THREAD_ID`uniquely identifies the row. | | `END_EVENT_ID` | `NULL` when the event starts, set to the thread's current event number at the end of the event. | | `EVENT_NAME` | Event instrument name and a NAME from the `setup_instruments` table | | `SOURCE` | Name and line number of the source file containing the instrumented code that produced the event. | | `TIMER_START` | Value in picoseconds when the event timing started or `NULL` if timing is not collected. | | `TIMER_END` | Value in picoseconds when the event timing ended, or `NULL` if timing is not collected. | | `TIMER_WAIT` | Value in picoseconds of the event's duration or `NULL` if timing is not collected. | | `SPINS` | Number of spin rounds for a mutex, or `NULL` if spin rounds are not used, or spinning is not instrumented. | | `OBJECT_SCHEMA` | Name of the schema that contains the table for table I/O objects, otherwise `NULL` for file I/O and synchronization objects. | | `OBJECT_NAME` | File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or `NULL` for a synchronization object. | | `INDEX_NAME` | Name of the index, PRIMARY for the primary key, or `NULL` for no index used. | | `OBJECT_TYPE` | FILE for a file object, `TABLE` or `TEMPORARY TABLE` for a table object, or `NULL` for a synchronization object. | | `OBJECT_INSTANCE_BEGIN` | Address in memory of the object. | | `NESTING_EVENT_ID` | `EVENT_ID` of event within which this event nests. | | `NESTING_EVENT_TYPE` | Nesting event type. Either `statement`, `stage` or `wait`. | | `OPERATION` | Operation type, for example read, write or lock | | `NUMBER_OF_BYTES` | Number of bytes that the operation read or wrote, or `NULL` for table I/O waits. | | `FLAGS` | Reserved for use in the future. | It is possible to empty this table with a `TRUNCATE TABLE` statement. events\_waits\_current and events\_waits\_history are related tables. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Compiling MariaDB From Source Compiling MariaDB From Source ============================== | Title | Description | | --- | --- | | [Get, Build and Test Latest MariaDB the Lazy Way](../get-build-and-test-latest-mariadb-the-lazy-way/index) | Instructions for people who don't have time to read the whole manual. | | [MariaDB Source Code](../getting-the-mariadb-source-code/index) | How to get the source code for MariaDB from GitHub. | | [Build Environment Setup for Linux](../build_environment_setup_for_linux/index) | Requirements and build environment setup for Linux. | | [Generic Build Instructions](../generic-build-instructions/index) | Instructions to help compile MariaDB from source. | | [Compiling MariaDB with Extra Modules/Options](../compiling-mariadb-with-extra-modulesoptions/index) | Articles on compiling MariaDB with extra modules and options | | [Creating the MariaDB Source Tarball](../creating_the_mariadb_source_tarball/index) | How to create a source tar.gz file | | [Creating the MariaDB Binary Tarball](../creating-the-mariadb-binary-tarball/index) | How to generate binary tar.gz files | | [Build Environment Setup for Mac](../build_environment_setup_for_mac/index) | Setting up the build environment for Mac | | [Building MariaDB from a Source RPM](../building-mariadb-from-a-source-rpm/index) | How to build MariaDB from a source RPM (SRPM). | | [Building MariaDB on CentOS](../source-building-mariadb-on-centos/index) | CentOS build requirements and steps. | | [Building MariaDB on Fedora](../building-mariadb-on-fedora/index) | Guide to building MariaDB from source code on Fedora Linux. | | [Building MariaDB on Debian](../building-mariadb-on-debian/index) | Steps to compiling MariaDB on Debian Linux. | | [Building MariaDB on FreeBSD](../building-mariadb-on-freebsd/index) | How to build MariaDB on FreeBSD. | | [Building MariaDB on Gentoo](../building_mariadb_on_gentoo/index) | Steps to build MariaDB on Gentoo | | [Building MariaDB on Solaris and OpenSolaris](../building-mariadb-on-solaris-and-opensolaris/index) | Links and notes for building MariaDB on Solaris and OpenSolaris | | [Building MariaDB on Ubuntu](../building-mariadb-on-ubuntu/index) | Requirements and steps for building MariaDB on Ubuntu. | | [Building MariaDB on Windows](../building_mariadb_on_windows/index) | Instructions for building MariaDB on Windows. | | [Installing MariaDB Server on macOS Using Homebrew](../installing-mariadb-on-macos-using-homebrew/index) | Installing MariaDB on macOS via the Homebrew package manager, the "missing ... | | [Compiling with the InnoDB Plugin from Oracle](../compiling-with-the-innodb-plugin-from-oracle/index) | Compiling MariaDB with the InnoDB plugin from Oracle. | | [Creating a Debian Repository](../creating_a_debian_repository/index) | Instructions for creating your own Debian repository | | [Building MariaDB From Source Using musl-based GNU/Linux](../building-mariadb-from-source-using-musl-based-gnulinux/index) | Instructions on compiling MariaDB on musl-based operating systems (Alpine) | | [Compiling MariaDB for Debugging](../compiling-mariadb-for-debugging/index) | Passing -DCMAKE\_BUILD\_TYPE=Debug to cmake to compile with debug information. | | [Cross-compiling MariaDB](../cross-compiling-mariadb/index) | To cross-compile with cmake you will need a toolchain file | | [MariaDB Source Configuration Options](../compiling-mariadb-from-source-mariadb-source-configuration-options/index) | Options for configuring a MariaDB source distribution. | | [Building RPM Packages From Source](../building-rpm-packages-from-source/index) | Building MariaDB RPM packages with CMake and CPackRPM. | | [Compile and Using MariaDB with Sanitizers (ASAN, UBSAN, TSAN, MSAN)](../compile-and-using-mariadb-with-sanitizers-asan-ubsan-tsan-msan/index) | How to compile and use MariaDB with AddressSanitizer (ASAN). | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BLOB and TEXT Data Types BLOB and TEXT Data Types ======================== Description ----------- A `BLOB` is a binary large object that can hold a variable amount of data. The four `BLOB` types are * [TINYBLOB](../sql_language-data_types-tinyblob/index), * [BLOB](../sql_language-data_types-blob/index), * [MEDIUMBLOB](../sql_language-data_types-mediumblob/index), and * [LONGBLOB](../sql_language-data_types-longblob/index). These differ only in the maximum length of the values they can hold. The `TEXT` types are * [TINYTEXT](../sql_language-data_types-tinytext/index), * [TEXT](../sql_language-data_types-text/index), * [MEDIUMTEXT](../sql_language-data_types-mediumtext/index), and * [LONGTEXT](../sql_language-data_types-longtext/index). * [JSON](../json-data-type/index) (alias for LONGTEXT) These correspond to the four `BLOB` types and have the same maximum lengths and [storage requirements](../data-type-storage-requirements/index). **MariaDB starting with [10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/)**Starting from [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/), `BLOB` and `TEXT` columns can have a `DEFAULT` value. **MariaDB starting with [10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)**From [MariaDB 10.4](../what-is-mariadb-104/index), it is possible to set a [unique index](../getting-started-with-indexes/index#unique-index) on columns that use the `BLOB` or `TEXT` data types. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema CLIENT_STATISTICS Table Information Schema CLIENT\_STATISTICS Table =========================================== The [Information Schema](../information_schema/index) `CLIENT_STATISTICS` table holds statistics about client connections. This is part of the [User Statistics](../user-statistics/index) feature, which is not enabled by default. It contains the following columns: | Field | Type | Notes | | --- | --- | --- | | `CLIENT` | `VARCHAR(64)` | The IP address or hostname the connection originated from. | | `TOTAL_CONNECTIONS` | `INT(21)` | The number of connections created for this client. | | `CONCURRENT_CONNECTIONS` | `INT(21)` | The number of concurrent connections for this client. | | `CONNECTED_TIME` | `INT(21)` | The cumulative number of seconds elapsed while there were connections from this client. | | `BUSY_TIME` | `DOUBLE` | The cumulative number of seconds there was activity on connections from this client. | | `CPU_TIME` | `DOUBLE` | The cumulative CPU time elapsed while servicing this client's connections. Note that this number may be wrong on SMP system if there was a CPU migration for the thread during the execution of the query. | | `BYTES_RECEIVED` | `INT(21)` | The number of bytes received from this client's connections. | | `BYTES_SENT` | `INT(21)` | The number of bytes sent to this client's connections. | | `BINLOG_BYTES_WRITTEN` | `INT(21)` | The number of bytes written to the [binary log](../binary-log/index) from this client's connections. | | `ROWS_READ` | `INT(21)` | The number of rows read by this client's connections. | | `ROWS_SENT` | `INT(21)` | The number of rows sent by this client's connections. | | `ROWS_DELETED` | `INT(21)` | The number of rows deleted by this client's connections. | | `ROWS_INSERTED` | `INT(21)` | The number of rows inserted by this client's connections. | | `ROWS_UPDATED` | `INT(21)` | The number of rows updated by this client's connections. | | `SELECT_COMMANDS` | `INT(21)` | The number of `[SELECT](../select/index)` commands executed from this client's connections. | | `UPDATE_COMMANDS` | `INT(21)` | The number of `[UPDATE](../update/index)` commands executed from this client's connections. | | `OTHER_COMMANDS` | `INT(21)` | The number of other commands executed from this client's connections. | | `COMMIT_TRANSACTIONS` | `INT(21)` | The number of `[COMMIT](../commit/index)` commands issued by this client's connections. | | `ROLLBACK_TRANSACTIONS` | `INT(21)` | The number of `[ROLLBACK](../rollback/index)` commands issued by this client's connections. | | `DENIED_CONNECTIONS` | `INT(21)` | The number of connections denied to this client. | | `LOST_CONNECTIONS` | `INT(21)` | The number of this client's connections that were terminated uncleanly. | | `ACCESS_DENIED` | `INT(21)` | The number of times this client's connections issued commands that were denied. | | `EMPTY_QUERIES` | `INT(21)` | The number of times this client's connections sent queries that returned no results to the server. | | `TOTAL_SSL_CONNECTIONS` | `INT(21)` | The number of [TLS connections](../secure-connections-overview/index) created for this client. (>= [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)) | | `MAX_STATEMENT_TIME_EXCEEDED` | `INT(21)` | The number of times a statement was aborted, because it was executed longer than its `[MAX\_STATEMENT\_TIME](../aborting-statements-that-take-longer-than-a-certain-time-to-execute/index)` threshold. (>= [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)) | #### Example ``` SELECT * FROM information_schema.CLIENT_STATISTICS\G *************************** 1. row *************************** CLIENT: localhost TOTAL_CONNECTIONS: 3 CONCURRENT_CONNECTIONS: 0 CONNECTED_TIME: 4883 BUSY_TIME: 0.009722 CPU_TIME: 0.0102131 BYTES_RECEIVED: 841 BYTES_SENT: 13897 BINLOG_BYTES_WRITTEN: 0 ROWS_READ: 0 ROWS_SENT: 214 ROWS_DELETED: 0 ROWS_INSERTED: 207 ROWS_UPDATED: 0 SELECT_COMMANDS: 10 UPDATE_COMMANDS: 0 OTHER_COMMANDS: 13 COMMIT_TRANSACTIONS: 0 ROLLBACK_TRANSACTIONS: 0 DENIED_CONNECTIONS: 0 LOST_CONNECTIONS: 0 ACCESS_DENIED: 0 EMPTY_QUERIES: 1 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB DYNAMIC Row Format InnoDB DYNAMIC Row Format ========================= **MariaDB starting with [10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/)**In [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/) and later, the default row format is `DYNAMIC`. The `DYNAMIC` row format is similar to the `COMPACT` row format, but tables using the `DYNAMIC` row format can store even more data on overflow pages than tables using the `COMPACT` row format. This results in more efficient data storage than tables using the `COMPACT` row format, especially for tables containing columns using the [VARBINARY](../varbinary/index), [VARCHAR](../varchar/index), [BLOB](../blob/index) and [TEXT](../text/index) data types. However, InnoDB tables using the `COMPRESSED` row format are more efficient. The `DYNAMIC` row format was originally introduced in [MariaDB 5.5](../what-is-mariadb-55/index). Using the DYNAMIC Row Format ---------------------------- **MariaDB starting with [10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/)**In [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/) and later, the default row format is `DYNAMIC`, as long as the [innodb\_default\_row\_format](../innodb-system-variables/index#innodb_default_row_format) system variable has not been modified. Therefore, in these versions, the easiest way to create an InnoDB table that uses the `DYNAMIC` row format is by **not** setting the [ROW\_FORMAT](../create-table/index#row_format) table option at all in a [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index) statement. It is recommended to set the [innodb\_strict\_mode](../innodb-system-variables/index#innodb_strict_mode) system variable to `ON` when using this row format. For example: ``` SET SESSION innodb_strict_mode=ON; SET GLOBAL innodb_default_row_format='dynamic'; CREATE TABLE tab ( id int, str varchar(50) ) ENGINE=InnoDB; ``` **MariaDB until [10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/)**In [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/) and before, the easiest way to create an InnoDB table that uses the `DYNAMIC` row format is by setting the [ROW\_FORMAT](../create-table/index#row_format) table option to to `DYNAMIC` in a [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index) statement. It is recommended to set the [innodb\_strict\_mode](../innodb-system-variables/index#innodb_strict_mode) system variable to `ON` when using this row format. The `DYNAMIC` row format is only supported by the `Barracuda` [file format](../xtradbinnodb-file-format/index). As a side effect, in [MariaDB 10.1](../what-is-mariadb-101/index) and before, the `DYNAMIC` row format is only supported if the [InnoDB file format](../xtradbinnodb-file-format/index) is `Barracuda`. Therefore, the [innodb\_file\_format](../innodb-system-variables/index#innodb_file_format) system variable must be set to `Barracuda` to use these row formats in those versions. In [MariaDB 10.1](../what-is-mariadb-101/index) and before, the `DYNAMIC` row format is also only supported if the table is in a [file per-table](../innodb-file-per-table-tablespaces/index) tablespace. Therefore, the [innodb\_file\_per\_table](../innodb-system-variables/index#innodb_file_per_table) system variable must be set to `ON` to use this row format in those versions. For example: ``` SET SESSION innodb_strict_mode=ON; SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_format='Barracuda'; CREATE TABLE tab ( id int, str varchar(50) ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; ``` Index Prefixes with the DYNAMIC Row Format ------------------------------------------ The `DYNAMIC` row format supports index prefixes up to 3072 bytes. In [MariaDB 10.2](../what-is-mariadb-102/index) and before, the [innodb\_large\_prefix](../innodb-system-variables/index#innodb_large_prefix) system variable is used to configure the maximum index prefix length. In these versions, if [innodb\_large\_prefix](../innodb-system-variables/index#innodb_large_prefix) is set to `ON`, then the maximum prefix length is 3072 bytes, and if it is set to `OFF`, then the maximum prefix length is 767 bytes. Overflow Pages with the DYNAMIC Row Format ------------------------------------------ All InnoDB row formats can store certain kinds of data in overflow pages. This allows for the maximum row size of an InnoDB table to be larger than the maximum amount of data that can be stored in the row's main data page. See [Maximum Row Size](#maximum-row-size) for more information about the other factors that can contribute to the maximum row size for InnoDB tables. In the `DYNAMIC` row format variable-length columns, such as columns using the [VARBINARY](../varbinary/index), [VARCHAR](../varchar/index), [BLOB](../blob/index) and [TEXT](../text/index) data types, can be completely stored in overflow pages. InnoDB only considers using overflow pages if the table's row size is greater than half of [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size). If the row size is greater than this, then InnoDB chooses variable-length columns to be stored on overflow pages until the row size is less than half of [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size). For [BLOB](../blob/index) and [TEXT](../text/index) columns, only values longer than 40 bytes are considered for storage on overflow pages. For [VARBINARY](../varbinary/index) and [VARCHAR](../varchar/index) columns, only values longer than 255 bytes are considered for storage on overflow pages. Bytes that are stored to track a value's length do not count towards these limits. These limits are only based on the length of the actual column's data. These limits differ from the limits for the `COMPACT` row format, where the limit is 767 bytes for all types. Fixed-length columns greater than 767 bytes are encoded as variable-length columns, so they can also be stored in overflow pages if the table's row size is greater than half of [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size). Even though a column using the [CHAR](../char/index) data type can hold at most 255 characters, a [CHAR](../char/index) column can still exceed 767 bytes in some cases. For example, a `char(255)` column can exceed 767 bytes if the [character set](../character-sets/index) is `utf8mb4`. If a column is chosen to be stored on overflow pages, then the entire value of the column is stored on overflow pages, and only a 20-byte pointer to the column's first overflow page is stored on the main page. Each overflow page is the size of [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size). If a column is too large to be stored on a single overflow page, then it is stored on multiple overflow pages. Each overflow page contains part of the data and a 20-byte pointer to the next overflow page, if a next page exists. This behavior differs from the behavior of the `COMPACT` row format, which always stores the column prefix on the main page. This allows tables using the `DYNAMIC` row format to contain a high number of columns using the [VARBINARY](../varbinary/index), [VARCHAR](../varchar/index), [BLOB](../blob/index) and [TEXT](../text/index) data types. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Running mariadb-tzinfo-to-sql with Ansible Running mariadb-tzinfo-to-sql with Ansible ========================================== For documentation about the `mariadb-tzinfo-to-sql` utility, see [mysql\_tzinfo\_to\_sql](../mysql_tzinfo_to_sql/index). This page is about running it using Ansible. Installing or Upgrading the Package ----------------------------------- First, we should install `mariadb-tzinfo-to-sql` if it is available on our system. For example, to install it on Ubuntu, we can use this task. For other systems, use the proper module and package name. ``` - name: Update timezone info tags: [ timezone-update ] apt: name: tzdata state: latest install_recommends: no register: timezone_info ``` This task installs the latest version of the `tzdata`, unless it is already installed and up to date. We register the `timezone_info` variables, so we can only run the next task if the package was installed or updated. We also specify a `timezone-update` tag, so we can apply the role to only update the timezone tables. Running the Script ------------------ The next task runs `mariadb-tzinfo-to-sql`. ``` - name: Move system timezone info into MariaDB tags: [ timezone-update ] shell: > mysql_tzinfo_to_sql /usr/share/zoneinfo \ | grep -v "^Warning" \ | mysql --database=mysql when: timezone_info.changed ``` We use the `shell` module to run the command. Running a command in this way is not idempotent, so we specify `when: timezone_info.changed` to only run it when necessary. Some warnings may be generated, so we pipe the output of `mysql_tzinfo_to_sql` to `grep` to filter warnings out. Using Galera ------------ If we're using [MariaDB Galera Cluster](../galera-cluster/index) we'll want to only update the timezone tables in one node, because the other nodes will replicate the changes. For our convenience, we can run this operation on the first node. If the nodes hostnames are defined in a list called `cluster_hosts`, we can check if the current node is the first in this way: ``` when: timezone_info.changed and inventory_hostname == cluster_hosts[0].hostname ``` --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadbd-multi mariadbd-multi ============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadbd-multi` is a symlink to `mysqld_multi`, the wrapper designed to manage several mysqld processes running on the same host. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadbd-multi` is the name of the server, with `mysqld_multi` a symlink . See [mysqld\_multi](../mysqld_multi/index) for details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Books on MariaDB Code Books on MariaDB Code ===================== Below is a list of books on coding in MariaDB, listed in order by date of publication—the most recent first. We've provided links to Amazon.com or the publisher for convenience, but they can be found at many bookstores. *[Understanding MySQL Internals](http://www.amazon.com/dp/0596009577)* by Sasha Pachev, former MySQL developer at MySQL AB, April 2007 This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. *[MySQL 5.1 Plugin Development](http://www.amazon.com/dp/1849510601)* by Sergei Golubchik and Andrew Hutching, August 2010 A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.tables_priv Table mysql.tables\_priv Table ======================== The `mysql.tables_priv` table contains information about table-level privileges. The table can be queried and although it is possible to directly update it, it is best to use [GRANT](../grant/index) for setting privileges. Note that the MariaDB privileges occur at many levels. A user may be granted a privilege at the table level, but may still not have permission on a database level, for example. See [privileges](../grant/index) for a more complete view of the MariaDB privilege system. The [INFORMATION\_SCHEMA.TABLE\_PRIVILEGES](../information-schema-table_privileges-table/index) table derives its contents from `mysql.tables_priv`. **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. The `mysql.tables_priv` table contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `Host` | `char(60)` | NO | PRI | | Host (together with `User`, `Db` and `Table_name`makes up the unique identifier for this record. | | `Db` | `char(64)` | NO | PRI | | Database (together with `User`, `Host` and `Table_name`makes up the unique identifier for this record. | | `User` | `char(80)` | NO | PRI | | User (together with `Host`, `Db` and `Table_name`makes up the unique identifier for this record. | | `Table_name` | `char(64)` | NO | PRI | | Table name (together with `User`, `Db` and `Table`makes up the unique identifier for this record. | | `Grantor` | `char(141)` | NO | MUL | | | | `Timestamp` | `timestamp` | NO | | `CURRENT_TIMESTAMP` | | | `Table_priv` | `set('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Grant', 'References', 'Index', 'Alter', 'Create View', 'Show view', 'Trigger', 'Delete versioning rows')` | NO | | | The table privilege type. See [Table Privileges](../grant/index#table-privileges) for details. | | `Column_priv` | `set('Select', 'Insert', 'Update', 'References')` | NO | | | The column privilege type. See [Column Privileges](../grant/index#column-privileges) for details. | The [Acl\_table\_grants](../server-status-variables/index#acl_table_grants) status variable, added in [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/), indicates how many rows the `mysql.tables_priv` table contains. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-import mariadb-import ============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-import` is a symlink to `mysqlimport`, the tool for loading tables from text files in various formats. See [mysqlimport](../mysqlimport/index) for details. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-import` is the name of the script, with `mysqlimport` a symlink . Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema global_status Table Performance Schema global\_status Table ======================================= **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The `global_status` table was added in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The `global_status` table contains a list of status variables and their global values. The table only stores status variable statistics for threads which are instrumented, and does not collect statistics for `Com_xxx` variables. The table contains the following columns: | Column | Description | | --- | --- | | `VARIABLE_NAME` | The global status variable name. | | `VARIABLE_VALUE` | The global status variable value. | [TRUNCATE TABLE](../truncate-table/index) resets global status variables, including thread, account, host, and user status, but not those that are never reset by the server. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Create Table ColumnStore Create Table ======================== A database consists of tables that store user data. You can create multiple columns with the create table statement. The data type follows the column name when adding columns. Syntax ------ ``` CREATE TABLE [IF NOT EXISTS] tbl_name (create_definition,...) engine=columnstore [ DEFAULT CHARSET=character-set] [COMMENT '[compression=0|1][;] CREATE TABLE [IF NOT EXISTS] tbl_name { LIKE old_table_name | (LIKE old_table_name) } create_definition: { col_name column_definition } column_definition: data_type [NOT NULL | NULL] [DEFAULT default_value] [COMMENT '[compression=0|1]; ``` images here Notes: ------ * ColumnStore tables should not be created in the mysql, information\_schema, calpontsys or test databases. * ColumnStore stores all object names in lower case. * CREATE TABLE LIKE is supported starting from version MariaDB CoumnStore 1.2 and higher * CREATE TABLE AS SELECT is not supported, and will instead create the table in the default storage engine. * Compression level (0 for no compression, 1 for compression) can be set at the system level. If a session default exists, this will override the system default. In turn, this can be overridden by the table level compression comment, and finally a compression comment at the column level. * A table can be created in the front end only by using a ‘schema sync only’ comment. This could be useful when the table has been created on one user module, and needs to be synced to others. * The column DEFAULT value can be a maximum of 64 characters. * For maximum compatibility with external tools MariaDB ColumnStore will accept the following table attributes, however these are not implemented within MariaDB ColumnStore: + MIN\_ROWS + MAX\_ROWS + AUTO\_INCREMENT * Datatype timestamp is not supported for Columnstore below 1.4. Caused a "The syntax or the data type(s) is not supported by Columnstore" error. All of these are ignored by ColumnStore.The following statement creates a table called orders with two columns: *orderkey* with datatype integer and *customer* with datatype varchar: ``` CREATE TABLE orders ( orderkey INTEGER, customer VARCHAR(45) ) ENGINE=ColumnStore ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INET6_ATON INET6\_ATON =========== Syntax ------ ``` INET6_ATON(expr) ``` Description ----------- Given an IPv6 or IPv4 network address as a string, returns a binary string that represents the numeric value of the address. No trailing zone ID's or traling network masks are permitted. For IPv4 addresses, or IPv6 addresses with IPv4 address parts, no classful addresses or trailing port numbers are permitted and octal numbers are not supported. The returned binary string will be [VARBINARY(16)](../varbinary/index) or [VARBINARY(4)](../varbinary/index) for IPv6 and IPv4 addresses respectively. Returns NULL if the argument is not understood. **MariaDB starting with [10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/)**From [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), `INET6_ATON` can take [INET6](../inet6/index) as an argument. Examples -------- ``` SELECT HEX(INET6_ATON('10.0.1.1')); +-----------------------------+ | HEX(INET6_ATON('10.0.1.1')) | +-----------------------------+ | 0A000101 | +-----------------------------+ SELECT HEX(INET6_ATON('48f3::d432:1431:ba23:846f')); +----------------------------------------------+ | HEX(INET6_ATON('48f3::d432:1431:ba23:846f')) | +----------------------------------------------+ | 48F3000000000000D4321431BA23846F | +----------------------------------------------+ ``` See Also -------- * [INET6\_NTOA()](../inet6_ntoa/index) * [INET\_ATON()](../inet_aton/index) * [INET6](../inet6/index) Data Type Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Virtual Machines - Ubuntu 14.04 "trusty" Buildbot Setup for Virtual Machines - Ubuntu 14.04 "trusty" =========================================================== Base install ------------ ``` qemu-img create -f qcow2 /kvm/vms/vm-trusty-amd64-serial.qcow2 20G qemu-img create -f qcow2 /kvm/vms/vm-trusty-i386-serial.qcow2 20G ``` Start each VM booting from the server install iso one at a time and perform the following install steps: ``` kvm -m 2048 -hda /kvm/vms/vm-trusty-amd64-serial.qcow2 \ -cdrom /kvm/iso/ubuntu/trusty-server-amd64.iso \ -boot d -smp 2 -cpu qemu64 \ -net nic,model=virtio \ -net user,hostfwd=tcp:127.0.0.1:2293-:22 kvm -m 2048 -hda /kvm/vms/vm-trusty-i386-serial.qcow2 \ -cdrom /kvm/iso/ubuntu/trusty-server-i386.iso \ -boot d -smp 2 -cpu qemu64 \ -net nic,model=virtio \ -net user,hostfwd=tcp:127.0.0.1:2294-:22 ``` Once running you can connect to the VNC server from your local host with: ``` vncviewer -via ${remote_host} localhost ``` Replace ${remote-host} with the host the vm is running on. **Note:** When you activate the install, vncviewer may disconnect with a complaint about the rect being too large. This is fine. Ubuntu has just resized the vnc screen. Simply reconnect. During the install, pick default options for the most part, with the following notes: * Set the hostname to `ubuntu-trusty-amd64` or `ubuntu-trusty-i386` (depending on which architecture we're installing) * **do not** encrypt the home directory * When prompted if the timezone is correct, answer "No" and when the list comes up, scroll to the bottom and choose "UTC" * When partitioning disks, choose "Guided - use entire disk" (we do not want LVM) * No automatic updates * Choose software to install: OpenSSH server Reboot when prompted. It will fail, so just kill the kvm process with `^Ctrl+C`. Now that the VM is installed, it's time to configure it. If you have the memory you can do the following simultaneously: ``` qemu-system-x86_64 -m 2048 -hda /kvm/vms/vm-trusty-amd64-serial.qcow2 \ -boot c -smp 2 -cpu qemu64 \ -net nic,model=virtio \ -net user,hostfwd=tcp:127.0.0.1:2293-:22 \ -nographic qemu-system-x86_64 -m 2048 -hda /kvm/vms/vm-trusty-i386-serial.qcow2 \ -boot c -smp 2 -cpu qemu64 \ -net nic,model=virtio \ -net user,hostfwd=tcp:127.0.0.1:2294-:22 \ -nographic ``` * set `vim` as the preferred editor ``` ssh -t -p 2293 localhost sudo update-alternatives --config editor ssh -t -p 2294 localhost sudo update-alternatives --config editor ``` * Enabling passwordless sudo: ``` sudo VISUAL=vi visudo # Add line at end: `%sudo ALL=NOPASSWD: ALL' ``` * edit /boot/grub/menu.lst: ``` sudo vi /etc/default/grub # Add/edit these entries: GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=0 GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL="serial" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" sudo update-grub # exit back to the host server ``` * create the `.ssh` directory and the `sudo` group ``` ssh -t -p 2293 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" ssh -t -p 2294 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" ``` * copy the `authorized_keys` file up to the VMs ``` scp -P 2293 /kvm/vms/authorized_keys localhost:.ssh/ scp -P 2294 /kvm/vms/authorized_keys localhost:.ssh/ ``` * create the buildbot user on the amd64 VM ``` echo $'Buildbot\n\n\n\n\ny' | ssh -p 2293 localhost 'chmod -vR go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir -v ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' ``` * create the buildbot user on the x86 VM ``` echo $'Buildbot\n\n\n\n\ny' | ssh -p 2294 localhost 'chmod -vR go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir -v ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' ``` * copy the ttyS0 file to the VMs ``` scp -i -P 2293 /kvm/vms/ttyS0.conf buildbot@localhost: scp -i -P 2294 /kvm/vms/ttyS0.conf buildbot@localhost: ``` * Apply all OS updates ``` ssh -t -i -p 2293 buildbot@localhost \ 'sudo apt-get update && sudo apt-get -y dist-upgrade;' ssh -t -i -p 2294 buildbot@localhost \ 'sudo apt-get update && sudo apt-get -y dist-upgrade;' ``` * copy the ttyS0 file to its proper location and shut down the VM ``` ssh -t -i -p 2293 buildbot@localhost \ 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ssh -t -i -p 2294 buildbot@localhost \ 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ``` VMs for building .debs ---------------------- ``` for i in '/kvm/vms/vm-trusty-amd64-serial.qcow2 2293 qemu64' '/kvm/vms/vm-trusty-i386-serial.qcow2 2294 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/build/')" \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/thrift-0.9.0.tar.gz buildbot@localhost:/dev/shm/" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get -y build-dep mysql-server-5.5" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts hardening-wrapper fakeroot doxygen texlive-latex-base ghostscript libevent-dev libssl-dev zlib1g-dev libpam0g-dev libreadline-gplv2-dev autoconf automake automake1.9 dpatch ghostscript-x libfontenc1 libjpeg62 libltdl-dev libltdl7 libmail-sendmail-perl libxfont1 lmodern texlive-latex-base-doc ttf-dejavu ttf-dejavu-extra libaio-dev xfonts-encodings xfonts-utils libxml2-dev unixodbc-dev bzr scons check libboost-all-dev openssl epm libjudy-dev libjemalloc-dev" \ "bzr co --lightweight lp:mariadb-native-client" \ "cd /usr/local/src;sudo tar zxf /dev/shm/thrift-0.9.0.tar.gz;pwd;ls" \ "cd /usr/local/src/thrift-0.9.0;echo;pwd;sudo ./configure --prefix=/usr --enable-shared=no --enable-static=yes CXXFLAGS=-fPIC CFLAGS=-fPIC && echo && echo 'now making' && echo && sleep 3 && sudo make && echo && echo 'now installing' && echo && sleep 3 && sudo make install" ; \ done ``` VMs for install testing. ------------------------ See [Buildbot Setup for Virtual Machines - General Principles](../buildbot-setup-for-virtual-machines-general-principles/index) for how to obtain `my.seed` and `sources.append`. ``` for i in '/kvm/vms/vm-trusty-amd64-serial.qcow2 2293 qemu64' '/kvm/vms/vm-trusty-i386-serial.qcow2 2294 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/install/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils unixodbc libxml2 libjudydebian1 libjemalloc1" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "sudo debconf-set-selections /tmp/my55.seed" \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'"; \ done ``` VMs for MySQL upgrade testing ----------------------------- ``` for i in '/kvm/vms/vm-trusty-amd64-serial.qcow2 2293 qemu64' '/kvm/vms/vm-trusty-i386-serial.qcow2 2294 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "sudo debconf-set-selections /tmp/my55.seed" \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server-5.5 libjemalloc1' \ 'mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' ;\ done ``` VMs for MariaDB upgrade testing ------------------------------- ``` for i in '/kvm/vms/vm-trusty-amd64-serial.qcow2 2293 qemu64' '/kvm/vms/vm-trusty-i386-serial.qcow2 2294 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade2/')" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "= scp -P $2 /kvm/vms/mariadb-trusty.list buildbot@localhost:/tmp/tmp.list" \ "sudo debconf-set-selections /tmp/my55.seed" \ 'sudo mv -vi /tmp/tmp.list /etc/apt/sources.list.d/' \ 'sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 0xcbcb082a1bb943db' \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server libjemalloc1' \ 'mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' \ 'sudo rm -v /etc/apt/sources.list.d/tmp.list' \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get update' \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils' \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y'; \ done ``` Add Key to known\_hosts ----------------------- Do the following on each kvm host server (terrier, terrier2, i7, etc...) to add the VMs to known\_hosts. ``` # trusty-amd64 cp -avi /kvm/vms/vm-trusty-amd64-install.qcow2 /kvm/vms/vm-trusty-amd64-test.qcow2 kvm -m 1024 -hda /kvm/vms/vm-trusty-amd64-test.qcow2 -redir tcp:2293::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic sudo su - buildbot ssh -p 2293 buildbot@localhost sudo shutdown -h now # answer "yes" when prompted exit # the buildbot user rm -v /kvm/vms/vm-trusty-amd64-test.qcow2 # trusty-i386 cp -avi /kvm/vms/vm-trusty-i386-install.qcow2 /kvm/vms/vm-trusty-i386-test.qcow2 kvm -m 1024 -hda /kvm/vms/vm-trusty-i386-test.qcow2 -redir tcp:2294::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic sudo su - buildbot ssh -p 2294 buildbot@localhost sudo shutdown -h now # answer "yes" when prompted exit # the buildbot user rm -v /kvm/vms/vm-trusty-i386-test.qcow2 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Partition Pruning and Selection Partition Pruning and Selection =============================== When a WHERE clause is related to the partitioning expression, the optimizer knows which partitions are relevant for the query. Other partitions will not be read. This optimization is called *partition pruning*. [EXPLAIN PARTITIONS](../explain/index) can be used to know which partitions will be read for a given query. A column called `partitions` will contain a comma-separated list of the accessed partitions. For example: ``` EXPLAIN PARTITIONS SELECT * FROM orders WHERE id < 15000000; +------+-------------+--------+------------+-------+---------------+---------+---------+------+------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+--------+------------+-------+---------------+---------+---------+------+------+-------------+ | 1 | SIMPLE | orders | p0,p1 | range | PRIMARY | PRIMARY | 4 | NULL | 2 | Using where | +------+-------------+--------+------------+-------+---------------+---------+---------+------+------+-------------+ ``` Sometimes the WHERE clause does not contain the necessary information to use partition pruning, or the optimizer cannot infer this information. However, we may know which partitions are relevant for the query. Since [MariaDB 10.0](../what-is-mariadb-100/index), we can force MariaDB to only access the specified partitions by adding a PARTITION clause. This feature is called *partition selection*. For example: ``` SELECT * FROM orders PARTITION (p3) WHERE user_id = 50; SELECT * FROM orders PARTITION (p2,p3) WHERE user_id >= 40; ``` The PARTITION clause is supported for all DML statements: * [SELECT](../select/index) * [INSERT](../insert/index) * [UPDATE](../update/index) * [DELETE](../delete/index) * [REPLACE](../replace/index) Partition Pruning and Triggers ------------------------------ In general, partition pruning is applied to statements contained in [triggers](../triggers/index). However, note that if a `BEFORE INSERT` or `BEFORE UPDATE` trigger is defined on a table, MariaDB doesn't know in advance if the columns used in the partitioning expression will be changed. For this reason, it is forced to lock all partitions. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb The mysql Database Tables The mysql Database Tables ========================== MariaDB comes pre-installed with a system database called `mysql` containing many important tables storing, in particular, [grant and privilege](../grant/index) information. Until [MariaDB 10.4](../what-is-mariadb-104/index), system tables used the [MyISAM](../myisam/index) storage engine. From [MariaDB 10.4](../what-is-mariadb-104/index), they use [Aria](../aria/index). | Title | Description | | --- | --- | | [mysql.column\_stats Table](../mysqlcolumn_stats-table/index) | Column stats for engine-independent statistics. | | [mysql.columns\_priv Table](../mysqlcolumns_priv-table/index) | Column-level privileges | | [mysql.db Table](../mysqldb-table/index) | Database-level access and privileges. | | [mysql.event Table](../mysqlevent-table/index) | Information about MariaDB events. | | [mysql.func Table](../mysqlfunc-table/index) | User-defined function information | | [mysql.general\_log Table](../mysqlgeneral_log-table/index) | Contents of the general query log if written to table | | [mysql.global\_priv Table](../mysqlglobal_priv-table/index) | Global privileges. | | [mysql.gtid\_slave\_pos Table](../mysqlgtid_slave_pos-table/index) | For replicas to keep track of the GTID. | | [mysql.help\_category Table](../mysqlhelp_category-table/index) | Help categories | | [mysql.help\_keyword Table](../mysqlhelp_keyword-table/index) | Help keywords | | [mysql.help\_relation Table](../mysqlhelp_relation-table/index) | HELP command relations | | [mysql.help\_topic Table](../mysqlhelp_topic-table/index) | Help topics | | [mysql.index\_stats Table](../mysqlindex_stats-table/index) | Index stats for engine-independent statistics. | | [mysql.innodb\_index\_stats](../mysqlinnodb_index_stats/index) | Data related to particular persistent index statistics, multiple rows for each index. | | [mysql.innodb\_table\_stats](../mysqlinnodb_table_stats/index) | Data related to persistent indexes, one row per table. | | [mysql.password\_reuse\_check\_history Table](../mysqlpassword_reuse_check_history-table/index) | Contains old passwords for purposes of preventing password reuse. | | [mysql.plugin Table](../mysqlplugin-table/index) | Plugins loaded with INSTALL SONAME, INSTALL PLUGIN or the mysql\_plugin utility | | [mysql.proc Table](../mysqlproc-table/index) | Information about stored routines. | | [mysql.procs\_priv Table](../mysqlprocs_priv-table/index) | Stored procedure and stored function privileges | | [mysql.proxies\_priv Table](../mysqlproxies_priv-table/index) | Proxy privileges. | | [mysql.roles\_mapping Table](../mysqlroles_mapping-table/index) | MariaDB roles information. | | [mysql.servers Table](../mysqlservers-table/index) | MariaDB servers | | [mysql.slow\_log Table](../mysqlslow_log-table/index) | Contents of the slow query log if written to table. | | [mysql.tables\_priv Table](../mysqltables_priv-table/index) | Table-level privileges | | [mysql.table\_stats Table](../mysqltable_stats-table/index) | Table stats for engine-independent statistics. | | [mysql.time\_zone Table](../mysqltime_zone-table/index) | Time zone table in the mysql database. | | [mysql.time\_zone\_leap\_second Table](../mysqltime_zone_leap_second-table/index) | Time zone leap second. | | [mysql.time\_zone\_name Table](../mysqltime_zone_name-table/index) | Time zone name. | | [mysql.time\_zone\_transition Table](../mysqltime_zone_transition-table/index) | Time zone transition table. | | [mysql.time\_zone\_transition\_type Table](../mysqltime_zone_transition_type-table/index) | Time zone transition type table. | | [mysql.transaction\_registry Table](../mysqltransaction_registry-table/index) | Used for transaction-precise versioning. | | [mysql.user Table](../mysqluser-table/index) | User access and global privileges. | | [Obsolete mysql Database Tables](../obsolete-mysql-database-tables/index) | Tables no longer present in the mysql system database. | | [Spider mysql Database Tables](../spider-mysql-database-tables/index) | System tables related to the Spider storage engine. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW CHARACTER SET SHOW CHARACTER SET ================== Syntax ------ ``` SHOW CHARACTER SET [LIKE 'pattern' | WHERE expr] ``` Description ----------- The `SHOW CHARACTER SET` statement shows all available [character sets](../data-types-character-sets-and-collations/index). The `LIKE` clause, if present on its own, indicates which character set names to match. The `WHERE` and `LIKE` clauses can be given to select rows using more general conditions, as discussed in [Extended SHOW](../extended-show/index). The same information can be queried from the [Information Schema CHARACTER\_SETS](../information-schema-character_sets-table/index) table. See [Setting Character Sets and Collations](../setting-character-sets-and-collations/index) for details on specifying the character set at the server, database, table and column levels. Examples -------- ``` SHOW CHARACTER SET LIKE 'latin%'; +---------+-----------------------------+-------------------+--------+ | Charset | Description | Default collation | Maxlen | +---------+-----------------------------+-------------------+--------+ | latin1 | cp1252 West European | latin1_swedish_ci | 1 | | latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 | | latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 | | latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 | +---------+-----------------------------+-------------------+--------+ ``` ``` SHOW CHARACTER SET WHERE Maxlen LIKE '2'; +---------+---------------------------+-------------------+--------+ | Charset | Description | Default collation | Maxlen | +---------+---------------------------+-------------------+--------+ | big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 | | sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 | | euckr | EUC-KR Korean | euckr_korean_ci | 2 | | gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 | | gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 | | ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 | | cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 | +---------+---------------------------+-------------------+--------+ ``` See Also -------- * [Supported Character Sets and Collations](../supported-character-sets-and-collations/index) * [Setting Character Sets and Collations](../setting-character-sets-and-collations/index) * [Information Schema CHARACTER\_SETS](../information-schema-character_sets-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb version_patch version\_patch ============== Syntax ------ ``` sys.version_patch() ``` Description ----------- `version_patch` is a [stored function](../stored-functions/index) available with the [Sys Schema](../sys-schema/index). It returns the MariaDB Server patch release version. Examples -------- ``` SELECT VERSION(), sys.version_major() AS major, sys.version_minor() AS minor, sys.version_patch() AS patch; +----------------+-------+-------+-------+ | VERSION() | major | minor | patch | +----------------+-------+-------+-------+ | 10.8.2-MariaDB | 10 | 8 | 2 | +----------------+-------+-------+-------+ ``` See Also -------- * [version\_major](../version_major/index) * [version\_minor](../version_minor/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema KEY_COLUMN_USAGE Table Information Schema KEY\_COLUMN\_USAGE Table =========================================== The [Information Schema](../information_schema/index) `KEY_COLUMN_USAGE` table shows which key columns have constraints. It contains the following columns: | Column | Description | | --- | --- | | `CONSTRAINT_CATALOG` | Always `def`. | | `CONSTRAINT_SCHEMA` | Database name of the constraint. | | `CONSTRAINT_NAME` | Name of the constraint (`PRIMARY` for the primary key). | | `TABLE_CATALOG` | Always #def`.` | | `TABLE_SCHEMA` | Database name of the column constraint. | | `TABLE_NAME` | Table name of the column constraint. | | `COLUMN_NAME` | Column name of the constraint. | | `ORDINAL_POSITION` | Position of the column within the constraint. | | `POSITION_IN_UNIQUE_CONSTRAINT` | For [foreign keys](../foreign-keys/index), the position in the unique constraint. | | `REFERENCED_TABLE_SCHEMA` | For foreign keys, the referenced database name. | | `REFERENCED_TABLE_NAME` | For foreign keys, the referenced table name. | | `REFERENCED_COLUMN_NAME` | For foreign keys, the referenced column name. | Example ------- ``` SELECT * FROM information_schema.KEY_COLUMN_USAGE LIMIT 1 \G ********************** 1. row ********************** CONSTRAINT_CATALOG: def CONSTRAINT_SCHEMA: my_website CONSTRAINT_NAME: PRIMARY TABLE_CATALOG: def TABLE_SCHEMA: users COLUMN_NAME: user_id ORDINAL_POSITION: 1 POSITION_IN_UNIQUE_CONSTRAINT: NULL REFERENCED_TABLE_SCHEMA: NULL REFERENCED_TABLE_NAME: NULL REFERENCED_COLUMN_NAME: NULL ``` See Also -------- * [Finding Tables Without Primary Keys](../getting-started-with-indexes/index#finding-tables-without-primary-keys) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Row Subqueries Row Subqueries ============== A row subquery is a [subquery](../subqueries/index) returning a single row, as opposed to a [scalar subquery](../subqueries-scalar-subqueries/index), which returns a single column from a row, or a literal. Examples -------- ``` CREATE TABLE staff (name VARCHAR(10), age TINYINT); CREATE TABLE customer (name VARCHAR(10), age TINYINT); INSERT INTO staff VALUES ('Bilhah',37), ('Valerius',61), ('Maia',25); INSERT INTO customer VALUES ('Thanasis',48), ('Valerius',61), ('Brion',51); SELECT * FROM staff WHERE (name,age) = (SELECT name,age FROM customer WHERE name='Valerius'); +----------+------+ | name | age | +----------+------+ | Valerius | 61 | +----------+------+ ``` Finding all rows in one table also in another: ``` SELECT name,age FROM staff WHERE (name,age) IN (SELECT name,age FROM customer); +----------+------+ | name | age | +----------+------+ | Valerius | 61 | +----------+------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Troubleshooting Row Size Too Large Errors with InnoDB Troubleshooting Row Size Too Large Errors with InnoDB ===================================================== With InnoDB, users can see the following message as an error or warning: ``` ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ``` And they can also see the following message as an error or warning in the [error log](../error-log/index): ``` [Warning] InnoDB: Cannot add field col in table db1.tab because after adding it, the row size is 8478 which is greater than maximum allowed size (8126) for a record on index leaf page. ``` These messages indicate that the table's definition allows rows that the table's InnoDB row format can't actually store. These messages are raised in the following cases: * If [InnoDB strict mode](../innodb-strict-mode/index) is **enabled** and if a [DDL](../data-definition/index) statement is executed that touches the table, such as [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index), then InnoDB will raise an **error** with this message * If [InnoDB strict mode](../innodb-strict-mode/index) is **disabled** and if a [DDL](../data-definition/index) statement is executed that touches the table, such as [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index), then InnoDB will raise a **warning** with this message. * Regardless of whether [InnoDB strict mode](../innodb-strict-mode/index) is enabled, if a [DML](../data-manipulation/index) statement is executed that attempts to write a row that the table's InnoDB row format can't store, then InnoDB will raise an **error** with this message. Example of the Problem ---------------------- Here is an example of the problem: ``` SET GLOBAL innodb_default_row_format='dynamic'; SET SESSION innodb_strict_mode=ON; CREATE OR REPLACE TABLE tab ( col1 varchar(40) NOT NULL, col2 varchar(40) NOT NULL, col3 varchar(40) NOT NULL, col4 varchar(40) NOT NULL, col5 varchar(40) NOT NULL, col6 varchar(40) NOT NULL, col7 varchar(40) NOT NULL, col8 varchar(40) NOT NULL, col9 varchar(40) NOT NULL, col10 varchar(40) NOT NULL, col11 varchar(40) NOT NULL, col12 varchar(40) NOT NULL, col13 varchar(40) NOT NULL, col14 varchar(40) NOT NULL, col15 varchar(40) NOT NULL, col16 varchar(40) NOT NULL, col17 varchar(40) NOT NULL, col18 varchar(40) NOT NULL, col19 varchar(40) NOT NULL, col20 varchar(40) NOT NULL, col21 varchar(40) NOT NULL, col22 varchar(40) NOT NULL, col23 varchar(40) NOT NULL, col24 varchar(40) NOT NULL, col25 varchar(40) NOT NULL, col26 varchar(40) NOT NULL, col27 varchar(40) NOT NULL, col28 varchar(40) NOT NULL, col29 varchar(40) NOT NULL, col30 varchar(40) NOT NULL, col31 varchar(40) NOT NULL, col32 varchar(40) NOT NULL, col33 varchar(40) NOT NULL, col34 varchar(40) NOT NULL, col35 varchar(40) NOT NULL, col36 varchar(40) NOT NULL, col37 varchar(40) NOT NULL, col38 varchar(40) NOT NULL, col39 varchar(40) NOT NULL, col40 varchar(40) NOT NULL, col41 varchar(40) NOT NULL, col42 varchar(40) NOT NULL, col43 varchar(40) NOT NULL, col44 varchar(40) NOT NULL, col45 varchar(40) NOT NULL, col46 varchar(40) NOT NULL, col47 varchar(40) NOT NULL, col48 varchar(40) NOT NULL, col49 varchar(40) NOT NULL, col50 varchar(40) NOT NULL, col51 varchar(40) NOT NULL, col52 varchar(40) NOT NULL, col53 varchar(40) NOT NULL, col54 varchar(40) NOT NULL, col55 varchar(40) NOT NULL, col56 varchar(40) NOT NULL, col57 varchar(40) NOT NULL, col58 varchar(40) NOT NULL, col59 varchar(40) NOT NULL, col60 varchar(40) NOT NULL, col61 varchar(40) NOT NULL, col62 varchar(40) NOT NULL, col63 varchar(40) NOT NULL, col64 varchar(40) NOT NULL, col65 varchar(40) NOT NULL, col66 varchar(40) NOT NULL, col67 varchar(40) NOT NULL, col68 varchar(40) NOT NULL, col69 varchar(40) NOT NULL, col70 varchar(40) NOT NULL, col71 varchar(40) NOT NULL, col72 varchar(40) NOT NULL, col73 varchar(40) NOT NULL, col74 varchar(40) NOT NULL, col75 varchar(40) NOT NULL, col76 varchar(40) NOT NULL, col77 varchar(40) NOT NULL, col78 varchar(40) NOT NULL, col79 varchar(40) NOT NULL, col80 varchar(40) NOT NULL, col81 varchar(40) NOT NULL, col82 varchar(40) NOT NULL, col83 varchar(40) NOT NULL, col84 varchar(40) NOT NULL, col85 varchar(40) NOT NULL, col86 varchar(40) NOT NULL, col87 varchar(40) NOT NULL, col88 varchar(40) NOT NULL, col89 varchar(40) NOT NULL, col90 varchar(40) NOT NULL, col91 varchar(40) NOT NULL, col92 varchar(40) NOT NULL, col93 varchar(40) NOT NULL, col94 varchar(40) NOT NULL, col95 varchar(40) NOT NULL, col96 varchar(40) NOT NULL, col97 varchar(40) NOT NULL, col98 varchar(40) NOT NULL, col99 varchar(40) NOT NULL, col100 varchar(40) NOT NULL, col101 varchar(40) NOT NULL, col102 varchar(40) NOT NULL, col103 varchar(40) NOT NULL, col104 varchar(40) NOT NULL, col105 varchar(40) NOT NULL, col106 varchar(40) NOT NULL, col107 varchar(40) NOT NULL, col108 varchar(40) NOT NULL, col109 varchar(40) NOT NULL, col110 varchar(40) NOT NULL, col111 varchar(40) NOT NULL, col112 varchar(40) NOT NULL, col113 varchar(40) NOT NULL, col114 varchar(40) NOT NULL, col115 varchar(40) NOT NULL, col116 varchar(40) NOT NULL, col117 varchar(40) NOT NULL, col118 varchar(40) NOT NULL, col119 varchar(40) NOT NULL, col120 varchar(40) NOT NULL, col121 varchar(40) NOT NULL, col122 varchar(40) NOT NULL, col123 varchar(40) NOT NULL, col124 varchar(40) NOT NULL, col125 varchar(40) NOT NULL, col126 varchar(40) NOT NULL, col127 varchar(40) NOT NULL, col128 varchar(40) NOT NULL, col129 varchar(40) NOT NULL, col130 varchar(40) NOT NULL, col131 varchar(40) NOT NULL, col132 varchar(40) NOT NULL, col133 varchar(40) NOT NULL, col134 varchar(40) NOT NULL, col135 varchar(40) NOT NULL, col136 varchar(40) NOT NULL, col137 varchar(40) NOT NULL, col138 varchar(40) NOT NULL, col139 varchar(40) NOT NULL, col140 varchar(40) NOT NULL, col141 varchar(40) NOT NULL, col142 varchar(40) NOT NULL, col143 varchar(40) NOT NULL, col144 varchar(40) NOT NULL, col145 varchar(40) NOT NULL, col146 varchar(40) NOT NULL, col147 varchar(40) NOT NULL, col148 varchar(40) NOT NULL, col149 varchar(40) NOT NULL, col150 varchar(40) NOT NULL, col151 varchar(40) NOT NULL, col152 varchar(40) NOT NULL, col153 varchar(40) NOT NULL, col154 varchar(40) NOT NULL, col155 varchar(40) NOT NULL, col156 varchar(40) NOT NULL, col157 varchar(40) NOT NULL, col158 varchar(40) NOT NULL, col159 varchar(40) NOT NULL, col160 varchar(40) NOT NULL, col161 varchar(40) NOT NULL, col162 varchar(40) NOT NULL, col163 varchar(40) NOT NULL, col164 varchar(40) NOT NULL, col165 varchar(40) NOT NULL, col166 varchar(40) NOT NULL, col167 varchar(40) NOT NULL, col168 varchar(40) NOT NULL, col169 varchar(40) NOT NULL, col170 varchar(40) NOT NULL, col171 varchar(40) NOT NULL, col172 varchar(40) NOT NULL, col173 varchar(40) NOT NULL, col174 varchar(40) NOT NULL, col175 varchar(40) NOT NULL, col176 varchar(40) NOT NULL, col177 varchar(40) NOT NULL, col178 varchar(40) NOT NULL, col179 varchar(40) NOT NULL, col180 varchar(40) NOT NULL, col181 varchar(40) NOT NULL, col182 varchar(40) NOT NULL, col183 varchar(40) NOT NULL, col184 varchar(40) NOT NULL, col185 varchar(40) NOT NULL, col186 varchar(40) NOT NULL, col187 varchar(40) NOT NULL, col188 varchar(40) NOT NULL, col189 varchar(40) NOT NULL, col190 varchar(40) NOT NULL, col191 varchar(40) NOT NULL, col192 varchar(40) NOT NULL, col193 varchar(40) NOT NULL, col194 varchar(40) NOT NULL, col195 varchar(40) NOT NULL, col196 varchar(40) NOT NULL, col197 varchar(40) NOT NULL, col198 varchar(40) NOT NULL, PRIMARY KEY (col1) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ``` Root Cause of the Problem ------------------------- The root cause is that InnoDB has a maximum row size that is roughly equivalent to half of the value of the [innodb\_page\_size](../xtradbinnodb-server-system-variables/index#innodb_page_size) system variable. See [InnoDB Row Formats Overview: Maximum Row Size](../innodb-row-formats-overview/index#maximum-row-size) for more information. InnoDB's row formats work around this limit by storing certain kinds of variable-length columns on overflow pages. However, different row formats can store different types of data on overflow pages. Some row formats can store more data in overflow pages than others. For example, the [DYNAMIC](../innodb-dynamic-row-format/index) and [COMPRESSED](../innodb-compressed-row-format/index) row formats can store the most data in overflow pages. To learn how the various InnoDB row formats use overflow pages, see the following pages: * [InnoDB REDUNDANT Row Format: Overflow Pages with the REDUNDANT Row Format](../innodb-redundant-row-format/index#overflow-pages-with-the-redundant-row-format) * [InnoDB COMPACT Row Format: Overflow Pages with the COMPACT Row Format](../innodb-compact-row-format/index#overflow-pages-with-the-compact-row-format) * [InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format](../innodb-dynamic-row-format/index#overflow-pages-with-the-dynamic-row-format) * [InnoDB COMPRESSED Row Format: Overflow Pages with the COMPRESSED Row Format](../innodb-compressed-row-format/index#overflow-pages-with-the-compressed-row-format) Checking Existing Tables for the Problem ---------------------------------------- InnoDB does not currently have an easy way to check all existing tables to determine which tables have this problem. See [MDEV-20400](https://jira.mariadb.org/browse/MDEV-20400) for more information. One method to check a single existing table for this problem is to enable [InnoDB strict mode](../innodb-strict-mode/index), and then try to create a duplicate of the table with [CREATE TABLE ... LIKE](../create-table/index#create-table-like). If the table has this problem, then the operation will fail. For example: ``` SET SESSION innodb_strict_mode=ON; CREATE TABLE tab_dup LIKE tab; ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ``` Finding All Tables That Currently Have the Problem -------------------------------------------------- The following shell script will read through a MariaDB server to identify every table that has a row size definition that is too large for its row format and the server's page size. It runs on most common distributions of Linux. To run the script, copy the code below to a shell-script named `rowsize.sh`, make it executable with the command `chmod 755 ./rowsize.sh`, and invoke it with the following parameters: ``` ./rowsize.sh host user password ``` When the script runs, it displays the name of the temporary database it creates, so that if the script is interrupted before cleaning up, the database can be easily identified and removed manually. As the script runs it will output one line reporting the database and tablename for each table it finds that has the oversize row problem. If it finds none, it will print the following message: "No tables with rows size too big found." In either case, the script prints one final line to announce when it's done: `./rowsize.sh done.` ``` #!/bin/bash [ -z "$3" ] && echo "Usage: $0 host user password" >&2 && exit 1 dt="tmp_$RANDOM$RANDOM" mysql -h $1 -u $2 -p$3 -ABNe "create database $dt;" [ $? -ne 0 ] && echo "Error: $0 terminating" >&2 exit 1 echo echo "Created temporary database ${dt} on host $1" echo c=0 for d in $(mysql -h $1 -u $2 -p$3 -ABNe "show databases;" | egrep -iv "information_schema|mysql|performance_schema|$dt") do for t in $(mysql -h $1 -u $2 -p$3 -ABNe "show tables;" $d) do tc=$(mysql -h $1 -u $2 -p$3 -ABNe "show create table $t\\G" $d | egrep -iv "^\*|^$t") echo $tc | grep -iq "ROW_FORMAT" if [ $? -ne 0 ] then tf=$(mysql -h $1 -u $2 -p$3 -ABNe "select row_format from information_schema.innodb_sys_tables where name = '${d}/${t}';") tc="$tc ROW_FORMAT=$tf" fi ef="/tmp/e$RANDOM$RANDOM" mysql -h $1 -u $2 -p$3 -ABNe "set innodb_strict_mode=1; set foreign_key_checks=0; ${tc};" $dt >/dev/null 2>$ef [ $? -ne 0 ] && cat $ef | grep -q "Row size too large" && echo "${d}.${t}" && let c++ || mysql -h $1 -u $2 -p$3 -ABNe "drop table if exists ${t};" $dt rm -f $ef done done mysql -h $1 -u $2 -p$3 -ABNe "set innodb_strict_mode=1; drop database $dt;" [ $c -eq 0 ] && echo "No tables with rows size too large found." || echo && echo "$c tables found with row size too large." echo echo "$0 done." ``` Solving the Problem ------------------- There are several potential solutions available to solve this problem. ### Converting the Table to the DYNAMIC Row Format If the table is using either the [REDUNDANT](../innodb-redundant-row-format/index) or the [COMPACT](../innodb-compact-row-format/index) row format, then one potential solution to this problem is to convert the table to use the [DYNAMIC](../innodb-dynamic-row-format/index) row format instead. If your tables were originally created on an older version of MariaDB or MySQL, then your table may be using one of InnoDB's older row formats: * In [MariaDB 10.1](../what-is-mariadb-101/index) and before, and in MySQL 5.6 and before, the [COMPACT](../innodb-compact-row-format/index) row format was the default row format. * In MySQL 4.1 and before, the [REDUNDANT](../innodb-redundant-row-format/index) row format was the default row format. The [DYNAMIC](../innodb-dynamic-row-format/index) row format can store more data on overflow pages than these older row formats, so this row format may actually be able to store the table's data safely. See [InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format](../innodb-dynamic-row-format/index#overflow-pages-with-the-dynamic-row-format) for more information. Therefore, a potential solution to the *Row size too large* error is to convert the table to use the [DYNAMIC](../innodb-dynamic-row-format/index) row format. For example: ``` ALTER TABLE tab ROW_FORMAT=DYNAMIC; ``` You can use the [INNODB\_SYS\_TABLES](../information-schema-innodb_sys_tables-table/index) table in the [information\_schema](../information-schema-tables/index) database to find all tables that use the [REDUNDANT](../innodb-redundant-row-format/index) or the [COMPACT](../innodb-compact-row-format/index) row formats. This is helpful if you would like to convert all of your tables that you still use the older row formats to the [DYNAMIC](../innodb-dynamic-row-format/index) row format. For example, the following query can find those tables, while excluding [InnoDB's internal system tables](../innodb-system-tablespaces/index#system-tables-within-the-innodb-system-tablespace): ``` SELECT NAME, ROW_FORMAT FROM information_schema.INNODB_SYS_TABLES WHERE ROW_FORMAT IN('Redundant', 'Compact') AND NAME NOT IN('SYS_DATAFILES', 'SYS_FOREIGN', 'SYS_FOREIGN_COLS', 'SYS_TABLESPACES', 'SYS_VIRTUAL', 'SYS_ZIP_DICT', 'SYS_ZIP_DICT_COLS'); ``` In [MariaDB 10.2](../what-is-mariadb-102/index) and later, the [DYNAMIC](../innodb-dynamic-row-format/index) row format is the default row format. If your tables were originally created on one of these newer versions, then they may already be using this row format. In that case, you may need to try the next solution. ### Fitting More Columns on Overflow Pages If the table is already using the [DYNAMIC](../innodb-dynamic-row-format/index) row format, then another potential solution to this problem is to change the table schema, so that the row format can store more columns on overflow pages. In order for InnoDB to store some variable-length columns on overflow pages, the length of those columns may need to be increased. Therefore, a counter-intuitive solution to the *Row size too large* error in a lot of cases is actually to **increase** the length of some variable-length columns, so that InnoDB's row format can store them on overflow pages. Some possible ways to change the table schema are listed below. #### Converting Some Columns to `BLOB` or `TEXT` For [BLOB](../blob/index) and [TEXT](../text/index) columns, the [DYNAMIC](../innodb-dynamic-row-format/index) row format can store these columns on overflow pages. See [InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format](../innodb-dynamic-row-format/index#overflow-pages-with-the-dynamic-row-format) for more information. Therefore, a potential solution to the *Row size too large* error is to convert some columns to the [BLOB](../blob/index) or [TEXT](../text/index) data types. #### Increasing the Length of `VARBINARY` Columns For [VARBINARY](../varbinary/index) columns, the [DYNAMIC](../innodb-dynamic-row-format/index) row format can only store these columns on overflow pages if the maximum length of the column is 256 bytes or longer. See [InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format](../innodb-dynamic-row-format/index#overflow-pages-with-the-dynamic-row-format) for more information. Therefore, a potential solution to the *Row size too large* error is to ensure that all [VARBINARY](../varbinary/index) columns are at least as long as `varbinary(256)`. #### Increasing the Length of `VARCHAR` Columns For [VARCHAR](../varchar/index) columns, the [DYNAMIC](../innodb-dynamic-row-format/index) row format can only store these columns on overflow pages if the maximum length of the column is 256 bytes or longer. See [InnoDB DYNAMIC Row Format: Overflow Pages with the DYNAMIC Row Format](../innodb-dynamic-row-format/index#overflow-pages-with-the-dynamic-row-format) for more information. The original table schema shown earlier on this page causes the *Row size too large* error, because all of the table's [VARCHAR](../varchar/index) columns are smaller than 256 bytes, which means that they have to be stored on the row's main data page. Therefore, a potential solution to the *Row size too large* error is to ensure that all [VARCHAR](../varchar/index) columns are at least as long as 256 bytes. The number of characters required to reach the 256 byte limit depends on the [character set](../character-sets/index) used by the column. For example, when using InnoDB's [DYNAMIC](../innodb-dynamic-row-format/index) row format and a default character set of [latin1](../supported-character-sets-and-collations/index) (which requires up to 1 byte per character), the 256 byte limit means that a [VARCHAR](../varchar/index) column will only be stored on overflow pages if it is at least as large as a `varchar(256)`: ``` SET GLOBAL innodb_default_row_format='dynamic'; SET SESSION innodb_strict_mode=ON; CREATE OR REPLACE TABLE tab ( col1 varchar(256) NOT NULL, col2 varchar(256) NOT NULL, col3 varchar(256) NOT NULL, col4 varchar(256) NOT NULL, col5 varchar(256) NOT NULL, col6 varchar(256) NOT NULL, col7 varchar(256) NOT NULL, col8 varchar(256) NOT NULL, col9 varchar(256) NOT NULL, col10 varchar(256) NOT NULL, col11 varchar(256) NOT NULL, col12 varchar(256) NOT NULL, col13 varchar(256) NOT NULL, col14 varchar(256) NOT NULL, col15 varchar(256) NOT NULL, col16 varchar(256) NOT NULL, col17 varchar(256) NOT NULL, col18 varchar(256) NOT NULL, col19 varchar(256) NOT NULL, col20 varchar(256) NOT NULL, col21 varchar(256) NOT NULL, col22 varchar(256) NOT NULL, col23 varchar(256) NOT NULL, col24 varchar(256) NOT NULL, col25 varchar(256) NOT NULL, col26 varchar(256) NOT NULL, col27 varchar(256) NOT NULL, col28 varchar(256) NOT NULL, col29 varchar(256) NOT NULL, col30 varchar(256) NOT NULL, col31 varchar(256) NOT NULL, col32 varchar(256) NOT NULL, col33 varchar(256) NOT NULL, col34 varchar(256) NOT NULL, col35 varchar(256) NOT NULL, col36 varchar(256) NOT NULL, col37 varchar(256) NOT NULL, col38 varchar(256) NOT NULL, col39 varchar(256) NOT NULL, col40 varchar(256) NOT NULL, col41 varchar(256) NOT NULL, col42 varchar(256) NOT NULL, col43 varchar(256) NOT NULL, col44 varchar(256) NOT NULL, col45 varchar(256) NOT NULL, col46 varchar(256) NOT NULL, col47 varchar(256) NOT NULL, col48 varchar(256) NOT NULL, col49 varchar(256) NOT NULL, col50 varchar(256) NOT NULL, col51 varchar(256) NOT NULL, col52 varchar(256) NOT NULL, col53 varchar(256) NOT NULL, col54 varchar(256) NOT NULL, col55 varchar(256) NOT NULL, col56 varchar(256) NOT NULL, col57 varchar(256) NOT NULL, col58 varchar(256) NOT NULL, col59 varchar(256) NOT NULL, col60 varchar(256) NOT NULL, col61 varchar(256) NOT NULL, col62 varchar(256) NOT NULL, col63 varchar(256) NOT NULL, col64 varchar(256) NOT NULL, col65 varchar(256) NOT NULL, col66 varchar(256) NOT NULL, col67 varchar(256) NOT NULL, col68 varchar(256) NOT NULL, col69 varchar(256) NOT NULL, col70 varchar(256) NOT NULL, col71 varchar(256) NOT NULL, col72 varchar(256) NOT NULL, col73 varchar(256) NOT NULL, col74 varchar(256) NOT NULL, col75 varchar(256) NOT NULL, col76 varchar(256) NOT NULL, col77 varchar(256) NOT NULL, col78 varchar(256) NOT NULL, col79 varchar(256) NOT NULL, col80 varchar(256) NOT NULL, col81 varchar(256) NOT NULL, col82 varchar(256) NOT NULL, col83 varchar(256) NOT NULL, col84 varchar(256) NOT NULL, col85 varchar(256) NOT NULL, col86 varchar(256) NOT NULL, col87 varchar(256) NOT NULL, col88 varchar(256) NOT NULL, col89 varchar(256) NOT NULL, col90 varchar(256) NOT NULL, col91 varchar(256) NOT NULL, col92 varchar(256) NOT NULL, col93 varchar(256) NOT NULL, col94 varchar(256) NOT NULL, col95 varchar(256) NOT NULL, col96 varchar(256) NOT NULL, col97 varchar(256) NOT NULL, col98 varchar(256) NOT NULL, col99 varchar(256) NOT NULL, col100 varchar(256) NOT NULL, col101 varchar(256) NOT NULL, col102 varchar(256) NOT NULL, col103 varchar(256) NOT NULL, col104 varchar(256) NOT NULL, col105 varchar(256) NOT NULL, col106 varchar(256) NOT NULL, col107 varchar(256) NOT NULL, col108 varchar(256) NOT NULL, col109 varchar(256) NOT NULL, col110 varchar(256) NOT NULL, col111 varchar(256) NOT NULL, col112 varchar(256) NOT NULL, col113 varchar(256) NOT NULL, col114 varchar(256) NOT NULL, col115 varchar(256) NOT NULL, col116 varchar(256) NOT NULL, col117 varchar(256) NOT NULL, col118 varchar(256) NOT NULL, col119 varchar(256) NOT NULL, col120 varchar(256) NOT NULL, col121 varchar(256) NOT NULL, col122 varchar(256) NOT NULL, col123 varchar(256) NOT NULL, col124 varchar(256) NOT NULL, col125 varchar(256) NOT NULL, col126 varchar(256) NOT NULL, col127 varchar(256) NOT NULL, col128 varchar(256) NOT NULL, col129 varchar(256) NOT NULL, col130 varchar(256) NOT NULL, col131 varchar(256) NOT NULL, col132 varchar(256) NOT NULL, col133 varchar(256) NOT NULL, col134 varchar(256) NOT NULL, col135 varchar(256) NOT NULL, col136 varchar(256) NOT NULL, col137 varchar(256) NOT NULL, col138 varchar(256) NOT NULL, col139 varchar(256) NOT NULL, col140 varchar(256) NOT NULL, col141 varchar(256) NOT NULL, col142 varchar(256) NOT NULL, col143 varchar(256) NOT NULL, col144 varchar(256) NOT NULL, col145 varchar(256) NOT NULL, col146 varchar(256) NOT NULL, col147 varchar(256) NOT NULL, col148 varchar(256) NOT NULL, col149 varchar(256) NOT NULL, col150 varchar(256) NOT NULL, col151 varchar(256) NOT NULL, col152 varchar(256) NOT NULL, col153 varchar(256) NOT NULL, col154 varchar(256) NOT NULL, col155 varchar(256) NOT NULL, col156 varchar(256) NOT NULL, col157 varchar(256) NOT NULL, col158 varchar(256) NOT NULL, col159 varchar(256) NOT NULL, col160 varchar(256) NOT NULL, col161 varchar(256) NOT NULL, col162 varchar(256) NOT NULL, col163 varchar(256) NOT NULL, col164 varchar(256) NOT NULL, col165 varchar(256) NOT NULL, col166 varchar(256) NOT NULL, col167 varchar(256) NOT NULL, col168 varchar(256) NOT NULL, col169 varchar(256) NOT NULL, col170 varchar(256) NOT NULL, col171 varchar(256) NOT NULL, col172 varchar(256) NOT NULL, col173 varchar(256) NOT NULL, col174 varchar(256) NOT NULL, col175 varchar(256) NOT NULL, col176 varchar(256) NOT NULL, col177 varchar(256) NOT NULL, col178 varchar(256) NOT NULL, col179 varchar(256) NOT NULL, col180 varchar(256) NOT NULL, col181 varchar(256) NOT NULL, col182 varchar(256) NOT NULL, col183 varchar(256) NOT NULL, col184 varchar(256) NOT NULL, col185 varchar(256) NOT NULL, col186 varchar(256) NOT NULL, col187 varchar(256) NOT NULL, col188 varchar(256) NOT NULL, col189 varchar(256) NOT NULL, col190 varchar(256) NOT NULL, col191 varchar(256) NOT NULL, col192 varchar(256) NOT NULL, col193 varchar(256) NOT NULL, col194 varchar(256) NOT NULL, col195 varchar(256) NOT NULL, col196 varchar(256) NOT NULL, col197 varchar(256) NOT NULL, col198 varchar(256) NOT NULL, PRIMARY KEY (col1) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ``` And when using InnoDB's [DYNAMIC](../innodb-dynamic-row-format/index) row format and a default character set of [utf8](../unicode/index) (which requires up to 3 bytes per character), the 256 byte limit means that a [VARCHAR](../varchar/index) column will only be stored on overflow pages if it is at least as large as a `varchar(86)`: ``` SET GLOBAL innodb_default_row_format='dynamic'; SET SESSION innodb_strict_mode=ON; CREATE OR REPLACE TABLE tab ( col1 varchar(86) NOT NULL, col2 varchar(86) NOT NULL, col3 varchar(86) NOT NULL, col4 varchar(86) NOT NULL, col5 varchar(86) NOT NULL, col6 varchar(86) NOT NULL, col7 varchar(86) NOT NULL, col8 varchar(86) NOT NULL, col9 varchar(86) NOT NULL, col10 varchar(86) NOT NULL, col11 varchar(86) NOT NULL, col12 varchar(86) NOT NULL, col13 varchar(86) NOT NULL, col14 varchar(86) NOT NULL, col15 varchar(86) NOT NULL, col16 varchar(86) NOT NULL, col17 varchar(86) NOT NULL, col18 varchar(86) NOT NULL, col19 varchar(86) NOT NULL, col20 varchar(86) NOT NULL, col21 varchar(86) NOT NULL, col22 varchar(86) NOT NULL, col23 varchar(86) NOT NULL, col24 varchar(86) NOT NULL, col25 varchar(86) NOT NULL, col26 varchar(86) NOT NULL, col27 varchar(86) NOT NULL, col28 varchar(86) NOT NULL, col29 varchar(86) NOT NULL, col30 varchar(86) NOT NULL, col31 varchar(86) NOT NULL, col32 varchar(86) NOT NULL, col33 varchar(86) NOT NULL, col34 varchar(86) NOT NULL, col35 varchar(86) NOT NULL, col36 varchar(86) NOT NULL, col37 varchar(86) NOT NULL, col38 varchar(86) NOT NULL, col39 varchar(86) NOT NULL, col40 varchar(86) NOT NULL, col41 varchar(86) NOT NULL, col42 varchar(86) NOT NULL, col43 varchar(86) NOT NULL, col44 varchar(86) NOT NULL, col45 varchar(86) NOT NULL, col46 varchar(86) NOT NULL, col47 varchar(86) NOT NULL, col48 varchar(86) NOT NULL, col49 varchar(86) NOT NULL, col50 varchar(86) NOT NULL, col51 varchar(86) NOT NULL, col52 varchar(86) NOT NULL, col53 varchar(86) NOT NULL, col54 varchar(86) NOT NULL, col55 varchar(86) NOT NULL, col56 varchar(86) NOT NULL, col57 varchar(86) NOT NULL, col58 varchar(86) NOT NULL, col59 varchar(86) NOT NULL, col60 varchar(86) NOT NULL, col61 varchar(86) NOT NULL, col62 varchar(86) NOT NULL, col63 varchar(86) NOT NULL, col64 varchar(86) NOT NULL, col65 varchar(86) NOT NULL, col66 varchar(86) NOT NULL, col67 varchar(86) NOT NULL, col68 varchar(86) NOT NULL, col69 varchar(86) NOT NULL, col70 varchar(86) NOT NULL, col71 varchar(86) NOT NULL, col72 varchar(86) NOT NULL, col73 varchar(86) NOT NULL, col74 varchar(86) NOT NULL, col75 varchar(86) NOT NULL, col76 varchar(86) NOT NULL, col77 varchar(86) NOT NULL, col78 varchar(86) NOT NULL, col79 varchar(86) NOT NULL, col80 varchar(86) NOT NULL, col81 varchar(86) NOT NULL, col82 varchar(86) NOT NULL, col83 varchar(86) NOT NULL, col84 varchar(86) NOT NULL, col85 varchar(86) NOT NULL, col86 varchar(86) NOT NULL, col87 varchar(86) NOT NULL, col88 varchar(86) NOT NULL, col89 varchar(86) NOT NULL, col90 varchar(86) NOT NULL, col91 varchar(86) NOT NULL, col92 varchar(86) NOT NULL, col93 varchar(86) NOT NULL, col94 varchar(86) NOT NULL, col95 varchar(86) NOT NULL, col96 varchar(86) NOT NULL, col97 varchar(86) NOT NULL, col98 varchar(86) NOT NULL, col99 varchar(86) NOT NULL, col100 varchar(86) NOT NULL, col101 varchar(86) NOT NULL, col102 varchar(86) NOT NULL, col103 varchar(86) NOT NULL, col104 varchar(86) NOT NULL, col105 varchar(86) NOT NULL, col106 varchar(86) NOT NULL, col107 varchar(86) NOT NULL, col108 varchar(86) NOT NULL, col109 varchar(86) NOT NULL, col110 varchar(86) NOT NULL, col111 varchar(86) NOT NULL, col112 varchar(86) NOT NULL, col113 varchar(86) NOT NULL, col114 varchar(86) NOT NULL, col115 varchar(86) NOT NULL, col116 varchar(86) NOT NULL, col117 varchar(86) NOT NULL, col118 varchar(86) NOT NULL, col119 varchar(86) NOT NULL, col120 varchar(86) NOT NULL, col121 varchar(86) NOT NULL, col122 varchar(86) NOT NULL, col123 varchar(86) NOT NULL, col124 varchar(86) NOT NULL, col125 varchar(86) NOT NULL, col126 varchar(86) NOT NULL, col127 varchar(86) NOT NULL, col128 varchar(86) NOT NULL, col129 varchar(86) NOT NULL, col130 varchar(86) NOT NULL, col131 varchar(86) NOT NULL, col132 varchar(86) NOT NULL, col133 varchar(86) NOT NULL, col134 varchar(86) NOT NULL, col135 varchar(86) NOT NULL, col136 varchar(86) NOT NULL, col137 varchar(86) NOT NULL, col138 varchar(86) NOT NULL, col139 varchar(86) NOT NULL, col140 varchar(86) NOT NULL, col141 varchar(86) NOT NULL, col142 varchar(86) NOT NULL, col143 varchar(86) NOT NULL, col144 varchar(86) NOT NULL, col145 varchar(86) NOT NULL, col146 varchar(86) NOT NULL, col147 varchar(86) NOT NULL, col148 varchar(86) NOT NULL, col149 varchar(86) NOT NULL, col150 varchar(86) NOT NULL, col151 varchar(86) NOT NULL, col152 varchar(86) NOT NULL, col153 varchar(86) NOT NULL, col154 varchar(86) NOT NULL, col155 varchar(86) NOT NULL, col156 varchar(86) NOT NULL, col157 varchar(86) NOT NULL, col158 varchar(86) NOT NULL, col159 varchar(86) NOT NULL, col160 varchar(86) NOT NULL, col161 varchar(86) NOT NULL, col162 varchar(86) NOT NULL, col163 varchar(86) NOT NULL, col164 varchar(86) NOT NULL, col165 varchar(86) NOT NULL, col166 varchar(86) NOT NULL, col167 varchar(86) NOT NULL, col168 varchar(86) NOT NULL, col169 varchar(86) NOT NULL, col170 varchar(86) NOT NULL, col171 varchar(86) NOT NULL, col172 varchar(86) NOT NULL, col173 varchar(86) NOT NULL, col174 varchar(86) NOT NULL, col175 varchar(86) NOT NULL, col176 varchar(86) NOT NULL, col177 varchar(86) NOT NULL, col178 varchar(86) NOT NULL, col179 varchar(86) NOT NULL, col180 varchar(86) NOT NULL, col181 varchar(86) NOT NULL, col182 varchar(86) NOT NULL, col183 varchar(86) NOT NULL, col184 varchar(86) NOT NULL, col185 varchar(86) NOT NULL, col186 varchar(86) NOT NULL, col187 varchar(86) NOT NULL, col188 varchar(86) NOT NULL, col189 varchar(86) NOT NULL, col190 varchar(86) NOT NULL, col191 varchar(86) NOT NULL, col192 varchar(86) NOT NULL, col193 varchar(86) NOT NULL, col194 varchar(86) NOT NULL, col195 varchar(86) NOT NULL, col196 varchar(86) NOT NULL, col197 varchar(86) NOT NULL, col198 varchar(86) NOT NULL, PRIMARY KEY (col1) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ``` And when using InnoDB's [DYNAMIC](../innodb-dynamic-row-format/index) row format and a default character set of [utf8mb4](../unicode/index) (which requires up to 4 bytes per character), the 256 byte limit means that a [VARCHAR](../varchar/index) column will only be stored on overflow pages if it is at least as large as a `varchar(64)`: ``` SET GLOBAL innodb_default_row_format='dynamic'; SET SESSION innodb_strict_mode=ON; CREATE OR REPLACE TABLE tab ( col1 varchar(64) NOT NULL, col2 varchar(64) NOT NULL, col3 varchar(64) NOT NULL, col4 varchar(64) NOT NULL, col5 varchar(64) NOT NULL, col6 varchar(64) NOT NULL, col7 varchar(64) NOT NULL, col8 varchar(64) NOT NULL, col9 varchar(64) NOT NULL, col10 varchar(64) NOT NULL, col11 varchar(64) NOT NULL, col12 varchar(64) NOT NULL, col13 varchar(64) NOT NULL, col14 varchar(64) NOT NULL, col15 varchar(64) NOT NULL, col16 varchar(64) NOT NULL, col17 varchar(64) NOT NULL, col18 varchar(64) NOT NULL, col19 varchar(64) NOT NULL, col20 varchar(64) NOT NULL, col21 varchar(64) NOT NULL, col22 varchar(64) NOT NULL, col23 varchar(64) NOT NULL, col24 varchar(64) NOT NULL, col25 varchar(64) NOT NULL, col26 varchar(64) NOT NULL, col27 varchar(64) NOT NULL, col28 varchar(64) NOT NULL, col29 varchar(64) NOT NULL, col30 varchar(64) NOT NULL, col31 varchar(64) NOT NULL, col32 varchar(64) NOT NULL, col33 varchar(64) NOT NULL, col34 varchar(64) NOT NULL, col35 varchar(64) NOT NULL, col36 varchar(64) NOT NULL, col37 varchar(64) NOT NULL, col38 varchar(64) NOT NULL, col39 varchar(64) NOT NULL, col40 varchar(64) NOT NULL, col41 varchar(64) NOT NULL, col42 varchar(64) NOT NULL, col43 varchar(64) NOT NULL, col44 varchar(64) NOT NULL, col45 varchar(64) NOT NULL, col46 varchar(64) NOT NULL, col47 varchar(64) NOT NULL, col48 varchar(64) NOT NULL, col49 varchar(64) NOT NULL, col50 varchar(64) NOT NULL, col51 varchar(64) NOT NULL, col52 varchar(64) NOT NULL, col53 varchar(64) NOT NULL, col54 varchar(64) NOT NULL, col55 varchar(64) NOT NULL, col56 varchar(64) NOT NULL, col57 varchar(64) NOT NULL, col58 varchar(64) NOT NULL, col59 varchar(64) NOT NULL, col60 varchar(64) NOT NULL, col61 varchar(64) NOT NULL, col62 varchar(64) NOT NULL, col63 varchar(64) NOT NULL, col64 varchar(64) NOT NULL, col65 varchar(64) NOT NULL, col66 varchar(64) NOT NULL, col67 varchar(64) NOT NULL, col68 varchar(64) NOT NULL, col69 varchar(64) NOT NULL, col70 varchar(64) NOT NULL, col71 varchar(64) NOT NULL, col72 varchar(64) NOT NULL, col73 varchar(64) NOT NULL, col74 varchar(64) NOT NULL, col75 varchar(64) NOT NULL, col76 varchar(64) NOT NULL, col77 varchar(64) NOT NULL, col78 varchar(64) NOT NULL, col79 varchar(64) NOT NULL, col80 varchar(64) NOT NULL, col81 varchar(64) NOT NULL, col82 varchar(64) NOT NULL, col83 varchar(64) NOT NULL, col84 varchar(64) NOT NULL, col85 varchar(64) NOT NULL, col86 varchar(64) NOT NULL, col87 varchar(64) NOT NULL, col88 varchar(64) NOT NULL, col89 varchar(64) NOT NULL, col90 varchar(64) NOT NULL, col91 varchar(64) NOT NULL, col92 varchar(64) NOT NULL, col93 varchar(64) NOT NULL, col94 varchar(64) NOT NULL, col95 varchar(64) NOT NULL, col96 varchar(64) NOT NULL, col97 varchar(64) NOT NULL, col98 varchar(64) NOT NULL, col99 varchar(64) NOT NULL, col100 varchar(64) NOT NULL, col101 varchar(64) NOT NULL, col102 varchar(64) NOT NULL, col103 varchar(64) NOT NULL, col104 varchar(64) NOT NULL, col105 varchar(64) NOT NULL, col106 varchar(64) NOT NULL, col107 varchar(64) NOT NULL, col108 varchar(64) NOT NULL, col109 varchar(64) NOT NULL, col110 varchar(64) NOT NULL, col111 varchar(64) NOT NULL, col112 varchar(64) NOT NULL, col113 varchar(64) NOT NULL, col114 varchar(64) NOT NULL, col115 varchar(64) NOT NULL, col116 varchar(64) NOT NULL, col117 varchar(64) NOT NULL, col118 varchar(64) NOT NULL, col119 varchar(64) NOT NULL, col120 varchar(64) NOT NULL, col121 varchar(64) NOT NULL, col122 varchar(64) NOT NULL, col123 varchar(64) NOT NULL, col124 varchar(64) NOT NULL, col125 varchar(64) NOT NULL, col126 varchar(64) NOT NULL, col127 varchar(64) NOT NULL, col128 varchar(64) NOT NULL, col129 varchar(64) NOT NULL, col130 varchar(64) NOT NULL, col131 varchar(64) NOT NULL, col132 varchar(64) NOT NULL, col133 varchar(64) NOT NULL, col134 varchar(64) NOT NULL, col135 varchar(64) NOT NULL, col136 varchar(64) NOT NULL, col137 varchar(64) NOT NULL, col138 varchar(64) NOT NULL, col139 varchar(64) NOT NULL, col140 varchar(64) NOT NULL, col141 varchar(64) NOT NULL, col142 varchar(64) NOT NULL, col143 varchar(64) NOT NULL, col144 varchar(64) NOT NULL, col145 varchar(64) NOT NULL, col146 varchar(64) NOT NULL, col147 varchar(64) NOT NULL, col148 varchar(64) NOT NULL, col149 varchar(64) NOT NULL, col150 varchar(64) NOT NULL, col151 varchar(64) NOT NULL, col152 varchar(64) NOT NULL, col153 varchar(64) NOT NULL, col154 varchar(64) NOT NULL, col155 varchar(64) NOT NULL, col156 varchar(64) NOT NULL, col157 varchar(64) NOT NULL, col158 varchar(64) NOT NULL, col159 varchar(64) NOT NULL, col160 varchar(64) NOT NULL, col161 varchar(64) NOT NULL, col162 varchar(64) NOT NULL, col163 varchar(64) NOT NULL, col164 varchar(64) NOT NULL, col165 varchar(64) NOT NULL, col166 varchar(64) NOT NULL, col167 varchar(64) NOT NULL, col168 varchar(64) NOT NULL, col169 varchar(64) NOT NULL, col170 varchar(64) NOT NULL, col171 varchar(64) NOT NULL, col172 varchar(64) NOT NULL, col173 varchar(64) NOT NULL, col174 varchar(64) NOT NULL, col175 varchar(64) NOT NULL, col176 varchar(64) NOT NULL, col177 varchar(64) NOT NULL, col178 varchar(64) NOT NULL, col179 varchar(64) NOT NULL, col180 varchar(64) NOT NULL, col181 varchar(64) NOT NULL, col182 varchar(64) NOT NULL, col183 varchar(64) NOT NULL, col184 varchar(64) NOT NULL, col185 varchar(64) NOT NULL, col186 varchar(64) NOT NULL, col187 varchar(64) NOT NULL, col188 varchar(64) NOT NULL, col189 varchar(64) NOT NULL, col190 varchar(64) NOT NULL, col191 varchar(64) NOT NULL, col192 varchar(64) NOT NULL, col193 varchar(64) NOT NULL, col194 varchar(64) NOT NULL, col195 varchar(64) NOT NULL, col196 varchar(64) NOT NULL, col197 varchar(64) NOT NULL, col198 varchar(64) NOT NULL, PRIMARY KEY (col1) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ``` Working Around the Problem -------------------------- There are a few ways to work around this problem. If you would like a solution for the problem instead of just working around it, then see the solutions mentioned in the previous section. ### Refactoring the Table into Multiple Tables A *safe* workaround is to refactor the single wide table, so that its columns are spread among multiple tables. This workaround can even work if your table is so wide that the previous solutions have failed to solve them problem for your table. ### Refactoring Some Columns into JSON A *safe* workaround is to refactor some of the columns into a JSON document. The JSON document can be queried and manipulated using MariaDB's [JSON functions](../json-functions/index). The JSON document can be stored in a column that uses one of the following data types: * [TEXT](../text/index): The maximum size of a [TEXT](../text/index) column is 64 KB. * [MEDIUMTEXT](../mediumtext/index): The maximum size of a [MEDIUMTEXT](../mediumtext/index) column is 16 MB. * [LONGTEXT](../longtext/index): The maximum size of a [LONGTEXT](../longtext/index) column is 4 GB. * [JSON](../json-data-type/index): This is just an alias for the [LONGTEXT](../longtext/index) data type. This workaround can even work if your table is so wide that the previous solutions have failed to solve them problem for your table. ### Disabling InnoDB Strict Mode An *unsafe* workaround is to disable [InnoDB strict mode](../innodb-strict-mode/index). [InnoDB strict mode](../innodb-strict-mode/index) can be disabled by setting the [innodb\_strict\_mode](../xtradbinnodb-server-system-variables/index#innodb_strict_mode) system variable to `OFF`. For example, even though the following table schema is too large for most InnoDB row formats to store, it can still be created when [InnoDB strict mode](../innodb-strict-mode/index) is disabled: ``` SET GLOBAL innodb_default_row_format='dynamic'; SET SESSION innodb_strict_mode=OFF; CREATE OR REPLACE TABLE tab ( col1 varchar(40) NOT NULL, col2 varchar(40) NOT NULL, col3 varchar(40) NOT NULL, col4 varchar(40) NOT NULL, col5 varchar(40) NOT NULL, col6 varchar(40) NOT NULL, col7 varchar(40) NOT NULL, col8 varchar(40) NOT NULL, col9 varchar(40) NOT NULL, col10 varchar(40) NOT NULL, col11 varchar(40) NOT NULL, col12 varchar(40) NOT NULL, col13 varchar(40) NOT NULL, col14 varchar(40) NOT NULL, col15 varchar(40) NOT NULL, col16 varchar(40) NOT NULL, col17 varchar(40) NOT NULL, col18 varchar(40) NOT NULL, col19 varchar(40) NOT NULL, col20 varchar(40) NOT NULL, col21 varchar(40) NOT NULL, col22 varchar(40) NOT NULL, col23 varchar(40) NOT NULL, col24 varchar(40) NOT NULL, col25 varchar(40) NOT NULL, col26 varchar(40) NOT NULL, col27 varchar(40) NOT NULL, col28 varchar(40) NOT NULL, col29 varchar(40) NOT NULL, col30 varchar(40) NOT NULL, col31 varchar(40) NOT NULL, col32 varchar(40) NOT NULL, col33 varchar(40) NOT NULL, col34 varchar(40) NOT NULL, col35 varchar(40) NOT NULL, col36 varchar(40) NOT NULL, col37 varchar(40) NOT NULL, col38 varchar(40) NOT NULL, col39 varchar(40) NOT NULL, col40 varchar(40) NOT NULL, col41 varchar(40) NOT NULL, col42 varchar(40) NOT NULL, col43 varchar(40) NOT NULL, col44 varchar(40) NOT NULL, col45 varchar(40) NOT NULL, col46 varchar(40) NOT NULL, col47 varchar(40) NOT NULL, col48 varchar(40) NOT NULL, col49 varchar(40) NOT NULL, col50 varchar(40) NOT NULL, col51 varchar(40) NOT NULL, col52 varchar(40) NOT NULL, col53 varchar(40) NOT NULL, col54 varchar(40) NOT NULL, col55 varchar(40) NOT NULL, col56 varchar(40) NOT NULL, col57 varchar(40) NOT NULL, col58 varchar(40) NOT NULL, col59 varchar(40) NOT NULL, col60 varchar(40) NOT NULL, col61 varchar(40) NOT NULL, col62 varchar(40) NOT NULL, col63 varchar(40) NOT NULL, col64 varchar(40) NOT NULL, col65 varchar(40) NOT NULL, col66 varchar(40) NOT NULL, col67 varchar(40) NOT NULL, col68 varchar(40) NOT NULL, col69 varchar(40) NOT NULL, col70 varchar(40) NOT NULL, col71 varchar(40) NOT NULL, col72 varchar(40) NOT NULL, col73 varchar(40) NOT NULL, col74 varchar(40) NOT NULL, col75 varchar(40) NOT NULL, col76 varchar(40) NOT NULL, col77 varchar(40) NOT NULL, col78 varchar(40) NOT NULL, col79 varchar(40) NOT NULL, col80 varchar(40) NOT NULL, col81 varchar(40) NOT NULL, col82 varchar(40) NOT NULL, col83 varchar(40) NOT NULL, col84 varchar(40) NOT NULL, col85 varchar(40) NOT NULL, col86 varchar(40) NOT NULL, col87 varchar(40) NOT NULL, col88 varchar(40) NOT NULL, col89 varchar(40) NOT NULL, col90 varchar(40) NOT NULL, col91 varchar(40) NOT NULL, col92 varchar(40) NOT NULL, col93 varchar(40) NOT NULL, col94 varchar(40) NOT NULL, col95 varchar(40) NOT NULL, col96 varchar(40) NOT NULL, col97 varchar(40) NOT NULL, col98 varchar(40) NOT NULL, col99 varchar(40) NOT NULL, col100 varchar(40) NOT NULL, col101 varchar(40) NOT NULL, col102 varchar(40) NOT NULL, col103 varchar(40) NOT NULL, col104 varchar(40) NOT NULL, col105 varchar(40) NOT NULL, col106 varchar(40) NOT NULL, col107 varchar(40) NOT NULL, col108 varchar(40) NOT NULL, col109 varchar(40) NOT NULL, col110 varchar(40) NOT NULL, col111 varchar(40) NOT NULL, col112 varchar(40) NOT NULL, col113 varchar(40) NOT NULL, col114 varchar(40) NOT NULL, col115 varchar(40) NOT NULL, col116 varchar(40) NOT NULL, col117 varchar(40) NOT NULL, col118 varchar(40) NOT NULL, col119 varchar(40) NOT NULL, col120 varchar(40) NOT NULL, col121 varchar(40) NOT NULL, col122 varchar(40) NOT NULL, col123 varchar(40) NOT NULL, col124 varchar(40) NOT NULL, col125 varchar(40) NOT NULL, col126 varchar(40) NOT NULL, col127 varchar(40) NOT NULL, col128 varchar(40) NOT NULL, col129 varchar(40) NOT NULL, col130 varchar(40) NOT NULL, col131 varchar(40) NOT NULL, col132 varchar(40) NOT NULL, col133 varchar(40) NOT NULL, col134 varchar(40) NOT NULL, col135 varchar(40) NOT NULL, col136 varchar(40) NOT NULL, col137 varchar(40) NOT NULL, col138 varchar(40) NOT NULL, col139 varchar(40) NOT NULL, col140 varchar(40) NOT NULL, col141 varchar(40) NOT NULL, col142 varchar(40) NOT NULL, col143 varchar(40) NOT NULL, col144 varchar(40) NOT NULL, col145 varchar(40) NOT NULL, col146 varchar(40) NOT NULL, col147 varchar(40) NOT NULL, col148 varchar(40) NOT NULL, col149 varchar(40) NOT NULL, col150 varchar(40) NOT NULL, col151 varchar(40) NOT NULL, col152 varchar(40) NOT NULL, col153 varchar(40) NOT NULL, col154 varchar(40) NOT NULL, col155 varchar(40) NOT NULL, col156 varchar(40) NOT NULL, col157 varchar(40) NOT NULL, col158 varchar(40) NOT NULL, col159 varchar(40) NOT NULL, col160 varchar(40) NOT NULL, col161 varchar(40) NOT NULL, col162 varchar(40) NOT NULL, col163 varchar(40) NOT NULL, col164 varchar(40) NOT NULL, col165 varchar(40) NOT NULL, col166 varchar(40) NOT NULL, col167 varchar(40) NOT NULL, col168 varchar(40) NOT NULL, col169 varchar(40) NOT NULL, col170 varchar(40) NOT NULL, col171 varchar(40) NOT NULL, col172 varchar(40) NOT NULL, col173 varchar(40) NOT NULL, col174 varchar(40) NOT NULL, col175 varchar(40) NOT NULL, col176 varchar(40) NOT NULL, col177 varchar(40) NOT NULL, col178 varchar(40) NOT NULL, col179 varchar(40) NOT NULL, col180 varchar(40) NOT NULL, col181 varchar(40) NOT NULL, col182 varchar(40) NOT NULL, col183 varchar(40) NOT NULL, col184 varchar(40) NOT NULL, col185 varchar(40) NOT NULL, col186 varchar(40) NOT NULL, col187 varchar(40) NOT NULL, col188 varchar(40) NOT NULL, col189 varchar(40) NOT NULL, col190 varchar(40) NOT NULL, col191 varchar(40) NOT NULL, col192 varchar(40) NOT NULL, col193 varchar(40) NOT NULL, col194 varchar(40) NOT NULL, col195 varchar(40) NOT NULL, col196 varchar(40) NOT NULL, col197 varchar(40) NOT NULL, col198 varchar(40) NOT NULL, PRIMARY KEY (col1) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ``` But as mentioned above, if [InnoDB strict mode](../innodb-strict-mode/index) is **disabled** and if a [DDL](../data-definition/index) statement is executed, then InnoDB will still raise a **warning** with this message. The [SHOW WARNINGS](../show-warnings/index) statement can be used to view the warning. For example: ``` SHOW WARNINGS; +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 139 | Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. | +---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.000 sec) ``` As mentioned above, even though InnoDB is allowing the table to be created, there is still an opportunity for errors. Regardless of whether [InnoDB strict mode](../innodb-strict-mode/index) is enabled, if a [DML](../data-manipulation/index) statement is executed that attempts to write a row that the table's InnoDB row format can't store, then InnoDB will raise an **error** with this message. This creates a somewhat *unsafe* situation, because it means that the application has the chance to encounter an additional error while executing [DML](../data-manipulation/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Performance Schema Status Variables Performance Schema Status Variables =================================== This page documents status variables related to the [Performance Schema](../performance-schema/index). See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with [SHOW STATUS](../show-status/index). See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `Performance_schema_accounts_lost` * **Description:** Number of times a row could not be added to the performance schema accounts table due to it being full. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_cond_classes_lost` * **Description:** Number of condition instruments that could not be loaded. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_cond_instances_lost` * **Description:** Number of instances a condition object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_digest_lost` * **Description:** The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_file_classes_lost` * **Description:** Number of file instruments that could not be loaded. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_file_handles_lost` * **Description:** Number of instances a file object could not be opened. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_file_instances_lost` * **Description:** Number of instances a file object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_hosts_lost` * **Description:** Number of times a row could not be added to the performance schema hosts table due to it being full. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_index_stat_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_locker_lost` * **Description:** Number of events not recorded, due to either being recursive, or having a deeper nested events stack than the implementation limit. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_memory_classes_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_metadata_lock_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_mutex_classes_lost` * **Description:** Number of mutual exclusion instruments that could not be loaded. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_mutex_instances_lost` * **Description:** Number of instances a mutual exclusion object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_nested_statement_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_prepared_statements_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_program_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_rwlock_classes_lost` * **Description:** Number of read/write lock instruments that could not be loaded. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_rwlock_instances_lost` * **Description:** Number of instances a read/write lock object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_session_connect_attrs_lost` * **Description:** Number of connections for which connection attribute truncation has occurred. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_socket_classes_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_socket_instances_lost` * **Description:** Number of instances a socket object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_stage_classes_lost` * **Description:** Number of stage event instruments that could not be loaded. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_statement_classes_lost` * **Description:** Number of statement instruments that could not be loaded. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_table_handles_lost` * **Description:** Number of instances a table object could not be opened. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_table_instances_lost` * **Description:** Number of instances a table object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_table_lock_stat_lost` * **Description:** * **Scope:** Global, Session * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Performance_schema_thread_classes_lost` * **Description:** Number of thread instruments that could not be loaded. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_thread_instances_lost` * **Description:** Number of instances thread object could not be created. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Performance_schema_users_lost` * **Description:** Number of times a row could not be added to the performance schema users table due to it being full. The global value can be flushed by [FLUSH STATUS](../flush/index). * **Scope:** Global, Session * **Data Type:** `numeric` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema events_statements_history_long Table Performance Schema events\_statements\_history\_long Table ========================================================== The `events_statements_history_long` table by default contains the ten thousand most recent completed statement events. This number can be adjusted by setting the [performance\_schema\_events\_statements\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_statements_history_long_size) system variable when the server starts up. The table structure is identical to the [events\_statements\_current](../performance-schema-events_statements_current-table/index) table structure, and contains the following columns: | Column | Description | | --- | --- | | `THREAD_ID` | Thread associated with the event. Together with `EVENT_ID` uniquely identifies the row. | | `EVENT_ID` | Thread's current event number at the start of the event. Together with `THREAD_ID` uniquely identifies the row. | | `END_EVENT_ID` | `NULL` when the event starts, set to the thread's current event number at the end of the event. | | `EVENT_NAME` | Event instrument name and a `NAME` from the `setup_instruments` table | | `SOURCE` | Name and line number of the source file containing the instrumented code that produced the event. | | `TIMER_START` | Value in picoseconds when the event timing started or `NULL` if timing is not collected. | | `TIMER_END` | Value in picoseconds when the event timing ended, or `NULL` if timing is not collected. | | `TIMER_WAIT` | Value in picoseconds of the event's duration or `NULL` if timing is not collected. | | `LOCK_TIME` | Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. | | `SQL_TEXT` | The SQL statement, or `NULL` if the command is not associated with an SQL statement. | | `DIGEST` | [Statement digest](../performance-schema-digests/index). | | `DIGEST_TEXT` | [Statement digest](../performance-schema-digests/index) text. | | `CURRENT_SCHEMA` | Statement's default database for the statement, or `NULL` if there was none. | | `OBJECT_SCHEMA` | Reserved, currently `NULL` | | `OBJECT_NAME` | Reserved, currently `NULL` | | `OBJECT_TYPE` | Reserved, currently `NULL` | | `OBJECT_INSTANCE_BEGIN` | Address in memory of the statement object. | | `MYSQL_ERRNO` | Error code. See [MariaDB Error Codes](../mariadb-error-codes/index) for a full list. | | `RETURNED_SQLSTATE` | The [SQLSTATE](../sqlstate/index) value. | | `MESSAGE_TEXT` | Statement error message. See [MariaDB Error Codes](../mariadb-error-codes/index). | | `ERRORS` | `0` if `SQLSTATE` signifies completion (starting with 00) or warning (01), otherwise `1`. | | `WARNINGS` | Number of warnings from the diagnostics area. | | `ROWS_AFFECTED` | Number of rows affected the statement affected. | | `ROWS_SENT` | Number of rows returned. | | `ROWS_EXAMINED` | Number of rows read during the statement's execution. | | `CREATED_TMP_DISK_TABLES` | Number of on-disk temp tables created by the statement. | | `CREATED_TMP_TABLES` | Number of temp tables created by the statement. | | `SELECT_FULL_JOIN` | Number of joins performed by the statement which did not use an index. | | `SELECT_FULL_RANGE_JOIN` | Number of joins performed by the statement which used a range search of the first table. | | `SELECT_RANGE` | Number of joins performed by the statement which used a range of the first table. | | `SELECT_RANGE_CHECK` | Number of joins without keys performed by the statement that check for key usage after each row. | | `SELECT_SCAN` | Number of joins performed by the statement which used a full scan of the first table. | | `SORT_MERGE_PASSES` | Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the [sort\_buffer\_size](../server-system-variables/index#sort_buffer_size). | | `SORT_RANGE` | Number of sorts performed by the statement which used a range. | | `SORT_ROWS` | Number of rows sorted by the statement. | | `SORT_SCAN` | Number of sorts performed by the statement which used a full table scan. | | `NO_INDEX_USED` | `0` if the statement performed a table scan with an index, `1` if without an index. | | `NO_GOOD_INDEX_USED` | `0` if a good index was found for the statement, `1` if no good index was found. See the `Range checked for each record description` in the [EXPLAIN](../explain/index) article. | | `NESTING_EVENT_ID` | Reserved, currently `NULL`. | | `NESTING_EVENT_TYPE` | Reserved, currently `NULL`. | It is possible to empty this table with a `TRUNCATE TABLE` statement. [events\_statements\_current](../performance-schema-events_statements_current-table/index) and [events\_statements\_history](../performance-schema-events_statements_history-table/index) are related tables. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb What is Table Elimination? What is Table Elimination? ========================== The basic idea behind table elimination is that sometimes it is possible to resolve a query without even accessing some of the tables that the query refers to. One can invent many kinds of such cases, but in Table Elimination we targeted only a certain class of SQL constructs that one ends up writing when they are querying [highly-normalized](../database-normalization/index) data. The sample queries were drawn from “Anchor Modeling”, a database modeling technique which takes normalization to the extreme. The [slides](http://www.anchormodeling.com/tiedostot/SU_KTH_Course_Presentation.pdf) at the [anchor modeling website](http://www.anchormodeling.com) have an in-depth explanation of Anchor modeling and its merits, but the part that's important for table elimination can be shown with an example. Suppose the database stores information about actors, together with their names, birthdays, and ratings, where ratings can change over time: According to anchor modeling, each attribute should go into its own table: * the 'anchor' table which only has a synthetic primary key: ``` create table ac_anchor(AC_ID int primary key); ``` * a table for the 'name' attribute: ``` create table ac_name(AC_ID int, ACNAM_name char(N), primary key(AC_ID)); ``` * a table for the 'birthdate' attribute: ``` create table ac_dob(AC_ID int, ACDOB_birthdate date, primary key(AC_ID)); ``` * a table for the ‘rating’ attribute, which is historized: ``` create table ac_rating(AC_ID int, ACRAT_rating int, ACRAT_fromdate date, primary key(AC_ID, ACRAT_fromdate)); ``` With this approach it becomes easy to add/change/remove attributes, but this comes at a cost of added complexity in querying the data: in order to answer the simplest, select-star question of displaying actors and their current ratings one has to write outer joins: Display actors, with their names and current ratings: ``` select ac_anchor.AC_ID, ACNAM_Name, ACDOB_birthdate, ACRAT_rating from ac_anchor left join ac_name on ac_anchor.AC_ID=ac_name.AC_ID left join ac_dob on ac_anchor.AC_ID=ac_dob.AC_ID left join ac_rating on (ac_anchor.AC_ID=ac_rating.AC_ID and ac_rating.ACRAT_fromdate = (select max(sub.ACRAT_fromdate) from ac_rating sub where sub.AC_ID = ac_rating.AC_ID)) ``` We don't want to write the joins every time we need to access an actor's properties, so we’ll create a view: ``` create view actors as select ac_anchor.AC_ID, ACNAM_Name, ACDOB_birthdate, ACRAT_rating from <see the select above> ``` This will allow us to access the data as if it was stored in a regular way: ``` select ACRAT_rating from actors where ACNAM_name='Gary Oldman' ``` And this is where table elimination will be needed. See Also -------- * This page is based on the following blog post about table elimination: <http://s.petrunia.net/blog/?p=58> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Intermediate MariaDB Articles Intermediate MariaDB Articles ============================== These are articles for intermediate level MariaDB developers and administrators. | Title | Description | | --- | --- | | [Database Theory](../database-theory/index) | Articles on hierarchical, network and relational databases. | | [Starting and Stopping MariaDB](../starting-and-stopping-mariadb/index) | Articles related to starting and stopping MariaDB Server. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb 10.2.7 Release Upgrade Tests 10.2.7 Release Upgrade Tests ============================ Upgrade from 10.0 ----------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 07:11:04 ### Summary (PASS) All tests passed ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | normal | 16 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 2 | normal | 16 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 3 | normal | 16 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 4 | normal | 16 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 5 | normal | 4 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 6 | normal | 4 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 7 | normal | 4 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 8 | normal | 4 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 9 | normal | 8 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 10 | normal | 8 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 11 | normal | 8 | 10.0.28 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 12 | normal | 8 | 10.0.28 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | Upgrade from 10.1 ----------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 07:29:38 ### Summary (PASS) All tests passed ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | normal | 64 | 10.1.24 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 2 | normal | 64 | 10.1.24 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 3 | normal | 64 | 10.1.24 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 4 | normal | 64 | 10.1.24 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 5 | normal | 64 | 10.1.24 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 6 | normal | 64 | 10.1.24 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 7 | normal | 64 | 10.1.24 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 8 | normal | 64 | 10.1.24 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 9 | normal | 8 | 10.1.24 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 10 | normal | 8 | 10.1.24 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 11 | normal | 8 | 10.1.24 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 12 | normal | 8 | 10.1.24 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 13 | normal | 8 | 10.1.24 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 14 | normal | 8 | 10.1.24 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 15 | normal | 8 | 10.1.24 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 16 | normal | 8 | 10.1.24 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 17 | normal | 16 | 10.1.24 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 18 | normal | 16 | 10.1.24 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 19 | normal | 16 | 10.1.24 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 20 | normal | 16 | 10.1.24 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 21 | normal | 16 | 10.1.24 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 22 | normal | 16 | 10.1.24 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 23 | normal | 16 | 10.1.24 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 24 | normal | 16 | 10.1.24 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 25 | normal | 32 | 10.1.24 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 26 | normal | 32 | 10.1.24 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 27 | normal | 32 | 10.1.24 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 28 | normal | 32 | 10.1.24 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 29 | normal | 32 | 10.1.24 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 30 | normal | 32 | 10.1.24 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 31 | normal | 32 | 10.1.24 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 32 | normal | 32 | 10.1.24 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 33 | normal | 4 | 10.1.24 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 34 | normal | 4 | 10.1.24 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 35 | normal | 4 | 10.1.24 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 36 | normal | 4 | 10.1.24 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 37 | normal | 4 | 10.1.24 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 38 | normal | 4 | 10.1.24 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 39 | normal | 4 | 10.1.24 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 40 | normal | 4 | 10.1.24 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 41 | normal | 8 | 10.1.20 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 42 | normal | 8 | 10.1.20 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 43 | normal | 8 | 10.1.20 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 44 | normal | 8 | 10.1.20 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 45 | normal | 8 | 10.1.20 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 46 | normal | 8 | 10.1.20 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 47 | normal | 8 | 10.1.20 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 48 | normal | 8 | 10.1.20 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 49 | normal | 64 | 10.1.20 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 50 | normal | 64 | 10.1.20 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 51 | normal | 64 | 10.1.20 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 52 | normal | 64 | 10.1.20 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 53 | normal | 64 | 10.1.20 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 54 | normal | 64 | 10.1.20 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 55 | normal | 64 | 10.1.20 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 56 | normal | 64 | 10.1.20 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 57 | normal | 32 | 10.1.20 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 58 | normal | 32 | 10.1.20 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 59 | normal | 32 | 10.1.20 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 60 | normal | 32 | 10.1.20 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 61 | normal | 32 | 10.1.20 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 62 | normal | 32 | 10.1.20 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 63 | normal | 32 | 10.1.20 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 64 | normal | 32 | 10.1.20 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 65 | normal | 16 | 10.1.20 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 66 | normal | 16 | 10.1.20 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 67 | normal | 16 | 10.1.20 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 68 | normal | 16 | 10.1.20 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 69 | normal | 16 | 10.1.20 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 70 | normal | 16 | 10.1.20 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 71 | normal | 16 | 10.1.20 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 72 | normal | 16 | 10.1.20 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 73 | normal | 4 | 10.1.20 (inbuilt) | Barracuda | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 74 | normal | 4 | 10.1.20 (inbuilt) | Antelope | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 75 | normal | 4 | 10.1.20 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 76 | normal | 4 | 10.1.20 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 77 | normal | 4 | 10.1.20 (inbuilt) | Antelope | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 78 | normal | 4 | 10.1.20 (inbuilt) | Barracuda | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 79 | normal | 4 | 10.1.20 (inbuilt) | Antelope | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 80 | normal | 4 | 10.1.20 (inbuilt) | Barracuda | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | Upgrade from 10.2 ----------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 09:34:15 ### Summary (FAIL) [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094), [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103) ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | crash | 64 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 2 | crash | 64 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 3 | crash | 64 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 4 | crash | 64 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 5 | crash | 8 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 6 | crash | 8 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 7 | crash | 8 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 8 | crash | 8 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 9 | crash | 16 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 10 | crash | 16 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 11 | crash | 16 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 12 | crash | 16 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 13 | crash | 32 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 14 | crash | 32 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 15 | crash | 32 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 16 | crash | 32 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 17 | crash | 4 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 18 | crash | 4 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 19 | crash | 4 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 20 | crash | 4 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 21 | normal | 32 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 22 | normal | 32 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 23 | normal | 32 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 24 | normal | 32 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 25 | normal | 4 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 26 | normal | 4 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 27 | normal | 4 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 28 | normal | 4 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 29 | normal | 16 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 30 | normal | 16 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 31 | normal | 16 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 32 | normal | 16 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 33 | normal | 64 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 34 | normal | 64 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 35 | normal | 64 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 36 | normal | 64 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 37 | normal | 8 | 10.2.6 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | OK | | | 38 | normal | 8 | 10.2.6 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | OK | | | 39 | normal | 8 | 10.2.6 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 40 | normal | 8 | 10.2.6 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | Upgrade from MySQL 5.6 ---------------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 10:34:00 ### Summary (PASS) All tests passed ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | normal | 16 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 2 | normal | 16 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 3 | normal | 16 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 4 | normal | 16 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 5 | normal | 4 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 6 | normal | 4 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 7 | normal | 4 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 8 | normal | 4 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 9 | normal | 8 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 10 | normal | 8 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 11 | normal | 8 | 5.6.35 (inbuilt) | Barracuda | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 12 | normal | 8 | 5.6.35 (inbuilt) | Antelope | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | Upgrade from MySQL 5.7 ---------------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 10:52:42 ### Summary (PASS) All tests passed ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | crash | 64 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 2 | crash | 64 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 3 | crash | 8 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 4 | crash | 8 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 5 | crash | 16 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 6 | crash | 16 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 7 | crash | 32 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 8 | crash | 32 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 9 | crash | 4 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 10 | crash | 4 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 11 | normal | 16 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 12 | normal | 16 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 13 | normal | 32 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 14 | normal | 32 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 15 | normal | 64 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 16 | normal | 64 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 17 | normal | 8 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 18 | normal | 8 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | | 19 | normal | 4 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | OK | | | 20 | normal | 4 | 5.7.17 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | on | - | - | OK | | Crash recovery -------------- ### Tested revision 5ff2db7f67401511b30dbd3fc69a1ea87d7e8cc4 ### Test date 2017-07-10 11:23:26 ### Summary (FAIL) [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094), [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103) ### Details | # | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | crash | 16 | 10.2.7 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 2 | crash | 16 | 10.2.7 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(3) | | 3 | crash | 16 | 10.2.7 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 4 | crash | 16 | 10.2.7 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 5 | crash | 4 | 10.2.7 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 6 | crash | 4 | 10.2.7 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(3) | | 7 | crash | 4 | 10.2.7 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 8 | crash | 4 | 10.2.7 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 9 | crash | 32 | 10.2.7 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 10 | crash | 32 | 10.2.7 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 11 | crash | 32 | 10.2.7 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 12 | crash | 32 | 10.2.7 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 13 | crash | 64 | 10.2.7 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 14 | crash | 64 | 10.2.7 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | 15 | crash | 64 | 10.2.7 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 16 | crash | 64 | 10.2.7 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 17 | crash | 8 | 10.2.7 (inbuilt) | | - | zlib | => | 10.2.7 (inbuilt) | | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 18 | crash | 8 | 10.2.7 (inbuilt) | | on | zlib | => | 10.2.7 (inbuilt) | | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | 19 | crash | 8 | 10.2.7 (inbuilt) | | - | - | => | 10.2.7 (inbuilt) | | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | | 20 | crash | 8 | 10.2.7 (inbuilt) | | on | - | => | 10.2.7 (inbuilt) | | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(2) | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb CONNECT MONGO Table Type: Accessing Collections from MongoDB CONNECT MONGO Table Type: Accessing Collections from MongoDB ============================================================ Classified as a NoSQL database program, MongoDB uses JSON-like documents (BSON) grouped in collections. The MONGO type is used to directly access MongoDB collections as tables. Accessing MongDB from CONNECT ----------------------------- Accessing MongoDB from CONNECT can be done in different ways: 1. As a MONGO table via the MongoDB C Driver. 2. As a MONGO table via the MongoDB Java Driver. 3. As a JDBC table using some commercially available MongoDB JDBC drivers. 4. As a JSON table via the MongoDB C or Java Driver. #### Using the MongoDB C Driver This is currently not available from binary distributions but only for versions compiled from source. The preferred version of the MongoDB C Driver is 1.7, because they provide package recognition. What must be done is: 1. Install libbson and the MongoDB C Driver 1.7. 2. Configure, compile and install MariaDB. With earlier versions of the Mongo C Driver, the additional include directories and libraries will have to be specified manually when compiling. When possible, this is the preferred means of access because it does not require all the Java path settings etc. and is faster than using the Java driver. #### Using the Mongo Java Driver This is possible with all distributions including JDBC support, or compiling from source. With a binary distribution that does not enable the MONGO table type, it is possible to access MongoDB using an OEM module. See [CONNECT OEM Table Example](../connect-oem-table-example/index) for details. The only additional things to do are: 1. Install the MongoDB Java Driver by downloading its jar file. Several versions are available. If possible use the latest version 3 one. 2. Add the path to it in the CLASSPATH environment variable or in the connect\_class\_path variable. This is like what is done to declare JDBC drivers. Connection is established by new Java wrappers Mongo3Interface and Mongo2Interface. They are available in a JDBC distribution in the Mongo2.jar and Mongo3.jar files (previously JavaWrappers.jar). If version 2 of the Java Driver is used, specify “Version=2” in the option list when creating tables. #### Using JDBC See the documentation of the existing commercial JDBC Mongo drivers. #### Using JSON See the specific chapter of the JSON Table Type. The following describes the MONGO table type. CONNECT MONGO Tables -------------------- Creating and running MONGO tables requires a connection to a running local or remote MongoDB server. A MONGO table is defined to access a MongoDB collection. The table rows will be the collection documents. For instance, to create a table based on the MongoDB sample collection restaurants, you can do something such as the following: ``` create table resto ( _id varchar(24) not null, name varchar(64) not null, cuisine char(200) not null, borough char(16) not null, restaurant_id varchar(12) not null) engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 connection='mongodb://localhost:27017'; ``` Note: The used driver is by default the C driver if only the MongoDB C Driver is installed and the Java driver if only the MongoDB Java Driver is installed. If both are available, it can be specified by the DRIVER option to be specified in the option list and defaults to C. Here we did not define all the items of the collection documents but only those that are JSON values. The database is test by default. The connection value is the URI used to establish a connection to a local or remote MongoDB server. The value shown in this example corresponds to a local server started with its default port. It is the default connection value for MONGO tables so we could have omit specifying it. Using discovery is available. This table could have been created by: ``` create table resto engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 option_list='level=-1'; ``` Here “depth=-1” is used to create only columns that are simple values (no array or object). Without this, with the default value “depth=0” the table had been created as: ``` CREATE TABLE `resto` ( `_id` char(24) NOT NULL, `address` varchar(136) NOT NULL, `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, `grades` varchar(638) NOT NULL, `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `DATA_CHARSET`='utf8'; ``` ### Fixing Problems With mysqldump In some case or some platforms, when CONNECT is set up for use with JDBC table types, this causes [mysqldump](../mysqldump/index) with the --all-databases option to fail. This was reported by Robert Dyas who found the cause of it and how to fix it (see [MDEV-11238](https://jira.mariadb.org/browse/MDEV-11238)). This occurs when the Java JRE “Usage Tracker” is enabled. In that case, Java creates a directory #mysql50#.oracle\_jre\_usage in the mysql data directory that shows up as a database but cannot be accessed via MySQL Workbench nor apparently backed up by mysqldump --all-databases. Per the Oracle documentation (<https://docs.oracle.com/javacomponents/usage-tracker/overview/>) the “Usage Tracker” is disabled by default. It is enabled only when creating the properties file <JRE directory>/lib/management/usagetracker.properties. This turns out to be WRONG on some platforms as the file does exist by default on a new installation, and the existence of this file enables the usage tracker. The solution on CentOS 7 with the Oracle JVM is to rename or delete the usagetracker.properties file (to disable it) and then delete the bogus folder it created in the mysql database directory, then restart. For example, the following works: ``` sudo mv /usr/java/default/jre/lib/management/management.properties /usr/java/default/jre/lib/management/management.properties.TRACKER-OFF sudo reboot sudo rm -rf /var/lib/mysql/.oracle_jre_usage sudo reboot ``` In this collection, the address column is a JSON object and the column grades is a JSON array. Unlike the JSON table, just specifying the column name with no Jpath result in displaying the JSON representation of them. For instance: ``` select name, address from resto limit 3; ``` | name | address | | --- | --- | | Morris Park Bake Shop | {"building":"1007","coord":[-73.8561,40.8484], "street":"Morris ParkAve", "zipcode":"10462"} | | Wendy'S | {"building":"469","coord":[-73.9617,40.6629], "street":"Flatbush Avenue", "zipcode":"11225"} | | Reynolds Restaurant | {"building":"351","coord":[-73.9851,40.7677], "street":"West 57Street", "zipcode":"10019"} | ### MongoDB Dot Notation To address the items inside object or arrays, specify the Jpath in MongoDB syntax (if using Discovery, specify the Depth option accordingly): From Connect 1.7.0002 ``` create table newresto ( _id varchar(24) not null, name varchar(64) not null, cuisine char(200) not null, borough char(16) not null, street varchar(65) jpath='address.street', building char(16) jpath='address.building', zipcode char(5) jpath='address.zipcode', grade char(1) jpath='grades.0.grade', score int(4) not null jpath='grades.0.score', `date` date jpath='grades.0.date', restaurant_id varchar(255) not null) engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 connection='mongodb://localhost:27017'; ``` Before Connect 1.7.0002 ``` create table newresto ( _id varchar(24) not null, name varchar(64) not null, cuisine char(200) not null, borough char(16) not null, street varchar(65) field_format='address.street', building char(16) field_format='address.building', zipcode char(5) field_format='address.zipcode', grade char(1) field_format='grades.0.grade', score int(4) not null field_format='grades.0.score', `date` date field_format='grades.0.date', restaurant_id varchar(255) not null) engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 connection='mongodb://localhost:27017'; ``` If this is not done, the Oracle JVM will start the usage tracker, which will create the hidden folder .oracle\_jre\_usage in the mysql home directory, which will cause a mysql dump of the server to fail. ``` select name, street, score, date from newresto limit 5; ``` | name | street | score | date | | --- | --- | --- | --- | | Morris Park Bake Shop | Morris Park Ave | 2 | 03/03/2014 | | Wendy'S | Flatbush Avenue | 8 | 30/12/2014 | | Dj Reynolds Pub And Restaurant | West 57 Street | 2 | 06/09/2014 | | Riviera Caterer | Stillwell Avenue | 5 | 10/06/2014 | | Tov Kosher Kitchen | 63 Road | 20 | 24/11/2014 | MONGO Specific Options ---------------------- The MongoDB syntax for Jpath does not allow the CONNECT specific items on arrays. The same effect can still be obtained by a different way. For this, additional options are used when creating MONGO tables. | Option | Type | Description | | --- | --- | --- | | Colist | String | Options to pass to the MongoDB cursor. | | Filter | String | Query used by the MongoDB cursor. | | Pipeline\* | Boolean | If True, Colist is a pipeline. | | Fullarray\* | Boolean | Used when creating with Discovery. | | Driver\* | String | C or Java. | | Version\* | Integer | The Java Driver version (defaults to 3) | * : To be specified in the option list. Note: For the content of these options, refer to the MongoDB documentation. ### Colist Option Used to pass different options when making the MongoDB cursor used to retrieve the collation documents. One of them is the projection, allowing to limit the items retrieved in documents. It is hardly useful because this limitation is made automatically by CONNECT. However, it can be used when using discovery to eliminate the \_id (or another) column when you are not willing to keep it: ``` create table restest engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 option_list='depth=-1' colist='{"projection":{"_id":0},"limit":5}'; ``` In this example, we added another cursor option, the limit option that works like the limit SQL clause. This additional option works only with the C driver. When using the Java driver, colist should be: ``` colist='{"_id":0}'; ``` And limit would be specified with select statements. Note: When used with a JSON table, to specify the projection list (or ‘all’ to get all columns) makes JPATH to be Connect Json paths, not MongoDB ones, allowing JPATH options not available to MongoDB. ### Filter Option This option is used to specify a “filter” that works as a where clause on the table. Supposing we want to create a table restricted to the restaurant making English cuisine that are not located in the Manhattan borough, we can do it by: ``` create table english engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 colist='{"projection":{"cuisine":0}}' filter='{"cuisine":"English","borough":{"$ne":"Manhattan"}}' option_list='Depth=-1'; ``` And if we ask: ``` select * from english; ``` This query will return: | \_id | borough | name | restaurant\_id | | --- | --- | --- | --- | | 58ada47de5a51ddfcd5ee1f3 | Brooklyn | The Park Slope Chipshop | 40816202 | | 58ada47de5a51ddfcd5ee999 | Brooklyn | Chip Shop | 41076583 | | 58ada47ee5a51ddfcd5f13d5 | Brooklyn | The Monro | 41660253 | | 58ada47ee5a51ddfcd5f176e | Brooklyn | Dear Bushwick | 41690534 | | 58ada47ee5a51ddfcd5f1e91 | Queens | Snowdonia Pub | 50000290 | ### Pipeline Option When this option is specified as true (by YES or 1) the Colist option contains a MongoDB pipeline applying to the table collation. This is a powerful mean for doing things such as expanding arrays like we do with JSON tables. For instance: ``` create table resto2 ( name varchar(64) not null, borough char(16) not null, date datetime not null, grade char(1) not null, score int(4) not null) engine=connect table_type=MONGO tabname='restaurants' data_charset=utf8 colist='{"pipeline":[{"$match":{"cuisine":"French"}},{"$unwind":"$grades"},{"$project":{"_id":0,"name":1,"borough":1,"date":"$grades.date","grade":"$grades.grade","score":"$grades.score"}}]}' option_list='Pipeline=1'; ``` In this pipeline “$match” is an early filter, “$unwind” means that the grades array will be expanded (one Document for each array values) and “$project” eliminates the \_id and cuisine columns and gives the Jpath for the date, grade and score columns. ``` select name, grade, score, date from resto2 where borough = 'Bronx'; ``` This query replies: | name | grade | score | date | | --- | --- | --- | --- | | Bistro Sk | A | 10 | 21/11/2014 01:00:00 | | Bistro Sk | A | 12 | 19/02/2014 01:00:00 | | Bistro Sk | B | 18 | 12/06/2013 02:00:00 | This make possible to get things like we do with JSON tables: ``` select name, avg(score) average from resto2 group by name having average >= 25; ``` Can be used to get the average score inside the grades array. | name | average | | --- | --- | | Bouley Botanical | 25,0000 | | Cheri | 46,0000 | | Graine De Paris | 30,0000 | | Le Pescadeux | 29,7500 | ### Fullarray Option This option, like the Depth option, is only interpreted when creating a table with Discovery (meaning not specifying the columns). It tells CONNECT to generate a column for all existing values in the array. For instance, let us see the MongoDB collection tar by: From Connect 1.7.0002 ``` create table seetar ( Collection varchar(300) not null jpath='*') engine=CONNECT table_type=MONGO tabname=tar; ``` Before Connect 1.7.0002 ``` create table seetar ( Collection varchar(300) not null field_format='*') engine=CONNECT table_type=MONGO tabname=tar; ``` The format ‘\*’ indicates we want to see the Json documents. This small collection is: | Collection | | --- | | {"\_id":{"$oid":"58f63a5099b37d9c930f9f3b"},"item":"journal","prices":[87.0,45.0,63.0,12.0,78.0]} | | {"\_id":{"$oid":"58f63a5099b37d9c930f9f3c"},"item":"notebook","prices":[123.0,456.0,789.0]} | The Fullarray option can be used here to generate enough columns to see all the prices of the document prices array. ``` create table tar engine=connect table_type=MONGO colist='{"projection":{"_id":0}}' option_list='depth=1,Fullarray=YES'; ``` The table has been created as: From Connect 1.7.0002 ``` CREATE TABLE `tar` ( `item` char(8) NOT NULL, `prices_0` double(12,6) NOT NULL `JPATH`='prices.0', `prices_1` double(12,6) NOT NULL `JPATH`='prices.1', `prices_2` double(12,6) NOT NULL `JPATH`='prices.2', `prices_3` double(12,6) DEFAULT NULL `JPATH`='prices.3', `prices_4` double(12,6) DEFAULT NULL `JPATH`='prices.4' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `COLIST`='{"projection":{"_id":0}}' `OPTION_LIST`='depth=1,Fullarray=YES'; ``` Before Connect 1.7.0002 ``` CREATE TABLE `tar` ( `item` char(8) NOT NULL, `prices_0` double(12,6) NOT NULL `FIELD_FORMAT`='prices.0', `prices_1` double(12,6) NOT NULL `FIELD_FORMAT`='prices.1', `prices_2` double(12,6) NOT NULL `FIELD_FORMAT`='prices.2', `prices_3` double(12,6) DEFAULT NULL `FIELD_FORMAT`='prices.3', `prices_4` double(12,6) DEFAULT NULL `FIELD_FORMAT`='prices.4' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `COLIST`='{"projection":{"_id":0}}' `OPTION_LIST`='level=1,Fullarray=YES'; ``` And is displayed as: | item | prices\_0 | prices\_1 | prices\_2 | prices\_3 | prices\_4 | | --- | --- | --- | --- | --- | --- | | journal | 87.00 | 45.00 | 63.00 | 12.00 | 78.00 | | notebook | 123.00 | 456.00 | 789.00 | NULL | NULL | Create, Read, Update and Delete Operations ------------------------------------------ All modifying operations are supported. However, inserting into arrays must be done in a specific way. Like with the Fullarray option, we must have enough columns to specify the array values. For instance, we can create a new table by: From Connect 1.7.0002 ``` create table testin ( n int not null, m char(12) not null, surname char(16) not null jpath='person.name.first', name char(16) not null jpath='person.name.last', age int(3) not null jpath='person.age', price_1 double(8,2) jpath='d.0', price_2 double(8,2) jpath='d.1', price_3 double(8,2) jpath='d.2') engine=connect table_type=MONGO tabname='tin' connection='mongodb://localhost:27017'; ``` Before Connect 1.7.0002 ``` create table testin ( n int not null, m char(12) not null, surname char(16) not null field_format='person.name.first', name char(16) not null field_format='person.name.last', age int(3) not null field_format='person.age', price_1 double(8,2) field_format='d.0', price_2 double(8,2) field_format='d.1', price_3 double(8,2) field_format='d.2') engine=connect table_type=MONGO tabname='tin' connection='mongodb://localhost:27017'; ``` Now it is possible to populate it by: ``` insert into testin values (1789, 'Welcome', 'Olivier','Bertrand',56, 3.14, 2.36, 8.45), (1515, 'Hello', 'John','Smith',32, 65.17, 98.12, NULL), (2014, 'Coucou', 'Foo','Bar',20, -1.0, 74, 81356); ``` The result will be: | n | m | surname | name | age | price\_1 | price\_2 | price\_3 | | --- | --- | --- | --- | --- | --- | --- | --- | | 1789 | Welcome | Olivier | Bertrand | 56 | 3,14 | 2,36 | 8,45 | | 1515 | Hello | John | Smith | 32 | 65,17 | 98,12 | NULL | | 2014 | Coucou | Foo | Bar | 20 | -1 | 74 | 81356 | Note: If the collection does not exist yet when creating the table and inserting in it, MongoDB creates it automatically. It can be updated by queries such as: ``` update tintin set price_3 = 83.36 where n = 2014; ``` To look how the array is generated, let us create another table: From Connect 1.7.0002 ``` create table tintin ( n int not null, name char(16) not null jpath='person.name.first', prices varchar(255) jpath='d') engine=connect table_type=MONGO tabname='tin'; ``` Before Connect 1.7.002 ``` create table tintin ( n int not null, name char(16) not null field_format='person.name.first', prices varchar(255) field_format='d') engine=connect table_type=MONGO tabname='in'; ``` This table is displayed as: From Connect 1.7.0002 | n | name | prices | | --- | --- | --- | | 1789 | Olivier | [3.1400000000000001243,2.3599999999999998757,8.4499999999999992895] | | 1515 | John | [65.170000000000001705,98.120000000000004547,null] | | 2014 | Foo | [null,74.0,83.359999999999999432] | Before Connect 1.7.002 | n | name | prices | | --- | --- | --- | | 1789 | Olivier | [3.14, 2.36, 8.45] | | 1515 | John | [65.17, 98.12] | | 2014 | Foo | [<null>, 74.0, 83.36] | Note: This last table can be used to make array calculations like with JSON tables using the JSON UDF functions. For instance: ``` select name, jsonget_real(prices,'[+]') sum_prices, jsonget_real(prices,'[!]') avg_prices from tintin; ``` This query returns: | name | sum\_prices | avg\_prices | | --- | --- | --- | | Olivier | 13.95 | 4.65 | | John | 163.29 | 81.64 | | Foo | 157,36 | 78.68 | Note: When calculating on arrays, null values are ignored. Status of MONGO Table Type -------------------------- This table type is still under development. It has significant advantages over the JSON type to access MongoDB collections. Firstly, the access being direct, tables are always up to date whether the collection has been modified by another application. Performance wise, it can be faster than JSON, because most processing is done by MongoDB on BSON, its internal representation of JSON data, which is designed to optimize all operations. Note that using the MongoDB C Driver can be faster than using the MongoDB Java Driver. Current Restrictions -------------------- * Option “CATFUNC=tables” is not implemented yet. * Options SRCDEF and EXECSRC do not apply to MONGO tables. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb About PBXT About PBXT ========== [PBXT](http://www.primebase.org) was a storage engine that was included in the MariaDB source and binaries by default until [MariaDB 5.3](../what-is-mariadb-53/index). Since [MariaDB 5.5](../what-is-mariadb-55/index), the PBXT storage engine has been disabled by default and must be [explicitly built](../how-to-build-pbxt/index) to use it. The reason is that PBXT is not actively maintained anymore. It has a few bugs that are not fixed and it's not actively used. The PBXT versions in various releases are: * version 1.0.11 in [MariaDB 5.1.47](http://askmonty.org/wiki/MariaDB:Download:MariaDB_5.1.47) * version 1.0.08d in [MariaDB 5.1.44b](http://askmonty.org/wiki/MariaDB:Download:MariaDB_5.1.44b) PBXT is a general purpose transactional storage engine. PBXT is fully "ACID" compliant, which means it can be used as an alternative to other MariaDB transactional engines (such as XtraDB or InnoDB). PBXT features include the following: * **MVCC Support:** MVCC stands for Multi-version Concurrency Control. MVCC allows reading the database without locking. * **Fully ACID compliant:** This means that all transactions are: atomic, consistent, isolated and durable. * **Row-level locking:** When updating, PBXT uses row-level locking. Row-level locking is also used during SELECT FOR UPDATE. * **Fast Rollback and Recovery:** PBXT uses a specialized method to identify garbage which makes "undo" unnecessary. This make both rollback of transactions and recovery after restart very fast. * **Deadlock Detection:** PBXT identifies all kinds of deadlocks immediately. * **Write-once:** PBXT uses a log-based storage which makes it possible to write transactional data directly to the database, without first being writen to the transaction log. * **Referential Integrity:** PBXT supports [foreign key](../foreign-keys/index) definitions, including cascaded updates and deletes. * **BLOB streaming:** In combination with the [BLOB Streaming engine](http://www.blobstreaming.org) PBXT can stream binary and media directly in and out of the database. PBXT will not take any resources (disk space or CPU processing) until you create your first PBXT table. xtstat ------ The included `xtstat` program can be used to monitor all internal activity of PBXT. See [xtstat](../xtstat/index) for more information. More information ---------------- Further documentation for PBXT can be found here: <http://www.primebase.org/documentation> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW SLAVE HOSTS SHOW SLAVE HOSTS ================ Syntax ------ ``` SHOW SLAVE HOSTS SHOW REPLICA HOSTS -- from MariaDB 10.5.1 ``` Description ----------- This command is run on the primary and displays a list of replicas that are currently registered with it. Only replicas started with the `--report-host=host_name` option are visible in this list. The list is displayed on any server (not just the primary server). The output looks like this: ``` SHOW SLAVE HOSTS; +------------+-----------+------+-----------+ | Server_id | Host | Port | Master_id | +------------+-----------+------+-----------+ | 192168010 | iconnect2 | 3306 | 192168011 | | 1921680101 | athena | 3306 | 192168011 | +------------+-----------+------+-----------+ ``` * **`Server_id`**: The unique server ID of the replica server, as configured in the server's option file, or on the command line with [--server-id=value](../replication-and-binary-log-server-system-variables/index#server_id). * **`Host`**: The host name of the replica server, as configured in the server's option file, or on the command line with `--report-host=host_name`. Note that this can differ from the machine name as configured in the operating system. * **`Port`**: The port the replica server is listening on. * **`Master_id`**: The unique server ID of the primary server that the replica server is replicating from. Some MariaDB and MySQL versions report another variable, [rpl\_recovery\_rank](../server-system-variables/index#rpl_recovery_rank). This variable was never used, and was eventually removed in [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/) . Requires the [REPLICATION MASTER ADMIN](../grant/index#replication-master-admin) privilege (>= [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)) or the [REPLICATION SLAVE](../grant/index#replication-slave) privilege (<= [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)). #### SHOW REPLICA HOSTS **MariaDB starting with [10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)**`SHOW REPLICA HOSTS` is an alias for `SHOW SLAVE HOSTS` from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/). See Also -------- * [MariaDB replication](../high-availability-performance-tuning-mariadb-replication/index) * [Replication threads](../replication-threads/index) * [SHOW PROCESSLIST](../show-processlist/index). In `[SHOW PROCESSLIST](../show-processlist/index)` output, replica threads are identified by `Binlog Dump` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Binary Logging of Stored Routines Binary Logging of Stored Routines ================================= Binary logging can be row-based, statement-based, or a mix of the two. See [Binary Log Formats](../binary-log-formats/index) for more details on the formats. If logging is statement-based, it is possible that a statement will have different effects on the master and on the slave. Stored routines are particularly prone to this, for two main reasons: * stored routines can be non-deterministic, in other words non-repeatable, and therefore have different results each time they are run. * the slave thread executing the stored routine on the slave holds full privileges, while this may not be the case when the routine was run on the master. The problems with replication will only occur with statement-based logging. If row-based logging is used, since changes are made to rows based on the master's rows, there is no possibility of the slave and master getting out of sync. By default, with row-based replication, triggers run on the master, and the effects of their executions are replicated to the slaves. However, starting from [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/), it is possible to run triggers on the slaves. See [Running triggers on the slave for Row-based events](../running-triggers-on-the-slave-for-row-based-events/index). How MariaDB Handles Statement-Based Binary Logging of Routines -------------------------------------------------------------- If the following criteria are met, then there are some limitations on whether stored routines can be created: * The [binary log](../binary-log/index) is enabled, and the `[binlog\_format](../replication-and-binary-log-system-variables/index#binlog_format)` system variable is set to `STATEMENT`. See [Binary Log Formats](../binary-log-formats/index) for more information. * The `[log\_bin\_trust\_function\_creators](../replication-and-binary-log-system-variables/index#log_bin_trust_function_creators)` is set to `OFF`, which is the default value. If the above criteria are met, then the following limitations apply: * When a [stored function](../stored-functions/index) is created, it must be declared as either `DETERMINISTIC`, `NO SQL` or `READS SQL DATA`, or else an error will occur. MariaDB cannot check whether a function is deterministic, and relies on the correct definition being used. * To create or modify a stored function, a user requires the `SUPER` privilege as well as the regular privileges. See [Stored Routine Privileges](../stored-routine-privileges/index) for these details. * [Triggers](../triggers/index) work in the same way, except that they are always assumed to be deterministic for logging purposes, even if this is obviously not the case, such as when they use the [UUID](../uuid/index) function. * [Triggers](../triggers/index) can also update data. The slave uses the DEFINER attribute to determine which user is taken to have created the trigger. * Note that the above limitations do no apply to [stored procedures](../stored-procedures/index) or to [events](../events/index). ### Examples A deterministic function: ``` DELIMITER // CREATE FUNCTION trust_me(x INT) RETURNS INT DETERMINISTIC READS SQL DATA BEGIN RETURN (x); END // DELIMITER ; ``` A non-deterministic function, since it uses the [UUID\_SHORT](../uuid_short/index) function: ``` DELIMITER // CREATE FUNCTION dont_trust_me() RETURNS INT BEGIN RETURN UUID_SHORT(); END // DELIMITER ; ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Internal Optimizations MariaDB Internal Optimizations =============================== Different optimizations strategies done internally in MariaDB | Title | Description | | --- | --- | | [Binary Log Group Commit and InnoDB Flushing Performance](../binary-log-group-commit-and-innodb-flushing-performance/index) | Improvement for group commit for InnoDB transactions with the binary log enabled. | | [Fair Choice Between Range and Index\_merge Optimizations](../fair-choice-between-range-and-index_merge-optimizations/index) | index\_merge is a method used by the optimizer to retrieve rows from a singl... | | [Improvements to ORDER BY Optimization](../improvements-to-order-by/index) | Several Improvements to the ORDER BY Optimizer in Version 10.1 of MariaDB. | | [Multi Range Read Optimization](../multi-range-read-optimization/index) | An optimization for improving performance of IO-bound queries which scan many rows. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb COUNT DISTINCT COUNT DISTINCT ============== Syntax ------ ``` COUNT(DISTINCT expr,[expr...]) ``` Description ----------- Returns a count of the number of different non-NULL values. COUNT(DISTINCT) returns 0 if there were no matching rows. Although, from [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/), [COUNT](../count/index) can be used as a [window function](../window-functions/index), COUNT DISTINCT cannot be. Examples -------- ``` CREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87), ('Tatiana', 'Tuning', 83); SELECT COUNT(*) FROM student; +----------+ | COUNT(*) | +----------+ | 8 | +----------+ SELECT COUNT(DISTINCT (name)) FROM student; +------------------------+ | COUNT(DISTINCT (name)) | +------------------------+ | 4 | +------------------------+ ``` See Also -------- * [SELECT](../select/index) * [COUNT](../count/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHARE PERFORMANCE ACROSS 2 SERVERS SHARE PERFORMANCE ACROSS 2 SERVERS ================================== Good morning in very l 'équipe of monty , sorry for my english, i am french. To ameliorate a problem of performance d 'une database. That this has 200 tables, therefore 2 very very hard soliciting. What for consequences l 'effet with dominoes. J 'explique if I solicit the performance of these from 198 small tables is good. But if all at once I solicit 2 big tables of numerous times, the solicitation of the 198 small tables becomes slow. I look for, a solution like SET @SERVER1='root@mypassword/192.0.1.128:3306'; SET @SERVER2='root2@mypasswordx/192.0.1.129:3306'; SELECT T1,T2 FROM SERVER1.DATABASE.ARTICLE , SERVER2.DATABASE.TAX WERE SERVER1.DATABASE.ARTICLE.S1KEYUNIK=SERVER2.DATABASE.TAX.S1KEYUNIK; Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-tzinfo-to-sql mariadb-tzinfo-to-sql ===================== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-tzinfo-to-sql` is a symlink to `mysql_tzinfo_to_sql`, the tool for loading [time zones](../time-zones/index) on systems that have a zoneinfo database. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mysql_tzinfo_to_sql` is the symlink, and `mariadb-tzinfo-to-sql` the binary name. See [mysql\_tzinfo\_to\_sql](../mysql_tzinfo_to_sql/index) for details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW EXPLAIN SHOW EXPLAIN ============ Syntax ------ ``` SHOW EXPLAIN FOR <thread_id>; EXPLAIN FOR CONNECTION <thread_id>; ``` Description ----------- The `SHOW EXPLAIN` command allows one to get an [EXPLAIN](../explain/index) (that is, a description of a query plan) of a query running in a certain thread. ``` SHOW EXPLAIN FOR <thread_id>; ``` will produce an `EXPLAIN` output for the query that thread number `thread_id` is running. The thread id can be obtained with [SHOW PROCESSLIST](../show-processlist/index). ``` SHOW EXPLAIN FOR 1; +------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+ | 1 | SIMPLE | tbl | index | NULL | a | 5 | NULL | 1000107 | Using index | +------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+ 1 row in set, 1 warning (0.00 sec) ``` The output is always accompanied with a warning which shows the query the target thread is running (this shows what the `EXPLAIN` is for): ``` SHOW WARNINGS; +-------+------+------------------------+ | Level | Code | Message | +-------+------+------------------------+ | Note | 1003 | select sum(a) from tbl | +-------+------+------------------------+ 1 row in set (0.00 sec) ``` **MariaDB starting with [10.9](../what-is-mariadb-109/index)**The `EXPLAIN FOR CONNECTION` syntax was added for MySQL compatibility. ### Possible Errors The output can be only produced if the target thread is *currently* running a query, which has a ready query plan. If this is not the case, the output will be: ``` SHOW EXPLAIN FOR 2; ERROR 1932 (HY000): Target is not running an EXPLAINable command ``` You will get this error when: * the target thread is not running a command for which one can run `EXPLAIN` * the target thread is running a command for which one can run `EXPLAIN`, but + there is no query plan yet (for example, tables are open and locks are acquired before the query plan is produced) ### Differences Between SHOW EXPLAIN and EXPLAIN Outputs #### Background In MySQL, `EXPLAIN` execution takes a slightly different route from the way the real query (typically the `SELECT`) is optimized. This is unfortunate, and has caused a number of bugs in `EXPLAIN`. (For example, see [MDEV-326](https://jira.mariadb.org/browse/MDEV-326), [MDEV-410](https://jira.mariadb.org/browse/MDEV-410), and [lp:1013343](https://bugs.launchpad.net/maria/+bug/1013343). [lp:992942](https://bugs.launchpad.net/maria/+bug/992942) is not directly about `EXPLAIN`, but it also would not have existed if MySQL didn't try to delete parts of a query plan in the middle of the query) `SHOW EXPLAIN` examines a running `SELECT`, and hence its output may be slightly different from what `EXPLAIN SELECT` would produce. We did our best to make sure that either the difference is negligible, or `SHOW EXPLAIN`'s output is closer to reality than `EXPLAIN`'s output. #### List of Recorded Differences * `SHOW EXPLAIN` may have Extra='`no matching row in const table`', where `EXPLAIN` would produce Extra='`Impossible WHERE ...`' * For queries with subqueries, `SHOW EXPLAIN` may print `select_type==PRIMARY` where regular `EXPLAIN` used to print `select_type==SIMPLE`, or vice versa. #### Required Permissions Running `SHOW EXPLAIN` requires the same permissions as running `SHOW PROCESSLIST` would. See Also -------- * [EXPLAIN](../explain/index) * [EXPLAIN ANALYZE](../explain-analyze/index), which will perform a query and outputs enhanced `EXPLAIN` results. * It is also possible to [save EXPLAIN into the slow query log](../explain-in-the-slow-query-log/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Transaction Coordinator Log Transaction Coordinator Log ============================ | Title | Description | | --- | --- | | [Transaction Coordinator Log Overview](../transaction-coordinator-log-overview/index) | The transaction coordinator log (tc\_log) is used to coordinate transactions... | | [Heuristic Recovery with the Transaction Coordinator Log](../heuristic-recovery-with-the-transaction-coordinator-log/index) | The transaction coordinator log (tc\_log) can be used to recover prepared XA... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Configuring Swappiness Configuring Swappiness ====================== Why to Avoid Swapping --------------------- Obviously, accessing swap memory from disk is far slower than accessing RAM directly. This is particularly bad on a database server because: * MariaDB's internal algorithms assume that memory is not swap, and are highly inefficient if it is. Some algorithms are intended to avoid or delay disk IO, and use memory where possible - performing this with swap can be worse than just doing it on disk in the first place. * Swap increases IO over just using disk in the first place as pages are actively swapped in and out of swap. Even something like removing a dirty page that is no longer going to be stored in memory, while designed to improve efficiency, will under a swap situation cost more IO. * Database locks are particularly inefficient in swap. They are designed to be obtained and released often and quickly, and pausing to perform disk IO will have a serious impact on their usability. The main way to avoid swapping is to make sure you have enough RAM for all processes that need to run on the machine. Setting the [system variables](../system-variables/index) too high can mean that under load the server runs short of memory, and needs to use swap. So understanding what settings to use and how these impact your server's memory usage is critical. Setting Swappiness on Linux --------------------------- Linux has a swappiness setting which determines the balance between swapping out pages (chunks of memory) from RAM to a preconfigured swap space on the hard drive. The setting is from 0 to 100, with lower values meaning a lower likelihood of swapping. The default is usually 60 - you can check this by running: ``` sysctl vm.swappiness ``` The default setting encourages the server to use swap. Since there probably won't be much else on the database server besides MariaDB processes to put into swap, you'll probably want to reduce this to zero to avoid swapping as much as possible. You can change the default by adding a line to the `sysctl.conf` file (usually found in `/etc/sysctl.conf`). To set the swappiness to zero, add the line: ``` vm.swappiness = 0 ``` This normally takes effect after a reboot, but you can change the value without rebooting as follows: ``` sysctl -w vm.swappiness=0 ``` Since RHEL 6.4, setting swappiness=0 more aggressively avoids swapping out, which increases the risk of OOM killing under strong memory and I/O pressure. A low swappiness setting is recommended for database workloads. For MariaDB databases, it is recommended to set swappiness to a value of 1. ``` vm.swappiness = 1 ``` Disabling Swap Altogether ------------------------- While some disable swap altogether, and you certainly want to avoid any database processes from using it, it can be prudent to leave some swap space to at least allow the kernel to fall over gracefully should a spike occur. Having emergency swap available at least allows you some scope to kill any runaway processes. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Spider Installation Spider Installation =================== The Spider storage engine supports partitioning and XA transactions, and allows tables of different MariaDB instances to be handled as if they were on the same instance. To use Spider, you need two or more instances of MariaDB, typically running on separate hosts. The Spider node is the MariaDB server that receives queries from your application. It then processes these queries, connecting to one or more data nodes. The data nodes are the MariaDB servers that actually store the table data. In order for this to work, you need to configure the data nodes to accept queries from the Spider node and you need to configure the Spider node to use the data nodes as remote storage. You don't need to install any additional packages to use it, but it does require some configuration. Configuring Data Nodes ---------------------- Spider deployments use data nodes to store the actual table data. In order for a MariaDB server to operate as a data node for Spider, you need to create a table or tables on which to store the data and configure the server to accept client connections from the Spider node. For instance, first create the table: ``` CREATE TABLE test.spider_example ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50) ) ENGINE=InnoDB; ``` Next, create a user for the Spider node and set a password for that user. For the sake of the example, assume the Spider node is at the IP address 192.168.1.1: ``` CREATE USER [email protected]; SET PASSWORD FOR [email protected] = PASSWORD('passwd'); ``` Then grant the `spider` user privileges on the example table. ``` GRANT ALL ON test.spider_example TO [email protected]; ``` The data node is now ready for use. You can test it by attempting to connect the MariaDB client to the data from the Spider node. For instance, assuming the data node is at the IP address 192.168.1.5, SSH into the Spider node then try to establish a client connection. ``` $ mysql -u spider -p -h 192.168.1.5 test -e "SHOW TABLES;" +----------------+ | Tables_in_test | +----------------+ | spider_example | +----------------+ ``` Install Spider on Spider Node ----------------------------- The Spider storage engine must be installed on the Spider node. The Spider node is the MariaDB server that receives queries for the table, (in this case `test.spider_example`). It then uses the Spider storage engine to connect to the tables on the data nodes to retrieve data and return the result-set. To install the Spider storage engine, complete the installation process shown below. ### Step 1: Install Spider Package (Debian/Ubuntu) On Debian and Ubuntu, the Spider storage engine is installed via a separate `mariadb-plugin-spider` package. To install the package via APT, execute the following command: ``` $ sudo apt install mariadb-plugin-spider ``` On other Linux distributions, the Spider storage engine is installed with MariaDB Server. ### Step 2a: Load the Spider Plugin ([MariaDB 10.4](../what-is-mariadb-104/index) and Later) With [MariaDB 10.4](../what-is-mariadb-104/index) and later, the Spider storage engine can be loaded as a normal plugin, and Spider automatically creates its dependencies. There are two primary ways to load the plugin. The plugin can be loaded dynamically without a server restart by executing `INSTALL SONAME` or `INSTALL PLUGIN`: ``` INSTALL SONAME "ha_spider"; ``` Alternatively, the plugin can be loaded by adding `plugin_load_add=ha_spider` to a configuration file: ``` <<quote>> [mariadb] ... plugin_load_add = "ha_spider" <</quote>> ``` If the plugin is loaded in a configuration file, then the server will load the plugin after the server has been restarted. Loading the plugin also creates a series of new tables in the `mysql` database, including: | table name | added version | | --- | --- | | spider\_xa | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_xa\_member | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_xa\_failed\_log | [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/) | | spider\_tables | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_link\_mon\_servers | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_link\_failed\_log | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_table\_position\_for\_recovery | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | spider\_table\_sts | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | spider\_table\_crd | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | ### Step 2b: Load the Spider Plugin ([MariaDB 10.3](../what-is-mariadb-103/index) and Before) With [MariaDB 10.3](../what-is-mariadb-103/index) and before, the Spider storage engine can be loaded by executing the included `install_spider.sql` script: ``` $ mysql --user root --password < /usr/share/mysql/install_spider.sql ``` Running this configuration script also creates a series of new tables in the `mysql` database, including: | table name | added version | | --- | --- | | spider\_xa | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_xa\_member | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_xa\_failed\_log | [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/) | | spider\_tables | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_link\_mon\_servers | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_link\_failed\_log | [MariaDB 10.0.4](https://mariadb.com/kb/en/mariadb-1004-release-notes/) | | spider\_table\_position\_for\_recovery | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | spider\_table\_sts | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | spider\_table\_crd | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | ### Step 3: Verify Loading of the Spider Plugin You can verify that the Spider plugin has been loaded by querying the `information_schema.ENGINES` table: ``` SELECT ENGINE, SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'SPIDER'; +--------------------+---------+ | ENGINE | SUPPORT | +--------------------+---------+ | SPIDER | YES | +--------------------+---------+ ``` If the Spider plugin is not loaded, then the query will not return any results. Configuring Spider Nodes ------------------------ With the data node or data nodes configured, you can set up the Spider node to use them. The Spider node is the MariaDB server that receives queries for the table, (in this case `test.spider_example`). It then uses the Spider storage engine to connect to the tables on the data nodes to retrieve data and return the result-set. ### Configure the Server In order to connect the Spider node to the data nodes, you need to issue a `[CREATE SERVER](../create-server/index)` statement for each data node. You can then use the server definition in creating the Spider table. ``` CREATE SERVER dataNode1 FOREIGN DATA WRAPPER mysql OPTIONS ( HOST '192.168.1.5', DATABASE 'test', USER 'spider', PASSWORD 'passwd', PORT 3306); ``` In the event that you need to modify or replace this server after setting up the Spider table, remember to issue a `[FLUSH](../flush/index)` statement to update the server definition. ``` FLUSH TABLES; ``` ### Create the Table With the data nodes set up and the Spider node configured for use, you can create the Spider table. The Spider table must have the same column definitions as the InnoDB tables on the data nodes. Spider is configured through table system variables passed to the `COMMENT` option. ``` CREATE TABLE test.spider_example ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50) ) ENGINE=Spider COMMENT='wrapper "mysql", srv "dataNode1", table "spider_example"'; ``` This configures Spider to use the server `dataNode1`, (defined above), as a remote table. Any data you write to this table is actually stored on the MariaDB server at 192.168.1.5. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BINARY BINARY ====== This page describes the BINARY data type. For details about the operator, see [Binary Operator](../binary-operator/index). Syntax ------ ``` BINARY(M) ``` Description ----------- The `BINARY` type is similar to the `[CHAR](../char/index)` type, but stores binary byte strings rather than non-binary character strings. `M` represents the column length in bytes. It contains no character set, and comparison and sorting are based on the numeric value of the bytes. If the maximum length is exceeded, and [SQL strict mode](../sql-mode/index) is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur. BINARY values are right-padded with `0x00` (the zero byte) to the specified length when inserted. The padding is *not* removed on select, so this needs to be taken into account when sorting and comparing, where all bytes are significant. The zero byte, `0x00` is less than a space for comparison purposes. Examples -------- Inserting too many characters, first with strict mode off, then with it on: ``` CREATE TABLE bins (a BINARY(10)); INSERT INTO bins VALUES('12345678901'); Query OK, 1 row affected, 1 warning (0.04 sec) SELECT * FROM bins; +------------+ | a | +------------+ | 1234567890 | +------------+ SET sql_mode='STRICT_ALL_TABLES'; INSERT INTO bins VALUES('12345678901'); ERROR 1406 (22001): Data too long for column 'a' at row 1 ``` Sorting is performed with the byte value: ``` TRUNCATE bins; INSERT INTO bins VALUES('A'),('B'),('a'),('b'); SELECT * FROM bins ORDER BY a; +------+ | a | +------+ | A | | B | | a | | b | +------+ ``` Using [CAST](../cast/index) to sort as a [CHAR](../char/index) instead: ``` SELECT * FROM bins ORDER BY CAST(a AS CHAR); +------+ | a | +------+ | a | | A | | b | | B | +------+ ``` The field is a BINARY(10), so padding of two '\0's are inserted, causing comparisons that don't take this into account to fail: ``` TRUNCATE bins; INSERT INTO bins VALUES('12345678'); SELECT a = '12345678', a = '12345678\0\0' from bins; +----------------+--------------------+ | a = '12345678' | a = '12345678\0\0' | +----------------+--------------------+ | 0 | 1 | +----------------+--------------------+ ``` See Also -------- * [CHAR](../char/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BIT_XOR BIT\_XOR ======== Syntax ------ ``` BIT_XOR(expr) [over_clause] ``` Description ----------- Returns the bitwise XOR of all bits in `expr`. The calculation is performed with 64-bit ([BIGINT](../bigint/index)) precision. It is an [aggregate function](../aggregate-functions/index), and so can be used with the [GROUP BY](../group-by/index) clause. If no rows match, `BIT_XOR` will return a value with all bits set to `0`. NULL values have no effect on the result unless all results are NULL, which is treated as no match. From [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/), `BIT_XOR` can be used as a [window function](../window-functions/index) with the addition of the *over\_clause*. Examples -------- ``` CREATE TABLE vals (x INT); INSERT INTO vals VALUES(111),(110),(100); SELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals; +------------+-----------+------------+ | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) | +------------+-----------+------------+ | 100 | 111 | 101 | +------------+-----------+------------+ ``` As an [aggregate function](../aggregate-functions/index): ``` CREATE TABLE vals2 (category VARCHAR(1), x INT); INSERT INTO vals2 VALUES ('a',111),('a',110),('a',100), ('b','000'),('b',001),('b',011); SELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals GROUP BY category; +----------+------------+-----------+------------+ | category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) | +----------+------------+-----------+------------+ | a | 100 | 111 | 101 | | b | 0 | 11 | 10 | +----------+------------+-----------+------------+ ``` No match: ``` SELECT BIT_XOR(NULL); +---------------+ | BIT_XOR(NULL) | +---------------+ | 0 | +---------------+ ``` See Also -------- * [BIT\_AND](../bit_and/index) * [BIT\_OR](../bit_or/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Upgrading MariaDB Upgrading MariaDB ================== | Title | Description | | --- | --- | | [Upgrading Between Major MariaDB Versions](../upgrading-between-major-mariadb-versions/index) | MariaDB is designed for easy upgrades. | | [Upgrading Between Minor Versions on Linux](../upgrading-between-minor-versions-on-linux/index) | Upgrading between minor versions of MariaDB, e.g. from MariaDB 10.4.12 to MariaDB 10.4.13 | | [Upgrading from MariaDB 10.6 to MariaDB 10.7](../upgrading-from-mariadb-106-to-mariadb-107/index) | How to upgrade from MariaDB 10.6 to MariaDB 10.7. | | [Upgrading from MariaDB 10.5 to MariaDB 10.6](../upgrading-from-mariadb-105-to-mariadb-106/index) | How to upgrade from MariaDB 10.5 to MariaDB 10.6. | | [Upgrading from MariaDB 10.4 to MariaDB 10.5](../upgrading-from-mariadb-104-to-mariadb-105/index) | How to upgrade from MariaDB 10.4 to MariaDB 10.5. | | [Upgrading from MariaDB 10.3 to MariaDB 10.4](../upgrading-from-mariadb-103-to-mariadb-104/index) | How to upgrade from MariaDB 10.3 to MariaDB 10.4. | | [Upgrading from MariaDB 10.2 to MariaDB 10.3](../upgrading-from-mariadb-102-to-mariadb-103/index) | How to upgrade from MariaDB 10.2 to MariaDB 10.3. | | [Upgrading from MariaDB 10.1 to MariaDB 10.2](../upgrading-from-mariadb-101-to-mariadb-102/index) | How to upgrade from MariaDB 10.1 to MariaDB 10.2. | | [Upgrading from MariaDB 10.0 to MariaDB 10.1](../upgrading-from-mariadb-100-to-mariadb-101/index) | How to upgrade from MariaDB 10.0 to MariaDB 10.1. | | [Upgrading from MariaDB 5.5 to MariaDB 10.0](../upgrading-from-mariadb-55-to-mariadb-100/index) | How to upgrade from MariaDB 5.5 to MariaDB 10.0. | | [Upgrading from MariaDB 5.3 to MariaDB 5.5](../upgrading-from-mariadb-53-to-mariadb-55/index) | How to upgrade from MariaDB 5.3 to MariaDB 5.5 | | [Upgrading MariaDB on Windows](../upgrading-mariadb-on-windows/index) | Upgrading MariaDB on Windows | | [Upgrading Galera Cluster](../upgrading-galera-cluster/index) | Upgrading MariaDB Galera Cluster. | | [Upgrading from MySQL to MariaDB](../upgrading-mariadb-upgrading-from-mysql-to-mariadb/index) | Upgrading from MySQL to MariaDB. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Machine Learning with MindsDB Machine Learning with MindsDB ============================= Overview -------- [MindsDB](https://docs.mindsdb.com/databases/) is a third-party application that interfaces with MariaDB Server to provide Machine Learning capabilities through SQL. The interface is done via the [Connect Storage Engine](../connect/index). Installation ------------ To get a functional MariaDB - MindsDB installation, one needs to install the following components: * **MindsDB**: follow the instructions in the project's [official documentation](https://docs.mindsdb.com/installation/Installing/). * **Connect Storage Engine** must be enabled for the integration to work. See [installing the connect storage engine](../installing-the-connect-storage-engine/index). MindsDB connects to MariaDB Server via a regular user to setup a dedicated database called `mindsdb`. Which user will be used is specified within MindsDB's [configuration file](https://docs.mindsdb.com/databases/MariaDB/). For example, if MindsDB is installed locally, one can create a user called `mindsdb@localhost`. MindsDB only authenticates via the [mysql\_native\_password](../authentication-plugin-mysql_native_password/index) plugin, hence one must set a password for the user: ``` CREATE USER mindsdb@localhost; SET PASSWORD for mindsdb@localhost=PASSWORD("password"); ``` The user must be granted the global [FILE](../grant/index#file) privilege and all privileges on the `mindsdb` database. ``` GRANT FILE on *.* to mindsdb@localhost; GRANT ALL on mindsdb.* to mindsdb@localhost; ``` Assuming MindsDB is in the python path one can start up MindsDB with the following parameters: ``` python -m mindsdb --config=$CONFIG_PATH --api=http,mysql ``` Make sure `$CONFIG_PATH` points to the appropriate MindsDB configuration file. Usage ----- Always consult the project's [official documentation](https://docs.mindsdb.com/installation/Installing/) for up-to-date usage scenarios as MindsDB is an actively developed project. For a step-by-step example, you can consult the following [blog post](https://mariadb.org/machine-learning-sql/). If the connection between MindsDB and MariaDB is successful, you should see the `mindsdb` database present and two tables within it: `commands` and `predictors`. MindsDB, as an AutoML framework does all the work when it comes to training the AI model. What is necessary is to pass it the initial data, which MindsDB retrieves via a SELECT statement. This can be done by inserting into the `predictors` table. ``` INSERT INTO `predictors` (`name`, `predict`, `select_data_query`) VALUES ('bikes_model', 'count', 'SELECT * FROM test.bike_data'); ``` The values inserted into predictors act as a command instructing MindsDB to: 1. Train a model called 'bikes\_model' 2. From the input data, learn to predict the 'count' column. 3. The input data is generated via the select statement 'SELECT \* FROM test.bike\_data'. The `select_data_query` should be a valid select that MindsDB can run against MariaDB. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema threads Table Performance Schema threads Table ================================ Each server thread is represented as a row in the `threads` table. The `threads` table contains the following columns: | Column | Description | | --- | --- | | `THREAD_ID` | A unique thread identifier. | | `NAME` | Name associated with the server's thread instrumentation code, for example `thread/sql/main` for the server's `main()` function, and `thread/sql/one_connection` for a user connection. | | `TYPE` | `FOREGROUND` or `BACKGROUND`, depending on the thread type. User connection threads are `FOREGROUND`, internal server threads are `BACKGROUND`. | | `PROCESSLIST_ID` | The `PROCESSLIST.ID` value for threads displayed in the `INFORMATION_SCHEMA.PROCESSLIST` table, or `0` for background threads. Also corresponds with the `CONNECTION_ID()` return value for the thread. | | `PROCESSLIST_USER` | Foreground thread user, or `NULL` for a background thread. | | `PROCESSLIST_HOST` | Foreground thread host, or `NULL` for a background thread. | | `PROCESSLIST_DB` | Thread's default database, or `NULL` if none exists. | | `PROCESSLIST_COMMAND` | Type of command executed by the thread. These correspond to the the `COM_xxx` client/server protocol commands, and the `Com_xxx` [status variables](../server-status-variables/index). See [Thread Command Values](../thread-command-values/index). | | `PROCESSLIST_TIME` | Time in seconds the thread has been in its current state. | | `PROCESSLIST_STATE` | Action, event or state indicating what the thread is doing. | | `PROCESSLIST_INFO` | Statement being executed by the thread, or `NULL` if a statement is not being executed. If a statement results in calling other statements, such as for a [stored procedure](../stored-procedures/index), the innermost statement from the stored procedure is shown here. | | `PARENT_THREAD_ID` | `THREAD_ID` of the parent thread, if any. Subthreads can for example be spawned as a result of [INSERT DELAYED](../insert-delayed/index) statements. | | `ROLE` | Unused. | | `INSTRUMENTED` | `YES` or `NO` for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the [setup\_actors](../performance-schema-setup_actors-table/index) table. Subthreads are again matched, while for background threads, this will be set to `YES` by default. To monitor events that the thread executes, `INSTRUMENTED` must be `YES` and the thread\_instrumentation consumer in the [setup\_consumers](../performance-schema-setup_consumers-table/index) table must also be `YES`. | | `HISTORY` | `YES` or `NO` for Whether to log historical events for the thread. For foreground threads, the initial value is determined by whether there's a user/host match in the [setup\_actors](../performance-schema-setup_actors-table/index) table. Subthreads are again matched, while for background threads, this will be set to `YES` by default. To monitor events that the thread executes, `INSTRUMENTED` must be `YES` and the thread\_instrumentation consumer in the [setup\_consumers](../performance-schema-setup_consumers-table/index) table must also be `YES`. Added in [MariaDB 10.5](../what-is-mariadb-105/index). | | `CONNECTION_TYPE` | The protocol used to establish the connection. One of `TCP/IP`, `SSL/TLS`, `Socket`, `Named Pipe`, `Shared Memory`, or `NULL` for background threads. Added in [MariaDB 10.5](../what-is-mariadb-105/index). | | `THREAD_OS_ID` | The thread or task identifier as defined by the underlying operating system, if there is one. Added in [MariaDB 10.5](../what-is-mariadb-105/index) | Example ------- ``` SELECT * FROM performance_schema.threads\G; *************************** 1. row *************************** THREAD_ID: 1 NAME: thread/sql/main TYPE: BACKGROUND PROCESSLIST_ID: NULL PROCESSLIST_USER: NULL PROCESSLIST_HOST: NULL PROCESSLIST_DB: NULL PROCESSLIST_COMMAND: NULL PROCESSLIST_TIME: 215859 PROCESSLIST_STATE: Table lock PROCESSLIST_INFO: INTERNAL DDL LOG RECOVER IN PROGRESS PARENT_THREAD_ID: NULL ROLE: NULL INSTRUMENTED: YES ... *************************** 21. row *************************** THREAD_ID: 64 NAME: thread/sql/one_connection TYPE: FOREGROUND PROCESSLIST_ID: 44 PROCESSLIST_USER: root PROCESSLIST_HOST: localhost PROCESSLIST_DB: NULL PROCESSLIST_COMMAND: Query PROCESSLIST_TIME: 0 PROCESSLIST_STATE: Sending data PROCESSLIST_INFO: SELECT * FROM performance_schema.threads PARENT_THREAD_ID: NULL ROLE: NULL INSTRUMENTED: YES ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb LAG LAG === **MariaDB starting with [10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/)**The LAG() function was first introduced with other [window functions](../window-functions/index) in [MariaDB 10.2](../what-is-mariadb-102/index). Syntax ------ ``` LAG (expr[, offset]) OVER ( [ PARTITION BY partition_expression ] < ORDER BY order_list > ) ``` Description ----------- The *LAG* function accesses data from a previous row according to the ORDER BY clause without the need for a self-join. The specific row is determined by the *offset* (default *1*), which specifies the number of rows behind the current row to use. An offset of *0* is the current row. Examples -------- ``` CREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10, 3), e real); INSERT INTO t1 VALUES ( 1, 0, 1, 'one', 0.1, 0.001), ( 2, 0, 2, 'two', 0.2, 0.002), ( 3, 0, 3, 'three', 0.3, 0.003), ( 4, 1, 2, 'three', 0.4, 0.004), ( 5, 1, 1, 'two', 0.5, 0.005), ( 6, 1, 1, 'one', 0.6, 0.006), ( 7, 2, NULL, 'n_one', 0.5, 0.007), ( 8, 2, 1, 'n_two', NULL, 0.008), ( 9, 2, 2, NULL, 0.7, 0.009), (10, 2, 0, 'n_four', 0.8, 0.010), (11, 2, 10, NULL, 0.9, NULL); SELECT pk, LAG(pk) OVER (ORDER BY pk) AS l, LAG(pk,1) OVER (ORDER BY pk) AS l1, LAG(pk,2) OVER (ORDER BY pk) AS l2, LAG(pk,0) OVER (ORDER BY pk) AS l0, LAG(pk,-1) OVER (ORDER BY pk) AS lm1, LAG(pk,-2) OVER (ORDER BY pk) AS lm2 FROM t1; +----+------+------+------+------+------+------+ | pk | l | l1 | l2 | l0 | lm1 | lm2 | +----+------+------+------+------+------+------+ | 1 | NULL | NULL | NULL | 1 | 2 | 3 | | 2 | 1 | 1 | NULL | 2 | 3 | 4 | | 3 | 2 | 2 | 1 | 3 | 4 | 5 | | 4 | 3 | 3 | 2 | 4 | 5 | 6 | | 5 | 4 | 4 | 3 | 5 | 6 | 7 | | 6 | 5 | 5 | 4 | 6 | 7 | 8 | | 7 | 6 | 6 | 5 | 7 | 8 | 9 | | 8 | 7 | 7 | 6 | 8 | 9 | 10 | | 9 | 8 | 8 | 7 | 9 | 10 | 11 | | 10 | 9 | 9 | 8 | 10 | 11 | NULL | | 11 | 10 | 10 | 9 | 11 | NULL | NULL | +----+------+------+------+------+------+------+ ``` See Also -------- * [LEAD](../lead/index) - Window function to access a following row Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb TokuDB TokuDB ======= TokuDB has been deprecated by its upstream maintainer. It is disabled from [MariaDB 10.5](../what-is-mariadb-105/index) and has been been removed in [MariaDB 10.6](../what-is-mariadb-106/index) - [MDEV-19780](https://jira.mariadb.org/browse/MDEV-19780). We recommend [MyRocks](../myrocks/index) as a long-term migration path. The TokuDB storage engine is for use in high-performance and write-intensive environments, offering increased compression and better performance. It is available in an open-source version, included with 64-bit MariaDB (but not enabled by default), and an Enterprise edition available from Tokutek. Official TokuDB Product Specs and Manuals are available on the Percona website. See: * [TokuDB Documentation](https://www.percona.com/doc/percona-tokudb/index.html) TokuDB is available on the following distributions: | Distribution | Introduced | | --- | --- | | CentOS 6 64-bit and newer | [MariaDB 5.5.36](https://mariadb.com/kb/en/mariadb-5536-release-notes/) and [MariaDB 10.0.9](https://mariadb.com/kb/en/mariadb-1009-release-notes/) | | Debian 7 "wheezy"64-bit and newer | [MariaDB 5.5.33](https://mariadb.com/kb/en/mariadb-5533-release-notes/) and [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/) | | Fedora 19 64-bit and newer | [MariaDB 5.5.33](https://mariadb.com/kb/en/mariadb-5533-release-notes/) and [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/) | | openSUSE 13.1 64-bit and newer | [MariaDB 5.5.41](https://mariadb.com/kb/en/mariadb-5541-release-notes/) and [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) | | Red Hat 6 64-bit and newer | [MariaDB 5.5.36](https://mariadb.com/kb/en/mariadb-5536-release-notes/) and [MariaDB 10.0.9](https://mariadb.com/kb/en/mariadb-1009-release-notes/) | | Ubuntu 12.10 "quantal" 64-bit and newer | [MariaDB 5.5.33](https://mariadb.com/kb/en/mariadb-5533-release-notes/) and [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/) | Note that the default value of [tokudb\_pk\_insert\_mode](../tokudb-system-variables/index#tokudb_pk_insert_mode) will prevent row-based replication from working. To use RBR, change the value of this variable. ### Versions of the TokuDB plugin included in MariaDB | TokuDB Version | Introduced | Maturity | | --- | --- | --- | | TokuDB from [Percona Server 5.6.49-89.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.49-89.0.html) | [MariaDB 10.1.46](https://mariadb.com/kb/en/mariadb-10146-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.46-86.2](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.46-86.2.html) | [MariaDB 10.1.44](https://mariadb.com/kb/en/mariadb-10144-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.43-84.3](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.43-84.3.html) | [MariaDB 10.1.39](https://mariadb.com/kb/en/mariadb-10139-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.42-84.2](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.42-84.2.html) | [MariaDB 10.0.38](https://mariadb.com/kb/en/mariadb-10038-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.41-84.1](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.41-84.1.html) | [MariaDB 10.1.36](https://mariadb.com/kb/en/mariadb-10136-release-notes/), [MariaDB 10.0.37](https://mariadb.com/kb/en/mariadb-10037-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.39-83.1](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.39-82.1.html) | [MariaDB 10.0.35](https://mariadb.com/kb/en/mariadb-10035-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.38-83.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.38-83.0.html) | [MariaDB 10.1.31](https://mariadb.com/kb/en/mariadb-10131-release-notes/), [MariaDB 10.0.34](https://mariadb.com/kb/en/mariadb-10034-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.37-82.2](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.37-82.2.html) | [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.27](https://mariadb.com/kb/en/mariadb-10127-release-notes/), [MariaDB 10.0.33](https://mariadb.com/kb/en/mariadb-10033-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.36-82.1](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.36-82.1.html) | [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/), [MariaDB 10.0.32](https://mariadb.com/kb/en/mariadb-10032-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.36-82.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.36-82.0.html) | [MariaDB 10.2.7](https://mariadb.com/kb/en/mariadb-1027-release-notes/), [MariaDB 10.1.24](https://mariadb.com/kb/en/mariadb-10124-release-notes/), [MariaDB 10.0.31](https://mariadb.com/kb/en/mariadb-10031-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.35-80.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.35-80.0.html) | [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/), [MariaDB 10.1.22](https://mariadb.com/kb/en/mariadb-10122-release-notes/), [MariaDB 10.0.30](https://mariadb.com/kb/en/mariadb-10030-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.34-79.1](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.34-79.1.html) | [MariaDB 10.1.20](https://mariadb.com/kb/en/mariadb-10120-release-notes/), [MariaDB 10.0.29](https://mariadb.com/kb/en/mariadb-10029-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.33-79.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.33-79.0.html) | [MariaDB 10.1.19](https://mariadb.com/kb/en/mariadb-10119-release-notes/), [MariaDB 10.0.28](https://mariadb.com/kb/en/mariadb-10028-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.32-78.1](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.32-78.1.html) | [MariaDB 10.1.18](https://mariadb.com/kb/en/mariadb-10118-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.31-77.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.31-77.0.html) | [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/), [MariaDB 10.0.27](https://mariadb.com/kb/en/mariadb-10027-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.30-76.3](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.30-76.3.html) | [MariaDB 10.1.15](https://mariadb.com/kb/en/mariadb-10115-release-notes/), [MariaDB 10.0.26](https://mariadb.com/kb/en/mariadb-10026-release-notes/) | Stable | | TokuDB from [Percona Server 5.6.26-74.0](https://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.30-76.3.html) [[1](#_note-0)] | [MariaDB 10.0.23](https://mariadb.com/kb/en/mariadb-10023-release-notes/) | Stable | | [TokuDB 7.5.7](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-7) | [MariaDB 10.0.20](https://mariadb.com/kb/en/mariadb-10020-release-notes/), [MariaDB 5.5.44](https://mariadb.com/kb/en/mariadb-5544-release-notes/) | Stable | | [TokuDB 7.5.6](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-6) | [MariaDB 10.1.5](https://mariadb.com/kb/en/mariadb-1015-release-notes/), [MariaDB 10.0.18](https://mariadb.com/kb/en/mariadb-10018-release-notes/), [MariaDB 5.5.43](https://mariadb.com/kb/en/mariadb-5543-release-notes/) | Stable | | [TokuDB 7.5.5](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-5) | [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/), [MariaDB 10.0.17](https://mariadb.com/kb/en/mariadb-10017-release-notes/), [MariaDB 5.5.42](https://mariadb.com/kb/en/mariadb-5542-release-notes/) | Stable | | [TokuDB 7.5.4](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-4) | [MariaDB 10.0.16](https://mariadb.com/kb/en/mariadb-10016-release-notes/) | Stable | | [TokuDB 7.5.3](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-3) | [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/), [MariaDB 5.5.41](https://mariadb.com/kb/en/mariadb-5541-release-notes/) | Stable | | [TokuDB 7.5.0](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-5-0) | [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), [MariaDB 5.5.40](https://mariadb.com/kb/en/mariadb-5540-release-notes/) | Stable | | [TokuDB 7.1.7](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-1-7) | [MariaDB 10.0.13](https://mariadb.com/kb/en/mariadb-10013-release-notes/), [MariaDB 5.5.39](https://mariadb.com/kb/en/mariadb-5539-release-notes/) | Stable | | [TokuDB 7.1.6](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-1-6) | [MariaDB 10.0.11](https://mariadb.com/kb/en/mariadb-10011-release-notes/), [MariaDB 5.5.38](https://mariadb.com/kb/en/mariadb-5538-release-notes/) | Stable | | [TokuDB 7.1.5](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudbv-7-1-5) | [MariaDB 10.0.10](https://mariadb.com/kb/en/mariadb-10010-release-notes/), [MariaDB 5.5.37](https://mariadb.com/kb/en/mariadb-5537-release-notes/) | Stable | | [TokuDB 7.1.0](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-1-0) | [MariaDB 5.5.34](https://mariadb.com/kb/en/mariadb-5534-release-notes/) | Stable | | [TokuDB 7.0.4](http://docs.tokutek.com/tokudb/tokudb-release-notes.html#tokudb-7-0-4) | [MariaDB 10.0.5](https://mariadb.com/kb/en/mariadb-1005-release-notes/), [MariaDB 5.5.33](https://mariadb.com/kb/en/mariadb-5533-release-notes/) | Stable | The version of TokuDB in your local MariaDB is available by querying the [tokudb\_version](../tokudb-system-and-status-variables/index#tokudb_version) status variable. For example: ``` SHOW VARIABLES LIKE 'tokudb_version'; ``` In the MariaDB binary tarballs, only the ones labeled "glibc\_214" have TokuDB. 1. [↑](#_ref-0) with this version, TokuDB now follows the version numbering of Percona XtraDB More information about TokuDB in MariaDB can be found on the following pages: | Title | Description | | --- | --- | | [Installing TokuDB](../installing-tokudb/index) | How to install and enable TokuDB in MariaDB. | | [TokuDB Differences](../tokudb-differences/index) | Things to know before using TokuDB in MariaDB. | | [TokuDB Resources](../tokudb-resources/index) | Online TokuDB resources. | | [TokuDB Status Variables](../tokudb-status-variables/index) | TokuDB status variables | | [TokuDB System Variables](../tokudb-system-variables/index) | TokuDB System Variables | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb list_drop list\_drop ========== Syntax ------ ``` sys.list_drop(list,value) ``` Description ----------- `list_drop` is a [stored function](../stored-functions/index) available with the [Sys Schema](../sys-schema/index). It takes a *list* to be be modified and a *value* to be dropped from the list, returning the resulting value. This can be used, for example, to remove a value from a system variable taking a comma-delimited list of options, such as [sql\_mode](../sql-mode/index). The related function [list\_add](../list_add/index) can be used to add a value to a list. Examples -------- ``` SELECT @@sql_mode; +-----------------------------------------------------------------------+ | @@sql_mode | +-----------------------------------------------------------------------+ | STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +-----------------------------------------------------------------------+ SET @@sql_mode = sys.list_drop(@@sql_mode, 'NO_ENGINE_SUBSTITUTION'); SELECT @@sql_mode; +-----------------------------------------------------------------------+ | @@sql_mode | +-----------------------------------------------------------------------+ | STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER | +-----------------------------------------------------------------------+ ``` See Also -------- * [list\_add](../list_add/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Beginner Books Beginner Books ============== Below is a list of books on MariaDB for beginners, listed in order by date of publication—the most recent first. We've provided links to Amazon.com or the publisher for convenience, but they can be found at many bookstores. *[PHP 7 et MariaDB : Coffret en 2 volumes](https://www.amazon.co.uk/PHP-MariaDB-D%C3%A9veloppez-application-persistance/dp/2409016669/ref=sr_1_3?keywords=mariadb&qid=1558010639&s=books&sr=1-3)* by Stéphane Combaudon and Olivier Heurtel, December 2018 (French) Build interactive, database-driven websites with PHP 7, MySQL 8, and MariaDB. *[Practical PHP 7, MySQL 8, and MariaDB Website Databases](https://www.amazon.com/Practical-MySQL-MariaDB-Website-Databases/dp/1484238427?tag=uuid10-20)* by Adrian W. West, 2nd edition, September 2018 Build interactive, database-driven websites with PHP 7, MySQL 8, and MariaDB. *[MariaDB Essentials](https://www.packtpub.com/application-development/mariadb-essentials)* by Emilien Kenler and Federico Razzoli, October 2015 For those that don't know SQL and want to quickly jump in and learn MariaDB, or that already know MySQL but want to go further. *[Getting Started with MariaDB, 2nd Edition](https://www.packtpub.com/big-data-and-business-intelligence/getting-started-mariadb-second-edition)* by Daniel Bartholomew, June 2015 A beginner's guide to MariaDB. No prior MariaDB or MySQL experience necessary. An expanded update to the 1st edition. *[Learning MySQL and MariaDB](http://www.amazon.com/gp/product/1449362907/)* by Russell J. T. Dyer, April 2015. An introduction to MariaDB: developing databases, using SQL statements, as well as basic administration tasks. *[MariaDB Beginners Guide](http://www.amazon.com/gp/product/B00MQC06HC)* by Rodrigo Ribeiro Gonçalves, August 2014 A book for newcomers to MariaDB and SQL. *[Getting Started with MariaDB](https://www.packtpub.com/big-data-and-business-intelligence/getting-started-mariadb)* by Daniel Bartholomew, October 2013 A beginner's guide to MariaDB. No prior MariaDB or MySQL experience necessary. *[MariaDB Crash Course](http://forta.com/books/0321799941/)* by Ben Forta, September 2011 First MariaDB book. For people who want to learn SQL and the basics of MariaDB. *[Building a Web Application with PHP and MariaDB: A Reference Guide](https://www.amazon.com/dp/B00L2AP6ME)* by Sai Srinivas Sriparasa, June 2014 Learn how to construct scalable and secure web applications Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BACKUP STAGE BACKUP STAGE ============ **MariaDB starting with [10.4.1](https://mariadb.com/kb/en/mariadb-1041-release-notes/)**The `BACKUP STAGE` commands were introduced in [MariaDB 10.4.1](https://mariadb.com/kb/en/mariadb-1041-release-notes/). The `BACKUP STAGE` commands are a set of commands to make it possible to make an efficient external backup tool. Syntax ------ ``` BACKUP STAGE [START | FLUSH | BLOCK_DDL | BLOCK_COMMIT | END ] ``` In the following text, a transactional table means InnoDB or "InnoDB-like engine with redo log that can lock redo purges and can be copied without locks by an outside process". Goals with BACKUP STAGE Commands -------------------------------- * To be able to do a majority of the backup with the minimum possible server locks. Especially for transactional tables (InnoDB, MyRocks etc) there is only need for a very short block of new commits while copying statistics and log tables. * DDL are only needed to be blocked for a very short duration of the backup while [mariabackup](../mariabackup/index) is copying the tables affected by DDL during the initial part of the backup. * Most non transactional tables (those that are not in use) will be copied during `BACKUP STAGE START`. The exceptions are system statistic and log tables that are not blocked during the backup until `BLOCK_COMMIT`. * Should work efficiently with backup tools that use disk snapshots. * Should work as efficiently as possible for all table types that store data on the local disks. * As little copying as possible under higher level stages/locks. For example, .frm (dictionary) and .trn (trigger) files should be copying while copying the table data. `BACKUP STAGE` Commands ------------------------ ### `BACKUP STAGE START` The `START` stage is designed for the following tasks: * Blocks purge of redo files for storage engines that needs this (Aria) * Start logging of DDL commands into 'datadir'/ddl.log. This may take a short time as the command has to wait until there are no active DDL commands. ### `BACKUP STAGE FLUSH` The `FLUSH` stage is designed for the following tasks: * FLUSH all changes for inactive non-transactional tables, except for statistics and log tables. * Close all tables that are not in use, to ensure they are marked as closed for the backup. * BLOCK all new write locks for all non transactional tables (except statistics and log tables). The command will not wait for tables that are in use by read-only transactions. DDLs don't have to be blocked at this stage as they can't cause the table to be in an inconsistent state. This is true also for non-transactional tables. ### `BACKUP STAGE BLOCK_DDL` The `BLOCK_DDL` stage is designed for the following tasks: * Wait for all statements using write locked non-transactional tables to end. * Blocks [CREATE TABLE](../create-table/index), [DROP TABLE](../drop-table/index), [TRUNCATE TABLE](../truncate-table/index), and [RENAME TABLE](../rename-table/index). * Blocks also start off a **new** [ALTER TABLE](../alter-table/index) and the **final rename phase** of [ALTER TABLE](../alter-table/index). Running ALTER TABLES are not blocked. ### `BACKUP STAGE BLOCK_COMMIT` The `BLOCK_COMMIT` stage is designed for the following tasks: * Lock the binary log and commit/rollback to ensure that no changes are committed to any tables. If there are active commits or data to be copied to the binary log this will be allowed to finish. Active transactions will not affect `BLOCK_COMMIT`. * This doesn't lock temporary tables that are not used by replication. However these will be blocked when it's time to write to the binary log. * Lock system log tables and statistics tables, flush them and mark them closed. When the `BLOCK_COMMIT`'s stages return, this is the 'backup time'. Everything committed will be in the backup and everything not committed will roll back. Transactional engines will continue to do changes to the redo log during the `BLOCK COMMIT` stage, but this is not important as all of these will roll back later as the changes will not be committed. ### `BACKUP STAGE END` The `END` stage is designed for the following tasks: * End DDL logging * Free resources Using `BACKUP STAGE` Commands with Backup Tools ----------------------------------------------- ### Using `BACKUP STAGE` Commands with Mariabackup The `BACKUP STAGE` commands are a set of commands to make it possible to make an efficient external backup tool. How [Mariabackup](../mariabackup/index) uses these commands depends on whether you are using the version that is bundled with MariaDB Community Server or the version that is bundled with [MariaDB Enterprise Server](https://mariadb.com/docs/products/mariadb-enterprise-server/). See [Mariabackup and BACKUP STAGE Commands](../mariabackup-and-backup-stage-commands/index) for some examples on how [Mariabackup](../mariabackup/index) uses these commands. If you would like to use a version of [Mariabackup](../mariabackup/index) that uses the [BACKUP STAGE](index) commands in an efficient way, then one option is to use [MariaDB Enterprise Backup](https://mariadb.com/docs/usage/mariadb-enterprise-backup/) that is bundled with [MariaDB Enterprise Server](https://mariadb.com/docs/products/mariadb-enterprise-server/). ### Using `BACKUP STAGE` Commands with Storage Snapshots The `BACKUP STAGE` commands are a set of commands to make it possible to make an efficient external backup tool. These commands could even be used by tools that perform backups by taking a snapshot of a file system, SAN, or some other kind of storage device. See [Storage Snapshots and BACKUP STAGE Commands](../storage-snapshots-and-backup-stage-commands/index) for some examples on how to use each `BACKUP STAGE` command in an efficient way. Privileges ---------- `BACKUP STAGE` requires the [RELOAD](../grant/index) privilege. Notes ----- * Only one connection can run `BACKUP STAGE START`. If a second connection tries, it will wait until the first one has executed `BACKUP STAGE END`. * If the user skips a `BACKUP STAGE`, then all intermediate backup stages will automatically be run. This will allow us to add new stages within the `BACKUP STAGE` hierarchy in the future with even more precise locks without causing problems for tools using an earlier version of the `BACKUP STAGE` implementation. * One can use the [max\_statement\_time](../server-system-variables/index#max_statement_time) or [lock\_wait\_timeout](../server-system-variables/index#lock_wait_timeout) system variables to ensure that a `BACKUP STAGE` command doesn't block the server too long. * DDL logging will only be available in [MariaDB Enterprise Server](https://mariadb.com/docs/products/mariadb-enterprise-server/) 10.2 and later. * A disconnect will automatically release backup stages. * There is no easy way to see which is the current stage. See Also -------- * [BACKUP LOCK](../backup-lock/index) Locking a table from DDL's. * [MDEV-5336](https://jira.mariadb.org/browse/MDEV-5336). Implement BACKUP STAGE for safe external backups. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Specifying Permissions for Schema (Data) Directories and Tables Specifying Permissions for Schema (Data) Directories and Tables =============================================================== Default File Permissions ------------------------ By default MariaDB uses the following permissions for files and directories: | Object Type | Default Mode | Default Permissions | | --- | --- | --- | | Files | `0660` | `-rw-rw----` | | Directories | `0700` | `drwx------` | Configuring File Permissions with Environment Variables ------------------------------------------------------- You can configure MariaDB to use different permissions for files and directories by setting the following [environment variables](../mariadb-environment-variables/index) before you start the server: | Object Type | Environment Variable | | --- | --- | | Files | `UMASK` | | Directories | `UMASK_DIR` | In other words, if you would run the following in a shell: ``` export UMASK=0640 export UMASK_DIR=0750 ``` These environment variables do not set the umask. They set the default file system permissions. See [MDEV-23058](https://jira.mariadb.org/browse/MDEV-23058) for more information. ### Configuring File Permissions with systemd If your server is started by `[systemd](../systemd/index)`, then there is a specific way to configure the umask. See [Systemd: Configuring the umask](../systemd/index#configuring-the-umask) for more information. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON Data Type JSON Data Type ============== **MariaDB starting with [10.2.7](https://mariadb.com/kb/en/mariadb-1027-release-notes/)**The JSON alias was added in [MariaDB 10.2.7](https://mariadb.com/kb/en/mariadb-1027-release-notes/). This was done to make it possible to use JSON columns in [statement based](../binary-log-formats/index#statement-based) [replication](../high-availability-performance-tuning-mariadb-replication/index) from MySQL to MariaDB and to make it possible for MariaDB to read [mysqldumps](../mysqldump/index) from MySQL. JSON is an alias for [LONGTEXT](../longtext/index) introduced for compatibility reasons with MySQL's JSON data type. MariaDB implements this as a LONGTEXT rather, as the JSON data type contradicts the SQL standard, and MariaDB's benchmarks indicate that performance is at least equivalent. In order to ensure that a a valid json document is inserted, the [JSON\_VALID](../json_valid/index) function can be used as a [CHECK constraint](../constraint/index#check-constraint-expressions). This constraint is automatically included for types using the JSON alias from [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/). Examples -------- ``` CREATE TABLE t (j JSON); DESC t; +-------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+-------+ | j | longtext | YES | | NULL | | +-------+----------+------+-----+---------+-------+ ``` With validation: ``` CREATE TABLE t2 ( j JSON CHECK (JSON_VALID(j)) ); INSERT INTO t2 VALUES ('invalid'); ERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2` INSERT INTO t2 VALUES ('{"id": 1, "name": "Monty"}'); Query OK, 1 row affected (0.13 sec) ``` Replicating JSON Data Between MySQL and MariaDB ----------------------------------------------- The JSON type in MySQL stores the JSON object in a compact form, not as [LONGTEXT](../longtext/index) as in MariaDB. This means that row based replication will not work for JSON types from MySQL to MariaDB. There are a a few different ways to solve this: * Use statement based replication. * Change the JSON column to type TEXT in MySQL * If you must use row-based replication and cannot change the MySQL master from JSON to TEXT, you can try to introduce an intermediate MySQL slave and change the column type from JSON to TEXT on it. Then you replicate from this intermediate slave to MariaDB. Converting a MySQL TABLE with JSON Fields to MariaDB ---------------------------------------------------- MariaDB can't directly access MySQL's JSON format. There are a a few different ways to move the table to MariaDB: * From [MariaDB 10.5.7](https://mariadb.com/kb/en/mariadb-1057-release-notes/), see the you can use the [mysql\_json](../mysql_json/index) plugin. See [Making MariaDB understand MySQL JSON](https://mariadb.org/making-mariadb-understand-mysql-json/). * Change the JSON column to type TEXT in MySQL. After this, MariaDB can directly use the table without any need for a dump and restore. * [Use mariadb-dump/mysqldump to copy the table](../mysqldump/index#examples). Differences Between MySQL JSON Strings and MariaDB JSON Strings --------------------------------------------------------------- * In MySQL, JSON is an object and is [compared according to json values](https://dev.mysql.com/doc/refman/8.0/en/json.html#json-comparison). In MariaDB JSON strings are normal strings and compared as strings. One exception is when using [JSON\_EXTRACT()](../json_extract/index) in which case strings are unescaped before comparison. See Also -------- * [JSON Functions](../json-functions/index) * [CONNECT JSON Table Type](../connect-json-table-type/index) * [MDEV-9144](https://jira.mariadb.org/browse/MDEV-9144) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Data Scrubbing InnoDB Data Scrubbing ===================== Note that most of the background and redo log scrubbing code has been removed in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). See [MDEV-15528](https://jira.mariadb.org/browse/MDEV-15528) and [MDEV-21870](https://jira.mariadb.org/browse/MDEV-21870). Sometimes there is a requirement that when some data is deleted, it is really gone. This might be the case when one stores user's personal information or some other sensitive data. Normally though, when a row is deleted, the space is only marked as free on the page. It may eventually be overwritten, but there is no guarantee when that will happen. A copy of the deleted rows may also be present in the log files. [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) introduced support for [InnoDB](../innodb/index) data scrubbing. Background threads periodically scan tablespaces and logs and remove all data that should be deleted. The number of background threads for tablespace scans is set by [innodb-encryption-threads](../xtradbinnodb-server-system-variables/index#innodb_encryption_threads). Log scrubbing happens in a separate thread. To configure scrubbing one can use the following variables: | | | | | --- | --- | --- | | [innodb-background-scrub-data-check-interval](../innodb-system-variables/index#innodb_background_scrub_data_check_interval) | Seconds | Check at this intervall if tablespaces needs scrubbing. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | | [innodb-background-scrub-data-compressed](../innodb-system-variables/index#innodb_background_scrub_data_compressed) | Boolean | Enable scrubbing of compressed data by background threads. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | | [innodb-background-scrub-data-interval](../innodb-system-variables/index#innodb_background_scrub_data_interval) | Seconds | Scrub spaces that were last scrubbed longer than this many seconds ago. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | | [innodb-background-scrub-data-uncompressed](../innodb-system-variables/index#innodb_background_scrub_data_uncompressed) | Boolean | Enable scrubbing of uncompressed data by background threads. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | | [innodb-immediate-scrub-data-uncompressed](../innodb-system-variables/index#innodb_immediate_scrub_data_uncompressed) | Boolean | Enable scrubbing of uncompressed data | | [innodb-scrub-log](../innodb-system-variables/index#innodb_scrub_log) | Boolean | Enable redo log scrubbing. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | | [innodb-scrub-log-speed](../innodb-system-variables/index#innodb_scrub_log_speed) | Bytes/sec | Redo log scrubbing speed in bytes/sec. Deprecated and ignored from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). | Redo log scrubbing did not fully work as intended, and was deprecated and ignored in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) ([MDEV-21870](https://jira.mariadb.org/browse/MDEV-21870)). If old log contents should be kept secret, then enabling [innodb\_encrypt\_log](../innodb-system-variables/index#innodb_encrypt_log) or setting a smaller [innodb\_log\_file\_size](../innodb-system-variables/index#innodb_log_file_size) could help. The [Information Schema INNODB\_TABLESPACES\_SCRUBBING table](../information-schema-innodb_tablespaces_scrubbing-table/index) contains scrubbing information. Thanks ------ * Scrubbing was donated to the MariaDB project by Google. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb EXTRACT EXTRACT ======= Syntax ------ ``` EXTRACT(unit FROM date) ``` Description ----------- The EXTRACT() function extracts the required unit from the date. See [Date and Time Units](../date-and-time-units/index) for a complete list of permitted units. In [MariaDB 10.0.7](https://mariadb.com/kb/en/mariadb-1007-release-notes/) and [MariaDB 5.5.35](https://mariadb.com/kb/en/mariadb-5535-release-notes/), `EXTRACT (HOUR FROM ...)` was changed to return a value from 0 to 23, adhering to the SQL standard. Until [MariaDB 10.0.6](https://mariadb.com/kb/en/mariadb-1006-release-notes/) and [MariaDB 5.5.34](https://mariadb.com/kb/en/mariadb-5534-release-notes/), and in all versions of MySQL at least as of MySQL 5.7, it could return a value > 23. [HOUR()](../hour/index) is not a standard function, so continues to adhere to the old behaviour inherited from MySQL. Examples -------- ``` SELECT EXTRACT(YEAR FROM '2009-07-02'); +---------------------------------+ | EXTRACT(YEAR FROM '2009-07-02') | +---------------------------------+ | 2009 | +---------------------------------+ SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03'); +------------------------------------------------+ | EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03') | +------------------------------------------------+ | 200907 | +------------------------------------------------+ SELECT EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03'); +------------------------------------------------+ | EXTRACT(DAY_MINUTE FROM '2009-07-02 01:02:03') | +------------------------------------------------+ | 20102 | +------------------------------------------------+ SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.000123'); +--------------------------------------------------------+ | EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.000123') | +--------------------------------------------------------+ | 123 | +--------------------------------------------------------+ ``` From [MariaDB 10.0.7](https://mariadb.com/kb/en/mariadb-1007-release-notes/) and [MariaDB 5.5.35](https://mariadb.com/kb/en/mariadb-5535-release-notes/), `EXTRACT (HOUR FROM...)` returns a value from 0 to 23, as per the SQL standard. `HOUR` is not a standard function, so continues to adhere to the old behaviour inherited from MySQL. ``` SELECT EXTRACT(HOUR FROM '26:30:00'), HOUR('26:30:00'); +-------------------------------+------------------+ | EXTRACT(HOUR FROM '26:30:00') | HOUR('26:30:00') | +-------------------------------+------------------+ | 2 | 26 | +-------------------------------+------------------+ ``` See Also -------- * [Date and Time Units](../date-and-time-units/index) * [Date and Time Literals](../date-and-time-literals/index) * [HOUR()](../hour/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb IS_FREE_LOCK IS\_FREE\_LOCK ============== Syntax ------ ``` IS_FREE_LOCK(str) ``` Description ----------- Checks whether the lock named `str` is free to use (that is, not locked). Returns `1` if the lock is free (no one is using the lock), `0` if the lock is in use, and `NULL` if an error occurs (such as an incorrect argument, like an empty string or `NULL`). `str` is case insensitive. If the [metadata\_lock\_info](../metadata_lock_info/index) plugin is installed, the [Information Schema](../information_schema/index) [metadata\_lock\_info](../information-schema-metadata_lock_info-table/index) table contains information about locks of this kind (as well as [metadata locks](../metadata-locking/index)). Statements using the `IS_FREE_LOCK` function are [not safe for statement-based replication](../unsafe-statements-for-statement-based-replication/index). See Also -------- * [GET\_LOCK](../get_lock/index) * [RELEASE\_LOCK](../release_lock/index) * [IS\_USED\_LOCK](../is_used_lock/index) * [RELEASE\_ALL\_LOCKS](../release_all_locks/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MEDIUMBLOB MEDIUMBLOB ========== Syntax ------ ``` MEDIUMBLOB ``` Description ----------- A [BLOB](../blob/index) column with a maximum length of 16,777,215 (224 - 1) bytes. Each MEDIUMBLOB value is stored using a three-byte length prefix that indicates the number of bytes in the value. See Also -------- * [BLOB](../blob/index) * [BLOB and TEXT Data Types](../blob-and-text-data-types/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Roadmap MariaDB Roadmap =============== This page talks in general about the MariaDB roadmap, and how it is formed. The roadmap it describes is located in our [JIRA](../jira/index) issue tracker: **[jira.mariadb.org](http://jira.mariadb.org)** The roadmap of MariaDB is formed by the [community](../community/index) on the [maria-developers list](https://launchpad.net/~maria-developers) on Launchpad, at conferences and developers events, and in discussions with customers of [MariaDB Foundation](../mariadb-foundation/index) members, like the [MariaDB Corporation](http://mariadb.com), who are part of developing MariaDB. The MariaDB developers are also working with several [storage engine](../storage-engines/index) vendors and developers to get the best storage engines into MariaDB. The collected information is then turned into specific tasks which are then prioritized and added to the roadmap in the MariaDB [JIRA](../jira/index) issue tracker: **[jira.mariadb.org](https://jira.mariadb.org)** Goals and Quality Standards --------------------------- The primary goal of MariaDB is for it to be a practical database developed in the direction MariaDB users and developers want it to be developed. Each feature should ideally be developed by or for users who want to test and put the feature into production ASAP — this helps ensure we don't implement features no one wants or needs. We are also putting a lot of effort into speeding up MariaDB, and to keep it stable and easy to use! The MariaDB source tree is maintained by the MariaDB developers. They are the primary contributors to the MariaDB project and the ones who are ultimately responsible for the quality of the code. [MariaDB 5.1](../what-is-mariadb-51/index), [MariaDB 5.2](../what-is-mariadb-52/index), and [MariaDB 5.3](../what-is-mariadb-53/index) were built off of [MySQL 5.1](../mariadb-versus-mysql/index). [MariaDB 5.5](../what-is-mariadb-55/index) was a combination of [MariaDB 5.3](../what-is-mariadb-53/index) and MySQL 5.5. [MariaDB 10.0](../what-is-mariadb-100/index), and later build off of the previous MariaDB release with backported features from MySQL and entirely new features not found anywhere else. Short descriptions of the various MariaDB releases and their main new features can be found on the [MariaDB Releases](../mariadb-releases/index) page. See Also -------- * [Plans for MariaDB 10.11](../plans-for-mariadb-1011/index) * [Plans for MariaDB 10.10](../plans-for-mariadb-1010/index) * [Plans for MariaDB 10.9](../plans-for-mariadb-109/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Audit Plugin ColumnStore Audit Plugin ======================== Introduction ============ MariaDB server includes an optional [Audit Plugin](../mariadb-audit-plugin/index) that enables logging and tracking of all user access and statements. This is included and can be enabled for ColumnStore Installation ============ To enable the audit plugin for the currently running instance (but no across restarts) run the following as mcsmysql with the default root account: ``` INSTALL PLUGIN server_audit SONAME 'server_audit.so'; ``` To have this persist across restarts edit the ColumnStore my.cnf file (example shown for root install): ``` $ vi /usr/local/mariadb/columnstore/mysql/my.cnf [mysqld] ... plugin_load=server_audit=server_audit.so ``` For more details see the [audit plugin installation guide](../mariadb-audit-plugin-installation/index) Enabling the audit plugin ========================= To enable audit logging the following global variable must be set to ON: ``` SET GLOBAL server_audit_logging=ON; ``` To ensure this persists across restarts edit the ColumnStore my.cnf file (example shown for root install): ``` $ vi /usr/local/mariadb/columnstore/mysql/my.cnf [server] ... server_audit_logging=ON ``` This will enable logging to the file /usr/local/mariadb/columnstore/mysql/db/server\_audit.log. For example: ``` 20170914 17:31:24,centos,root,localhost,11,114,QUERY,loans,'SELECT grade, AVG(loan_amnt) avg, FROM loanstats GROUP BY grade ORDER BY grade',0 ``` To have the log entries written to syslog the global variable server\_audit\_output\_type should be changed from 'file' to 'syslog'. In this case the 'syslog\_info' entry contains the ColumnStore server instance name, for example: ``` Sep 14 17:46:51 centos mysql-server_auditing: columnstore-1 centos,root,localhost,11,117,QUERY,loans,'SELECT grade, AVG(loan_amnt) avg,FROM loanstats GROUP BY grade ORDER BY grade',0 ``` For additional configuration and customization options see the [Audit Plugin](../mariadb-audit-plugin/index) documentation. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Performance Schema memory_summary_by_user_by_event_name Table Performance Schema memory\_summary\_by\_user\_by\_event\_name Table =================================================================== **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The memory\_summary\_by\_user\_by\_event\_name table was introduced in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). There are five memory summary tables in the Performance Schema that share a number of fields in common. These include: * [memory\_summary\_by\_account\_by\_event\_name](../performance-schema-memory_summary_by_account_by_event_name-table/index) * [memory\_summary\_by\_host\_by\_event\_name](../performance-schema-memory_summary_by_host_by_event_name-table/index) * [memory\_summary\_by\_thread\_by\_event\_name](../performance-schema-memory_summary_by_thread_by_event_name-table/index) * memory\_summary\_by\_user\_by\_event\_name * [memory\_global\_by\_event\_name](../performance-schema-memory_global_by_event_name-table/index) The `memory_summary_by_user_by_event_name` table contains memory usage statistics aggregated by user and event. The table contains the following columns: | Field | Type | Null | Default | Description | | --- | --- | --- | --- | --- | | USER | char(32) | YES | NULL | User portion of the account. | | EVENT\_NAME | varchar(128) | NO | NULL | Event name. | | COUNT\_ALLOC | bigint(20) unsigned | NO | NULL | Total number of allocations to memory. | | COUNT\_FREE | bigint(20) unsigned | NO | NULL | Total number of attempts to free the allocated memory. | | SUM\_NUMBER\_OF\_BYTES\_ALLOC | bigint(20) unsigned | NO | NULL | Total number of bytes allocated. | | SUM\_NUMBER\_OF\_BYTES\_FREE | bigint(20) unsigned | NO | NULL | Total number of bytes freed | | LOW\_COUNT\_USED | bigint(20) | NO | NULL | Lowest number of allocated blocks (lowest value of CURRENT\_COUNT\_USED). | | CURRENT\_COUNT\_USED | bigint(20) | NO | NULL | Currently allocated blocks that have not been freed (COUNT\_ALLOC minus COUNT\_FREE). | | HIGH\_COUNT\_USED | bigint(20) | NO | NULL | Highest number of allocated blocks (highest value of CURRENT\_COUNT\_USED). | | LOW\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Lowest number of bytes used. | | CURRENT\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Current number of bytes used (total allocated minus total freed). | | HIGH\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Highest number of bytes used. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SET SQL_LOG_BIN SET SQL\_LOG\_BIN ================= Syntax ------ ``` SET [SESSION] sql_log_bin = {0|1} ``` Description ----------- Sets the [sql\_log\_bin](../replication-and-binary-log-system-variables/index#sql_log_bin) system variable, which disables or enables [binary logging](../binary-log/index) for the current connection, if the client has the `SUPER` [privilege](../grant/index). The statement is refused with an error if the client does not have that privilege. Before [MariaDB 5.5](../what-is-mariadb-55/index) and before MySQL 5.6 one could also set `sql_log_bin` as a global variable. This was disabled as this was too dangerous as it could damage replication. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Managing ColumnStore Database Environment Managing ColumnStore Database Environment ========================================== Documentation for the latest release of Columnstore is not available on the Knowledge Base. Instead, see: * [Release Notes](https://mariadb.com/docs/release-notes/mariadb-columnstore-1-5-2-release-notes/) * [Deployment Instructions](https://mariadb.com/docs/deploy/community-single-columnstore/) | Title | Description | | --- | --- | | [ColumnStore Database User Management](../columnstore-database-user-management/index) | MariaDB ColumnStore database user management | | [ColumnStore Partition Management](../columnstore-partition-management/index) | Partition Management SQL Commands to view, drop, disable, and enable partitions | | [ColumnStore System Variables](../columnstore-system-variables/index) | ColumnStore System Variables | | [Configuring ColumnStore Cross-Engine Joins](../configuring-columnstore-cross-engine-joins/index) | Configuring MariaDB ColumnStore Cross-Engine Joins | | [Configuring ColumnStore Local PM Query Mode](../configuring-columnstore-local-pm-query-mode/index) | Configuring MariaDB ColumnStore Local PM Query Mode | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SUBSTRING_INDEX SUBSTRING\_INDEX ================ Syntax ------ ``` SUBSTRING_INDEX(str,delim,count) ``` Description ----------- Returns the substring from string *`str`* before count occurrences of the delimiter *`delim`*. If *`count`* is positive, everything to the left of the final delimiter (counting from the left) is returned. If *`count`* is negative, everything to the right of the final delimiter (counting from the right) is returned. `SUBSTRING_INDEX()` performs a case-sensitive match when searching for *`delim`*. If any argument is `NULL`, returns `NULL`. For example ``` SUBSTRING_INDEX('www.mariadb.org', '.', 2) ``` means "Return all of the characters up to the 2nd occurrence of ." Examples -------- ``` SELECT SUBSTRING_INDEX('www.mariadb.org', '.', 2); +--------------------------------------------+ | SUBSTRING_INDEX('www.mariadb.org', '.', 2) | +--------------------------------------------+ | www.mariadb | +--------------------------------------------+ SELECT SUBSTRING_INDEX('www.mariadb.org', '.', -2); +---------------------------------------------+ | SUBSTRING_INDEX('www.mariadb.org', '.', -2) | +---------------------------------------------+ | mariadb.org | +---------------------------------------------+ ``` See Also -------- * [INSTR()](../instr/index) - Returns the position of a string within a string * [LOCATE()](../locate/index) - Returns the position of a string within a string * [SUBSTRING()](../substring/index) - Returns a string based on position Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Upgrading Between Minor Versions on Linux Upgrading Between Minor Versions on Linux ========================================= For Windows, see [Upgrading MariaDB on Windows](../upgrading-mariadb-on-windows/index) instead. For MariaDB Galera Cluster, see [Upgrading Between Minor Versions with Galera Cluster](../upgrading-between-minor-versions-with-galera-cluster/index) instead. Before you upgrade, it would be best to take a backup of your database. This is always a good idea to do before an upgrade. We would recommend [Mariabackup](../mariabackup/index). To upgrade between minor versions of MariaDB on Linux/Unix (for example from [MariaDB 10.3.12](https://mariadb.com/kb/en/mariadb-10312-release-notes/) to [MariaDB 10.3.13](https://mariadb.com/kb/en/mariadb-10313-release-notes/)), the following procedure is suggested: 1. [Stop MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). 2. Uninstall the old version of MariaDB. 3. Install the new version of MariaDB. * On Debian, Ubuntu, and other similar Linux distributions, see [Installing MariaDB Packages with APT](../installing-mariadb-deb-files/index#installing-mariadb-packages-with-apt) for more information. * On RHEL, CentOS, Fedora, and other similar Linux distributions, see [Installing MariaDB Packages with YUM](../yum/index#installing-mariadb-packages-with-yum) for more information. * On SLES, OpenSUSE, and other similar Linux distributions, see [Installing MariaDB Packages with ZYpp](../installing-mariadb-with-zypper/index#installing-mariadb-packages-with-zypp) for more information. 4. Make any desired changes to configuration options in [option files](../configuring-mariadb-with-option-files/index), such as `my.cnf`. 5. [Start MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). 6. Run `[mysql\_upgrade](../mysql_upgrade/index)`. * `mysql_upgrade` does two things: 1. Ensures that the system tables in the `[mysq](../the-mysql-database-tables/index)l` database are fully compatible with the new version. 2. Does a very quick check of all tables and marks them as compatible with the new version of MariaDB . * In most cases this should be a fast operation (depending of course on the number of tables). To upgrade between major versions, see the following: * [Upgrading from MariaDB 10.4 to MariaDB 10.5](../upgrading-from-mariadb-104-to-mariadb-105/index) * [Upgrading from MariaDB 10.3 to MariaDB 10.4](../upgrading-from-mariadb-103-to-mariadb-104/index) * [Upgrading from MariaDB 10.2 to MariaDB 10.3](../upgrading-from-mariadb-102-to-mariadb-103/index) * [Upgrading from MariaDB 10.1 to MariaDB 10.2](../upgrading-from-mariadb-101-to-mariadb-102/index) * [Upgrading from MariaDB 10.0 to MariaDB 10.1](../upgrading-from-mariadb-100-to-mariadb-101/index) * [Upgrading from MariaDB 5.5 to MariaDB 10.0](../upgrading-from-mariadb-55-to-mariadb-100/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Distributed Functions ColumnStore Distributed Functions ================================= ColumnStore supports the following functions. These functions can be specified in the projection (SELECT), WHERE and ORDER BY portions of the SQL statement and will be processed in a distributed manner. * [&](../bitwise_and/index) * [ABS()](../abs/index) * [ACOS()](../acos/index) * [ADDDATE()](../adddate/index) * [ADDTIME()](../addtime/index) * [ASCII()](../ascii/index) * [ASIN()](../asin/index) * [ATAN()](../atan/index) * [BETWEEN...AND...](../between-and/index) * [BIT\_AND()](../bit_and/index) * [BIT\_OR()](../bit_or/index) * [BIT\_XOR()](../bit_xor/index) * [CASE()](../case-operator/index) * [CAST()](../cast/index) * [CEIL()](../ceil/index), [CEILING()](../ceiling/index) * [CHAR\_LENGTH(), CHARACTER\_LENGTH()](../char_length/index) * [COALESCE()](../coalesce/index) * [CONCAT()](../concat/index) * [CONCAT\_WS()](../concat_ws/index) * [CONV()](../conv/index) * [CONVERT()](../convert/index) * [COS()](../cos/index) * [COT()](../cot/index) * [CRC32()](../crc32/index) * [DATE()](../date-function/index) * [DATE\_ADD()](../date_add/index) * [DATE\_FORMAT()](../date_format/index) * [DATE\_SUB()](../date_sub/index) * [DATEDIFF()](../datediff/index) * [DAY(), DAYOFMONTH()](../dayofmonth/index) * [DAYNAME()](../dayname/index) * [DAYOFWEEK()](../dayofweek/index) * [DAYOFYEAR()](../dayofyear/index) * [DEGREES()](../degrees/index) * [DIV](../div/index) * [ELT()](../elt/index) * [EXP()](../exp/index) * [EXTRACT()](../extract/index) * [FIND\_IN\_SET()](../find_in_set/index) * [FLOOR()](../floor/index) * [FORMAT()](../format/index) * [FROM\_DAYS()](../from_days/index) * [FROM\_UNIXTIME()](../from_unixtime/index) * [GET\_FORMAT()](../get_format/index) * [GREATEST()](../greatest/index) * [GROUP\_CONCAT()](../group_concat/index) * [HEX()](../hex/index) * [HOUR()](../hour/index) * [IF()](../if-function/index) * [IFNULL()](../ifnull/index) * [IN](../in/index) * [INET\_ATON()](../inet_aton/index) * [INET\_NTOA()](../inet_ntoa/index) * [INSERT()](../insert-function/index) * [INSTR()](../instr/index) * [ISNULL()](../isnull/index) * [LAST\_DAY()](../last_day/index) * [LCASE()](../lcase/index) * [LEAST()](../least/index) * [LEFT()](../left/index) * [LENGTH()](../length/index) * [LIKE](../like/index) * [LN()](../ln/index) * [LOCATE()](../locate/index) * [LOG()](../log/index) * [LOG2()](../log2/index) * [LOG10()](../log10/index) * [LOWER()](../lower/index) * [LPAD()](../lpad/index) * [LTRIM()](../ltrim/index) * [MAKEDATE()](../makedate/index) * [MAKETIME()](../maketime/index) * [MD5()](../md5/index) * [MICROSECOND()](../microsecond/index) * [MINUTE()](../minute/index) * [MOD()](../mod/index) * [MONTH()](../month/index) * [MONTHNAME()](../monthname/index) * [NOW()](../now/index) * [NULLIF()](../nullif/index) * [PERIOD\_ADD()](../period_add/index) * [PERIOD\_DIFF()](../period_diff/index) * [POSITION()](../position/index) * [POW()](../pow/index), [POWER()](../power/index) * [QUARTER()](../quarter/index) * [RADIANS()](../radians/index) * [RAND()](../rand/index) * [REGEXP()](../regexp/index) * [REPEAT()](../repeat-function/index) * [REPLACE()](../replace/index) * [REVERSE()](../reverse/index) * [RIGHT()](../right/index) * [RLIKE()](../rlike/index) * [ROUND()](../round/index) * [RPAD()](../rpad/index) * [RTRIM()](../rtrim/index) * [SEC\_TO\_TIME()](../sec_to_time/index) * [SECOND()](../second/index) * [SHA(), SHA1()](../sha1/index) * [SIGN()](../sign/index) * [SIN()](../sin/index) * [SPACE()](../space/index) * [SQRT()](../sqrt/index) * [STR\_TO\_DATE()](../str_to_date/index) * [STRCMP()](../strcmp/index) * [SUBDATE()](../subdate/index) * [SUBSTR()](../substr/index), [SUBSTRING()](../substring/index) * [SUBSTRING\_INDEX()](../substring_index/index) * [SUBTIME()](../subtime/index) * [SYSDATE()](../sysdate/index) * [TAN()](../tan/index) * [TIME()](../time/index) * [TIME\_FORMAT()](../time_format/index) * [TIME\_TO\_SEC()](../time_to_sec/index) * [TIMEDIFF()](../timediff/index) * [TIMESTAMPADD()](../timestampadd/index) * [TIMESTAMPDIFF()](../timestampdiff/index) * [TO\_DAYS()](../to_days/index) * [TRIM()](../trim/index) * [TRUNCATE()](../truncate/index) * [UCASE()](../ucase/index) * [UNIX\_TIMESTAMP()](../unix_timestamp/index) * [UNIX\_TIME()](unix_time) * [UPPER()](../upper/index) * [WEEK()](../week/index) * [WEEKDAY()](../weekday/index) * [WEEKOFYEAR()](../weekofyear/index) * [XOR()](../xor/index) * [YEAR()](../year/index) * [YEARWEEK()](../yearweek/index) See also -------- * [ColumnStore Non-Distributed Post-Processed Functions](../columnstore-non-distributed-post-processed-functions/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Server Status Variables InnoDB Server Status Variables ============================== See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with [SHOW STATUS](../show-status/index). Much of the [InnoDB](../innodb/index) information here can also be seen with a [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) statement. See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `Innodb_adaptive_hash_cells` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `Innodb_adaptive_hash_hash_searches` * **Description:** Hash searches as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + Before the variable was introduced in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), use the `adaptive_hash_searches` counter in the [information\_schema.INNODB\_METRICS](../information-schema-innodb_metrics-table/index) table instead. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_adaptive_hash_heap_buffers` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `Innodb_adaptive_hash_non_hash_searches` * **Description:** Non-hash searches as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. From [MariaDB 10.6.2](https://mariadb.com/kb/en/mariadb-1062-release-notes/), not updated if [innodb\_adaptive\_hash\_index](../innodb-system-variables/index#innodb_adaptive_hash_index) is not enabled (the default). + In [MariaDB 10.1](../what-is-mariadb-101/index), [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. Use the `adaptive_hash_searches_btree` counter in the [information\_schema.INNODB\_METRICS](../information-schema-innodb_metrics-table/index) table instead. + From [MariaDB 10.5](../what-is-mariadb-105/index), this status variable is present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) * **Removed:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `Innodb_available_undo_logs` * **Description:** Total number available InnoDB [undo logs](../undo-log/index). Differs from the [innodb\_undo\_logs](../innodb-system-variables/index#innodb_undo_logs) system variable, which specifies the number of *active* undo logs. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_background_log_sync` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index), [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_buffer_pool_bytes_data` * **Description:** Number of bytes contained in the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index), both dirty (modified) and clean (unmodified). See also [Innodb\_buffer\_pool\_pages\_data](#innodb_buffer_pool_pages_data), which can contain pages of different sizes in the case of compression. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_bytes_dirty` * **Description:** Number of dirty (modified) bytes contained in the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index). See also [Innodb\_buffer\_pool\_pages\_dirty](#innodb_buffer_pool_pages_dirty), which can contain pages of different sizes in the case of compression. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_dump_status` * **Description:** A text description of the progress or final status of the last Innodb buffer pool dump. * **Scope:** Global * **Data Type:** `string` * **Introduced:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `Innodb_buffer_pool_load_incomplete` * **Description:** Whether or not the loaded buffer pool is incomplete, for example after a shutdown or abort during innodb buffer pool load from file caused an incomplete save. * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) --- #### `Innodb_buffer_pool_load_status` * **Description:** A text description of the progress or final status of the last Innodb buffer pool load. * **Scope:** Global * **Data Type:** `string` * **Introduced:** [MariaDB 10.0.0](https://mariadb.com/kb/en/mariadb-1000-release-notes/) --- #### `Innodb_buffer_pool_pages_data` * **Description:** Number of [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages which contain data, both dirty (modified) and clean (unmodified). See also [Innodb\_buffer\_pool\_bytes\_data](#innodb_buffer_pool_bytes_data). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_pages_dirty` * **Description:** Number of [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages which contain dirty (modified) data. See also [Innodb\_buffer\_pool\_bytes\_dirty](innodb_buffer_pool_bytes_dirty). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_pages_flushed` * **Description:** Number of [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages which have been flushed. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_pages_LRU_flushed` * **Description:** Flush list as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_buffer_pool_pages_LRU_freed` * **Description:** Monitor the number of pages that were freed by a buffer pool LRU eviction scan, without flushing. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) --- #### `Innodb_buffer_pool_pages_free` * **Description:** Number of free [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_pages_made_not_young` * **Description:** Pages not young as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_buffer_pool_pages_made_young` * **Description:** Pages made young as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_buffer_pool_pages_misc` * **Description:** Number of [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages set aside for internal use. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_pages_old` * **Description:** Old database page, as shown in the BUFFER POOL AND MEMORY section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present for XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_buffer_pool_pages_total` * **Description:** Total number of [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) pages. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_read_ahead` * **Description:** Number of pages read into the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) by the read-ahead background thread. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_read_ahead_evicted` * **Description:** Number of pages read into the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) by the read-ahead background thread that were evicted without having been accessed by queries. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_read_ahead_rnd` * **Description:** Number of random read-aheads. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_read_requests` * **Description:** Number of requests to read from the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_reads` * **Description:** Number of reads that could not be satisfied by the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) and had to be read from disk. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_resize_status` * **Description:** Progress of the dynamic [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) resizing operation. See [Setting Innodb Buffer Pool Size Dynamically](../setting-innodb-buffer-pool-size-dynamically/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/) --- #### `Innodb_buffer_pool_wait_free` * **Description:** Number of times InnoDB waited for a free page before reading or creating a page. Normally, writes to the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index) happen in the background. When no clean pages are available, dirty pages are flushed first in order to free some up. This counts the numbers of wait for this operation to finish. If this value is not small, look at increasing [innodb\_buffer\_pool\_size](../xtradbinnodb-server-system-variables/index#innodb_buffer_pool_size). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffer_pool_write_requests` * **Description:** Number of requests to write to the [InnoDB buffer pool](../xtradbinnodb-memory-buffer/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_buffered_aio_submitted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_checkpoint_age` * **Description:** The checkpoint age, as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. (This is equivalent to subtracting "Last checkpoint at" from "Log sequence number".) + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_checkpoint_max_age` * **Description:** Max checkpoint age, as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_checkpoint_target_age` * **Description:** Checkpoint age target, as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. XtraDB only. Removed in [MariaDB 10.0](../what-is-mariadb-100/index) and replaced with MySQL 5.6's flushing implementation. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_current_row_locks` * **Description:** Number of current row locks on InnoDB tables as shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. Renamed from [InnoDB\_row\_lock\_numbers](#innodb_row_lock_numbers) in XtraDB 5.5.8-20.1. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `Innodb_data_fsyncs` * **Description:** Number of InnoDB fsync (sync-to-disk) calls. fsync call frequency can be influenced by the [innodb\_flush\_method](../xtradbinnodb-server-system-variables/index#innodb_flush_method) configuration option. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_pending_fsyncs` * **Description:** Number of pending InnoDB fsync (sync-to-disk) calls. fsync call frequency can be influenced by the [innodb\_flush\_method](../xtradbinnodb-server-system-variables/index#innodb_flush_method) configuration option. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_pending_reads` * **Description:** Number of pending InnoDB reads. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_pending_writes` * **Description:** Number of pending InnoDB writes. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_read` * **Description:** Number of InnoDB bytes read since server startup (not to be confused with [Innodb\_data\_reads](#innodb_data_reads)). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_reads` * **Description:** Number of InnoDB read operations (not to be confused with [Innodb\_data\_read](#innodb_data_read)). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_writes` * **Description:** Number of InnoDB write operations. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_data_written` * **Description:** Number of InnoDB bytes written since server startup. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_dblwr_pages_written` * **Description:** Number of pages written to the [InnoDB doublewrite buffer](../xtradbinnodb-doublewrite-buffer/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_dblwr_writes` * **Description:** Number of writes to the [InnoDB doublewrite buffer](../xtradbinnodb-doublewrite-buffer/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_deadlocks` * **Description:** Total number of InnoDB deadlocks. Deadlocks occur when at least two transactions are waiting for the other to finish, creating a circular dependency. InnoDB usually detects these quickly, returning an error. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_defragment_compression_failures` * **Description:** Number of defragment re-compression failures. See [Defragmenting InnoDB Tablespaces](../defragmenting-innodb-tablespaces/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/) --- #### `Innodb_defragment_count` * **Description:** Number of defragment operations. See [Defragmenting InnoDB Tablespaces](../defragmenting-innodb-tablespaces/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/) --- #### `Innodb_defragment_failures` * **Description:** Number of defragment failures. See [Defragmenting InnoDB Tablespaces](../defragmenting-innodb-tablespaces/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/) --- #### `Innodb_dict_tables` * **Description:** Number of entries in the XtraDB data dictionary cache. This Percona XtraDB variable was removed in MariaDB 10/XtraDB 5.6 as it was replaced with MySQL 5.6's [table\_definition\_cache](../server-system-variables/index#table_definition_cache) implementation. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** XtraDB 5.0.77-b13 * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_encryption_n_merge_blocks_decrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.28](https://mariadb.com/kb/en/mariadb-10128-release-notes/), [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) --- #### `Innodb_encryption_n_merge_blocks_encrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.28](https://mariadb.com/kb/en/mariadb-10128-release-notes/), [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) --- #### `Innodb_encryption_n_rowlog_blocks_decrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.28](https://mariadb.com/kb/en/mariadb-10128-release-notes/), [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) --- #### `Innodb_encryption_n_rowlog_blocks_encrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.28](https://mariadb.com/kb/en/mariadb-10128-release-notes/), [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) --- #### `Innodb_encryption_n_temp_blocks_decrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/) --- #### `Innodb_encryption_n_temp_blocks_encrypted` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/) --- #### `Innodb_encryption_num_key_requests` * **Description:** Was not present in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_encryption_rotation_estimated_iops` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_encryption_rotation_pages_flushed` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_encryption_rotation_pages_modified` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_encryption_rotation_pages_read_from_cache` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_encryption_rotation_pages_read_from_disk` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_have_atomic_builtins` * **Description:** Whether the server has been built with atomic instructions, provided by the CPU ensuring that critical low-level operations can't be interrupted. XtraDB only. * **Scope:** Global * **Data Type:** `boolean` --- #### `Innodb_have_bzip2` * **Description:** Whether the server has the bzip2 compression method available. See [InnoDB/XtraDB Page Compression](../innodbxtradb-page-compression/index). * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_have_lz4` * **Description:** Whether the server has the lz4 compression method available. See [InnoDB/XtraDB Page Compression](../innodbxtradb-page-compression/index). * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_have_lzma` * **Description:** Whether the server has the lzma compression method available. See [InnoDB/XtraDB Page Compression](../innodbxtradb-page-compression/index). * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_have_lzo` * **Description:** Whether the server has the lzo compression method available. See [InnoDB/XtraDB Page Compression](../innodbxtradb-page-compression/index). * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_have_punch_hole` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_have_snappy` * **Description:** Whether the server has the snappy compression method available. See [InnoDB/XtraDB Page Compression](../innodbxtradb-page-compression/index). * **Scope:** Global * **Data Type:** `boolean` * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) --- #### `Innodb_history_list_length` * **Description:** History list length as shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. XtraDB only until introduced in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_discarded_delete_marks` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_discarded_deletes` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_discarded_inserts` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_free_list` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_merged_delete_marks` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_merged_deletes` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_merged_inserts` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_merges` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_segment_size` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_ibuf_size` * **Description:** As shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_instant_alter_column` * **Description:** See [Instant ADD COLUMN for InnoDB](../instant-add-column-for-innodb/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) --- #### `Innodb_log_waits` * **Description:** Number of times InnoDB was forced to wait for log writes to be flushed due to the log buffer being too small. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_log_write_requests` * **Description:** Number of requests to write to the InnoDB redo log. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_log_writes` * **Description:** Number of writes to the InnoDB redo log. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_lsn_current` * **Description:** Log sequence number as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_lsn_flushed` * **Description:** Flushed up to log sequence number as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_lsn_last_checkpoint` * **Description:** Log sequence number last checkpoint as shown in the LOG section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_master_thread_1_second_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_master_thread_10_second_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_master_thread_active_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.0.9](https://mariadb.com/kb/en/mariadb-1009-release-notes/) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/): --- #### `Innodb_master_thread_background_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_master_thread_idle_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.0.9](https://mariadb.com/kb/en/mariadb-1009-release-notes/) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/): --- #### `Innodb_master_thread_main_flush_loops` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index) and later, this system variable is not present * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_master_thread_sleeps` * **Description:** As shown in the BACKGROUND THREAD section of the [SHOW ENGINE INNODB STATUS](../show-engine/index) output. XtraDB only. + In [MariaDB 5.5](../what-is-mariadb-55/index), this system variable is present in XtraDB. + In [MariaDB 10.1](../what-is-mariadb-101/index), [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. Use the `innodb_master_thread_sleeps` counter in the `[information\_schema.INNODB\_METRICS](../information-schema-innodb_metrics-table/index)` table instead. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.0](../what-is-mariadb-100/index) --- #### `Innodb_max_trx_id` * **Description:** As shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_mem_adaptive_hash` * **Description:** As shown in the BUFFER POOL AND MEMORY section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_mem_dictionary` * **Description:** As shown in the BUFFER POOL AND MEMORY section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.3](../what-is-mariadb-103/index), and [MariaDB 10.4](../what-is-mariadb-104/index), this system variable is not present. + In [MariaDB 10.5](../what-is-mariadb-105/index), this system variable was reintroduced. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) (XtraDB-only), [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) --- #### `Innodb_mem_total` * **Description:** As shown in the BUFFER POOL AND MEMORY section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `Innodb_mutex_os_waits` * **Description:** Mutex OS waits as shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `Innodb_mutex_spin_rounds` * **Description:** Mutex spin rounds as shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `Innodb_mutex_spin_waits` * **Description:** Mutex spin waits as shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) --- #### `Innodb_num_index_pages_written` * **Description:** * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_num_non_index_pages_written` * **Description:** * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/) --- #### `Innodb_num_open_files` * **Description:** Number of open files held by InnoDB. InnoDB only. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_page_compressed_trim_op` * **Description:** Number of trim operations performed. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_page_compressed_trim_op_saved` * **Description:** Number of trim operations not done because of an earlier trim. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_decrypted` * **Description:** Number of pages page decrypted. See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_encrypted` * **Description:** Number of pages page encrypted. See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_page_compressed` * **Description:** Number of pages that are page compressed. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_page_compression_error` * **Description:** Number of compression errors. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_page_decompressed` * **Description:** Number of pages compressed with page compression that are decompressed. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_num_pages_page_encryption_error` * **Description:** Number of page encryption errors. See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) * **Removed:** [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) --- #### `Innodb_oldest_view_low_limit_trx_id` * **Description:** As shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_onlineddl_pct_progress` * **Description:** Shows the progress of in-place alter table. It might be not so accurate because in-place alter is highly dependent on disk and buffer pool status. See [Monitoring progress and temporal memory usage of Online DDL in InnoDB](https://blog.mariadb.org/monitoring-progress-and-temporal-memory-usage-of-online-ddl-in-innodb). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_onlineddl_rowlog_pct_used` * **Description:** Shows row log buffer usage in 5-digit integer (10000 means 100.00%). See [Monitoring progress and temporal memory usage of Online DDL in InnoDB](https://blog.mariadb.org/monitoring-progress-and-temporal-memory-usage-of-online-ddl-in-innodb). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_onlineddl_rowlog_rows` * **Description:** Number of rows stored in the row log buffer. See [Monitoring progress and temporal memory usage of Online DDL in InnoDB](https://blog.mariadb.org/monitoring-progress-and-temporal-memory-usage-of-online-ddl-in-innodb). * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_os_log_fsyncs` * **Description:** Number of InnoDB log fsync (sync-to-disk) requests. * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.8](../what-is-mariadb-108/index) --- #### `Innodb_os_log_pending_fsyncs` * **Description:** Number of pending InnoDB log fsync (sync-to-disk) requests. * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.8](../what-is-mariadb-108/index) --- #### `Innodb_os_log_pending_writes` * **Description:** Number of pending InnoDB log writes. * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.8](../what-is-mariadb-108/index) --- #### `Innodb_os_log_written` * **Description:** Number of bytes written to the InnoDB log. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_page_compression_saved` * **Description:** Number of bytes saved by page compression. * **Scope:** * **Data Type:** --- #### `Innodb_page_compression_trim_sect512` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 512 byte block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect1024` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 1K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect2048` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 2K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect4096` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 4K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect8192` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 8K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect16384` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 16K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_compression_trim_sect32768` * **Description:** Number of TRIM operations performed for the page-compression/NVM Compression workload for the 32K block-size. * **Scope:** * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) Fusion-io * **Removed:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) --- #### `Innodb_page_size` * **Description:** Page size used by InnoDB. Defaults to 16KB, can be compiled with a different value. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_pages_created` * **Description:** Number of InnoDB pages created. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_pages_read` * **Description:** Number of InnoDB pages read. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_pages0_read` * **Description:** Counter for keeping track of reads of the first page of InnoDB data files, because the original implementation of data-at-rest-encryption for InnoDB introduced new code paths for reading the pages. Removed in [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/) as the extra reads of the first page were removed, and the encryption subsystem will be initialized whenever we first read the first page of each data file, in fil\_node\_open\_file(). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/), [MariaDB 10.1.21](https://mariadb.com/kb/en/mariadb-10121-release-notes/) * **Removed:** [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/) --- #### `Innodb_pages_written` * **Description:** Number of InnoDB pages written. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_purge_trx_id` * **Description:** Purge transaction id as shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_purge_undo_no` * **Description:** As shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_read_views_memory` * **Description:** As shown in the BUFFER POOL AND MEMORY section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. Shows the total of memory in bytes allocated for the InnoDB read view. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5.32](https://mariadb.com/kb/en/mariadb-5532-release-notes/) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_row_lock_current_waits` * **Description:** Number of pending row lock waits on InnoDB tables. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_row_lock_numbers` * **Description:** Number of current row locks on InnoDB tables as shown in the TRANSACTIONS section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. Renamed to [InnoDB\_current\_row\_locks](#innodb_current_row_locks) in XtraDB 5.5.10-20.1. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) / XtraDB 5.5.8-20 * **Removed:** [MariaDB 5.5](../what-is-mariadb-55/index) / XtraDB 5.5.10-20.1 --- #### `Innodb_row_lock_time` * **Description:** Total time in milliseconds spent getting InnoDB row locks. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_row_lock_time_avg` * **Description:** Average time in milliseconds spent getting an InnoDB row lock. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_row_lock_time_max` * **Description:** Maximum time in milliseconds spent getting an InnoDB row lock. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_row_lock_waits` * **Description:** Number of times InnoDB had to wait before getting a row lock. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_rows_deleted` * **Description:** Number of rows deleted from InnoDB tables. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_rows_inserted` * **Description:** Number of rows inserted into InnoDB tables. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_rows_read` * **Description:** Number of rows read from InnoDB tables. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_rows_updated` * **Description:** Number of rows updated in InnoDB tables. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_s_lock_os_waits` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_s_lock_spin_rounds` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_s_lock_spin_waits` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_scrub_background_page_reorganizations` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_background_page_split_failures_missing_index` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_background_page_split_failures_out_of_filespace` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_background_page_split_failures_underflow` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_background_page_split_failures_unknown` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_background_page_splits` * **Description:** See [Table and Tablespace Encryption](../table-and-tablespace-encryption/index). * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_scrub_log` * **Description:** * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) * **Removed:** [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) --- #### `Innodb_secondary_index_triggered_cluster_reads` * **Description:** Used to track the effectiveness of the Prefix Index Queries Optimization ([MDEV-6929](https://jira.mariadb.org/browse/MDEV-6929)). Removed in [MariaDB 10.10](../what-is-mariadb-1010/index) as the optimization is now always enabled. * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.10](../what-is-mariadb-1010/index) --- #### `Innodb_secondary_index_triggered_cluster_reads_avoided` * **Description:** Used to track the effectiveness of the Prefix Index Queries Optimization ([MDEV-6929](https://jira.mariadb.org/browse/MDEV-6929)). Removed in [MariaDB 10.10](../what-is-mariadb-1010/index) as the optimization is now always enabled. * **Scope:** Global * **Data Type:** `numeric` * **Removed:** [MariaDB 10.10](../what-is-mariadb-1010/index) --- #### `Innodb_system_rows_deleted` * **Description:** * **Scope:** * **Data Type:** `numeric` --- #### `Innodb_system_rows_inserted` * **Description:** * **Scope:** * **Data Type:** `numeric` --- #### `Innodb_system_rows_read` * **Description:** * **Scope:** * **Data Type:** `numeric` --- #### `Innodb_system_rows_updated` * **Description:** * **Scope:** * **Data Type:** `numeric` --- #### `Innodb_truncated_status_writes` * **Description:** Number of times output from [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) has been truncated. * **Scope:** Global * **Data Type:** `numeric` --- #### `Innodb_undo_truncations` * **Description:** Number of undo tablespace truncation operations. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/) --- #### `Innodb_x_lock_os_waits` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_x_lock_spin_rounds` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- #### `Innodb_x_lock_spin_waits` * **Description:** As shown in the SEMAPHORES section of the [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) output. + In [MariaDB 5.5](../what-is-mariadb-55/index) and [MariaDB 10.1](../what-is-mariadb-101/index), this system variable is present in XtraDB. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, this system variable is not present. * **Scope:** Global * **Data Type:** `numeric` * **Introduced:** [MariaDB 5.5](../what-is-mariadb-55/index) * **Removed:** [MariaDB 10.2](../what-is-mariadb-102/index) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Inward and Outward Tables Inward and Outward Tables ========================= There are two broad categories of file-based CONNECT tables. Inward and Outward. They are described below. Outward Tables -------------- Tables are "outward" when their file name is specified in the CREATE TABLE statement using the *file\_name* option. Firstly, remember that CONNECT implements MED (Management of External Data). This means that the "true" CONNECT tables – "outward tables" – are based on data that belongs to files that can be produced by other applications or data imported from another DBMS. Therefore, their data is "precious" and should not be modified except by specific commands such as [INSERT](../insert/index), [UPDATE](../update/index), or [DELETE](../delete/index). For other commands such as [CREATE](../create/index), [DROP](../drop/index), or [ALTER](../alter/index) their data is never modified or erased. Outward tables can be created on existing files or external tables. When they are dropped, only the local description is dropped, the file or external table is not dropped or erased. Also, [DROP TABLE](../drop-table/index) does not erase the indexes. [ALTER TABLE](../alter-table/index) produces the following warning, as a reminder: ``` Warning (Code 1105): This is an outward table, table data were not modified. ``` If the specified file does not exist, it is created when data is inserted into the table. If a [SELECT](../select/index) is issued before the file is created, the following error is produced: ``` Warning (Code 1105): Open(rb) error 2 on <file_path>: No such file or directory ``` ### Altering Outward Tables When an [ALTER TABLE](../alter-table/index) is issued, it just modifies the table definition accordingly without changing the data. [ALTER](../alter/index) can be used safely to, for instance, modify options such as MAPPED, HUGE or READONLY but with extreme care when modifying column definitions or order options because some column options such as FLAG should also be modified or may become wrong. Changing the table type with [ALTER](../alter/index) often makes no sense. But many suspicious alterations can be acceptable if they are just meant to correct an existing wrong definition. Translating a CONNECT table to another engine is fine but the opposite is forbidden when the target CONNECT table is not table based or when its data file exists (because when the target table data cannot be changed and if the source table is dropped, the table data would be lost). However, it can be done to create a new file-based tables when its file does not exist or is void. Creating or dropping indexes is accepted because it does not modify the table data. However, it is often unsafe to do it with an [ALTER TABLE](../alter-table/index) statement that does other modifications. Of course, all changes are acceptable for empty tables. **Note:** Using outward tables requires the [FILE](../grant/index#global-privileges) privilege. Inward Tables ------------- A special type of file-based CONNECT tables are “inward” tables. They are file-based tables whose file name is not specified in the [CREATE TABLE](../create-table/index) statement (no *file\_name* option). Their file will be located in the current database directory and their name will default to tablename.type where tablename is the table name and type is the table type folded to lower case. When they are created without using a `CREATE TABLE ... SELECT ...` statement, an empty file is made at create time and they can be populated by further inserts. They behave like tables of other storage engines and, unlike outward CONNECT tables, they are erased when the table is dropped. Of course they should not be read-only to be usable. Even though their utility is limited, they can be used for testing purposes or when the user does not have the [FILE](../grant/index#global-privileges) privilege. ### Altering Inward Tables One thing to know, because CONNECT builds indexes in a specific way, is that all index modifications are done using an "in-place" algorithm – meaning not using a temporary table. This is why, when indexing is specified in an [ALTER TABLE](../alter-table/index) statement containing other changes that cannot be done "in-place", the statement cannot be executed and raises an error. Converting an inward table to an outward table, using an ALTER TABLE statement specifying a new file name and/or a new table type, is restricted the same way it is when converting a table from another engine to an outward table. However there are no restrictions to convert another engine table to a CONNECT inward table. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.spider_link_mon_servers Table mysql.spider\_link\_mon\_servers Table ====================================== The `mysql.spider_link_mon_servers` table is installed by the [Spider storage engine](../spider/index). **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. It contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | db\_name | char(64) | NO | PRI | | | | table\_name | char(199) | NO | PRI | | | | link\_id | char(64) | NO | PRI | | | | sid | int(10) unsigned | NO | PRI | 0 | | | server | char(64) | YES | | NULL | | | scheme | char(64) | YES | | NULL | | | host | char(64) | YES | | NULL | | | port | char(5) | YES | | NULL | | | socket | text | YES | | NULL | | | username | char(64) | YES | | NULL | | | password | char(64) | YES | | NULL | | | ssl\_ca | text | YES | | NULL | | | ssl\_capath | text | YES | | NULL | | | ssl\_cert | text | YES | | NULL | | | ssl\_cipher | char(64) | YES | | NULL | | | ssl\_key | text | YES | | NULL | | | ssl\_verify\_server\_cert | tinyint(4) | NO | | 0 | | | default\_file | text | YES | | NULL | | | default\_group | char(64) | YES | | NULL | | | dsn | char(64) | YES | | NULL | | | filedsn | text | YES | | NULL | | | driver | char(64) | YES | | NULL | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_CONTAINS JSON\_CONTAINS ============== **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**JSON functions were added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` JSON_CONTAINS(json_doc, val[, path]) ``` Description ----------- Returns whether or not the specified value is found in the given JSON document or, optionally, at the specified path within the document. Returns `1` if it does, `0` if not and NULL if any of the arguments are null. An error occurs if the document or path is not valid, or contains the `*` or `**` wildcards. Examples -------- ``` SET @json = '{"A": 0, "B": {"C": 1}, "D": 2}'; SELECT JSON_CONTAINS(@json, '2', '$.A'); +----------------------------------+ | JSON_CONTAINS(@json, '2', '$.A') | +----------------------------------+ | 0 | +----------------------------------+ SELECT JSON_CONTAINS(@json, '2', '$.D'); +----------------------------------+ | JSON_CONTAINS(@json, '2', '$.D') | +----------------------------------+ | 1 | +----------------------------------+ SELECT JSON_CONTAINS(@json, '{"C": 1}', '$.A'); +-----------------------------------------+ | JSON_CONTAINS(@json, '{"C": 1}', '$.A') | +-----------------------------------------+ | 0 | +-----------------------------------------+ SELECT JSON_CONTAINS(@json, '{"C": 1}', '$.B'); +-----------------------------------------+ | JSON_CONTAINS(@json, '{"C": 1}', '$.B') | +-----------------------------------------+ | 1 | +-----------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb GROUP BY GROUP BY ======== Use the `GROUP BY` clause in a [SELECT](../select/index) statement to group rows together that have the same value in one or more column, or the same computed value using expressions with any [functions and operators](../functions-and-operators/index) except [grouping functions](../functions-and-modifiers-for-use-with-group-by/index). When you use a `GROUP BY` clause, you will get a single result row for each group of rows that have the same value for the expression given in `GROUP BY`. When grouping rows, grouping values are compared as if by the `[=](../equal/index)` operator. For string values, the `=` operator ignores trailing whitespace and may normalize characters and ignore case, depending on the [collation](../data-types-character-sets-and-collations/index) in use. You can use any of the grouping functions in your select expression. Their values will be calculated based on all the rows that have been grouped together for each result row. If you select a non-grouped column or a value computed from a non-grouped column, it is undefined which row the returned value is taken from. This is not permitted if the `ONLY_FULL_GROUP_BY` [SQL\_MODE](../sql-mode/index) is used. You can use multiple expressions in the `GROUP BY` clause, separated by commas. Rows are grouped together if they match on each of the expressions. You can also use a single integer as the grouping expression. If you use an integer *n*, the results will be grouped by the *n*th column in the select expression. The `WHERE` clause is applied before the `GROUP BY` clause. It filters non-aggregated rows before the rows are grouped together. To filter grouped rows based on aggregate values, use the `HAVING` clause. The `HAVING` clause takes any expression and evaluates it as a boolean, just like the `WHERE` clause. You can use grouping functions in the `HAVING` clause. As with the select expression, if you reference non-grouped columns in the `HAVING` clause, the behavior is undefined. By default, if a `GROUP BY` clause is present, the rows in the output will be sorted by the expressions used in the `GROUP BY`. You can also specify `ASC` or `DESC` (ascending, descending) after those expressions, like in [ORDER BY](../order-by/index). The default is `ASC`. If you want the rows to be sorted by another field, you can add an explicit [ORDER BY](../order-by/index). If you don't want the result to be ordered, you can add [ORDER BY NULL](../order-by/index). ### WITH ROLLUP The `WITH ROLLUP` modifer adds extra rows to the resultset that represent super-aggregate summaries. For a full description with examples, see [SELECT WITH ROLLUP](../select-with-rollup/index). ### GROUP BY Examples Consider the following table that records how many times each user has played and won a game: ``` CREATE TABLE plays (name VARCHAR(16), plays INT, wins INT); INSERT INTO plays VALUES ("John", 20, 5), ("Robert", 22, 8), ("Wanda", 32, 8), ("Susan", 17, 3); ``` Get a list of win counts along with a count: ``` SELECT wins, COUNT(*) FROM plays GROUP BY wins; +------+----------+ | wins | COUNT(*) | +------+----------+ | 3 | 1 | | 5 | 1 | | 8 | 2 | +------+----------+ 3 rows in set (0.00 sec) ``` The `GROUP BY` expression can be a computed value, and can refer back to an identifer specified with `AS`. Get a list of win averages along with a count: ``` SELECT (wins / plays) AS winavg, COUNT(*) FROM plays GROUP BY winavg; +--------+----------+ | winavg | COUNT(*) | +--------+----------+ | 0.1765 | 1 | | 0.2500 | 2 | | 0.3636 | 1 | +--------+----------+ 3 rows in set (0.00 sec) ``` You can use any [grouping function](../functions-and-modifiers-for-use-with-group-by/index) in the select expression. For each win average as above, get a list of the average play count taken to get that average: ``` SELECT (wins / plays) AS winavg, AVG(plays) FROM plays GROUP BY winavg; +--------+------------+ | winavg | AVG(plays) | +--------+------------+ | 0.1765 | 17.0000 | | 0.2500 | 26.0000 | | 0.3636 | 22.0000 | +--------+------------+ 3 rows in set (0.00 sec) ``` You can filter on aggregate information using the `HAVING` clause. The `HAVING` clause is applied after `GROUP BY` and allows you to filter on aggregate data that is not available to the `WHERE` clause. Restrict the above example to results that involve an average number of plays over 20: ``` SELECT (wins / plays) AS winavg, AVG(plays) FROM plays GROUP BY winavg HAVING AVG(plays) > 20; +--------+------------+ | winavg | AVG(plays) | +--------+------------+ | 0.2500 | 26.0000 | | 0.3636 | 22.0000 | +--------+------------+ 2 rows in set (0.00 sec) ``` ### See Also * [SELECT](../select/index) * [Joins and Subqueries](../joins-subqueries/index) * [LIMIT](../limit/index) * [ORDER BY](../order-by/index) * [Common Table Expressions](../common-table-expressions/index) * [SELECT WITH ROLLUP](../select-with-rollup/index) * [SELECT INTO OUTFILE](../select-into-outfile/index) * [SELECT INTO DUMPFILE](../select-into-dumpfile/index) * [FOR UPDATE](../for-update/index) * [LOCK IN SHARE MODE](../lock-in-share-mode/index) * [Optimizer Hints](../optimizer-hints/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_PolygonFromText ST\_PolygonFromText =================== A synonym for [ST\_PolyFromText](../st_polyfromtext/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb PolyFromText PolyFromText ============ A synonym for [ST\_PolyFromText](../st_polyfromtext/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Page Compression InnoDB Page Compression ======================= Overview -------- InnoDB page compression provides a way to compress InnoDB tables. Use Cases --------- * InnoDB page compression can be used on any storage device and any file system. * InnoDB page compression is most efficient on file systems that support sparse files. See [Saving Storage Space with Sparse Files](#saving-storage-space-with-sparse-files) for more information. * InnoDB page compression is most beneficial on solid state drives (SSDs) and other flash storage. See [Optimized for Flash Storage](#optimized-for-flash-storage) for more information. * InnoDB page compression performs best when your storage device and file system support atomic writes, since that allows the [InnoDB doublewrite buffer](../xtradbinnodb-doublewrite-buffer/index) to be disabled. See [Atomic Write Support](../atomic-write-support/index) for more information. Comparison with the `COMPRESSED` Row Format ------------------------------------------- InnoDB page compression is a modern way to compress your InnoDB tables. It is similar to InnoDB's [COMPRESSED](../innodb-compressed-row-format/index) row format, but it has many advantages. Some of the differences are: * With InnoDB page compression, compressed pages are immediately decompressed after being read from the tablespace file, and only uncompressed pages are stored in the buffer pool. In contrast, with InnoDB's [COMPRESSED](../innodb-compressed-row-format/index) row format, compressed pages are decompressed immediately after they are read from the tablespace file, and both the uncompressed and compressed pages are stored in the buffer pool. This means that the [COMPRESSED](../innodb-compressed-row-format/index) row format uses more space in the buffer pool than InnoDB page compression does. * With InnoDB page compression, pages are compressed just before being written to the tablespace file. In contrast, with InnoDB's [COMPRESSED](../innodb-compressed-row-format/index) row format, pages are re-compressed immediately after any changes, and the compressed pages are stored in the buffer pool alongside the uncompressed pages. These changes are then occasionally flushed to disk. This means that the [COMPRESSED](../innodb-compressed-row-format/index) row format re-compresses data more frequently than InnoDB page compression does. * With InnoDB page compression, multiple compression algorithms are supported. In contrast, with InnoDB's [COMPRESSED](../innodb-compressed-row-format/index) row format, [zlib](https://www.zlib.net/) is the only supported compression algorithm. This means that the [COMPRESSED](../innodb-compressed-row-format/index) row format has less compression options than InnoDB page compression does. In general, InnoDB page compression is superior to the [COMPRESSED](../innodb-compressed-row-format/index) row format. Comparison with Storage Engine-Independent Column Compression ------------------------------------------------------------- * See [Storage Engine-Independent Column Compression - Comparison with InnoDB Page Compression](../storage-engine-independent-column-compression/index#comparison-with-innodb-page-compression). Configuring the InnoDB Page Compression Algorithm ------------------------------------------------- There is not currently a table option to set different InnoDB page compression algorithms for individual tables. However, the server-wide InnoDB page compression algorithm can be configured by setting the [innodb\_compression\_algorithm](../innodb-system-variables/index#innodb_compression_algorithm) system variable. When this system variable is changed, the InnoDB page compression algorithm does not change for existing pages that were already compressed with a different InnoDB page compression algorithm. InnoDB is able to handle this situation without issues, because every page in an InnoDB tablespace contains metadata about the InnoDB page compression algorithm in the page header. This means that InnoDB supports having uncompressed pages and pages compressed with different InnoDB page compression algorithms in the same InnoDB tablespace at the same time. This system variable can be set to one of the following values: | System Variable Value | Description | | --- | --- | | `none` | Pages are not compressed. This is the default value in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) and before, and [MariaDB 10.1.21](https://mariadb.com/kb/en/mariadb-10121-release-notes/) and before. | | `zlib` | Pages are compressed using the bundled [zlib](https://www.zlib.net/) compression algorithm. This is the default value in [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) and later, and [MariaDB 10.1.22](https://mariadb.com/kb/en/mariadb-10122-release-notes/) and later. | | `lz4` | Pages are compressed using the [lz4](https://code.google.com/p/lz4/) compression algorithm. | | `lzo` | Pages are compressed using the [lzo](http://www.oberhumer.com/opensource/lzo/) compression algorithm. | | `lzma` | Pages are compressed using the [lzma](http://tukaani.org/xz/) compression algorithm. | | `bzip2` | Pages are compressed using the [bzip2](http://www.bzip.org/) compression algorithm. | | `snappy` | Pages are compressed using the [snappy](http://google.github.io/snappy/) algorithm. | However, on many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. From [MariaDB 10.7](../what-is-mariadb-107/index), algorithms can be [installed as a plugin](../compression-plugins/index). This system variable can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL innodb_compression_algorithm='lzma'; ``` This system variable can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_compression_algorithm=lzma ``` ### Checking Supported InnoDB Page Compression Algorithms On many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. Therefore, if you want to use a specific InnoDB page compression algorithm, then you should check whether your MariaDB build supports it. The [zlib](https://www.zlib.net/) compression algorithm is always supported. From [MariaDB 10.7](../what-is-mariadb-107/index), algorithms can be [installed as a plugin](../compression-plugins/index). A MariaDB build's support for other InnoDB page compression algorithms can be checked by querying the following status variables with [SHOW GLOBAL STATUS](../show-status/index): | Status Variable | Description | | --- | --- | | [Innodb\_have\_lz4](../innodb-server-status-variables/index#innodb_have_lz4) | Whether InnoDB supports the [lz4](https://code.google.com/p/lz4/) compression algorithm. | | [Innodb\_have\_lzo](../innodb-server-status-variables/index#innodb_have_lzo) | Whether InnoDB supports the [lzo](http://www.oberhumer.com/opensource/lzo/) compression algorithm. | | [Innodb\_have\_lzma](../innodb-server-status-variables/index#innodb_have_lzma) | Whether InnoDB supports the [lzma](http://tukaani.org/xz/) compression algorithm. | | [Innodb\_have\_bzip2](../innodb-server-status-variables/index#innodb_have_bzip2) | Whether InnoDB supports the [bzip2](http://www.bzip.org/) compression algorithm. | | [Innodb\_have\_snappy](../innodb-server-status-variables/index#innodb_have_snappy) | Whether InnoDB supports the [snappy](http://google.github.io/snappy/) compression algorithm. | For example: ``` SHOW GLOBAL STATUS WHERE Variable_name IN ( 'Innodb_have_lz4', 'Innodb_have_lzo', 'Innodb_have_lzma', 'Innodb_have_bzip2', 'Innodb_have_snappy' ); +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | Innodb_have_lz4 | OFF | | Innodb_have_lzo | OFF | | Innodb_have_lzma | ON | | Innodb_have_bzip2 | OFF | | Innodb_have_snappy | OFF | +--------------------+-------+ ``` ### Adding Support for an InnoDB Page Compression Algorithm On many distributions, the standard MariaDB builds do not support all InnoDB page compression algorithms by default. From [MariaDB 10.7](../what-is-mariadb-107/index), algorithms can be [installed as a plugin](../compression-plugins/index), but in earlier versions, if you want to use certain InnoDB page compression algorithms, then you may need to do the following: * Download the package for the desired compression library from the above links. * Install the package for the desired compression library. * Compile MariaDB from the source distribution. The general steps for compiling MariaDB are: * Download and unpack the source code distribution: ``` wget https://downloads.mariadb.com/MariaDB/mariadb-10.4.8/source/mariadb-10.4.8.tar.gz tar -xvzf mariadb-10.4.8.tar.gz cd mariadb-10.4.8/ ``` * Configure the build using [cmake](../generic-build-instructions/index#using-cmake): ``` cmake . ``` * Check [CMakeCache.txt](https://cmake.org/runningcmake/) to confirm that it has found the desired compression library on your system. * Compile the build: ``` make ``` * Either install the build: ``` make install ``` Or make a package to install: ``` make package ``` See [Compiling MariaDB From Source](../compiling-mariadb-from-source/index) for more information. Enabling InnoDB Page Compression -------------------------------- InnoDB page compression is not enabled by default. However, InnoDB page compression can be enabled for just individual InnoDB tables or it can be enabled for all new InnoDB tables by default. InnoDB page compression is also only supported if the InnoDB table is in a [file per-table](../innodb-file-per-table-tablespaces/index) tablespace. Therefore, the [innodb\_file\_per\_table](../innodb-system-variables/index#innodb_file_per_table) system variable must be set to `ON` to use InnoDB page compression. InnoDB page compression is only supported if the InnoDB table uses the `Barracuda` [file format](../xtradbinnodb-file-format/index).Therefore, in [MariaDB 10.1](../what-is-mariadb-101/index) and before, the [innodb\_file\_format](../innodb-system-variables/index#innodb_file_format) system variable must be set to `Barracuda` to use InnoDB page compression. InnoDB page compression is also only supported if the InnoDB table's [row format](../innodb-row-formats-overview/index) is [COMPACT](../innodb-compact-row-format/index) or [DYNAMIC](../innodb-dynamic-row-format/index). ### Enabling InnoDB Page Compression by Default **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**The [innodb\_compression\_default](../innodb-system-variables/index#innodb_compression_default) system variable was first added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). In [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) and later, InnoDB page compression can be enabled for all new InnoDB tables by default by setting the [innodb\_compression\_default](../innodb-system-variables/index#innodb_compression_default) system variable to `ON`. This system variable can be set to one of the following values: | System Variable Value | Description | | --- | --- | | `OFF` | New InnoDB tables do not use InnoDB page compression. This is the default value. | | `ON` | New InnoDB tables use InnoDB page compression. | This system variable can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL innodb_compression_default=ON; ``` This system variable's session value can be changed dynamically with [SET SESSION](../set/index#global-session). For example: ``` SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_default_row_format='dynamic'; SET GLOBAL innodb_compression_algorithm='lzma'; SET SESSION innodb_compression_default=ON; CREATE TABLE users ( user_id int not null, b varchar(200), primary key(user_id) ) ENGINE=InnoDB; ``` This system variable can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_compression_default=ON ``` ### Enabling InnoDB Page Compression for Individual Tables InnoDB page compression can be enabled for individual tables by setting the [PAGE\_COMPRESSED](../create-table/index#page_compressed) table option to `1`. For example: ``` SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_default_row_format='dynamic'; SET GLOBAL innodb_compression_algorithm='lzma'; CREATE TABLE users ( user_id int not null, b varchar(200), primary key(user_id) ) ENGINE=InnoDB PAGE_COMPRESSED=1; ``` Configuring the Compression Level --------------------------------- Some InnoDB page compression algorithms support a compression level option, which configures how the InnoDB page compression algorithm will balance speed and compression. The compression level's supported values range from `1` to `9`. The range goes from the fastest to the most compact, which means that `1` is the fastest and `9` is the most compact. Only the following InnoDB page compression algorithms currently support compression levels: * [zlib](https://www.zlib.net/) * [lzma](http://tukaani.org/xz/) If an InnoDB page compression algorithm does not support compression levels, then it ignores any provided compression level value. ### Configuring the Default Compression Level The default compression level can be configured by setting the [innodb\_compression\_level](../innodb-system-variables/index#innodb_compression_level) system variable. This system variable's default value is `6`. This system variable can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL innodb_compression_level=9; ``` This system variable can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_compression_level=9 ``` ### Configuring the Compression Level for Individual Tables The compression level for individual tables can also be configured by setting the [PAGE\_COMPRESSION\_LEVEL](../create-table/index#page_compression_level) table option for the table. For example: ``` SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_default_row_format='dynamic'; SET GLOBAL innodb_compression_algorithm='lzma'; CREATE TABLE users ( user_id int not null, b varchar(200), primary key(user_id) ) ENGINE=InnoDB PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; ``` Configuring the Failure Threshold and Maximum Padding ----------------------------------------------------- InnoDB page compression can encounter compression failures. InnoDB page compression's failure threshold can be configured. If InnoDB encounters more compression failures than the failure threshold, then it pads pages with zeroed out bytes before attempting to compress them as a way to reduce failures. If the failure rate stays above the failure threshold, then InnoDB pads pages with more zeroed out bytes in 128 byte increments. InnoDB page compression's maximum padding can also be configured. ### Configuring the Failure Threshold The failure threshold can be configured by setting the [innodb\_compression\_failure\_threshold\_pct](../innodb-system-variables/index#innodb_compression_failure_threshold_pct) system variable. This system variable's supported values range from `0` to `100`. This system variable's default value is `5`. This system variable can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL innodb_compression_failure_threshold_pct=10; ``` This system variable can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_compression_failure_threshold_pct=10 ``` ### Configuring the Maximum Padding The maximum padding can be configured by setting the [innodb\_compression\_pad\_pct\_max](../innodb-system-variables/index#innodb_compression_pad_pct_max) system variable. This system variable's supported values range from `0` to `75`. This system variable's default value is `50`. This system variable can be changed dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL innodb_compression_pad_pct_max=75; ``` This system variable can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_compression_pad_pct_max=75 ``` Saving Storage Space with Sparse Files -------------------------------------- When InnoDB page compression is used, InnoDB may still write the compressed page to the tablespace file with the original size of the uncompressed page, which would be equivalent to the value of the [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size) system variable. This is done by design, because when InnoDB's I/O code needs to read the page from disk, it can only read the full page size. However, this is obviously not optimal. On file systems that support sparse files, this problem is solved by writing the tablespace file as a sparse file using the *punch hole* technique. With the *punch hole* technique, InnoDB will only write the actual compressed page size to the tablespace file, aligned to sector size. The rest of the page is trimmed. This *punch hole* technique allows InnoDB to read the compressed page from disk as the full page size, even though the compressed page really takes up less space on the file system. There are some potential disadvantages to using sparse files: * Some utilities may require special options in order to handle sparse files in an efficient manner. * Most existing file systems are slow to [unlink()](https://linux.die.net/man/2/unlink) sparse files. As a consequence, if a tablespace file is a sparse file, then dropping the table can be very slow. ### Sparse File Support on Linux On Linux, the following file systems support sparse files: * `ext3` * `ext4` * `xfs` * `btrfs` * `nvmfs` On Linux, file systems need to support the [fallocate()](https://linux.die.net/man/2/fallocate) system call with the `FALLOC_FL_PUNCH_HOLE` and `FALLOC_FL_KEEP_SIZE` flags. For example: ``` fallocate(file_handle, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, file_offset, remainder_len); ``` Some Linux utilities may require special options in order to work with sparse files efficiently. For example: * The [ls](https://linux.die.net/man/1/ls) utility will report the non-sparse size of the tablespace file when executed with default behavior, but `[ls -s](https://linux.die.net/man/1/ls)` will report the actual amount of storage allocated for the tablespace file. * The [cp](https://linux.die.net/man/1/cp) utility is pretty good at auto-detecting sparse files, but it also provides the [cp --sparse=always](https://linux.die.net/man/1/cp) and [cp --sparse=never](https://linux.die.net/man/1/cp) options, if the auto-detection is not desired. * The [tar](https://linux.die.net/man/1/tar) utility will archive sparse files with their non-sparse size when executed with default behavior, but [tar --sparse](https://linux.die.net/man/1/tar) will auto-detect sparse files, and archive them with their sparse size. ### Sparse File Support on Windows On Windows, the following file systems support sparse files: * `NTFS` On Windows, file systems need to support the [DeviceIoControl()](https://docs.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol) function with the [FSCTL\_SET\_SPARSE](https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_set_sparse) and [FSCTL\_SET\_ZERO\_DATA](https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_set_zero_data) control codes. For example: ``` DeviceIoControl(file_handle, FSCTL_SET_SPARSE, inbuf, inbuf_size, outbuf, outbuf_size, NULL, &overlapped) ... DeviceIoControl(file_handle, FSCTL_SET_ZERO_DATA, inbuf, inbuf_size, outbuf, outbuf_size, NULL, &overlapped) ``` ### Configuring InnoDB to use Sparse Files In [MariaDB 10.3](../what-is-mariadb-103/index) and later, InnoDB uses the *punch hole* technique to create sparse files used automatically when the underlying file system supports sparse files. In [MariaDB 10.2](../what-is-mariadb-102/index) and before, InnoDB can be configured to use the *punch hole* technique to create sparse files by configuring the [innodb\_use\_trim](../innodb-system-variables/index#innodb_use_trim) and [innodb\_use\_fallocate](../innodb-system-variables/index#innodb_use_fallocate) system variables. These system variables can be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... innodb_use_trim=ON innodb_use_fallocate=ON ``` Optimized for Flash Storage --------------------------- InnoDB page compression was designed to be optimized on solid state drives (SSDs) and other flash storage. InnoDB page compression was originally developed by collaborating with [Fusion-io](http://fusionio.com). As a consequence, it was originally designed to work best on [FusionIO devices](../fusion-io-introduction/index) using [NVMFS](https://ieeexplore.ieee.org/document/6558434). [Fusion-io](http://fusionio.com) has since been acquired by [Western Digital](https://www.westerndigital.com/), and they have decided not to continue supporting [NVMFS](https://ieeexplore.ieee.org/document/6558434). However, InnoDB page compression is still likely to be most optimized on solid state drives (SSDs) and other flash storage. InnoDB page compression works without any issues on hard disk drives (HDDs). However, since its compression relies on the use of sparse files, the data may be somewhat fragmented on disk. This fragmentation may hurt performance on HDDs, since they handle random reads and writes much more slowly than flash storage. Configuring InnoDB Page Flushing -------------------------------- With InnoDB page compression, pages are compressed when they are flushed to disk. Therefore, it can be helpful to optimize the configuration of InnoDB's page flushing. See [InnoDB Page Flushing](../innodb-page-flushing/index) for more information. Monitoring InnoDB Page Compression ---------------------------------- InnoDB page compression can be monitored by querying the following status variables with [SHOW GLOBAL STATUS](../show-status/index): | Status Variable | Description | | --- | --- | | [Innodb\_page\_compression\_saved](../xtradbinnodb-server-status-variables/index#innodb_page_compression_saved) | Bytes saved by compression | | [Innodb\_page\_compression\_trim\_sect512](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect512) | Number of 512 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect1024](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect1024) | Number of 1024 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect2048](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect2048) | Number of 2048 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect4096](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect4096) | Number of 4096 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect8192](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect8192) | Number of 8192 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect16384](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect16384) | Number of 16384 sectors trimmed | | [Innodb\_page\_compression\_trim\_sect32768](../xtradbinnodb-server-status-variables/index#innodb_page_compression_trim_sect32768) | Number of 32768 sectors trimmed | | [Innodb\_num\_pages\_page\_compressed](../xtradbinnodb-server-status-variables/index#innodb_num_pages_page_compressed) | Number of pages compressed | | [Innodb\_num\_page\_compressed\_trim\_op](../xtradbinnodb-server-status-variables/index#innodb_num_page_compressed_trim_op) | Number of trim operations | | [Innodb\_num\_page\_compressed\_trim\_op\_saved](../xtradbinnodb-server-status-variables/index#innodb_num_page_compressed_trim_op_saved) | Number of trim operations saved | | [Innodb\_num\_pages\_page\_decompressed](../xtradbinnodb-server-status-variables/index#innodb_num_pages_page_decompressed) | Number of pages decompressed | | [Innodb\_num\_pages\_page\_compression\_error](../xtradbinnodb-server-status-variables/index#innodb_num_pages_page_compression_error) | Number of compression errors | With InnoDB page compression, a page is only compressed when it is flushed to disk. This means that if you are monitoring InnoDB page compression via these status variables, then the status variables values will only get incremented when the dirty pages are flushed to disk, which does not necessarily happen immediately. For example: ``` CREATE TABLE `tab` ( `id` int(11) NOT NULL, `str` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; INSERT INTO tab VALUES (1, 'str1'); SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed'; +----------------------------------+-------+ | Variable_name | Value | +----------------------------------+-------+ | Innodb_num_pages_page_compressed | 0 | +----------------------------------+-------+ SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_format='Barracuda'; SET GLOBAL innodb_default_row_format='dynamic'; SET GLOBAL innodb_compression_algorithm='lzma'; ALTER TABLE tab PAGE_COMPRESSED=1; SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed'; +----------------------------------+-------+ | Variable_name | Value | +----------------------------------+-------+ | Innodb_num_pages_page_compressed | 0 | +----------------------------------+-------+ SELECT SLEEP(10); +-----------+ | SLEEP(10) | +-----------+ | 0 | +-----------+ SHOW GLOBAL STATUS LIKE 'Innodb_num_pages_page_compressed'; +----------------------------------+-------+ | Variable_name | Value | +----------------------------------+-------+ | Innodb_num_pages_page_compressed | 3 | +----------------------------------+-------+ ``` Compatibility with Backup Tools ------------------------------- [Mariabackup](../mariabackup/index) supports InnoDB page compression. [Percona XtraBackup](../percona-xtrabackup/index) does not support InnoDB page compression. Acknowledgements ---------------- * InnoDB page compression was developed by collaborating with [Fusion-io](http://fusionio.com). Special thanks especially to Dhananjoy Das and Torben Mathiasen. See Also -------- * [Storage-Engine Independent Column Compression](../storage-engine-independent-column-compression/index) * [Atomic Write Support](../atomic-write-support/index) * [MariaDB Introduces Atomic Writes](https://blog.mariadb.org/mariadb-introduces-atomic-writes/) * [Small Datum: Third day with InnoDB transparent page compression](http://smalldatum.blogspot.com/2015/09/third-day-with-innodb-transparent-page.html) * [InnoDB holepunch compression vs the filesystem in MariaDB 10.1](https://blog.mariadb.org/innodb-holepunch-compression-vs-the-filesystem-in-mariadb-10-1/) * [Significant performance boost with new MariaDB page compression on FusionIO](https://blog.mariadb.org/significant-performance-boost-with-new-mariadb-page-compression-on-fusionio/) * [INFLOW '14: NVM Compression—Hybrid Flash-Aware Application Level Compression](https://www.usenix.org/conference/inflow14/workshop-program/presentation/das) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Performance Schema events_transactions_history_long Table Performance Schema events\_transactions\_history\_long Table ============================================================ **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The events\_transactions\_history\_long table was introduced in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The `events_transactions_history_long` table contains the most recent completed transaction events that have ended globally, across all threads. The number of records stored in the table is determined by the [performance\_schema\_events\_transactions\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_transactions_history_long_size) system variable, which is autosized on startup. If adding a completed transaction would cause the table to exceed this limit, the oldest row, regardless of thread, is discarded. The table contains the following columns: | Column | Type | Description | | --- | --- | --- | | THREAD\_ID | bigint(20) unsigned | The thread associated with the event. | | EVENT\_ID | bigint(20) unsigned | The event id associated with the event. | | END\_EVENT\_ID | bigint(20) unsigned | This column is set to NULL when the event starts and updated to the thread current event number when the event ends. | | EVENT\_NAME | varchar(128) | The name of the instrument from which the event was collected. This is a NAME value from the setup\_instruments table. | | STATE | enum('ACTIVE', 'COMMITTED',' ROLLED BACK') | The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). | | TRX\_ID | bigint(20) unsigned | Unused. | | GTID | varchar(64) | Transaction [GTID](../gtid/index), using the format DOMAIN-SERVER\_ID-SEQUENCE\_NO. | | XID\_FORMAT\_ID | int(11) | XA transaction format ID for GTRID and BQUAL values. | | XID\_GTRID | varchar(130) | XA global transaction ID. | | XID\_BQUAL | varchar(130) | XA transaction branch qualifier. | | XA\_STATE | varchar(64) | The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). | | SOURCE | varchar(64) | The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. | | TIMER\_START | bigint(20) unsigned | The unit is picoseconds. When event timing started. NULL if event has no timing information. | | TIMER\_END | bigint(20) unsigned | The unit is picoseconds. When event timing ended. NULL if event has no timing information. | | TIMER\_WAIT | bigint(20) unsigned | The unit is picoseconds. Event duration. NULL if event has not timing information. | | ACCESS\_MODE | enum('READ ONLY', 'READ WRITE') | Transaction access mode. | | ISOLATION\_LEVEL | varchar(64) | Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. | | AUTOCOMMIT | enum('YES', 'NO') | NO | | NUMBER\_OF\_SAVEPOINTS | bigint(20) unsigned | The number of SAVEPOINT statements issued during the transaction. | | NUMBER\_OF\_ROLLBACK\_TO\_SAVEPOINT | bigint(20) unsigned | The number of ROLLBACK\_TO\_SAVEPOINT statements issued during the transaction. | | NUMBER\_OF\_RELEASE\_SAVEPOINT | bigint(20) unsigned | The number of RELEASE\_SAVEPOINT statements issued during the transaction. | | OBJECT\_INSTANCE\_BEGIN | bigint(20) unsigned | Unused. | | NESTING\_EVENT\_ID | bigint(20) unsigned | The EVENT\_ID value of the event within which this event is nested. | | NESTING\_EVENT\_TYPE | enum('TRANSACTION',' STATEMENT', 'STAGE', 'WAIT') | The nesting event type. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb A Comparison Between Automation Systems A Comparison Between Automation Systems ======================================= This page compares the automation systems that are covered by this section of the MariaDB Knowledge Base. More information about these systems are presented in the relevant pages, and more systems may be added in the future. Code Structure Differences -------------------------- Different automation systems provide different ways to describe our infrastructure. Understanding how they work is the first step to evaluate them and choose one for our organization. ### Ansible Code Structure Ansible code consists of the following components: * An **inventory** determines which **hosts** Ansible should be able to deploy. Each host may belong to one or more **groups**. Groups may have **children**, forming a hierarchy. This is useful because it allows us to deploy on a group, or to assign variables to a group. * A **role** describes the state that a host, or group of hosts, should reach after a deploy. * A **play** associates hosts or groups to their roles. Each role/group can have more than one role. * A role consists of a list of **tasks**. Despite its name a task is not necessarily something to do, but something that must exist in a certain state. * Tasks can use **variables**. They can affect how a task is executed (for example a variable could be a file name), or even whether a task is executed or not. Variables exist at role, group or host level. Variables can also be passed by the user when a play is applied. * **Playbooks** are the code that is used to define tasks and variables. * **Facts** are data that Ansible retrieves from remote hosts before deploying. This is a very important step, because facts may determine which tasks are executed or how they are executed. Facts include, for example, the operating system family or its version. A playbook sees facts as pre-set variables. * **Modules** implement **actions** that tasks can use. Action examples are **file** (to declare that files and directories must exist) or **mysql\_variables** (to declare MySQL/MariaDB variables that need to be set). See [Ansible Overview - concepts](../ansible-overview/index#concepts) for more details and an example. ### Puppet Code Structure Puppet code consists of the following components: * An **inventory file** defines a set of **groups** and their **targets** (the members of a group). **plugins** can be used to retrieve groups and target dynamically, so they are equivalent to Ansible dynamic inventories. * A **manifest** is a file that describes a configuration. * A **resource** is a component that should run on a server. For example, "file" and "service" are existing support types. * An **attribute** relates to a resource and affects the way it is applied. For example, a resource of type "file" can have attributes like "owner" and "mode". * A **class** groups resources and variables, describing a logical part of server configuration. A class can be associated to several servers. A class is part of a manifest. * A **module** is a set of manifests and describes an infrastructure or a part of it. * Classes can have typed **parameters** that affect how they are applied. * **Properties** are variables that are read from the remote server, and cannot be arbitrarily assigned. * **Facts** are pre-set variables collected by Puppet before applying or compiling a manifest. Architectural Differences ------------------------- The architecture of the various systems is different. Their architectures determine how a deploy physically works, and what is needed to be able to deploy. ### Ansible Architecture Ansible architecture is simple. Ansible can run from any host, and can apply its playbooks on remote hosts. To do this, it runs commands via SSH. In practice, in most cases the commands will be run as superuser via `sudo`, though this is not always necessary. Inventories can be dynamic. In this case, when we apply a playbook Ansible connects to remote services to discover hosts. Ansible playbooks are applied via the `ansible-playbook` binary. Changes to playbooks are only applied when we perform this operation. To recap, Ansible does not need to be installed on the server is administers. It needs an SSH access, and normally its user needs to be able to run `sudo`. It is also possible to configure a dynamic inventory, and a remote service to be used for this purpose. ### Puppet Architecture Puppet supports two types of architecture: agent-master or standalone. The agent-master architecture is recommended by Puppet Labs, and it is the most popular among Puppet users. For this reason, those who prefer a standalone architecture tend to prefer Ansible. #### Agent-Master Architecture When this architecture is chosen, manifests are sent to the **Puppet master**. There can be more than one master, for high availability reasons. All target hosts run a **Puppet agent**. Normally this is a service that automatically starts at system boot. The agent contacts a master at a given interval. It sends facts, and uses them to compile a **catalog** from the manifests. A catalog is a description of what exactly an individual server should run. The agent receives the catalog and checks if there are differences between its current configuration and the catalog. If differences are found, the agent applies the relevant parts of the catalog. An optional component is **PuppetDB**. This is a central place where some data are stored, including manifests, retrieved facts and logs. PuppetDB is based on PostgreSQL and there are no plans to support MariaDB or other DBMSs. If a manual change is made to a remove server, it will likely be overwritten the next time Puppet agent runs. To avoid this, the Puppet agent service can be stopped. #### Standalone Architecture As mentioned, this architecture is not recommended by Puppet Labs nor popular amongst Puppet users. It is similar to Ansible architecture. Users can apply manifests from any host with Puppet installed. This could be their laptop but, in order to emulate the behavior of an agent-master architecture, normally Puppet runs on a dedicated node as a cronjob. The **Puppet apply** application will require facts from remote hosts, it will compile a catalog for each host, will check which parts of it need to be applied, and will apply them remotely. If a manual change is made to a remove server, it will be overwritten the next time Puppet apply runs. To avoid this, comment out any cron job running Puppet apply, or comment out the target server in the inventory. #### Inventory As mentioned, Puppet supports plugins to retrieve the inventory dynamically from remote services. In an agent-master architecture, one has to make sure that each target host has access to these services. In a standalone architecture, one has to make sure that the hosts running Puppet apply have access to these services. Storing Secrets --------------- Often our automation repositories need to contain secrets, like MariaDB user passwords or private keys for SSH authentication. Both Ansible and Puppet support integration with secret stores, like Hashicorp Vault. For Puppet integration, see [Integrations with secret stores](https://puppet.com/docs/puppet/6.17/integrations_with_secret_stores.html). In the simplest case, Ansible allows encrypting secrets in playbooks and decrypting them during execution using [ansible-vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html). This implies a minimal effort to handle secrets. However, it is not the most secure way to store secrets. The passwords to disclose certain secrets need to be shared with the users who have the right to use them. Also, brute force attacks are possible. Ecosystems and Communities -------------------------- Automation software communities are very important, because they make available a wide variety of modules to handle specific software. ### Ansible Ecosystem Ansible is open source, released under the terms of the GNU GPL. It is produced by RedHat. RedHat has a page about [Red Hat Ansible Automation Platform Partners](https://www.ansible.com/partners), who can provide support and consulting. [Ansible Galaxy](https://galaxy.ansible.com/) is a big repository of Ansible roles produced by both the vendor and the community. Ansible comes with `ansible-galaxy`, a tool that can be used to create roles and upload them to Ansible Galaxy. At the time of this writing, Ansible does not have specific MariaDB official modules. MySQL official modules can be used. However, be careful not try to use features that only apply to MySQL. There are several community-maintained MariaDB roles. ### Puppet Ecosystem Puppet is open source, released under the GNU GPL. It is produced by a homonym company. The page [Puppet Partners](https://puppet.com/partners/) lists partners that can provide support and consulting about Puppet. [Puppet Forge](https://forge.puppet.com/) is a big repository of modules produced by the vendor and by the community, as well as how-to guides. Currently Puppet has many MariaDB modules. See Also -------- For more information about the systems mentioned in this page, from MariaDB users perspective: * [Ansible and MariaDB](../ansible-and-mariadb/index). * [Puppet and MariaDB](../automated-mariadb-deployment-and-administration-puppet-and-mariadb/index). --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Installation issues on Debian and Ubuntu Installation issues on Debian and Ubuntu ========================================= Solutions to different installation issues on Debian and Ubuntu | Title | Description | | --- | --- | | [Differences in MariaDB in Debian (and Ubuntu)](../differences-in-mariadb-in-debian-and-ubuntu/index) | MariaDB when installed from the Debian repos has a number of differences with standard MariaDB. | | [Moving from MySQL to MariaDB in Debian 9](../moving-from-mysql-to-mariadb-in-debian-9/index) | MariaDB 10.1 is the default mysql server in Debian 9 "Stretch" | | [Creating a Debian Repository](../creating_a_debian_repository/index) | Instructions for creating your own Debian repository | | [MariaDB 5.5.33 Debian and Ubuntu Installation Issues](../mariadb-5533-debian-and-ubuntu-installation-issues/index) | Workarounds for some repository issues with the 5.5.33 release. | | [MariaDB Debian Live Images](../mariadb-debian-live-images/index) | Debian live iso images with pre-installed MariaDB (obsolete) | | [apt-upgrade Fails, But the Database is Running](../apt-upgrade-fails-but-the-database-is-running/index) | timeout causing apt to fail while the database is running. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb dbForge Schema Compare for MariaDB & MySQL dbForge Schema Compare for MariaDB & MySQL ========================================== [**dbForge Schema Compare**](https://www.devart.com/dbforge/mysql/schemacompare/) is an efficient solution that allows for the comparison of the MariaDB database structure. With this tool, you can easily find the differences in MariaDB database schemas. Schema Compare Tool Key features: --------------------------------- ### 1.Mariadb & MySQL Schema Synchronization Update MariaDB schemas by generating accurate synchronization scripts Preview sync scripts for any schema objects Customize the synchronization output with various options Get warnings on possible errors while synchronization Sync asynchronous structure ### 2. MariaDB Backup and Restore Enjoy the advantages of MariaDB backup and restore Wizards Have a full or partial backup Restore database and schedule backups with a command-line interface Support for databases over 2Gb ### 3. Scripts Folder Comparison Compare the data both in two different databases and the database data with the data placed locally Choose any connection and script folder stored locally with the new Data Comparison Wizard View the comparison process results in a data grid ### 4. Routine Tasks Automation Sync and compare database schemas with command-line support Use the Windows Scheduler to automate the sync processes Run synchronization and schema comparison tasks with command-line execution files ### 5. Broad Compatibility MariaDB server versions 5.5-10.6 All MariaDB instances set up on Windows, Linux, FreeBSD, etc. Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud Security connections: Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona ![broad-compatibility-new](https://mariadb.com/kb/en/dbforge-schema-compare-for-mariadb-mysql/+image/broad-compatibility-new "broad-compatibility-new") ### 6. Supported Schema Objects Packages Sequences ### 7. Database Structure Comparison Configuration Filter the types of objects before the comparison Dismiss particular table options while comparing Use the Schema Comparison Wizard for switching between the Target and Source databases ### 8. Comparison Results Analysis Sort and filter the compared objects Get a clear view of MariaDB and MySQL schema diffs in the grid. Manage groups of compared objects ### 9. Comparison Results Export Generate comparison results reports in HTML, Excel XML, XML for Excel Include specifically selected objects in your comparison report Download a free 30-day trial of dbForge MariaDB and MySQL Schema Compare [here](https://www.devart.com/dbforge/mysql/schemacompare/download.html). [Documentation](https://docs.devart.com/schema-compare-for-mysql/) | Version | Introduced | | --- | --- | | dbForge Schema Compare 5.0 | [MariaDB 10.5](../what-is-mariadb-105/index) | | dbForge Schema Compare 4.4 | [MariaDB 10.4](../what-is-mariadb-104/index) | | dbForge Schema Compare 4.3 | [MariaDB 10.3](../what-is-mariadb-103/index) | | dbForge Schema Compare 4.2 | [MariaDB 10.2](../what-is-mariadb-102/index), [MariaDB 10.1](../what-is-mariadb-101/index) | | dbForge Schema Compare 3.1 | [MariaDB 10.0](../what-is-mariadb-100/index), [MariaDB 5.5](../what-is-mariadb-55/index) | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Solaris Sparc Buildbot Setup for Solaris Sparc ================================ Setting up a BuildBot slave on Solaris -------------------------------------- **NOTE #1:** *It would probably make sense to create a seperate zone for the buildbot on your Solaris 10 system. That is left up to you!* **NOTE #2:** *You might need to install the Zope Interface package for some of the Python pieces to work properly. Do this after installing Python 2.5. You can find information on the Zope Interface on their [site](http://pypi.python.org/pypi/zope.interface).* ### Solaris 10 (SPARC) Unless you want to spend time optimizing the underlying Solaris 10 (SPARC) installation, it is strongly suggested that you choose the "Entire" Software Group during the installation process. Once you have your Solaris 10 (SPARC) system on the network and able to access the Internet you can use the following suggestions to setup your buildbot: 1. By default Solaris 10 comes packages with Python 2.6.x. For compatibility reasons, you need to install Python 2.5.x. The author found it easiest to use Sunfreeware (ftp://ftp.sunfreeware.com/pub/freeware/sparc/5.10/): ``` $ cd /tmp $ ftp ftp.sunfreeware.com Name: anonymous Password: (your email address) ftp> bin ftp> cd pub/freeware/sparc/5.10/ ftp> get python-2.5.4-sol10-sparc-local.gz ftp> quit $ gunzip python-2.5.4-sol10-sparc-local.gz $ pkgadd -d python-2.5.4-sol10-sparc-local ``` *If you are unfamiliar with howto install packages from Sunfreeware please read their [howto](http://www.sunfreeware.com/indexsparc10.html).* 2. Setup your environment: * Create a user: ``` $ useradd -d /export/home/buildbot -m buildbot ``` *It is imperative that you not use Bash as the buildbot user's shell. It could have been a dependency issue but I literally spent several days trying to solve why the buildbot wasn't checking out code with bzr only to discover that using the default Solaris shell fixed the problem. If someone comes up with a solution please let us know on the mailing list.* * Adjust the global profile (you could be more granular here but since I'm setting up a dedicated system I wasn't): ``` $ vi /etc/profile LD_LIBRARY_PATH=/opt/csw/lib:/usr/local/lib:/usr/sfw/lib:$LD_LIBRARY_PATH # Add required libraries PYTHONPATH=/usr/local/lib/python2.5/site-packages:$PYTHONPATH # Makes Python 2.5 the default PATH=/usr/local/bin:/usr/bin:/usr/sbin:/etc:/usr/sfw/bin:$PATH # Puts "local" packages in your path export LOGNAME PATH PYTHONPATH LD_LIBRARY_PATH ``` 3. Install the latest Twisted: ``` $ wget tmrc.mit.edu/mirror/twisted/Twisted/9.0/Twisted-9.0.0.tar.bz2 $ bunzip2 Twisted-9.0.0.tar.bz2 $ tar -xf Twisted-9.0.0.tar $ cd Twisted-9.0.0 $ python setup.py build install ``` 4. Install required packages from Sunfreeware: ``` automake, autoconf, gcc, m4, md5, openssl, libsigsegv, Tcl, Tk, perl, libtool, sed, libgcc, gcc, libintl, libiconv, zlib, binutils, groff, cmake ``` 5. Install the Bazaar DVCS: * You can find a package on [Google Code](http://code.google.com/p/bzrunix/downloads/list). * Install the latest Bazaar for Solaris 10. At the time of this writing it was 1.14.1: <http://bzrunix.googlecode.com/files/bzr-1.14.1-sol10-sparc-local.gz> . 6. Volunteer your buildbot to the Maria team. Follow the directions listed in the **Volunteering to run a build slave** section of the [About Buildbot](../about-buildbot/index) page. 7. Create the buildbot as the buildbot user: ``` buildbot create-slave --usepty=0 /export/home/buildbot/maria-slave hasky.askmonty.org:9989 ${buildbotname} <passwd> ``` *Replace ${buildbotname} with the buildbot name you received from the MariaDB developers. Replace <passwd> with the password they gave you. You can adjust these and other parameters anytime within the maria-slave/buildbot.tac file at anytime in the future.* 8. Create a shared Bazaar repository in the buildbot build directory: ``` HOME=/export/home/buildbot; bzr init-repo maria-slave/${buildbotname} ``` *Replace ${buildbotname} like you did in **Step #7**.* 9. Attach the buildbot to the master (this assumes you are not logged in as buildbot): ``` sudo su - buildbot -c "/usr/bin/buildbot start /export/home/buildbot/maria-slave" ``` *OPTIONAL: You can create a proper service by following (and modifying as necessary) these [directions](http://wadofstuff.blogspot.com/2007/01/smf-manifest-for-buildbot.html)* 10. Please ask on the #maria [IRC](../irc/index) channel on irc.freenode.net if you have problems or questions setting up your buildbot. Or ask on the on the [maria-developers](http://launchpad.net/~maria-developers) mailing list. 11. Check the status of your buildbot through the [BuildBot buildslaves](http://buildbot.askmonty.org/buildbot/buildslaves) page. This howto was contributed by Adam Dutko. The original version is [here](http://littlehat.homelinux.org/tuts/MariaDB/buildbot/README-SOL10-SPARC). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Securing Connections for Client and Server Securing Connections for Client and Server ========================================== By default, MariaDB transmits data between the server and clients without encrypting it. This is generally acceptable when the server and client run on the same host or in networks where security is guaranteed through other means. However, in cases where the server and client exist on separate networks or they are in a high-risk network, the lack of encryption does introduce security concerns as a malicious actor could potentially eavesdrop on the traffic as it is sent over the network between them. To mitigate this concern, MariaDB allows you to encrypt data in transit between the server and clients using the Transport Layer Security (TLS) protocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly speaking the SSL protocol is a predecessor to TLS and, that version of the protocol is now considered insecure. The documentation still uses the term SSL often and for compatibility reasons TLS-related server system and status variables still use the prefix `ssl_`, but internally, MariaDB only supports its secure successors. In order to secure connections between the server and client, you need to ensure that your server was compiled with TLS support. See [Secure Connections Overview](../secure-connections-overview/index) to determine how to check whether a server was compiled with TLS support. You also need an X509 certificate, a private key, and the Certificate Authority (CA) chain to verify the X509 certificate for the server. If you want to use two-way TLS, then you will also need an X509 certificate, a private key, and the Certificate Authority (CA) chain to verify the X509 certificate for the client. If you want to use self-signed certificates that are created with OpenSSL, then see [Certificate Creation with OpenSSL](../certificate-creation-with-openssl/index) for information on how to create those. Enabling TLS ------------ ### Enabling TLS for MariaDB Server In order to enable TLS on a MariaDB server that was compiled with TLS support, there are a number of system variables that you need to set, such as: * You need to set the path to the server's X509 certificate by setting the [ssl\_cert](../ssltls-system-variables/index#ssl_cert) system variable. * You need to set the path to the server's private key by setting the [ssl\_key](../ssltls-system-variables/index#ssl_key) system variable. * You need to set the path to the certificate authority (CA) chain that can verify the server's certificate by setting either the [ssl\_ca](../ssltls-system-variables/index#ssl_ca) or the [ssl\_capath](../ssltls-system-variables/index#ssl_capath) system variables. * If you want to restrict the server to certain ciphers, then you also need to set the [ssl\_cipher](../ssltls-system-variables/index#ssl_cipher) system variable. For example, to set these variables for the server, add the system variables to a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index): ``` [mariadb] ... ssl_cert = /etc/my.cnf.d/certificates/server-cert.pem ssl_key = /etc/my.cnf.d/certificates/server-key.pem ssl_ca = /etc/my.cnf.d/certificates/ca.pem ``` And then [restart the server](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index) to make the changes persistent. Once the server is back up, you can check that TLS is enabled by checking the value of the [have\_ssl](../ssltls-system-variables/index#have_ssl) system variable. For example: ``` SHOW VARIABLES LIKE 'have_ssl'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | have_ssl | YES | +---------------+-------+ ``` #### Reloading the Server's Certificates and Keys Dynamically **MariaDB starting with [10.4](../what-is-mariadb-104/index)**The `FLUSH SSL` command was first added in [MariaDB 10.4](../what-is-mariadb-104/index). In [MariaDB 10.4](../what-is-mariadb-104/index) and later, the `FLUSH SSL` command can be used to dynamically reinitialize the server's [TLS](../data-in-transit-encryption/index) context. See [FLUSH SSL](../flush/index#flush-ssl) for more information. ### Enabling TLS for MariaDB Clients Different [clients and utilities](../clients-utilities/index) may use different methods to enable TLS. For many of the standard [clients and utilities](../clients-utilities/index) that come bundled with MariaDB, you can enable two-way TLS by adding the same options that were set for the server to a relevant client [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [client-mariadb] ... ssl_cert = /etc/my.cnf.d/certificates/client-cert.pem ssl_key = /etc/my.cnf.d/certificates/client-key.pem ssl_ca = /etc/my.cnf.d/certificates/ca.pem ``` The specific options that you would need to set would depend on whether you want one-way TLS or two-way TLS, and whether you want to verify the server certificate. The same options may also enable TLS on non-standard [clients and utilities](../clients-utilities/index) that are linked with either [libmysqlclient](https://dev.mysql.com/doc/refman/5.5/en/c-api.html) or [MariaDB Connector/C](../mariadb-connector-c/index). #### Enabling Two-Way TLS for MariaDB Clients Two-way TLS means that both the client and server provide a private key and an X509 certificate. It is called "two-way" TLS because both the client and server can be authenticated. For example, to specify these options in a relevant client [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), you could set the following: ``` [client-mariadb] ... ssl_cert = /etc/my.cnf.d/certificates/client-cert.pem ssl_key = /etc/my.cnf.d/certificates/client-key.pem ssl_ca = /etc/my.cnf.d/certificates/ca.pem ssl-verify-server-cert ``` Or if you wanted to specify them on the command-line with the [mysql](../mysql-command-line-client/index) client, then you could execute something like this: ``` $ mysql -u myuser -p -h myserver.mydomain.com \ --ssl-cert=/etc/my.cnf.d/certificates/client-cert.pem \ --ssl-key=/etc/my.cnf.d/certificates/client-key.pem \ --ssl-ca=/etc/my.cnf.d/certificates/ca.pem \ --ssl-verify-server-cert ``` Two-way SSL is required for an account if the `REQUIRE X509`, `REQUIRE SUBJECT`, and/or `REQUIRE ISSUER` clauses are specified for the account. #### Enabling One-Way TLS for MariaDB Clients ##### Enabling One-Way TLS for MariaDB Clients with Server Certificate Verification One-way TLS means that only the server provides a private key and an X509 certificate. When TLS is used without a client certificate, it is called "one-way" TLS, because only the server can be authenticated, so authentication is only possible in one direction. However, encryption is still possible in both directions. [Server certificate verification](../secure-connections-overview/index#server-certificate-verification) means that the client verifies that the certificate belongs to the server. For example, to specify these options in a a relevant client [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), you could set the following: ``` [client-mariadb] ... ssl_ca = /etc/my.cnf.d/certificates/ca.pem ssl-verify-server-cert ``` Or if you wanted to specify them on the command-line with the [mysql](../mysql-command-line-client/index) client, then you could execute something like this: ``` $ mysql -u myuser -p -h myserver.mydomain.com \ --ssl-ca=/etc/my.cnf.d/certificates/ca.pem \ --ssl-verify-server-cert ``` ##### Enabling One-Way TLS for MariaDB Clients without Server Certificate Verification One-way TLS means that only the server provides a private key and an X509 certificate. When TLS is used without a client certificate, it is called "one-way" TLS, because only the server can be authenticated, so authentication is only possible in one direction. However, encryption is still possible in both directions. For example, to specify these options in a a relevant client [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), you could set the following: ``` [client-mariadb] ... ssl ``` Or if you wanted to specify them on the command-line with the [mysql](../mysql-command-line-client/index) client, then you could execute something like this: ``` $ mysql -u myuser -p -h myserver.mydomain.com \ --ssl ``` ### Enabling TLS for MariaDB Connector/C Clients See the documentation on MariaDB Connector/C's [TLS Options](../mysql_optionsv/index#tlsssl-options) for information on how to enable TLS for clients that use MariaDB Connector/C. ### Enabling TLS for MariaDB Connector/ODBC Clients See the documentation on MariaDB Connector/ODBC's [TLS-Related Connection Parameters](../about-mariadb-connector-odbc/index#tls-related-connection-parameters) for information on how to enable TLS for clients that use MariaDB Connector/ODBC. ### Enabling TLS for MariaDB Connector/J Clients See the documentation on [Using TLS/SSL with MariaDB Connector/J](../using-tls-ssl-with-mariadb-java-connector/index) for information on how to enable TLS for clients that use MariaDB Connector/J. Verifying that a Connection is Using TLS ---------------------------------------- You can verify that a connection is using TLS by checking the connection's [Ssl\_cipher](../library/ssltls-status-variables/index#ssl_cipher) status variable. If it is non-empty, then the connection is using TLS. For example: ``` SHOW SESSION STATUS LIKE 'Ssl_cipher'; +---------------+---------------------------+ | Variable_name | Value | +---------------+---------------------------+ | Ssl_cipher | DHE-RSA-AES256-GCM-SHA384 | +---------------+---------------------------+ 1 row in set (0.00 sec) ``` Requiring TLS ------------- From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), the [require\_secure\_transport](../server-system-variables/index#require_secure_transport) system variable is available. When set (by default it is off), connections attempted using insecure transport will be rejected. Secure transports are SSL/TLS, Unix sockets or named pipes. Note that requirements set for specific user accounts will take precedence over this setting. ### Requiring TLS for Specific User Accounts You can set certain TLS-related restrictions for specific user accounts. For instance, you might use this with user accounts that require access to sensitive data while sending it across networks that you do not control. These restrictions can be enabled for a user account with the [CREATE USER](../create-user/index), [ALTER USER](../alter-user/index), or [GRANT](../grant/index) statements. For example: * A user account must connect via TLS if the user account is defined with the `REQUIRE SSL` clause. ``` ALTER USER 'alice'@'%' REQUIRE SSL; ``` * A user account must connect via TLS with a specific cipher if the user account is defined with the `REQUIRE CIPHER` clause. ``` ALTER USER 'alice'@'%' REQUIRE CIPHER 'ECDH-RSA-AES256-SHA384'; ``` * A user account must connect via TLS with a valid client certificate if the user account is defined with the `REQUIRE X509` clause. ``` ALTER USER 'alice'@'%' REQUIRE X509; ``` * A user account must connect via TLS with a specific client certificate if the user account is defined with the `REQUIRE SUBJECT` clause. ``` ALTER USER 'alice'@'%' REQUIRE SUBJECT '/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland'; ``` * A user account must connect via TLS with a client certificate that must be signed by a specific certificate authority if the user account is defined with the `REQUIRE ISSUER` clause. ``` ALTER USER 'alice'@'%' REQUIRE SUBJECT '/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland' AND ISSUER '/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter Parker/[email protected]'; ``` ### Requiring TLS for Specific User Accounts from Specific Hosts A user account can have different definitions depending on what host the user account is logging in from. Therefore, it is possible to have different TLS requirements for the same username for different hosts. For example: ``` CREATE USER 'alice'@'localhost' REQUIRE NONE; CREATE USER 'alice'@'%' REQUIRE SUBJECT '/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland' AND ISSUER '/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter Parker/[email protected]' AND CIPHER 'ECDHE-ECDSA-AES256-SHA384'; ``` In the above example, the `alice` user account does not require TLS when logging in from localhost. However, when the `alice` user account logs in from any other host, they must use TLS with the given cipher, and they must provide a valid client certificate with the given subject that must have been signed by the given issuer. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Database Normalization: 4th Normal Form Database Normalization: 4th Normal Form ======================================= This article is intended to be read after the [Boyce-Codd normal form](../database-normalization-boyce-codd-normal-form/index) article. Let's look at the situation where redundancies can creep in even though a table is in [Boyce-Codd normal form](../database-normalization-boyce-codd-normal-form/index). Let's take the student / instructor / course example used in that article, but change one of the initial assumptions. Assume that the following is true for the tables below: * Each instructor takes only one course * Each course can have one or more instructors * Each student can have several instructors per course (this is different to the previous example) * Each student can take one or more courses ### Student Course Instructor data, with several instructors per course ### More data anomalies | Student | Course | Instructor | | --- | --- | --- | | Conrad Pienaar | Biology | Nkosizana Asmal | | Dingaan Fortune | Mathematics | Kader Dlamini | | Gerrie Jantjies | Science | Helen Ginwala | | Mark Thobela | Biology | Nkosizana Asmal | | Conrad Pienaar | Science | Peter Leon | | Alicia Ncita | Science | Peter Leon | | Quinton Andrews | Mathematics | Kader Dlamini | | Dingaan Fortune | Mathematics | Helen Ginwala | The data is the same as before, except that Helen Ginwala is teaching science to Gerrie Jantjies as well as mathematics to Dingaan Fortune, and Dingaan Fortune is being taught by both Helen Ginwala and Kader Dlamini for mathematics. The only possible key is a combination of all three attributes, as shown below. No other combination will uniquely identify a particular record. ### Three attributes as key | Student Course Instructor table | | --- | | *Student* | | *Instructor* | | *Course* | But this still has some potentially anomalous behavior. The fact that Kader Dlamini teaches mathematics is still stored more than once, as is the fact that Dingaan Thobela takes mathematics. The real problem is that the table stores more than one kind of fact: that of student-to-course relationship, as well as that of a student-to-instructor relationship. You can avoid this, as always, by separating the data into two tables, as shown below: ### Creating a table for the student to instructor relationship | Student Instructor table | | --- | | *Student* | | *Instructor* | ### Creating a table for the student to course relationship | Student Instructor table | | --- | | *Student* | | *Course* | This situation exists when you have multiple multivalued dependencies. A multivalued dependency exists between two attributes when, for each value of the first attribute, there are one or more associated values of the second attribute. For each value of *student*, there were many values of *course*. This is the first multivalued dependency. Then, for each value of *student*, there are one or more associated values of *instructor*. This is the second multivalued dependency. Thus, a table is in 4th normal form if: * it is in Boyce-Codd normal form * it does not contain more than one multivalued dependency Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema accounts Table Performance Schema accounts Table ================================= Description ----------- Each account that connects to the server is stored as a row in the accounts table, along with current and total connections. The table size is determined at startup by the value of the [performance\_schema\_accounts\_size](../performance-schema-system-variables/index#performance_schema_accounts_size) system variable. If this is set to 0, account statistics will be disabled. | Column | Description | | --- | --- | | `USER` | The connection's client user name for the connection, or NULL if an internal thread. | | `HOST` | The connection client's host name, or NULL if an internal thread. | | `CURRENT_CONNECTIONS` | Current connections for the account. | | `TOTAL_CONNECTIONS` | Total connections for the account. | The `USER` and `HOST` values shown here are the username and host used for user connections, not the patterns used to check permissions. Example ------- ``` SELECT * FROM performance_schema.accounts; +------------------+-----------+---------------------+-------------------+ | USER | HOST | CURRENT_CONNECTIONS | TOTAL_CONNECTIONS | +------------------+-----------+---------------------+-------------------+ | root | localhost | 1 | 2 | | NULL | NULL | 20 | 23 | | debian-sys-maint | localhost | 0 | 35 | +------------------+-----------+---------------------+-------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb EXPLAIN ANALYZE EXPLAIN ANALYZE =============== The syntax for the `EXPLAIN ANALYZE` feature was changed to `ANALYZE statement`, available since [MariaDB 10.1.0](https://mariadb.com/kb/en/mariadb-1010-release-notes/). See [ANALYZE statement](../analyze-statement/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_TYPE JSON\_TYPE ========== **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**JSON functions were added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` JSON_TYPE(json_val) ``` Description ----------- Returns the type of a JSON value (as a string), or NULL if the argument is null. An error will occur if the argument is an invalid JSON value. The following is a complete list of the possible return types: | Return type | Value | Example | | --- | --- | --- | | ARRAY | JSON array | [1, 2, {"key": "value"}] | | OBJECT | JSON object | {"key":"value"} | | BOOLEAN | JSON true/false literals | true, false | | DOUBLE | A number with at least one floating point decimal. | 1.2 | | INTEGER | A number without a floating point decimal. | 1 | | NULL | JSON null literal (this is returned as a string, not to be confused with the SQL NULL value!) | null | | STRING | JSON String | "a sample string" | Examples -------- ``` SELECT JSON_TYPE('{"A": 1, "B": 2, "C": 3}'); +---------------------------------------+ | JSON_TYPE('{"A": 1, "B": 2, "C": 3}') | +---------------------------------------+ | OBJECT | +---------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Buildbot Setup for MacOSX Buildbot Setup for MacOSX ========================= Setting up a Buildbot slave on Mac OS X --------------------------------------- Install buildbot-slave using [macports](http://www.macports.org/) or buildbot from [fink](http://www.finkproject.org/) (if you use old version of buildbot/buildbot-slave you should use buildbot command instead of buildslave-2.6 in following instructions). Add user buildbot: Make sure that you do not have a buildbot user and group on your system ``` # Check for group with id 101 id -g -nr 101 # Check for user with id 101 id -u -nr 101 ``` If you do not have the group and user buildbot, then create the group and the user buildbot ``` # Create group buildbot with group id 101 GROUP="buildbot" dscl . create /groups/$GROUP dscl . create /groups/$GROUP name $GROUP dscl . create /groups/$GROUP passwd "*" dscl . create /groups/$GROUP gid 101 # Create user buildbot with id 101 BUILDSLAVE_HOME=/var/lib/buildslave USER=buildbot mkdir -p $BUILDSLAVE_HOME dscl . -create /Users/$USER dscl . -create /Users/$USER RealName "Buildbot slave" dscl . -create /Users/$USER NFSHomeDirectory $BUILDSLAVE_HOME dscl . -create /Users/$USER UserShell /bin/bash dscl . -create /Users/$USER UniqueID 101 dscl . -create /Users/$USER PrimaryGroupID 101 chown 101:101 $BUILDSLAVE_HOME ``` To hide the user use: ``` defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add buildbot ``` Prepare environment: ``` sudo -i -u buildbot buildslave-2.6 create-slave --usepty=0 maria-slave hasky.askmonty.org:9989 <slavename> <passwd> bzr init-repo maria-slave/<slavedirectory> $EDITOR maria-slave/info/admin $EDITOR maria-slave/info/host logout ``` Buildbot can be started/stopped manually with these commands (it's a good idea to start and stop it to see if it is set up correctly): If you installed buildbot from [fink](http://www.finkproject.org/), please make sure that the buildbot user is using the environment settings. Your .profile should contain follwing line: ``` sudo - buildbot more .profile test -r /sw/bin/init.sh && . /sw/bin/init.sh ``` ``` sudo -i -u buildbot buildslave-2.6 start maria-slave buildslave-2.6 stop maria-slave logout ``` In order to make buildbot start on system boot, you'll need to create /Library/LaunchDaemons/net.sourceforge.buildbot.plist file with the following contents (modified example from buildbot wiki): ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>StandardOutPath</key> <string>twistd.log</string> <key>StandardErrorPath</key> <string>twistd-err.log</string> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/opt/local/bin:/sbin:/usr/sbin:/bin:/usr/bin</string> <key>PYTHONPATH</key> <string>/opt/local/lib/python2.5/site-packages</string> </dict> <key>GroupName</key> <string>daemon</string> <key>KeepAlive</key> <dict> <key>SuccessfulExit</key> <false/> </dict> <key>Label</key> <string>net.sourceforge.buildbot.slave.test</string> <key>ProgramArguments</key> <array> <string>/opt/local/bin/buildslave-2.6</string> <string>start</string> <string>--nodaemon</string> <string>maria-slave</string> </array> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>buildbot</string> <key>WorkingDirectory</key> <string>/var/lib/buildslave/</string> </dict> </plist> ``` If you installed buildbot from [fink](http://www.finkproject.org/), then you can edit and copy the plist file ``` $EDITOR /sw/share/doc/buildbot-py26/contrib/os-x/net.sourceforge.buildbot.slave.plist ``` Your plist file should similar to this one after editing: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd "> <plist version="1.0"> <dict> <key>Label</key> <string>net.sourceforge.buildbot.slave</string> <!-- Change this to the user you want to run buildbot as --> <key>UserName</key> <string>buildbot</string> <!-- Change this to your buildbot working directory --> <key>WorkingDirectory</key> <string>/Volumes/MiniHD2/ServiceData/buildslave/maria-slave</string> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string> </dict> <key>ProgramArguments</key> <array> <string>/sw/bin/twistd</string> <string>--nodaemon</string> <string>--python=buildbot.tac</string> <string>--logfile=buildbot.log</string> <string>--prefix=slave</string> </array> <key>KeepAlive</key> <dict> <key>SuccessfulExit</key> <false/> </dict> <key>RunAtLoad</key> <true/> </dict> </plist> ``` ``` sudo cp /sw/share/doc/buildbot-py26/contrib/os-x/net.sourceforge.buildbot.slave.plist /Library/LaunchDaemons/ ``` Note: you have to start your buildslave via launchd, otherwise you will run into several problems. For further details, please refer to [Using Launchd](http://buildbot.net/trac/wiki/UsingLaunchd) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema replication_applier_status Table Performance Schema replication\_applier\_status Table ===================================================== **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The `replication_applier_status` table, along with many other new [Performance Schema tables](../list-of-performance-schema-tables/index), was added in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The [Performance Schema](../performance-schema/index) replication\_applier\_status table contains information about the general transaction execution status on the replica. It contains the following fields. | Field | Type | Null | Description | | --- | --- | --- | --- | | CHANNEL\_NAME | char(64) | NO | The replication channel name. | | SERVICE\_STATE | enum('ON','OFF') | NO | Shows ON when the replication channel's applier threads are active or idle, OFF means that the applier threads are not active. | | REMAINING\_DELAY | int(10) unsigned | YES | Seconds the replica needs to wait to reach the desired delay from master. | | COUNT\_TRANSACTIONS\_RETRIES | bigint(20) unsigned | NO | The number of retries that were made because the replication SQL thread failed to apply a transaction. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Subqueries in a FROM Clause Subqueries in a FROM Clause =========================== Although [subqueries](../subqueries/index) are more commonly placed in a WHERE clause, they can also form part of the FROM clause. Such subqueries are commonly called derived tables. If a subquery is used in this way, you must also use an AS clause to name the result of the subquery. ORACLE mode ----------- **MariaDB starting with [10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/)**From [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/), [anonymous subqueries in a FROM clause](../sql_modeoracle/index#simple-syntax-compatibility) (no AS clause) are permitted in [ORACLE mode](../sql_modeoracle-from-mariadb-103/index). Examples -------- ``` CREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87), ('Tatiana', 'Tuning', 83); ``` Assume that, given the data above, you want to return the average total for all students. In other words, the average of Chun's 148 (75+73), Esben's 74 (43+31), etc. You cannot do the following: ``` SELECT AVG(SUM(score)) FROM student GROUP BY name; ERROR 1111 (HY000): Invalid use of group function ``` A subquery in the FROM clause is however permitted: ``` SELECT AVG(sq_sum) FROM (SELECT SUM(score) AS sq_sum FROM student GROUP BY name) AS t; +-------------+ | AVG(sq_sum) | +-------------+ | 134.0000 | +-------------+ ``` From [MariaDB 10.6](../what-is-mariadb-106/index) in [ORACLE mode](../sql_modeoracle-from-mariadb-103/index), the following is permitted: ``` SELECT * FROM (SELECT 1 FROM DUAL), (SELECT 2 FROM DUAL); ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Understanding the Hierarchical Database Model Understanding the Hierarchical Database Model ============================================= The earliest model was the hierarchical database model, resembling an upside-down tree. Files are related in a parent-child manner, with each parent capable of relating to more than one child, but each child only being related to one parent. Most of you will be familiar with this kind of structure—it’s the way most file systems work. There is usually a root, or top-level, directory that contains various other directories and files. Each subdirectory can then contain more files and directories, and so on. Each file or directory can only exist in one directory itself—it only has one parent. As you can see in the image below *A1* is the root directory, and its children are *B1* and *B2*. *B1* is a parent to *C1*, *C2*, and *C3*, which in turn has children of its own. This model, although being a vast improvement on dealing with unrelated files, has some serious disadvantages. It represents one-to-many relationships well (one parent has many children; for example, one company branch has many employees), but it has problems with many-to-many relationships. Relationships such as that between a product file and an orders file are difficult to implement in a hierarchical model. Specifically, an order can contain many products, and a product can appear in many orders. Also, the hierarchical model is not flexible because adding new relationships can result in wholesale changes to the existing structure, which in turn means all existing applications need to change as well. This is not fun when someone has forgotten a table and wants it added to the system shortly before the project is due to launch! And developing the applications is complex because the programmer needs to know the data structure well in order to traverse the model to access the needed data. As you’ve seen in the earlier chapters, when accessing data from two related tables, you only need to know the fields you require from those two tables. In the hierarchical model, you’d need to know the entire chain between the two. For example, to relate data from *A1* and *D4*, you’d need to take the route: *A1*, *B1*, *C3* and *D4*. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Information Schema Tables ColumnStore Information Schema Tables ===================================== MariaDB ColumnStore has four Information Schema tables that expose information about the table and column storage. These tables were added in version 1.0.5 of ColumnStore and were heavily modified for 1.0.6. COLUMNSTORE\_TABLES ------------------- The first table is the INFORMATION\_SCHEMA.COLUMNSTORE\_TABLES. This contains information about the tables inside ColumnStore. The table layout is as follows: | Column | Description | | --- | --- | | TABLE\_SCHEMA | The database schema for the table | | TABLE\_NAME | The table name | | OBJECT\_ID | The ColumnStore object ID for the table | | CREATION\_DATE | The date the table was created | | COLUMN\_COUNT | The number of columns in the table | | AUTOINCREMENT | The start autoincrement value for the table set during CREATE TABLE | **Note:** Tables created with ColumnStore 1.0.4 or lower will have the year field of the creation data set incorrectly by 1900 years. COLUMNSTORE\_COLUMNS -------------------- The INFORMATION\_SCHEMA.COLUMNSTORE\_COLUMNS table contains information about every single column inside ColumnStore. The table layout is as follows: | Column | Description | | --- | --- | | TABLE\_SCHEMA | The database schema for the table | | TABLE\_NAME | The table name for the column | | COLUMN\_NAME | The column name | | OBJECT\_ID | The object ID for the column | | DICTIONARY\_OBJECT\_ID | The dictionary object ID for the column (NULL if there is no dictionary object | | LIST\_OBJECT\_ID | Placeholder for future information | | TREE\_OBJECT\_ID | Placeholder for future information | | DATA\_TYPE | The data type for the column | | COLUMN\_LENGTH | The data length for the column | | COLUMN\_POSITION | The position of the column in the table, starting at 0 | | COLUMN\_DEFAULT | The default value for the column | | IS\_NULLABLE | Whether or not the column can be set to NULL | | NUMERIC\_PRECISION | The numeric precision for the column | | NUMERIC\_SCALE | The numeric scale for the column | | IS\_AUTOINCREMENT | Set to 1 if the column is an autoincrement column | | COMPRESSION\_TYPE | The type of compression (either "None" or "Snappy") | COLUMNSTORE\_EXTENTS -------------------- This table displays the extent map in a user consumable form. An extent is a collection of details about a section of data related to a columnstore column. A majority of columns in ColumnStore will have multiple extents and the columns table above can be joined to this one to filter results by table or column. The table layout is as follows: | Column | Description | | --- | --- | | OBJECT\_ID | The object ID for the extent | | OBJECT\_TYPE | Whether this is a "Column" or "Dictionary" extent | | LOGICAL\_BLOCK\_START | ColumnStore's internal start LBID for this extent | | LOGICAL\_BLOCK\_END | ColumnStore's internal end LBID for this extent | | MIN\_VALUE | This minimum value stored in this extent | | MAX\_VALUE | The maximum value stored in this extent | | WIDTH | The data width for the extent | | DBROOT | The DBRoot number for the extent | | PARTITION\_ID | The parition ID for the extent | | SEGMENT\_ID | The segment ID for the extent | | BLOCK\_OFFSET | The block offset for the data file, each data file can contain multiple extents for a column | | MAX\_BLOCKS | The maximum number of blocks for the extent | | HIGH\_WATER\_MARK | The last block committed to the extent (starting at 0) | | STATE | The state of the extent (see below) | | STATUS | The availability status for the column which is either "Available", "Unavailable" or "Out of service" | | DATA\_SIZE | The uncompressed data size for the extent calculated as (HWM + 1) \* BLOCK\_SIZE | **Notes:** 1. The state is "Valid" for a normal state, "Invalid" if a cpimport has completed but the table has not yet been accessed (min/max values will be invalid) or "Updating" if there is a DML statement writing to the column 2. In ColumnStore the block size is 8192 bytes 3. By default ColumnStore will write create an extent file of 256\*1024\*WIDTH bytes for the first partition, if this is too small then for uncompressed data it will create a file of the maximum size for the extent (MAX\_BLOCKS \* BLOCK\_SIZE). Snappy always compression adds a header block. 4. Object IDs of less than 3000 are for internal tables and will not appear in any of the information schema tables 5. Prior to 1.0.12 / 1.1.2 DATA\_SIZE was incorrectly calculated 6. HWM is set to zero for the lower segments when there are multiple segments in an extent file, these can be observed when BLOCK\_OFFSET > 0 7. When HWM is 0 the DATA\_SIZE will show 0 instead of 8192 to avoid confusion when there is multiple segments in an extent file COLUMNSTORE\_FILES ------------------ The columnstore\_files table provides information about each file associated with extensions. Each extension can reuse a file at different block offsets so this is not a 1:1 relationship to the columnstore\_extents table. | Column | Description | | --- | --- | | OBJECT\_ID | The object ID for the extent | | SEGMENT\_ID | The segment ID for the extent | | PARTITION\_ID | The partition ID for the extent | | FILENAME | The full path and filename for the extent file, multiple extents for the same column can point to this file with different BLOCK\_OFFSETs | | FILE\_SIZE | The disk file size for the extent | | COMPRESSED\_DATA\_SIZE | The amount of the compressed file used, NULL if this is an uncompressed file | Stored Procedures ----------------- A few stored procedures were added in 1.0.6 to provide summaries based on the information schema tables. These can be accessed from the COLUMNSTORE\_INFO schema. ### total\_usage() The total\_usage() procedure gives a total disk usage summary for all the columns in ColumnStore with the exception of the columns used for internal maintenance. It is executed using the following query: ``` > call columnstore_info.total_usage(); ``` ### table\_usage() The table\_usage() procedure gives a the total data disk usage, dictionary disk usage and grand total disk usage per-table. It can be called in several ways, the first gives a total for each table: ``` > call columnstore_info.table_usage(NULL, NULL); ``` Or for a specific table, my\_table in my\_schema in this example: ``` > call columnstore_info.table_usage('my_schema', 'my_table'); ``` You can also request all tables for a specified schema: ``` > call columnstore_info.table_usage('my_schema', NULL); ``` **Note:** The quotes around the table name are required, an error will occur without them. ### compression\_ratio() The compression\_ratio() procedure calculates the average compression ratio across all the compressed extents in ColumnStore. It is called using: ``` > call columnstore_info.compression_ratio(); ``` **Note:** The compression ratio is incorrectly calculated before versions 1.0.12 / 1.1.2 Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Beekeeper Studio Beekeeper Studio ================ [Beekeeper Studio](https://www.beekeeperstudio.io) is an open-source database GUI available for Linux, MacOS, and Windows. ![SQL Gui Screenshot](https://mariadb.com/kb/en/beekeeper-studio/+image/main-dark "SQL Gui Screenshot") Beekeeper Studio works great with MariaDB, but also works with other databases like Postgres, Redshift, SQL Server, and more. Beekeeper Studio has all the nice features you'd expect of a quality SQL GUI: * Tabbed interface * SSH tunneling * SQL autocomplete * Multi-connection Things that make Beekeeper Studio uniquely awesome: * [Totally open source and free](https://github.com/beekeeper-studio/beekeeper-studio). No feature walls for any GUI features. * [Privacy respecting](https://www.beekeeperstudio.io/mission/). No usage tracking or anything at all like that. * Modern and easy to use - Everyone deserves a first class app experience. **Links** * Homepage - <https://beekeeperstudio.io> * GitHub - <https://github.com/beekeeper-studio/beekeeper-studio> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb VAR_POP VAR\_POP ======== Syntax ------ ``` VAR_POP(expr) ``` Description ----------- Returns the population standard variance of `expr`. It considers rows as the whole population, not as a sample, so it has the number of rows as the denominator. You can also use [VARIANCE()](../variance/index), which is equivalent but is not standard SQL. Variance is calculated by * working out the mean for the set * for each number, subtracting the mean and squaring the result * calculate the average of the resulting differences It is an [aggregate function](../aggregate-functions/index), and so can be used with the [GROUP BY](../group-by/index) clause. From [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), VAR\_POP() can be used as a [window function](../window-functions/index). VAR\_POP() returns `NULL` if there were no matching rows. Examples -------- ``` CREATE TABLE v(i tinyint); INSERT INTO v VALUES(101),(99); SELECT VAR_POP(i) FROM v; +------------+ | VAR_POP(i) | +------------+ | 1.0000 | +------------+ INSERT INTO v VALUES(120),(80); SELECT VAR_POP(i) FROM v; +------------+ | VAR_POP(i) | +------------+ | 200.5000 | +------------+ ``` As an [aggregate function](../aggregate-functions/index): ``` CREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT); INSERT INTO stats VALUES ('a',1),('a',2),('a',3), ('b',11),('b',12),('b',20),('b',30),('b',60); SELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) FROM stats GROUP BY category; +----------+---------------+----------------+------------+ | category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) | +----------+---------------+----------------+------------+ | a | 0.8165 | 1.0000 | 0.6667 | | b | 18.0400 | 20.1693 | 325.4400 | +----------+---------------+----------------+------------+ ``` As a [window function](../window-functions/index): ``` CREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student_test VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87); SELECT name, test, score, VAR_POP(score) OVER (PARTITION BY test) AS variance_results FROM student_test; +---------+--------+-------+------------------+ | name | test | score | variance_results | +---------+--------+-------+------------------+ | Chun | SQL | 75 | 287.1875 | | Esben | SQL | 43 | 287.1875 | | Kaolin | SQL | 56 | 287.1875 | | Tatiana | SQL | 87 | 287.1875 | | Chun | Tuning | 73 | 582.0000 | | Esben | Tuning | 31 | 582.0000 | | Kaolin | Tuning | 88 | 582.0000 | +---------+--------+-------+------------------+ ``` See Also -------- * [VARIANCE](../variance/index) (equivalent, non-standard SQL) * [STDDEV\_POP](../stddev_pop/index) (population standard deviation) * [STDDEV\_SAMP](../stddev_samp/index) (sample standard deviation) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SB Data Generator SB Data Generator ================= Generate and populate databases with large volumes of realistic test data. [**SB Data Generator**](https://soft-builder.com/sb-data-generator/) is a simple and powerful GUI tool for creating large volumes of realistic test data to populate selected tables or entire databases. The tool reverses your database and displays tables and columns, so you can assign to them multiple data generator templates. The tool includes multiple built-in generators that allow populating MariaDB database tables with realistic data of various types. **Key Benefits:** * Understand your database structure by visualizing the ER Diagram (tables, columns, relationships, keys, sequences, indexes, and triggers) * Ability to generate a large volume of realistic test data * Preview what data will be generated before populating the database with test data * Multiple built-in generators available with the ability to create custom data generators * Generate test data for most popular DBMS including MariaDB and MySQL [**Learn more about SB Data Generator**](https://soft-builder.com/sb-data-generator/) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW LOCALES SHOW LOCALES ============ `SHOW LOCALES` was introduced as part of the [Information Schema plugin extension](../information-schema-plugins-show-and-flush-statements/index). `SHOW LOCALES` is used to return `[locales](../server-locale/index)` information as part of the [Locales](../locales-plugin/index) plugin. While the `[information\_schema.LOCALES](../information-schema-locales-table/index)` table has 8 columns, the `SHOW LOCALES` statement will only display 4 of them: Example ------- ``` SHOW LOCALES; +-----+-------+-------------------------------------+------------------------+ | Id | Name | Description | Error_Message_Language | +-----+-------+-------------------------------------+------------------------+ | 0 | en_US | English - United States | english | | 1 | en_GB | English - United Kingdom | english | | 2 | ja_JP | Japanese - Japan | japanese | | 3 | sv_SE | Swedish - Sweden | swedish | ... ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB InnoDB ======= **MariaDB starting with [10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/)**In [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) and later, the InnoDB implementation has diverged substantially from the InnoDB in MySQL. Therefore, in these versions, the InnoDB version is no longer associated with a MySQL release version. **MariaDB starting with [10.2](../what-is-mariadb-102/index)**In [MariaDB 10.2](../what-is-mariadb-102/index) and later, the default InnoDB implementation is based on InnoDB from MySQL 5.7. See [Why MariaDB uses InnoDB instead of XtraDB from MariaDB 10.2](../why-does-mariadb-102-use-innodb-instead-of-xtradb/index) for more information. **MariaDB until [10.1](../what-is-mariadb-101/index)**In [MariaDB 10.1](../what-is-mariadb-101/index) and before, the default InnoDB implementation is based on Percona's XtraDB. XtraDB is a performance enhanced fork of InnoDB. For compatibility reasons, the [system variables](../xtradbinnodb-server-system-variables/index) still retain their original `innodb` prefixes. If the documentation says that something applies to InnoDB, then it usually also applies to the XtraDB fork, unless explicitly stated otherwise. In these versions, it is still possible to use InnoDB instead of XtraDB. See [Using InnoDB instead of XtraDB](../using-innodb-instead-of-xtradb/index) for more information. | Title | Description | | --- | --- | | [InnoDB Versions](../innodb-versions/index) | From MariaDB 10.2, InnoDB is the default storage engine. | | [InnoDB Limitations](../innodb-limitations/index) | The InnoDB storage engine has the following limitations. | | [InnoDB Troubleshooting](../innodb-troubleshooting/index) | Guidelines when troubleshooting problems with InnoDB . | | [InnoDB System Variables](../innodb-system-variables/index) | List and description of InnoDB-related server system variables. | | [InnoDB Server Status Variables](../innodb-status-variables/index) | List and description of InnoDB status variables. | | [AUTO\_INCREMENT Handling in InnoDB](../auto_increment-handling-in-innodb/index) | AUTO\_INCREMENT handling in InnoDB and the lock modes. | | [InnoDB Buffer Pool](../innodb-buffer-pool/index) | The most important memory buffer used by InnoDB. | | [InnoDB Change Buffering](../innodb-change-buffering/index) | Buffering INSERT, UPDATE and DELETE statements for greater efficiency. | | [InnoDB Doublewrite Buffer](../innodb-doublewrite-buffer/index) | Buffer used for recovering from half-written pages. | | [InnoDB Tablespaces](../innodb-tablespaces/index) | Information on tablespaces in InnoDB, including an overview, system tablesp... | | [InnoDB File Format](../innodb-file-format/index) | Description of the file formats supported by InnoDB. | | [InnoDB Row Formats](../innodb-row-formats/index) | InnoDB's row formats are REDUNDANT, COMPACT, DYNAMIC, and COMPRESSED. | | [InnoDB Strict Mode](../innodb-strict-mode/index) | InnoD strict mode makes InnoDB more reliable. | | [InnoDB Redo Log](../innodb-redo-log/index) | The redo log is used by InnoDB during crash recovery. | | [InnoDB Undo Log](../innodb-undo-log/index) | InnoDB Undo log. | | [InnoDB Page Flushing](../innodb-page-flushing/index) | Configuring when and how InnoDB flushes dirty pages to disk. | | [InnoDB Purge](../innodb-purge/index) | When a transaction updates a row in an InnoDB table, InnoDB's MVCC impleme... | | [Information Schema InnoDB Tables](../information-schema-innodb-tables/index) | All InnoDB-specific Information Schema tables. | | [Information Schema XtraDB Tables](../information-schema-xtradb-tables/index) | All XtraDB-specific Information Schema tables. | | [InnoDB Online DDL](../innodb-online-ddl/index) | InnoDB tables support online DDL in certain circumstances. | | [Binary Log Group Commit and InnoDB Flushing Performance](../binary-log-group-commit-and-innodb-flushing-performance/index) | Improvement for group commit for InnoDB transactions with the binary log enabled. | | [InnoDB Page Compression](../innodb-page-compression/index) | InnoDB page compression, which is more sophisticated than the COMPRESSED row format. | | [InnoDB Data Scrubbing](../innodb-data-scrubbing/index) | Ensuring data is completely removed when deleted. | | [InnoDB Lock Modes](../innodb-lock-modes/index) | InnoDB supports a number of lock modes to ensure that concurrent write operations never collide. | | [InnoDB Monitors](../xtradb-innodb-monitors/index) | Standard Monitor, Lock Monitor, Tablespace Monitor and the Table Monitor. | | [InnoDB Encryption Overview](../innodb-encryption-overview/index) | Data-at-rest encryption for tables that use the InnoDB storage engine. | | [About XtraDB](../about-xtradb/index) | XtraDB was an enhanced version of the InnoDB storage engine used until MariaDB 10.2. | | [Using InnoDB Instead of XtraDB](../using-innodb-instead-of-xtradb/index) | Using the InnoDB plugin instead of XtraDB | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Status Variables Added in MariaDB 10.5 Status Variables Added in MariaDB 10.5 ====================================== This is a list of [status variables](../server-status-variables/index) that were added in the [MariaDB 10.5](../what-is-mariadb-105/index) series. | Variable | Added | | --- | --- | | [Innodb\_adaptive\_hash\_hash\_searches](../innodb-status-variables/index#innodb_adaptive_hash_hash_searches) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_adaptive\_hash\_non\_hash\_searches](../innodb-status-variables/index#innodb_adaptive_hash_non_hash_searches) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_background\_log\_sync](../innodb-status-variables/index#innodb_background_log_sync) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_buffer\_pool\_pages\_made\_not\_young](../innodb-status-variables/index#innodb_buffer_pool_pages_made_not_young) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_buffer\_pool\_pages\_made\_young](../innodb-status-variables/index#innodb_buffer_pool_pages_made_young) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_buffer\_pool\_pages\_old](../innodb-status-variables/index#innodb_buffer_pool_pages_old) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_buffer\_pool\_pages\_LRU\_flushed](../innodb-status-variables/index#innodb_buffer_pool_pages_LRU_flushed) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_buffered\_aio\_submitted](../innodb-status-variables/index#innodb_buffered_aio_submitted) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_checkpoint\_age](../innodb-status-variables/index#innodb_checkpoint_age) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_checkpoint\_max\_age](../innodb-status-variables/index#innodb_checkpoint_max_age) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_deadlocks](../innodb-status-variables/index#innodb_deadlocks) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_discarded\_delete\_marks](../innodb-status-variables/index#innodb_ibuf_discarded_delete_marks) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_discarded\_deletes](../innodb-status-variables/index#innodb_ibuf_discarded_deletes) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_discarded\_inserts](../innodb-status-variables/index#innodb_ibuf_discarded_inserts) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_free\_list](../innodb-status-variables/index#innodb_ibuf_free_list) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_merged\_delete\_marks](../innodb-status-variables/index#innodb_ibuf_merged_delete_marks) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_merged\_deletes](../innodb-status-variables/index#innodb_ibuf_merged_deletes) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_merged\_inserts](../innodb-status-variables/index#innodb_ibuf_merged_inserts) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_merges](../innodb-status-variables/index#innodb_ibuf_merges) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_segment\_size](../innodb-status-variables/index#innodb_ibuf_segment_size) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_ibuf\_size](../innodb-status-variables/index#innodb_ibuf_size) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_lsn\_current](../innodb-status-variables/index#innodb_lsn_current) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_lsn\_flushed](../innodb-status-variables/index#innodb_lsn_flushed) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_lsn\_last\_checkpoint](../innodb-status-variables/index#innodb_lsn_last_checkpoint) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_master\_thread\_active\_loops](../innodb-status-variables/index#innodb_master_thread_active_loops) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_master\_thread\_idle\_loops](../innodb-status-variables/index#innodb_master_thread_idle_loops) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_max\_trx\_id](../innodb-status-variables/index#innodb_max_trx_id) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_mem\_adaptive\_hash](../innodb-status-variables/index#innodb_mem_adaptive_hash) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [Innodb\_mem\_dictionary](../innodb-status-variables/index#innodb_mem_dictionary) | [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) | | [performance\_schema\_index\_stat\_lost](../performance-schema-status-variables/index#performance_schema_index_stat_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_memory\_classes\_lost](../performance-schema-status-variables/index#performance_schema_memory_classes_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_metadata\_lock\_lost](../performance-schema-status-variables/index#performance_schema_metadata_lock_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_nested\_statement\_lost](../performance-schema-status-variables/index#performance_schema_nested_statement_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_prepared\_statements\_lost](../performance-schema-status-variables/index#performance_schema_prepared_statements_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_program\_lost](../performance-schema-status-variables/index#performance_schema_program_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [performance\_schema\_table\_lock\_stat\_lost](../performance-schema-status-variables/index#performance_schema_table_lock_stat_lost) | [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/) | | [S3\_pagecache\_blocks\_not\_flushed](../s3-storage-engine-status-variables/index#S3_pagecache_blocks_not_flushed) | [MariaDB 10.5](../what-is-mariadb-105/index) | | [S3\_pagecache\_blocks\_unused](../s3-storage-engine-status-variables/index#S3_pagecache_blocks_unused) | [MariaDB 10.5](../what-is-mariadb-105/index) | | [S3\_pagecache\_blocks\_used](../s3-storage-engine-status-variables/index#S3_pagecache_blocks_used) | [MariaDB 10.5](../what-is-mariadb-105/index) | | [S3\_pagecache\_reads](../s3-storage-engine-status-variables/index#S3_pagecache_reads) | [MariaDB 10.5](../what-is-mariadb-105/index) | See Also -------- * [System variables added in MariaDB 10.5](../system-variables-added-in-mariadb-105/index) * [Status variables added in MariaDB 10.4](../status-variables-added-in-mariadb-104/index) * [Status variables added in MariaDB 10.3](../status-variables-added-in-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SET PASSWORD SET PASSWORD ============ Syntax ------ ``` SET PASSWORD [FOR user] = { PASSWORD('some password') | OLD_PASSWORD('some password') | 'encrypted password' } ``` Description ----------- The `SET PASSWORD` statement assigns a password to an existing MariaDB user account. If the password is specified using the `[PASSWORD()](../password/index)` or `[OLD\_PASSWORD()](../old_password/index)` function, the literal text of the password should be given. If the password is specified without using either function, the password should be the already-encrypted password value as returned by `[PASSWORD()](../password/index)`. `[OLD\_PASSWORD()](../old_password/index)` should only be used if your MariaDB/MySQL clients are very old (< 4.0.0). With no `FOR` clause, this statement sets the password for the current user. Any client that has connected to the server using a non-anonymous account can change the password for that account. With a `FOR` clause, this statement sets the password for a specific account on the current server host. Only clients that have the `UPDATE` privilege for the `mysql` database can do this. The user value should be given in `user_name@host_name` format, where `user_name` and `host_name` are exactly as they are listed in the User and Host columns of the `[mysql.user](../mysqluser-table/index)` table (or view in MariaDB-10.4 onwards) entry. The argument to `[PASSWORD()](../password/index)` and the password given to MariaDB clients can be of arbitrary length. Authentication Plugin Support ----------------------------- **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, `SET PASSWORD` (with or without `PASSWORD()`) works for accounts authenticated via any [authentication plugin](../authentication-plugins/index) that supports passwords stored in the `[mysql.global\_priv](../mysqlglobal_priv-table/index)` table. The `[ed25519](../authentication-plugin-ed25519/index)`, `[mysql\_native\_password](../authentication-plugin-mysql_native_password/index)`, and `[mysql\_old\_password](../authentication-plugin-mysql_old_password/index)` authentication plugins store passwords in the `[mysql.global\_priv](../mysqlglobal_priv-table/index)` table. If you run `SET PASSWORD` on an account that authenticates with one of these authentication plugins that stores passwords in the `[mysql.global\_priv](../mysqlglobal_priv-table/index)` table, then the `PASSWORD()` function is evaluated by the specific authentication plugin used by the account. The authentication plugin hashes the password with a method that is compatible with that specific authentication plugin. The `[unix\_socket](../authentication-plugin-unix-socket/index)`, `[named\_pipe](../authentication-plugin-named-pipe/index)`, `[gssapi](../authentication-plugin-gssapi/index)`, and `[pam](../authentication-plugin-pam/index)` authentication plugins do **not** store passwords in the `[mysql.global\_priv](../mysqlglobal_priv-table/index)` table. These authentication plugins rely on other methods to authenticate the user. If you attempt to run `SET PASSWORD` on an account that authenticates with one of these authentication plugins that doesn't store a password in the `[mysql.global\_priv](../mysqlglobal_priv-table/index)` table, then MariaDB Server will raise a warning like the following: ``` SET PASSWORD is ignored for users authenticating via unix_socket plugin ``` See [Authentication from MariaDB 10.4](../authentication-from-mariadb-104/index) for an overview of authentication changes in [MariaDB 10.4](../what-is-mariadb-104/index). **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, `SET PASSWORD` (with or without `PASSWORD()`) only works for accounts authenticated via `[mysql\_native\_password](../authentication-plugin-mysql_native_password/index)` or `[mysql\_old\_password](../authentication-plugin-mysql_old_password/index)` authentication plugins Passwordless User Accounts -------------------------- User accounts do not always require passwords to login. The `[unix\_socket](../authentication-plugin-unix-socket/index)` , `[named\_pipe](../authentication-plugin-named-pipe/index)` and `[gssapi](../authentication-plugin-gssapi/index)` authentication plugins do not require a password to authenticate the user. The `[pam](../authentication-plugin-pam/index)` authentication plugin may or may not require a password to authenticate the user, depending on the specific configuration. The `[mysql\_native\_password](../authentication-plugin-mysql_native_password/index)` and `[mysql\_old\_password](../authentication-plugin-mysql_old_password/index)` authentication plugins require passwords for authentication, but the password can be blank. In that case, no password is required. If you provide a password while attempting to log into the server as an account that doesn't require a password, then MariaDB server will simply ignore the password. **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, a user account can be defined to use multiple authentication plugins in a specific order of preference. This specific scenario may be more noticeable in these versions, since an account could be associated with some authentication plugins that require a password, and some that do not. Example ------- For example, if you had an entry with User and Host column values of '`bob`' and '`%.loc.gov`', you would write the statement like this: ``` SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass'); ``` If you want to delete a password for a user, you would do: ``` SET PASSWORD FOR 'bob'@localhost = PASSWORD(""); ``` See Also -------- * [Password Validation Plugins](../password-validation-plugins/index) - permits the setting of basic criteria for passwords * `[ALTER USER](../alter-user/index)` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Database Normalization: 2nd Normal Form Database Normalization: 2nd Normal Form ======================================= This article follows on from [Database Normalization: 1st Normal Form](../database-normalization-1st-normal-form/index). After converting to first normal form, the following table structure was achieved: | Plant location table | | --- | | *Location code* | | Location name | | *Plant code* | | Plant name | | Soil category | | Soil description | Is this in 2nd normal form? A table is in 2nd normal form if: * it is in 1st normal form * it includes no partial dependencies (where an attribute is only dependent on part of a primary key) For an attribute to be only dependent on part of the primary key, the primary key must consist of more than one field. If the primary key contains only one field, the table is automatically in 2nd normal form if it is in 1st normal form Let's examine all the fields. *Location name* is only dependent on *location code*. *Plant name*, *soil category*, and *soil description* are only dependent on *plant code* (this assumes that each plant only occurs in one soil type, which is the case in this example). So you remove each of these fields and place them in a separate table, with the key being that part of the original key on which they are dependent. For example, with *plant name*, the key is *plant code*. This leaves you with the tables below: ### Plant location table with partial dependencies removed | Plant location table | | --- | | *Plant code* | | *Location code* | ### Table resulting from fields dependent on plant code | Plant table | | --- | | *Plant code* | | Plant name | | Soil category | | Soil description | ### Table resulting from fields dependent on location code | Location table | | --- | | *Location code* | | Location name | The resulting tables are now in 2nd normal form. The process for turning a table into 3rd normal form is continued in the next article. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INET6 INET6 ===== **MariaDB starting with [10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/)**The INET6 data type was added in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) Syntax ------ ``` INET6 ``` Description ----------- The `INET6` data type is intended for storage of IPv6 addresses, as well as IPv4 addresses assuming conventional mapping of IPv4 addresses into IPv6 addresses. Both short and long IPv6 notation are permitted, according to RFC-5952. * Values are stored as a 16-byte fixed length binary string, with most significant byte first. * Storage engines see INET6 as BINARY(16). * Clients see INET6 as CHAR(39) and get text representation on retrieval. The IPv4-compatible notation is considered as deprecated. It is supported for compatibility with the [INET6\_ATON](../inet6_aton/index) function, which also understands this format. It's recommended to use the mapped format to store IPv4 addresses in INET6. When an IPv4 mapped (or compatible) value is stored in INET6, it still occupies 16 bytes: ### Retrieval On retrieval, in the client-server text protocol, INET6 values are converted to the short text representation, according to RFC-5952, that is with all leading zeroes in each group removed and with consequent zero groups compressed. Besides creating one's own [stored function](../stored-functions/index), there is no a way to retrieve an INET6 value using long text representation. ### Casting * [CAST](../cast/index) from a character string to INET6 understands addresses in short or long text notation (including IPv4 mapped and compatible addresses). NULL is returned if the format is not understood. * CAST from a binary string to INET6 requires a 16-byte string as an argument. NULL is returned if the argument length is not equal to 16. * CAST from other data types to INET6 first converts data to a character string, then CAST from character string to INET6 is applied. * CAST from INET6 to [CHAR](../char/index) returns short text address notation. * CAST from INET6 to [BINARY](../binary/index) returns its 16-byte binary string representation. * CAST from INET6 to data types other than [CHAR](../char/index) (e.g. SIGNED, UNSIGNED, TIME, etc) returns an error. ### Comparisons An INET6 expression can be compared to: * another INET6 expression * a character string expression with a text (short or long) address representation: * a 16-byte binary string expression: Attempting to compare INET6 to an expression of any other data type returns an error. ### Mixing INET6 Values for Result An INET6 expression can be mixed for result (i.e. [UNION](../union/index), [CASE..THEN](case), [COALESCE](../coalesce/index) etc) with: * another INET6 expression. The resulting data type is INET6. * a character string in text (short or long) address representation. The result data type is INET6. The character string counterpart is automatically converted to INET6. If the string format is not understood, it's converted with a warning to either NULL or to '::', depending on the NULL-ability of the result. * a 16-byte binary string. The resulting data type is INET6. The binary string counterpart is automatically converted to INET6. If the length of the binary string is not equal to 16, it's converted with a warning to NULL or to '::' depending on the NULL-ability of the result. Attempts to mix INET6 for result with other data types will return an error. Mixing INET6 with other data types for [LEAST](../least/index) and [GREATEST](../greatest/index), when mixing for comparison and mixing for result are involved at the same time, uses the same rules with mixing for result, described in the previous paragraphs. ### Functions and Operators * [HEX()](../hex/index) with an INET6 argument returns a hexadecimal representation of the underlying 16-byte binary string * Arithmetic operators (+,-,\*,/,MOD,DIV) are not supported for INET6. This may change in the future. * The [INET6\_ATON](../inet6_aton/index) function now understands INET6 values as an argument * The prototypes of the [IS\_IPV4\_COMPAT](../is_ipv4_compat/index) and I[S\_IPV4\_MAPPED](../is_ipv4_mapped/index) functions have changed from `a BINARY(16)` to `a INET6`, * When the argument for these two functions is not INET6, automatic implicit CAST to INET6 is applied. As a consequence, both functions now understand arguments in both text representation and binary(16) representation. Before [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), these functions understood only binary(16) representation. ### Prepared Statement Parameters INET6 understands both [text](../text/index) and [binary(16)](../binary/index) address representation in [prepared statement](../prepared-statements/index) parameters ([PREPARE](../prepare-statement/index)..[EXECUTE](../execute-statement/index) and [EXECUTE IMMEDIATE](../execute-immediate/index) statements). ### Migration between BINARY(16) and INET6 Before [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), you may have used [BINARY(16)](../binary/index) as a storage for IPv6 internet addresses, in combination with [INET6\_ATON](../inet6_aton/index) and [INET6\_NTOA](../inet6_ntoa/index) to respectively insert and retrieve data. From 10.5, you can [ALTER](../alter-table/index) BINARY(16) columns storing IPv6 addresses to INET6. After such an alter, there is no a need to use INET6\_ATON() and INET6\_NTOA(). Addresses can be inserted and retrieved directly. It is also possible to convert INET6 columns to BINARY(16) and continue using the data in combination with INET6\_NTOA() and INET6\_ATON(). Examples -------- ``` CREATE TABLE t1 (a INET6); ``` Inserting using short text address notation: ``` INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); ``` Long text address notation: ``` INSERT INTO t1 VALUES ('2001:0db8:0000:0000:0000:ff00:0042:8329'); ``` 16-byte binary string notation: ``` INSERT INTO t1 VALUES (0x20010DB8000000000000FF0000428329); INSERT INTO t1 VALUES (UNHEX('20010DB8000000000000FF0000428329')); ``` IPv4 addresses, using IPv4-mapped and IPv4-compatible notations: ``` INSERT INTO t1 VALUES ('::ffff:192.0.2.128'); -- mapped INSERT INTO t1 VALUES ('::192.0.2.128'); -- compatible ``` ``` SELECT * FROM t1; +------------------------+ | a | +------------------------+ | 2001:db8::ff00:42:8329 | | 2001:db8::ff00:42:8329 | | 2001:db8::ff00:42:8329 | | 2001:db8::ff00:42:8329 | | ::ffff:192.0.2.128 | | ::192.0.2.128 | +------------------------+ ``` IPv4 mapped (or compatible) values still occupy 16 bytes: ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('::ffff:192.0.2.128'); SELECT * FROM t1; +--------------------+ | a | +--------------------+ | ::ffff:192.0.2.128 | +--------------------+ SELECT HEX(a) FROM t1; +----------------------------------+ | HEX(a) | +----------------------------------+ | 00000000000000000000FFFFC0000280 | +----------------------------------+ ``` Casting from INET6 to anything other than [CHAR](../char/index) returns an error: ``` SELECT CAST(a AS DECIMAL) FROM t1; ERROR 4079 (HY000): Illegal parameter data type inet6 for operation 'decimal_typecast' ``` ### Comparison Examples Comparison with another INET6 expression: ``` CREATE OR REPLACE TABLE t1 (a INET6); CREATE OR REPLACE TABLE t2 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8328'),('2001:db8::ff00:42:8329'); INSERT INTO t2 VALUES ('2001:db8::ff00:42:832a'),('2001:db8::ff00:42:8329'); SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a; +------------------------+ | a | +------------------------+ | 2001:db8::ff00:42:8329 | +------------------------+ ``` With a character string expression with a text (short or long) address representation: ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); SELECT * FROM t1 WHERE a='2001:db8::ff00:42:8329'; +------------------------+ | a | +------------------------+ | 2001:db8::ff00:42:8329 | +------------------------+ ``` With a 16-byte binary string expression: ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); SELECT * FROM t1 WHERE a=X'20010DB8000000000000FF0000428329'; +------------------------+ | a | +------------------------+ | 2001:db8::ff00:42:8329 | +------------------------+ ``` With an expression of another data type: ``` SELECT * FROM t1 WHERE a=1; ERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation '=' ``` ### Mixing for Result Examples Mixed with another INET6 expression, returning an INET6 data type: ``` CREATE OR REPLACE TABLE t1 (a INET6, b INET6); INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:8329'); SELECT a FROM t1 UNION SELECT b FROM t1; +------------------------+ | a | +------------------------+ | NULL | | 2001:db8::ff00:42:8329 | +------------------------+ SELECT COALESCE(a, b) FROM t1; +------------------------+ | COALESCE(a, b) | +------------------------+ | 2001:db8::ff00:42:8329 | +------------------------+ ``` Mixed with a character string in text (short or long) address representation: ``` CREATE OR REPLACE TABLE t1 (a INET6, b VARCHAR(64)); INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:8328'); INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:832a garbage'); SELECT COALESCE(a,b) FROM t1; +------------------------+ | COALESCE(a,b) | +------------------------+ | 2001:db8::ff00:42:8328 | | NULL | +------------------------+ 2 rows in set, 1 warning (0.001 sec) SHOW WARNINGS; +---------+------+---------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------+ | Warning | 1292 | Incorrect inet6 value: '2001:db8::ff00:42:832a garbage' | +---------+------+---------------------------------------------------------+ ``` Mixed with a 16-byte binary string: ``` CREATE OR REPLACE TABLE t1 (a INET6, b VARBINARY(16)); INSERT INTO t1 VALUES (NULL,CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF)); INSERT INTO t1 VALUES (NULL,0x00/*garbage*/); SELECT COALESCE(a,b) FROM t1; +---------------+ | COALESCE(a,b) | +---------------+ | ffff::ffff | | NULL | +---------------+ 2 rows in set, 1 warning (0.001 sec) SHOW WARNINGS; +---------+------+-------------------------------+ | Level | Code | Message | +---------+------+-------------------------------+ | Warning | 1292 | Incorrect inet6 value: '\x00' | +---------+------+-------------------------------+ ``` Mixing with other data types: ``` SELECT CAST('ffff::ffff' AS INET6) UNION SELECT 1; ERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation 'UNION' ``` ### Functions and Operators Examples [HEX](../hex/index) with an INET6 argument returning a hexadecimal representation: ``` SELECT HEX(CAST('2001:db8::ff00:42:8329' AS INET6)); +----------------------------------------------+ | HEX(CAST('2001:db8::ff00:42:8329' AS INET6)) | +----------------------------------------------+ | 20010DB8000000000000FF0000428329 | +----------------------------------------------+ ``` [INET6\_ATON](../inet6_aton/index) now understands INET6 values as an argument: ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); SELECT a, HEX(INET6_ATON(a)) FROM t1; +------------------------+----------------------------------+ | a | HEX(INET6_ATON(a)) | +------------------------+----------------------------------+ | 2001:db8::ff00:42:8329 | 20010DB8000000000000FF0000428329 | +------------------------+----------------------------------+ ``` [IS\_IPV4\_COMPAT](../is_ipv4_compat/index) and [IS\_IPV4\_MAPPED](../is_ipv4_mapped/index) prototype now `a BINARY(16))`: ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); INSERT INTO t1 VALUES ('::ffff:192.168.0.1'); INSERT INTO t1 VALUES ('::192.168.0.1'); SELECT a, IS_IPV4_MAPPED(a), IS_IPV4_COMPAT(a) FROM t1; +------------------------+-------------------+-------------------+ | a | IS_IPV4_MAPPED(a) | IS_IPV4_COMPAT(a) | +------------------------+-------------------+-------------------+ | 2001:db8::ff00:42:8329 | 0 | 0 | | ::ffff:192.168.0.1 | 1 | 0 | | ::192.168.0.1 | 0 | 1 | +------------------------+-------------------+-------------------+ ``` Automatic implicit CAST to INET6: ``` CREATE OR REPLACE TABLE t1 ( a INET6, b VARCHAR(39) DEFAULT a ); INSERT INTO t1 (a) VALUES ('ffff::ffff'),('::ffff:192.168.0.1'); SELECT a, IS_IPV4_MAPPED(a), b, IS_IPV4_MAPPED(b) FROM t1; +--------------------+-------------------+--------------------+-------------------+ | a | IS_IPV4_MAPPED(a) | b | IS_IPV4_MAPPED(b) | +--------------------+-------------------+--------------------+-------------------+ | ffff::ffff | 0 | ffff::ffff | 0 | | ::ffff:192.168.0.1 | 1 | ::ffff:192.168.0.1 | 1 | +--------------------+-------------------+--------------------+-------------------+ CREATE OR REPLACE TABLE t1 ( a INET6, b BINARY(16) DEFAULT UNHEX(HEX(a)) ); INSERT INTO t1 (a) VALUES ('ffff::ffff'),('::ffff:192.168.0.1'); SELECT a, IS_IPV4_MAPPED(a), HEX(b), IS_IPV4_MAPPED(b) FROM t1; +--------------------+-------------------+----------------------------------+-------------------+ | a | IS_IPV4_MAPPED(a) | HEX(b) | IS_IPV4_MAPPED(b) | +--------------------+-------------------+----------------------------------+-------------------+ | ffff::ffff | 0 | FFFF000000000000000000000000FFFF | 0 | | ::ffff:192.168.0.1 | 1 | 00000000000000000000FFFFC0A80001 | 1 | +--------------------+-------------------+----------------------------------+-------------------+ ``` ### Prepared Statement Parameters Examples ``` CREATE OR REPLACE TABLE t1 (a INET6); EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)' USING 'ffff::fffe'; EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)' USING X'FFFF000000000000000000000000FFFF'; SELECT * FROM t1; +------------+ | a | +------------+ | ffff::fffe | | ffff::ffff | +------------+ EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING 'ffff::fffe'; +------------+ | a | +------------+ | ffff::fffe | +------------+ EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING X'FFFF000000000000000000000000FFFF'; +------------+ | a | +------------+ | ffff::ffff | +------------+ ``` ### Migration between BINARY(16) and INET6 Examples Before [MariaDB 10.5](../what-is-mariadb-105/index): ``` CREATE OR REPLACE TABLE t1 (a BINARY(16)); INSERT INTO t1 VALUES (INET6_ATON('ffff::ffff')); SELECT INET6_NTOA(a) FROM t1; +---------------+ | INET6_NTOA(a) | +---------------+ | ffff::ffff | +---------------+ ``` Migrating to INET6, from [MariaDB 10.5](../what-is-mariadb-105/index): ``` ALTER TABLE t1 MODIFY a INET6; INSERT INTO t1 VALUES ('ffff::fffe'); SELECT * FROM t1; +------------+ | a | +------------+ | ffff::ffff | | ffff::fffe | +------------+ ``` Migration from INET6 to BINARY(16): ``` CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329'); INSERT INTO t1 VALUES ('::ffff:192.168.0.1'); INSERT INTO t1 VALUES ('::192.168.0.1'); ALTER TABLE t1 MODIFY a BINARY(16); SELECT INET6_NTOA(a) FROM t1; +------------------------+ | INET6_NTOA(a) | +------------------------+ | 2001:db8::ff00:42:8329 | | ::ffff:192.168.0.1 | | ::192.168.0.1 | +------------------------+ ``` See Also -------- * [IS\_IPV6](../is_ipv6/index) * [INET6\_ATON](../inet6_aton/index) * [INET6\_NTOA](../inet6_ntoa/index) * [Working with IPv6 in MariaDB - the INET6 datatype](https://www.youtube.com/watch?v=1zNOGGgUnlQ) (video) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Compile and Using MariaDB with Sanitizers (ASAN, UBSAN, TSAN, MSAN) Compile and Using MariaDB with Sanitizers (ASAN, UBSAN, TSAN, MSAN) =================================================================== What are Sanitizers? -------------------- Sanitizers are open source runtime error detectors developed by Google that are enabled during the compile step. These sanitizers add extra code during compilation that will throw exceptions when certain errors are detected. [AddressSanitizer (aka ASAN)](https://github.com/google/sanitizers/wiki/AddressSanitizer) is a memory error detector for C/C++. It finds a lot of the same things as [valgrind](../compiling-mariadb-for-debugging/index), but with a lot less overhead. * Use after free (dangling pointer dereference) * Heap buffer overflow * Stack buffer overflow * Global buffer overflow * Use after return * Use after scope * Initialization order bugs * Memory leaks To use ASAN you need a gcc version that supports ASAN. gcc 4.8.5 and up are known to work. In addition to ASAN there are sanitizers for Undefined Behaviour, Thread and Memory related errors. [UndefinedBehaviourSanitizer (aka UBSAN)](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) [ThreadSanitizer (aka TSAN)](https://clang.llvm.org/docs/ThreadSanitizer.html) [MemorySanitizer (aka MSAN)](https://clang.llvm.org/docs/MemorySanitizer.html) How to Compile MariaDB with Sanitizers -------------------------------------- Before using ASAN locally, please ensure that it is installed on the system: ``` yum install -y /usr/lib64/libasan.so.6.0.0 ``` ASAN is supported in [MariaDB 10.1](../what-is-mariadb-101/index) and up. You can use one of the two following build commands: ``` cmake . -DWITH_ASAN=ON ``` or from [MariaDB 10.2](../what-is-mariadb-102/index) and up: ``` ./BUILD/compile-pentium64-asan-max ``` Additionally, UBSAN, TSAN, and MSAN can be enabled in a similar way: UBSAN: ``` yum install -y /usr/lib64/libubsan.so.1.0.0 cmake . -DWITH_UBSAN=ON ``` TSAN: ``` yum install -y /usr/lib64/libtsan.so.0.0.0 cmake . -DWITH_TSAN=ON ``` MSAN: Note: keep in mind that only clang supports MSAN, g++ or other compilers will not work. ``` cmake . -DWITH_MSAN=ON ``` Running an ASAN Build --------------------- To run mysqld with instrumentation you have to set the `ASAN_OPTIONS` environment variable before starting `mysqld`. Either in your shell or in your [mysqld\_safe](../mysqld_safe/index) script. ``` export ASAN_OPTIONS=abort_on_error=1 ``` The above command will abort any instrumented executable if any errors are found, which is good for debugging. If you set abort\_on\_error=0 all server errors are logged to your error log file (mysqld.err). To catch errors for other processes than the server, you can set more options, like this: ``` export ASAN_OPTIONS=abort_on_error=1:log_path=/tmp/asan ``` If you are seeing an incomplete stack trace for a memory allocation, you may rerun the failing test with ``` export ASAN_OPTIONS=abort_on_error=1:log_path=/tmp/asan:fast_unwind_on_malloc=0 ``` To get core dumps of failures: ``` export ASAN_OPTIONS=abort_on_error=1:disable_coredump=0 ``` To see all the options (or to check if an executable is instrumented), you may try the following: ``` ASAN_OPTIONS=help=1 extra/perror 0 ``` ### Using Valgrind The [MariaDB test system](../mysqltest/index) can use [Valgrind](http://www.valgrind.org) for finding memory leaks and wrong memory accesses. Valgrind is an instrumentation framework for building dynamic analysis tools. If Valgrind is installed on your system, you can simply use [mysql-test-run --valgrind](../mysql-test-runpl-options/index#options-for-valgrind) to run the test under Valgrind. See Also -------- * [Compiling MariaDB for debugging](../compiling-mariadb-for-debugging/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb FLOOR FLOOR ===== Syntax ------ ``` FLOOR(X) ``` Description ----------- Returns the largest integer value not greater than X. Examples -------- ``` SELECT FLOOR(1.23); +-------------+ | FLOOR(1.23) | +-------------+ | 1 | +-------------+ SELECT FLOOR(-1.23); +--------------+ | FLOOR(-1.23) | +--------------+ | -2 | +--------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Handling Joins With Cassandra Handling Joins With Cassandra ============================= CassandraSE is no longer actively being developed and has been removed in [MariaDB 10.6](../what-is-mariadb-106/index). See [MDEV-23024](https://jira.mariadb.org/browse/MDEV-23024). Joins with data stored in a Cassandra database are only possible on the MariaDB side. That is, if we want to compute a join between two tables, we will: 1. Read the relevant data for the first table. 2. Based on data we got in #1, read the matching records from the second table. Either of the tables can be an InnoDB table, or a Cassandra table. In case the second table is a Cassandra table, the Cassandra Storage Engine allows to read matching records in an efficient way. Some general info ----------------- All this is targeted at running joins which touch small fraction of the tables. The expected typical use-case looks like this: * The primary data is stored in MariaDB (ie. in InnoDB) * There is also some extra data stored in Cassandra (e.g. hit counters) * The user accesses data in MariaDB (think of a website and a query like: ``` select * from user_accounts where username='joe') ``` Cassandra SE allows to grab some Cassandra data, as well. One can write things like this: ``` select user_accounts.*, cassandra_table.some_more_fields from user_accounts, cassandra_data where user_accounts.username='joe' and user_accounts.user_id= cassandra_table.user_id ``` which is much easier to do than to use Thrift API. If the user wants to run huge joins that touch a big fraction of table's data, for example: "What are top 10 countries that my website had visitors from in the last month"? or "Go through last month's orders and give me top 10 selling items" then Cassandra Storage engine is not a good answer. Queries like this are answered in two ways: 1. Design their schema in Cassandra in such a way that allows to get this data in one small select. No kidding. This is what Cassandra is targeted at, they explicitly recommend that Cassandra schema design starts with the queries. 2. If the query doesn't match Cassandra's schema, they need to run Hive (or Pig), which have some kind of distributed join support. Hive/Pig compile queries to Map/reduce job which are ran across the whole cluster, so they will certainly beat Cassandra Storage Engine which runs on one mysqld node (you can have multiple mysqld nodes of course, but they will not cooperate with one another). It is possible to run Hive/Pig on Cassandra. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LIMIT ROWS EXAMINED LIMIT ROWS EXAMINED =================== Syntax ------ ``` SELECT ... FROM ... WHERE ... [group_clause] [order_clause] LIMIT [[offset,] row_count] ROWS EXAMINED rows_limit; ``` Similar to the parameters of `LIMIT`, *`rows_limit`* can be both a prepared statement parameter, or a stored program parameter. Description ----------- The purpose of this optimization is to provide the means to terminate the execution of `[SELECT](../select/index)` statements which examine too many rows, and thus use too many resources. This is achieved through an extension of the `[LIMIT](../select/index#limit)` clause — `LIMIT ROWS EXAMINED number_of_rows` . Whenever possible the semantics of `LIMIT ROWS EXAMINED` is the same as that of normal `LIMIT` (for instance for aggregate functions). The `LIMIT ROWS EXAMINED` clause is taken into account by the query engine only during query execution. Thus the clause is ignored in the following cases: * If a query is `[EXPLAIN](../explain/index)`-ed. * During query optimization. * During auxiliary operations such as writing to system tables (e.g. logs). The clause is not applicable to `[DELETE](../delete/index)` or `[UPDATE](../update/index)` statements, and if used in those statements produces a syntax error. The effects of this clause are as follows: * The server counts the number of read, inserted, modified, and deleted rows during query execution. This takes into account the use of temporary tables, and sorting for intermediate query operations. * Once the counter exceeds the value specified in the LIMIT ROWS EXAMINED clause, query execution is terminated as soon as possible. * The effects of terminating the query because of LIMIT ROWS EXAMINED are as follows: + The result of the query is a subset of the complete query, depending on when the query engine detected that the limit was reached. The result may be empty if no result rows could be computed before reaching the limit. + A warning is generated of the form: "Query execution was interrupted. The query examined at least 100 rows, which exceeds LIMIT ROWS EXAMINED (20). The query result may be incomplete." + If query processing was interrupted during filesort, an error is returned in addition to the warning. + If a UNION was interrupted during execution of one of its queries, the last step of the UNION is still executed in order to produce a partial result. + Depending on the join and other execution strategies used for a query, the same query may produce no result at all, or a different subset of the complete result when terminated due to LIMIT ROWS EXAMINED. + If the query contains a GROUP BY clause, the last group where the limit was reached will be discarded. The `LIMIT ROWS EXAMINED` clause cannot be specified on a per-subquery basis. There can be only one `LIMIT ROWS EXAMINED` clause for the whole `SELECT` statement. If a `SELECT` statement contains several subqueries with `LIMIT ROWS EXAMINED`, the one that is parsed last is taken into account. Examples -------- A simple example of the clause is: ``` SELECT * from t1, t2 LIMIT 10 ROWS EXAMINED 10000; ``` The `LIMIT ROWS EXAMINED` clause is global for the whole statement. If a composite query (such as `UNION`, or query with derived tables or with subqueries) contains more than one `LIMIT ROWS EXAMINED`, the last one parsed is taken into account. In this manner either the last or the outermost one is taken into account. For instance, in the query: ``` SELECT * FROM t1 WHERE c1 IN (SELECT * FROM t2 WHERE c2 > ' ' LIMIT ROWS EXAMINED 0) LIMIT ROWS EXAMINED 11; ``` The limit that is taken into account is 11, not 0. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Subqueries and ALL Subqueries and ALL ================== [Subqueries](../subqueries/index) using the ALL keyword will return `true` if the comparison returns `true` for each row returned by the subquery, or the subquery returns no rows. Syntax ------ ``` scalar_expression comparison_operator ALL <Table subquery> ``` * `scalar_expression` may be any expression that evaluates to a single value * `comparison_operator` may be any one of: `=`, `>`, `<`, `>=`, `<=`, `<>` or `!=` `ALL` returns: * `NULL` if the comparison operator returns `NULL` for at least one row returned by the Table subquery or scalar\_expression returns `NULL`. * `FALSE` if the comparison operator returns `FALSE` for at least one row returned by the Table subquery. * `TRUE` if the comparison operator returns `TRUE` for all rows returned by the Table subquery, or if Table subquery returns no rows. `NOT IN` is an alias for `<> ALL`. Examples -------- ``` CREATE TABLE sq1 (num TINYINT); CREATE TABLE sq2 (num2 TINYINT); INSERT INTO sq1 VALUES(100); INSERT INTO sq2 VALUES(40),(50),(60); SELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2); +------+ | num | +------+ | 100 | +------+ ``` Since `100` > all of `40`,`50` and `60`, the evaluation is true and the row is returned Adding a second row to sq1, where the evaluation for that record is false: ``` INSERT INTO sq1 VALUES(30); SELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2); +------+ | num | +------+ | 100 | +------+ ``` Adding a new row to sq2, causing all evaluations to be false: ``` INSERT INTO sq2 VALUES(120); SELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2); Empty set (0.00 sec) ``` When the subquery returns no results, the evaluation is still true: ``` SELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2 WHERE num2 > 300); +------+ | num | +------+ | 100 | | 30 | +------+ ``` Evaluating against a NULL will cause the result to be unknown, or not true, and therefore return no rows: ``` INSERT INTO sq2 VALUES (NULL); SELECT * FROM sq1 WHERE num > ALL (SELECT * FROM sq2); ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb IS_USED_LOCK IS\_USED\_LOCK ============== Syntax ------ ``` IS_USED_LOCK(str) ``` Description ----------- Checks whether the lock named `str` is in use (that is, locked). If so, it returns the connection identifier of the client that holds the lock. Otherwise, it returns `NULL`. `str` is case insensitive. If the [metadata\_lock\_info](../metadata_lock_info/index) plugin is installed, the [Information Schema](../information_schema/index) [metadata\_lock\_info](../information-schema-metadata_lock_info-table/index) table contains information about locks of this kind (as well as [metadata locks](../metadata-locking/index)). Statements using the `IS_USED_LOCK` function are [not safe for statement-based replication](../unsafe-statements-for-statement-based-replication/index). See Also -------- * [GET\_LOCK](../get_lock/index) * [RELEASE\_LOCK](../release_lock/index) * [IS\_FREE\_LOCK](../is_free_lock/index) * [RELEASE\_ALL\_LOCKS](../release_all_locks/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb COLUMN_DELETE COLUMN\_DELETE ============== Syntax ------ ``` COLUMN_DELETE(dyncol_blob, column_nr, column_nr...); COLUMN_DELETE(dyncol_blob, column_name, column_name...); ``` Description ----------- Deletes a [dynamic column](../dynamic-columns/index) with the specified name. Multiple names can be given. The return value is a dynamic column blob after the modification. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.help_relation Table mysql.help\_relation Table ========================== `mysql.help_relation` is one of the four tables used by the [HELP command](../help-command/index). It is populated when the server is installed by the `fill_help_table.sql` script. The other help tables are [help\_topic](../mysqlhelp_topic-table/index), [help\_category](../mysqlhelp_category-table/index) and [help\_keyword](../mysqlhelp_keyword-table/index). **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. The `mysql.help_relation` table contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `help_topic_id` | `int(10) unsigned` | NO | PRI | `NULL` | | | `help_keyword_id` | `int(10) unsigned` | NO | PRI | `NULL` | | Example ------- ``` ... | 106 | 456 | | 463 | 456 | | 468 | 456 | | 463 | 457 | | 194 | 458 | | 478 | 458 | | 374 | 459 | | 459 | 459 | | 39 | 460 | | 58 | 460 | | 185 | 460 | | 264 | 460 | | 269 | 460 | | 209 | 461 | | 468 | 461 | | 201 | 462 | | 468 | 463 | +---------------+-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Galera 5.5 Changelogs MariaDB Galera 5.5 Changelogs ============================== Changelogs for [MariaDB Galera 5.5](../what-is-mariadb-galera-cluster/index) releases. | Title | Description | | --- | --- | | [MariaDB Galera Cluster 5.5.63 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5563-changelog/) | Status: Stable (GA) | Release Date: 1 Feb 2019 | | [MariaDB Galera Cluster 5.5.62 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5562-changelog/) | Status: Stable (GA) | Release Date: 31 Oct 2018 | | [MariaDB Galera Cluster 5.5.61 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5561-changelog/) | Status: Stable (GA) | Release Date: 3 Aug 2018 | | [MariaDB Galera Cluster 5.5.60 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5560-changelog/) | Status: Stable (GA) | Release Date: 3 May 2018 | | [MariaDB Galera Cluster 5.5.59 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5559-changelog/) | Status: Stable (GA) | Release Date: 23 Jan 2018 | | [MariaDB Galera Cluster 5.5.58 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5558-changelog/) | Status: Stable (GA) | Release Date: 25 Oct 2017 | | [MariaDB Galera Cluster 5.5.57 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5557-changelog/) | Status: Stable (GA) | Release Date: 26 Jul 2017 | | [MariaDB Galera Cluster 5.5.56 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5556-changelog/) | Status: Stable (GA) | Release Date: 22 Apr 2017 | | [MariaDB Galera Cluster 5.5.55 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5555-changelog/) | Status: Stable (GA) | Release Date: 22 Apr 2017 | | [MariaDB Galera Cluster 5.5.54 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5554-changelog/) | Status: Stable (GA) | Release Date: 4 Jan 2017 | | [MariaDB Galera Cluster 5.5.53 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5553-changelog/) | Status: Stable (GA) | Release Date: 20 Oct 2016 | | [MariaDB Galera Cluster 5.5.52 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5552-changelog/) | Status: Stable (GA) | Release Date: 21 Sep 2016 | | [MariaDB Galera Cluster 5.5.51 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5551-changelog/) | Status: Stable (GA) | Release Date: 15 Aug 2016 | | [MariaDB Galera Cluster 5.5.50 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5550-changelog/) | Status: Stable (GA) | Release Date: 1 Jul 2016 | | [MariaDB Galera Cluster 5.5.49 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5549-changelog/) | Status: Stable (GA) | Release Date: 26 Apr 2016 | | [MariaDB Galera Cluster 5.5.48 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5548-changelog/) | Status: Stable (GA) | Release Date: 23 Feb 2016 | | [MariaDB Galera Cluster 5.5.47 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5547-changelog/) | Status: Stable (GA) | Release Date: 24 Dec 2015 | | [MariaDB Galera Cluster 5.5.46 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5546-changelog/) | Status: Stable (GA) | Release Date: 20 Oct 2015 | | [MariaDB Galera Cluster 5.5.45 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5545-changelog/) | Status: Stable (GA) | Release Date: 18 Aug 2015 | | [MariaDB Galera Cluster 5.5.44 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5544-changelog/) | Status: Stable (GA) | Release Date: 27 Jun 2015 | | [MariaDB Galera Cluster 5.5.43 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5543-changelog/) | Status: Stable (GA) | Release Date: 15 May 2015 | | [MariaDB Galera Cluster 5.5.42 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5542-changelog/) | Status: Stable (GA) | Release Date: 11 Mar 2015 | | [MariaDB Galera Cluster 5.5.41 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5541-changelog/) | Status: Stable (GA) | Release Date: 6 Jan 2015 | | [MariaDB Galera Cluster 5.5.40 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5540-changelog/) | Status: Stable (GA) | Release Date: 17 Oct 2014 | | [MariaDB Galera Cluster 5.5.39 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5539-changelog/) | Status: Stable (GA) | Release Date: 21 Aug 2014 | | [MariaDB Galera Cluster 5.5.38 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5538-changelog/) | Status: Stable (GA) | Release Date: 25 Jun 2014 | | [MariaDB Galera Cluster 5.5.37 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5537-changelog/) | Status: Stable (GA) | Release Date: 30 Apr 2014 | | [MariaDB Galera Cluster 5.5.36 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5536-changelog/) | Status: Stable (GA) | Release Date: 12 Mar 2014 | | [MariaDB Galera Cluster 5.5.35 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5535-changelog/) | Status: Stable (GA) | Release Date: 14 Feb 2014 | | [MariaDB Galera Cluster 5.5.34 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-5534-changelog/) | Status: Stable (GA) | Release Date: 18 Dec 2013 | | [MariaDB Galera 5.5.33a Changelog](https://mariadb.com/kb/en/mariadb-galera-5533a-changelog/) | Status: Stable (GA) | Release Date: 30 Sep 2013 | | [MariaDB Galera 5.5.32 Changelog](https://mariadb.com/kb/en/mariadb-galera-5532-changelog/) | Status: Stable (GA) | Release Date: 30 Aug 2013 | | [MariaDB Galera 5.5.29 Changelog](https://mariadb.com/kb/en/mariadb-galera-5529-changelog/) | Status: Stable (GA) | Release Date: 5 Mar 2013 | | [MariaDB Galera 5.5.28a Changelog](https://mariadb.com/kb/en/mariadb-galera-5528a-changelog/) | Status: Release Candidate (RC) | Release Date: 21 Dec 2012 | | [MariaDB Galera 5.5.25 Changelog](https://mariadb.com/kb/en/mariadb-galera-5525-changelog/) | Status: Alpha | Release Date: 4 Sep 2012 | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Status Variables Added in MariaDB 10.2 Status Variables Added in MariaDB 10.2 ====================================== This is a list of [status variables](../server-status-variables/index) that were added in the [MariaDB 10.2](../what-is-mariadb-102/index) series. | Variable | Added | | --- | --- | | [Com\_alter\_user](../server-status-variables/index#com_alter_user) | [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) | | [Com\_execute\_immediate](../server-status-variables/index#com_execute_immediate) | [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) | | [Com\_multi](../server-status-variables/index#com_multi) | [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) | | [Com\_show\_create\_user](../server-status-variables/index#com_show_create_user) | [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) | | [Innodb\_buffer\_pool\_resize\_status](../xtradbinnodb-server-status-variables/index#innodb_buffer_pool_resize_status) | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/) | | [Innodb\_encryption\_num\_key\_requests](../xtradbinnodb-server-status-variables/index#innodb_encryption_num_key_requests) | [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) | | [Innodb\_have\_punch\_hole](../xtradbinnodb-server-status-variables/index#innodb_have_punch_hole) | [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) | | [Innodb\_pages0read](../xtradbinnodb-server-status-variables/index#innodb_pages0_read) | [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) | | [Innodb\_scrub\_log](../xtradbinnodb-server-status-variables/index#innodb_scrub_log) | [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) | See Also -------- * [System variables added in MariaDB 10.2](../system-variables-added-in-mariadb-102/index) * [Status variables added in MariaDB 10.3](../status-variables-added-in-mariadb-103/index) * [Status variables added in MariaDB 10.1](../status-variables-added-in-mariadb-101/index) * [Status variables added in MariaDB 10.0](../status-variables-added-in-mariadb-100/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Navicat Navicat ======= [Navicat](http://www.navicat.com/products/navicat-for-mariadb) is a graphical front-end for MariaDB. It is a commercial product with several different versions (Navicat Premium, Navicat for MySQL, etc...) and different "editions" within those versions (Non-commercial, Standard, and Enterprise). Certain features are only available in certain editions/versions. Navicat is compatible with all versions of MariaDB and with MySQL 3.21 and above. It is available for Windows, MacOS, and Linux. In addition to standard client features, it includes: * a SQL Builder/Editor * a Data Modeling Tool (Enterprise version only) * Data/Structure Synchronization * Report Builder (Windows-only) * "Premium" version which can connect to MariaDB, MySQL, SQL Server, SQLite, Oracle, and PostgreSQL databases simultaneously. A [feature comparison matrix](http://www.navicat.com/products/navicat-for-mysql-feature-matrix) is available. More information, including pricing and "trial" versions, is available on the [Navicat website](http://www.navicat.com). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb EXECUTE Statement EXECUTE Statement ================= Syntax ------ ``` EXECUTE stmt_name [USING expression[, expression] ...] ``` **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**`EXECUTE` with expression as parameters was introduced in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Before that one could only use variables (@var\_name) as parameters. Description ----------- After preparing a statement with `[PREPARE](../prepare-statement/index)`, you execute it with an `EXECUTE` statement that refers to the prepared statement name. If the prepared statement contains any parameter markers, you must supply a `USING` clause that lists user variables containing the values to be bound to the parameters. Parameter values can be supplied only by user variables, and the `USING` clause must name exactly as many variables as the number of parameter markers in the statement. You can execute a given prepared statement multiple times, passing different variables to it or setting the variables to different values before each execution. If the specified statement has not been PREPAREd, an error similar to the following is produced: ``` ERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to EXECUTE ``` Example ------- See [example in PREPARE](../prepare-statement/index#example). See Also -------- * [EXECUTE IMMEDIATE](../execute-immediate/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb COLLATION COLLATION ========= Syntax ------ ``` COLLATION(str) ``` Description ----------- Returns the collation of the string argument. If `str` is not a string, it is considered as a binary string (so the function returns 'binary'). This applies to `NULL`, too. The return value is a string in the utf8 [character set](../data-types-character-sets-and-collations/index). See [Character Sets and Collations](../data-types-character-sets-and-collations/index). Examples -------- ``` SELECT COLLATION('abc'); +-------------------+ | COLLATION('abc') | +-------------------+ | latin1_swedish_ci | +-------------------+ SELECT COLLATION(_utf8'abc'); +-----------------------+ | COLLATION(_utf8'abc') | +-----------------------+ | utf8_general_ci | +-----------------------+ ``` See Also -------- * [String literals](../string-literals/index) * [CAST()](../cast/index) * [CONVERT()](../convert/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BLACKHOLE BLACKHOLE ========= The `BLACKHOLE` storage engine accepts data but does not store it and always returns an empty result. A table using the `BLACKHOLE` storage engine consists of a single .frm table format file, but no associated data or index files. This storage engine can be useful, for example, if you want to run complex filtering rules on a slave without incurring any overhead on a master. The master can run a `BLACKHOLE` storage engine, with the data replicated to the slave for processing. Installing the Plugin --------------------- Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing [INSTALL SONAME](../install-soname/index) or [INSTALL PLUGIN](../install-plugin/index). For example: ``` INSTALL SONAME 'ha_blackhole'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the [--plugin-load](../mysqld-options/index#-plugin-load) or the [--plugin-load-add](../mysqld-options/index#-plugin-load-add) options. This can be specified as a command-line argument to [mysqld](../mysqld-options/index) or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = ha_blackhole ``` Uninstalling the Plugin ----------------------- You can uninstall the plugin dynamically by executing [UNINSTALL SONAME](../uninstall-soname/index) or [UNINSTALL PLUGIN](../uninstall-plugin/index). For example: ``` UNINSTALL SONAME 'ha_blackhole'; ``` If you installed the plugin by providing the [--plugin-load](../mysqld-options/index#-plugin-load) or the [--plugin-load-add](../mysqld-options/index#-plugin-load-add) options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Using the BLACKHOLE Storage Engine ---------------------------------- ### Using with DML [INSERT](../insert/index), [UPDATE](../update/index), and [DELETE](../delete/index) statements all work with the `BLACKHOLE` storage engine. However, no data changes are actually applied. ### Using with Replication If the binary log is enabled, all SQL statements will be logged as usual, and replicated to any slave servers. However, since rows are not stored, it is important to use statement-based rather than the row or mixed format, as [UPDATE](../update/index) and [DELETE](../delete/index) statements are neither logged nor replicated. See [Binary Log Formats](../binary-log-formats/index). ### Using with Triggers Some [triggers](../triggers/index) work with the `BLACKHOLE` storage engine. `BEFORE` [triggers](../triggers/index) for [INSERT](../insert/index) statements are still activated. [Triggers](../triggers/index) for [UPDATE](../update/index) and [DELETE](../delete/index) statements are **not** activated. [Triggers](../triggers/index) with the `FOR EACH ROW` clause do not apply, since the tables have no rows. ### Using with Foreign Keys Foreign keys are not supported. If you convert an [InnoDB](../innodb/index) table to `BLACKHOLE`, then the foreign keys will disappear. If you convert the same table back to InnoDB, then you will have to recreate them. ### Using with Virtual Columns If you convert an [InnoDB](../innodb/index) table which contains [virtual columns](../virtual-columns/index) to `BLACKHOLE`, then it produces an error. ### Using with AUTO\_INCREMENT Because a BLACKHOLE table does not store data, it will not maintain the [AUTO\_INCREMENT](../auto_increment/index) value. If you are replicating to a table that can handle `AUTO_INCREMENT` columns, and are not explicitly setting the primary key auto-increment value in the [INSERT](../insert/index) query, or using the [SET](../set/index) [INSERT\_ID](../server-system-variables/index#insert_id) statement, inserts will fail on the slave due to duplicate keys. Limits ------ The maximum key size is: * 3500 bytes (>= [MariaDB 10.1.48](https://mariadb.com/kb/en/mariadb-10148-release-notes/), [MariaDB 10.2.35](https://mariadb.com/kb/en/mariadb-10235-release-notes/), [MariaDB 10.3.26](https://mariadb.com/kb/en/mariadb-10326-release-notes/), [MariaDB 10.4.16](https://mariadb.com/kb/en/mariadb-10416-release-notes/) and [MariaDB 10.5.7](https://mariadb.com/kb/en/mariadb-1057-release-notes/)) * 1000 bytes (<= [MariaDB 10.1.47](https://mariadb.com/kb/en/mariadb-10147-release-notes/), [MariaDB 10.2.34](https://mariadb.com/kb/en/mariadb-10234-release-notes/), [MariaDB 10.3.25](https://mariadb.com/kb/en/mariadb-10325-release-notes/), [MariaDB 10.4.15](https://mariadb.com/kb/en/mariadb-10415-release-notes/) and [MariaDB 10.5.6](https://mariadb.com/kb/en/mariadb-1056-release-notes/)). Examples -------- ``` CREATE TABLE table_name ( id int unsigned primary key not null, v varchar(30) ) ENGINE=BLACKHOLE; INSERT INTO table_name VALUES (1, 'bob'),(2, 'jane'); SELECT * FROM table_name; Empty set (0.001 sec) ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB 5.3 TODO not MariaDB 5.3 TODO not ==================== **Note:** This page is obsolete. The information is old, outdated, or otherwise currently incorrect. We are keeping the page for historical reasons only. **Do not** rely on the information in this article. This page lists things that were in plans for [MariaDB 5.3](../what-is-mariadb-53/index) but were not included after all. For the actual list of things that are still needed before 5.3 release, see [mariadb-53-todo](../mariadb-53-todo/index) Specific goals ============== Top-level worklog for all tasks: [MWL#91](http://askmonty.org/worklog/?tid=91) TODO per person before 5.3 can go beta ====================================== Sergey Petrunya --------------- In priority order: Timour Katchaounov ------------------ ### Optional tasks * Possibly: MWL#?? Remove double materialization in materialized subqueries ;In 5.5 * New tasks (moved from [MWL#89](http://askmonty.org/worklog/?tid=89)): + implement robust expensive predicate handling (is\_expensive), possibly in a separate task * performance tuning for all WL Michael "Monty" Widenius ------------------------ * mwl#?? VARCHAR and BLOB for HEAP tables (from ebay). + Waiting for ok from Ebay to use their code to start working on this. Igor Babaev ----------- ### [MWL#128](http://askmonty.org/worklog/?tid=128): Implement Block Nested Loop Hash Join **hash join over attributes with non-binary collation (not started, 1-2 weeks) (not critical)** ### MWL#?? (new) * Cost-based choice for join buffers (not started, 2 weeks, including review) ### [MWL#106](http://askmonty.org/worklog/?tid=106): Backport optimizations for derived tables and views The goal of this task is to backport the implementation of the late materialization of derived tables and views and the additional optimizations for derived tables/views from MySQL 6.0 code line to [MariaDB 5.3](../what-is-mariadb-53/index). * Done in a separate tree, probable requires refactoring. * Probable problems of merging with other tasks. (1 week) * Philip should start testing; Timour+Igor to define when bugs should be reported (not to be reported if bugs is also a subquery bug) Oleksandr "Sanja" Byelkin ------------------------- ### mwl#?? * Bitmap in tmp table keys ; 1-3 days Sergei Golubchik ---------------- * review query rewrite plugin contribution * review Kristian's replication tasks * [MWL#113](http://askmonty.org/worklog/?tid=113): many clustered keys (not only primary) * [MWL#114](http://askmonty.org/worklog/?tid=114): insert ignore ha\_extra hint * [MWL#151](http://askmonty.org/worklog/?tid=151): Phone home (done, just needs to be pushed) Kristian Nielsen ---------------- Tasks which should go in 5.3: * [MWL#116](http://askmonty.org/worklog/?tid=116): Group commit framework and implementation + Code complete, waiting for code review. + After review+fixes, need to supply info for documentation. * [MWL#136](http://askmonty.org/worklog/?tid=136): Cross-engine consistency for START TRANSACTION WITH CONSISTENT SNAPSHOT + Code complete, waiting for code review. + After review+fixes, need to supply info for documentation. * [MWL#163](http://askmonty.org/worklog/?tid=163): release of row locks in InnoDB during prepare + Code complete, waiting for code review. + After review+fixes, need to supply info for documentation. Tasks which are not critical for 5.3, but could go there: * PBXT part of [MWL#116](http://askmonty.org/worklog/?tid=116). + Waiting for response from Paul McCullagh. * [MWL#132](http://askmonty.org/worklog/?tid=132): TC plugin + Waiting for code review. Rolling features ================ * [MWL#92](http://askmonty.org/worklog/?tid=92): Subqueries backport: fix known semi-join subquery bugs * Consolidate the range query apis (need more info) * [MWL#115](http://askmonty.org/worklog/?tid=115): innodb statistics in the slow log * Tasks in [worklog](http://askmonty.org/worklog/index.pl?virtual=version:Server-5.3) * mwl#?? Optimized versions of users statistics (from google/facebook). + responsible: Monty + status: will do if Monty has time after VARCHAR and BLOB task + todo: review, change, possibly reimplement, est: 7 days work Testing ======= * Still a lot of open bugs at [Launchpad](https://bugs.launchpad.net/maria). * More testing to be decided later Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema file_instances Table Performance Schema file\_instances Table ======================================== Description ----------- The `file_instances` table lists instances of instruments seen by the Performance Schema when executing file I/O instrumentation, and the associated files. Only files that have been opened, and that have not been deleted, will be listed in the table. The [performance\_schema\_max\_file\_instances](../performance-schema-system-variables/index#performance_schema_max_file_instances) system variable specifies the maximum number of instrumented file objects. | Column | Description | | --- | --- | | `FILE_NAME` | File name. | | `EVENT_NAME` | Instrument name associated with the file. | | `OPEN_COUNT` | Open handles on the file. A value of greater than zero means that the file is currently open. | Example ------- ``` SELECT * FROM performance_schema.file_instances WHERE OPEN_COUNT>0; +----------------------------------------------------+--------------------------------------+------------+ | FILE_NAME | EVENT_NAME | OPEN_COUNT | +----------------------------------------------------+--------------------------------------+------------+ | /var/log/mysql/mariadb-bin.index | wait/io/file/sql/binlog_index | 1 | | /var/lib/mysql/ibdata1 | wait/io/file/innodb/innodb_data_file | 2 | | /var/lib/mysql/ib_logfile0 | wait/io/file/innodb/innodb_log_file | 2 | | /var/lib/mysql/ib_logfile1 | wait/io/file/innodb/innodb_log_file | 2 | | /var/lib/mysql/mysql/gtid_slave_pos.ibd | wait/io/file/innodb/innodb_data_file | 3 | | /var/lib/mysql/mysql/innodb_index_stats.ibd | wait/io/file/innodb/innodb_data_file | 3 | | /var/lib/mysql/mysql/innodb_table_stats.ibd | wait/io/file/innodb/innodb_data_file | 3 | ... ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_ISEMPTY ST\_ISEMPTY =========== Syntax ------ ``` ST_IsEmpty(g) IsEmpty(g) ``` Description ----------- IsEmpty is a function defined by the OpenGIS specification, but is not fully implemented by MariaDB or MySQL. Since MariaDB and MySQL do not support GIS EMPTY values such as POINT EMPTY, as implemented it simply returns `1` if the geometry value *`g`* is invalid, `0` if it is valid, and `NULL` if the argument is `NULL`. `ST_IsEmpty()` and `IsEmpty()` are synonyms. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb S3 Storage Engine Status Variables S3 Storage Engine Status Variables ================================== **MariaDB starting with [10.5](../what-is-mariadb-105/index)**The [S3 storage engine](../s3-storage-engine/index) has been available since [MariaDB 10.5.4](https://mariadb.com/kb/en/mariadb-1054-release-notes/). This page documents status variables related to the [S3 storage engine](../s3-storage-engine/index). See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with [SHOW STATUS](../show-status/index). See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `S3_pagecache_blocks_not_flushed` * **Description:** * **Scope:** * **Data Type:** * **Introduced:** [MariaDB 10.5](../what-is-mariadb-105/index) --- #### `S3_pagecache_blocks_unused` * **Description:** * **Scope:** * **Data Type:** * **Introduced:** [MariaDB 10.5](../what-is-mariadb-105/index) --- #### `S3_pagecache_blocks_used` * **Description:** * **Scope:** * **Data Type:** * **Introduced:** [MariaDB 10.5](../what-is-mariadb-105/index) --- #### `S3_pagecache_reads` * **Description:** * **Scope:** * **Data Type:** * **Introduced:** [MariaDB 10.5](../what-is-mariadb-105/index) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema events_stages_summary_by_thread_by_event_name Table Performance Schema events\_stages\_summary\_by\_thread\_by\_event\_name Table ============================================================================= The table lists stage events, summarized by thread and event name. It contains the following columns: | Column | Description | | --- | --- | | `THREAD_ID` | Thread associated with the event. Together with `EVENT_NAME` uniquely identifies the row. | | `EVENT_NAME` | Event name. Used together with `THREAD_ID` for grouping events. | | `COUNT_STAR` | Number of summarized events, which includes all timed and untimed events. | | `SUM_TIMER_WAIT` | Total wait time of the timed summarized events. | | `MIN_TIMER_WAIT` | Minimum wait time of the timed summarized events. | | `AVG_TIMER_WAIT` | Average wait time of the timed summarized events. | | `MAX_TIMER_WAIT` | Maximum wait time of the timed summarized events. | Example ------- ``` SELECT * FROM events_stages_summary_by_thread_by_event_name\G ... *************************** 2287. row *************************** THREAD_ID: 64 EVENT_NAME: stage/sql/Waiting for event metadata lock COUNT_STAR: 0 SUM_TIMER_WAIT: 0 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 0 MAX_TIMER_WAIT: 0 *************************** 2288. row *************************** THREAD_ID: 64 EVENT_NAME: stage/sql/Waiting for commit lock COUNT_STAR: 0 SUM_TIMER_WAIT: 0 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 0 MAX_TIMER_WAIT: 0 *************************** 2289. row *************************** THREAD_ID: 64 EVENT_NAME: stage/aria/Waiting for a resource COUNT_STAR: 0 SUM_TIMER_WAIT: 0 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 0 MAX_TIMER_WAIT: 0 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb COLUMN_ADD COLUMN\_ADD =========== Syntax ------ ``` COLUMN_ADD(dyncol_blob, column_nr, value [as type], [column_nr, value [as type]]...); COLUMN_ADD(dyncol_blob, column_name, value [as type], [column_name, value [as type]]...); ``` Description ----------- Adds or updates [dynamic columns](../dynamic-columns/index). * **`dyncol_blob`** must be either a valid dynamic columns blob (for example, `COLUMN_CREATE` returns such blob), or an empty string. * **`column_name`** specifies the name of the column to be added. If `dyncol_blob` already has a column with this name, it will be overwritten. * **`value`** specifies the new value for the column. Passing a NULL value will cause the column to be deleted. * **`as type`** is optional. See <#datatypes> section for a discussion about types. The return value is a dynamic column blob after the modifications. Examples -------- ``` UPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, "column_name", "value") WHERE id=1; ``` Note: `COLUMN_ADD()` is a regular function (just like `[CONCAT()](../concat/index)`), hence, in order to update the value in the table you have to use the `UPDATE ... SET dynamic_col=COLUMN_ADD(dynamic_col, ....)` pattern. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Disk-Based Joins ColumnStore Disk-Based Joins ============================ ### Introduction Joins are performed in-memory on the [UM](../columnstore-user-module/index) node. When a join operation exceeds the memory allocated on the UM for query joins, the query is aborted with an error code IDB-2001. Disk-based joins enable such queries to use disk for intermediate join data in case when the memory needed for join exceeds the memory limit on the UM. Although slower in performance as compared to a fully in-memory join, and bound by the temporary space on disk, it does allow such queries to complete. **Note:Disk-based joins does not include aggregation and DML joins.** The following variables in the ***HashJoin*** element in the Columnstore.xml configuration file relate to disk-based joins. Columnstore.xml resides in the etc directory for your installation(/usr/local/mariadb/columnstore/etc). * ***AllowDiskBasedJoin*** – Option to use disk-based joins. Valid values are Y (enabled) or N (disabled). Default is disabled. * ***TempFileCompression*** – Option to use compression for disk join files. Valid values are Y (use compressed files) or N (use non-compressed files). * ***TempFilePath*** – The directory path used for the disk joins. By default, this path is the tmp directory for your installation (i.e., /usr/local/mariadb/columnstore/tmp). Files (named infinidb-join-data\*) in this directory will be created and cleaned on an as needed basis. The entire directory is removed and recreated by ExeMgr at startup.) **Note: When using disk-based joins, it is strongly recommended that the TempFilePath reside on its own partition as the partition may fill up as queries are executed.** ### Per user join memory limit In addition to the system wide flags, at SQL global and session level, the following system variables exists for managing per user memory limit for joins. * ***infinidb\_um\_mem\_limit*** - A value for memory limit in MB per user. When this limit is exceeded by a join, it will switch to a disk-based join. By default the limit is not set (value of 0). For modification at the global level: In my.cnf file (typically /usr/local/mariadb/columnstore/mysql): ``` [mysqld] ... infinidb_um_mem_limit = value where value is the value in Mb for in memory limitation per user. ``` For modification at the session level, before issuing your join query from the SQL client, set the session variable as follows. ``` set infinidb_um_mem_limit = value ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb NOT BETWEEN NOT BETWEEN =========== Syntax ------ ``` expr NOT BETWEEN min AND max ``` Description ----------- This is the same as NOT (expr [BETWEEN](../between-and/index) min AND max). Note that the meaning of the alternative form `NOT expr BETWEEN min AND max` is affected by the `HIGH_NOT_PRECEDENCE` [SQL\_MODE](../sql-mode/index) flag. Examples -------- ``` SELECT 1 NOT BETWEEN 2 AND 3; +-----------------------+ | 1 NOT BETWEEN 2 AND 3 | +-----------------------+ | 1 | +-----------------------+ ``` ``` SELECT 'b' NOT BETWEEN 'a' AND 'c'; +-----------------------------+ | 'b' NOT BETWEEN 'a' AND 'c' | +-----------------------------+ | 0 | +-----------------------------+ ``` NULL: ``` SELECT 1 NOT BETWEEN 1 AND NULL; +--------------------------+ | 1 NOT BETWEEN 1 AND NULL | +--------------------------+ | NULL | +--------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb AES_DECRYPT AES\_DECRYPT ============ Syntax ------ ``` AES_DECRYPT(crypt_str,key_str) ``` Description ----------- This function allows decryption of data using the official AES (Advanced Encryption Standard) algorithm. For more information, see the description of `[AES\_ENCRYPT()](../aes_encrypt/index)`. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Spider FAQ Spider FAQ ========== ### What does "[ERROR] mysqld: Can't find record in 'spider\_tables'" mean? This happens when you have a Spider table defined that does not point to an existing table on a data node. ### Are there minimum Spider settings? ``` myisam-recover=FORCE,BACKUP ``` **MariaDB until [10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)** ``` optimizer_switch='engine_condition_pushdown=on' ``` **MariaDB until [10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/)**When using spider\_autoincrement\_mode = 0, partitioned Spider tables work as spider\_autoincrement\_mode = 1 see : [MDEV-21404](https://jira.mariadb.org/browse/MDEV-21404) ### What does "select spider\_ping\_table()" in the general log mean? This is used by Spider monitoring to ask other monitoring nodes the status of a table. ### Do I need a primary key on physical tables? Not having a primary key will generate errors for resynchronizing tables via spider\_copy\_table(). ### Can I use Spider on top of Galera shards? Yes, XA transactions can be disabled from Spider. Until Galera 4.0 fully supports xa transactions, spider can point to a maxscale proxy that can manage transparent node election in case of failure inside a shard group. Note that disabling XA will break cross shard WRITES in case of transaction ROLLBACK. This architecture need to be used with care if you have a highly transactional workload that can generate cross shard deadlocks. ### What are the most used architectures for Spider HA? * Delegation of shard node replication using asynchronous replication and slave election with GTID. * Delegation of shard node replication via active passive HA solutions. * Shard builds via replication into Spider tables is interesting when you can route READS to a pool of Spider nodes reattaching the shards. ### What are the most used architectures for Spider Map Reduce? * Map reduce in Spider is limited to a single table. Building spider on top of some views can eliminate the need to use joins. * Replication to universal tables to every shard is commonly used to enable the views on each shard. ### What about Grants on shards? * When using MRR and BKA (and you do so with network storage), when Spider needs to create temporary tables on the backends, use the CREATE TEMPORARY TABLES privilege. Spider can still switch to a lower performance solution using [spider\_bka\_mode=2](../spider-server-system-variables/index#spider_bka_mode), or Query push down or range predicate using [spider\_bka\_mode=0](../spider-server-system-variables/index#spider_bka_mode) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Full List of MariaDB Options, System and Status Variables Full List of MariaDB Options, System and Status Variables ========================================================= Alphabetical list of all [mysqld Options](../mysqld-options-full-list/index), [Server System Variables](../server-system-variables/index) and [Server Status Variables](../server-status-variables/index). The convention used is that variable names are listed with '\_' and options with '-'. If a variable and option both exist, both versions are listed for easy searching. | Name | | --- | | [-a (--ansii)](../mysqld-options/index#-a-ansi) | | [--abort-slave-event-count](../mysqld-options/index#-abort-slave-event-count) | | [Aborted\_clients](../server-status-variables/index#aborted_clients) | | [Aborted\_connects](../server-status-variables/index#aborted_connects) | | [Aborted\_connects\_preauth](../server-status-variables/index#aborted_connects) | | [Access\_denied\_errors](../server-status-variables/index#access_denied_errors) | | [Acl\_column\_grants](../server-status-variables/index#acl_column_grants) | | [Acl\_database\_grants](../server-status-variables/index#acl_database_grants) | | [Acl\_function\_grants](../server-status-variables/index#acl_function_grants) | | [Acl\_package\_body\_grants](../server-status-variables/index#acl_package_body_grants) | | [Acl\_package\_spec\_grants](../server-status-variables/index#acl_package_spec_grants) | | [Acl\_procedure\_grants](../server-status-variables/index#acl_procedure_grants) | | [Acl\_proxy\_users](../server-status-variables/index#acl_proxy_users) | | [Acl\_role\_grants](../server-status-variables/index#acl_role_grants) | | [Acl\_roles](../server-status-variables/index#acl_roles) | | [Acl\_table\_grants](../server-status-variables/index#acl_table_grants) | | [Acl\_users](../server-status-variables/index#acl_users) | | --[allow-suspicious-udfs](../mysqld-options/index#-allow-suspicious-udfs) | | --[alter-algorithm](../server-system-variables/index#alter_algorithm), [alter\_algorithm](../server-system-variables/index#alter_algorithm) | | --[analyze-sample-percentage](../server-system-variables/index#analyze_sample_percentage), [analyze\_sample\_percentage](../server-system-variables/index#analyze_sample_percentage) | | --[ansii](../mysqld-options/index#-a-ansi) | | --[aria-block-size](../aria-server-system-variables/index#aria_block_size), [aria\_block\_size](../aria-server-system-variables/index#aria_block_size) | | --[aria-checkpoint-interval](../aria-server-system-variables/index#aria_checkpoint_interval), [aria\_checkpoint\_interval](../aria-server-system-variables/index#aria_checkpoint_interval) | | --[aria-checkpoint-log-activity](../aria-server-system-variables/index#aria_checkpoint_log_activity), [aria\_checkpoint\_log\_activity](../aria-server-system-variables/index#aria_checkpoint_log_activity) | | --[aria-encrypt-tables](../aria-server-system-variables/index#aria_encrypt_tables), [aria\_encrypt\_tables](../aria-server-system-variables/index#aria_encrypt_tables) | | --[aria-force-start-after-recovery-failures](../aria-server-system-variables/index#aria_force_start_after_recovery_failures), [aria\_force\_start\_after\_recovery\_failures](../aria-server-system-variables/index#aria_force_start_after_recovery_failures) | | --[aria-group-commit](../aria-server-system-variables/index#aria_group_commit), [aria\_group\_commit](../aria-server-system-variables/index#aria_group_commit) | | --[aria-group-commit-interval](../aria-server-system-variables/index#aria_group_commit_interval), [aria\_group\_commit\_interval](../aria-server-system-variables/index#aria_group_commit_interval) | | --[aria-log-dir-path](../mysqld-options/index#-aria-log-dir-path) | | --[aria-log-file-size](../aria-server-system-variables/index#aria_log_file_size), [aria\_log\_file\_size](../aria-server-system-variables/index#aria_log_file_size) | | --[aria-log-purge-type](../aria-server-system-variables/index#aria_log_purge_type), [aria\_log\_purge\_type](../aria-server-system-variables/index#aria_log_purge_type) | | --[aria-max-sort-file-size](../aria-server-system-variables/index#aria_max_sort_file_size), [aria\_max\_sort\_file\_size](../aria-server-system-variables/index#aria_max_sort_file_size) | | --[aria-page-checksum](../aria-server-system-variables/index#aria_page_checksum), [aria\_page\_checksum](../aria-server-system-variables/index#aria_page_checksum) | | --[aria-pagecache-age-threshold](../aria-server-system-variables/index#aria_pagecache_age_threshold), [aria\_pagecache\_age\_threshold](../aria-server-system-variables/index#aria_pagecache_age_threshold) | | [Aria\_pagecache\_blocks\_not\_flushed](../aria-server-status-variables/index#aria_pagecache_blocks_not_flushed) | | [Aria\_pagecache\_blocks\_unused](../aria-server-status-variables/index#aria_pagecache_blocks_unused) | | [Aria\_pagecache\_blocks\_used](../aria-server-status-variables/index#aria_pagecache_blocks_used) | | --[aria-pagecache-buffer-size](../aria-server-system-variables/index#aria_pagecache_buffer_size), [aria\_pagecache\_buffer\_size](../aria-server-system-variables/index#aria_pagecache_buffer_size) | | --[aria-pagecache-division-limit](../aria-server-system-variables/index#aria_pagecache_division_limit), [aria\_pagecache\_division\_limit](../aria-server-system-variables/index#aria_pagecache_division_limit) | | --[aria-pagecache-file-hash-size](../aria-server-system-variables/index#aria_pagecache_file_hash_size), [aria\_pagecache\_file\_hash\_size](../aria-server-system-variables/index#aria_pagecache_file_hash_size) | | [Aria\_pagecache\_read\_requests](../aria-server-status-variables/index#aria_pagecache_read_requests) | | [Aria\_pagecache\_reads](../aria-server-status-variables/index#aria_pagecache_reads) | | [Aria\_pagecache\_write\_requests](../aria-server-status-variables/index#aria_pagecache_write_requests) | | [Aria\_pagecache\_writes](../aria-server-status-variables/index#aria_pagecache_writes) | | --[aria-recover](../aria-server-system-variables/index#aria_recover), [aria\_recover](../aria-server-system-variables/index#aria_recover) | | --[aria-recover-options](../aria-server-system-variables/index#aria_recover_options), [aria\_recover\_options](../aria-server-system-variables/index#aria_recover_options) | | --[aria-repair-threads](../aria-server-system-variables/index#aria_repair_threads), [aria\_repair\_threads](../aria-server-system-variables/index#aria_repair_threads) | | --[aria-sort-buffer-size](../aria-server-system-variables/index#aria_sort_buffer_size), [aria\_sort\_buffer\_size](../aria-server-system-variables/index#aria_sort_buffer_size) | | --[aria-stats-method](../aria-server-system-variables/index#aria_stats_method), [aria\_stats\_method](../aria-server-system-variables/index#aria_stats_method) | | --[aria-sync-log-dir](../aria-server-system-variables/index#aria_sync_log_dir), [aria\_sync\_log\_dir](../aria-server-system-variables/index#aria_sync_log_dir) | | [Aria\_transaction\_log\_syncs](../aria-server-status-variables/index#aria_transaction_log_syncs) | | [aria\_used\_for\_temp\_tables](../aria-server-system-variables/index#aria_used_for_temp_tables) | | --[autocommit](../server-system-variables/index#autocommit), [autocommit](../server-system-variables/index#autocommit) | | --[auto-increment-increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment), [auto\_increment\_increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) | | --[auto-increment-offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset), [auto\_increment\_offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset) | | --[automatic-sp-privileges](../server-system-variables/index#automatic_sp_privileges), [automatic\_sp\_privileges](../server-system-variables/index#automatic_sp_privileges) | | [aws\_key\_management\_key\_spec](../aws-key-management-encryption-plugin/index#aws_key_management_key_spec) | | [aws\_key\_management\_log\_level](../aws-key-management-encryption-plugin/index#aws_key_management_log_level) | | [aws\_key\_management\_master\_key\_id](../aws-key-management-encryption-plugin/index#aws_key_management_master_key_id) | | [aws\_key\_management\_mock](../aws-key-management-encryption-plugin/index#aws_key_management_mock) | | [aws\_key\_management\_region](../aws-key-management-encryption-plugin/index#aws_key_management_region) | | [aws\_key\_management\_request\_timeout](../aws-key-management-encryption-plugin/index#aws_key_management_request_timeout) | | [aws\_key\_management\_rotate\_key](../aws-key-management-encryption-plugin/index#aws_key_management_rotate_key) | | --[back-log](../server-system-variables/index#back_log), [back\_log](../server-system-variables/index#back_log) | | -b, --[basedir](../server-system-variables/index#basedir), [basedir](../server-system-variables/index#basedir) | | --[big-tables](../server-system-variables/index#big_tables), [big\_tables](../server-system-variables/index#big_tables) | | --[bind-address](../server-system-variables/index#bind_address), [bind\_address](../server-system-variables/index#bind_address) | | --[binlog-annotate-row-events](../replication-and-binary-log-server-system-variables/index#binlog_annotate_row_events), [binlog\_annotate\_row\_events](../replication-and-binary-log-server-system-variables/index#binlog_annotate_row_events) | | [Binlog\_bytes\_written](../replication-and-binary-log-server-status-variables/index#binlog_bytes_written) | | [Binlog\_cache\_disk\_use](../replication-and-binary-log-server-status-variables/index#binlog_cache_disk_use) | | --[binlog-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_cache_size), [binlog\_cache\_size](../replication-and-binary-log-server-system-variables/index#binlog_cache_size) | | [Binlog\_cache\_use](../replication-and-binary-log-server-status-variables/index#binlog_cache_use) | | --[binlog-checksum](../replication-and-binary-log-server-system-variables/index#binlog_checksum), [binlog\_checksum](../replication-and-binary-log-server-system-variables/index#binlog_checksum) | | --[binlog-commit-wait-count](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_count), [binlog\_commit\_wait\_count](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_count) | | --[binlog-commit-wait-count](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_usec), [binlog\_commit\_wait\_usec](../replication-and-binary-log-server-system-variables/index#binlog_commit_wait_count) | | [Binlog\_commits](../replication-and-binary-log-server-status-variables/index#binlog_commits) | | --[binlog-direct-non-transactional-updates](../replication-and-binary-log-server-system-variables/index#binlog_direct_non_transactional_updates), [binlog\_direct\_non\_transactional\_updates](../replication-and-binary-log-server-system-variables/index#binlog_direct_non_transactional_updates) | | --[binlog-do-db](../mysqld-options/index#-binlog-do-db) | | --[binlog-expire-logs-seconds](../replication-and-binary-log-server-system-variables/index#binlog_expire_logs_seconds), [binlog\_expire\_logs\_seconds](../replication-and-binary-log-server-system-variables/index#binlog_expire_logs_seconds) | | --[binlog-file-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_file_cache_size), [binlog\_file\_cache\_size](../replication-and-binary-log-server-system-variables/index#binlog_file_cache_size) | | --[binlog-format](../replication-and-binary-log-server-system-variables/index#binlog_format), [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) | | [Binlog\_group\_commits](../replication-and-binary-log-server-status-variables/index#binlog_group_commits) | | [Binlog\_group\_commit\_trigger\_count](../replication-and-binary-log-status-variables/index#binlog_group_commit_trigger_count) | | [Binlog\_group\_commit\_trigger\_lock\_wait](../replication-and-binary-log-status-variables/index#binlog_group_commit_trigger_lock_wait) | | [Binlog\_group\_commit\_trigger\_timeout](../replication-and-binary-log-status-variables/index#binlog_group_commit_trigger_timeout) | | --[binlog-ignore-db](../mysqld-options/index#-binlog-ignore-db) | | --[binlog-optimize-thread-scheduling](../replication-and-binary-log-server-system-variables/index#binlog_optimize_thread_scheduling), [binlog\_optimize\_thread\_scheduling](../replication-and-binary-log-server-system-variables/index#binlog_optimize_thread_scheduling) | | --[binlog-row-image](../replication-and-binary-log-server-system-variables/index#binlog_row_image), [binlog\_row\_image](../replication-and-binary-log-server-system-variables/index#binlog_row_image) | | --[binlog-row-metadata](../replication-and-binary-log-server-system-variables/index#binlog_row_metadata), [binlog\_row\_metadata](../replication-and-binary-log-server-system-variables/index#binlog_row_metadata) | | --[binlog-row-event-max-size](../mysqld-options/index#-binlog-row-event-max-size) | | [Binlog\_snapshot\_file](../replication-and-binary-log-server-status-variables/index#binlog_snapshot_file) | | [Binlog\_snapshot\_position](../replication-and-binary-log-server-status-variables/index#binlog_snapshot_position) | | [Binlog\_stmt\_cache\_disk\_use](../replication-and-binary-log-server-status-variables/index#binlog_stmt_cache_disk_use) | | [Binlog\_stmt\_cache\_use](../replication-and-binary-log-server-status-variables/index#binlog_stmt_cache_use) | | --[binlog-stmt-cache-size](../replication-and-binary-log-server-system-variables/index#binlog_stmt_cache_size), [binlog\_stmt\_cache\_size](../replication-and-binary-log-server-system-variables/index#binlog_stmt_cache_size) | | --[bootstrap](../mysqld-options/index#-bootstrap) | | --[bulk\_insert-buffer-size](../server-system-variables/index#bulk_insert_buffer_size), [bulk\_insert\_buffer\_size](../server-system-variables/index#bulk_insert_buffer_size) | | [Busy\_time](../server-status-variables/index#busy_time) | | [Bytes\_received](../server-status-variables/index#bytes_received) | | [Bytes\_sent](../server-status-variables/index#bytes_sent) | | [cassandra\_default\_thrift\_host](../cassandra-system-variables/index#cassandra_default_thrift_host) | | [cassandra\_failure\_retries](../cassandra-system-variables/index#cassandra_failure_retries) | | [cassandra\_insert\_batch\_size](../cassandra-system-variables/index#cassandra_insert_batch_size) | | [cassandra\_multiget\_batch\_size](../cassandra-system-variables/index#cassandra_multiget_batch_size) | | [Cassandra\_multiget\_keys\_scanned](../cassandra-status-variables/index#cassandra_multiget_keys_scanned) | | [Cassandra\_multiget\_reads](../cassandra-status-variables/index#cassandra_multiget_reads) | | [Cassandra\_multiget\_rows\_read](../cassandra-status-variables/index#cassandra_multiget_rows_read) | | [Cassandra\_network\_exceptions](../cassandra-status-variables/index#cassandra_network_exceptions) | | [cassandra\_read\_consistency](../cassandra-system-variables/index#cassandra_read_consistency) | | [cassandra\_rnd\_batch\_size](../cassandra-system-variables/index#cassandra_rnd_batch_size) | | [Cassandra\_row\_inserts](../cassandra-status-variables/index#cassandra_row_inserts) | | [Cassandra\_row\_insert\_batches](../cassandra-status-variables/index#cassandra_row_insert_batches) | | [Cassandra\_timeout\_exceptions](../cassandra-status-variables/index#cassandra_timeout_exceptions) | | [Cassandra\_unavailable\_exceptions](../cassandra-status-variables/index#cassandra_unavailable_exceptions) | | [cassandra\_write\_consistency](../cassandra-system-variables/index#cassandra_write_consistency) | | [character\_set\_client](../server-system-variables/index#character_set_client) | | --[character-set-client-handshake](../mysqld-options/index#-character-set-client-handshake) | | [character\_set\_connection](../server-system-variables/index#character_set_connection) | | [character\_set\_database](../server-system-variables/index#character_set_database) | | --[character-set-filesystem](../server-system-variables/index#character_set_filesystem), [character\_set\_filesystem](../server-system-variables/index#character_set_filesystem) | | [character\_set\_results](../server-system-variables/index#character_set_results) | | -C, --[character-set-server](../server-system-variables/index#character_set_server), [character\_set\_server](../server-system-variables/index#character_set_server) | | [character\_set\_system](../server-system-variables/index#character_set_system) | | --[character-sets-dir](../server-system-variables/index#character_sets_dir), [character\_sets\_dir](../server-system-variables/index#character_sets_dir) | | --[check-constraint-checks](../server-system-variables/index#check_constraint_checks), [check\_constraint\_checks](../server-system-variables/index#check_constraint_checks) | | -r, --[chroot](../mysqld-options/index#-chroot) | | [collation\_connection](../server-system-variables/index#collation_connection) | | [collation\_database](../server-system-variables/index#collation_database) | | --[collation-server](../server-system-variables/index#collation_server), [collation\_server](../server-system-variables/index#collation_server) | | [Column\_compressions](../storage-engine-independent-column-compression/index#column_compressions) | | --[column-compression-threshold](../storage-engine-independent-column-compression/index#column_compression_threshold), [column\_compression\_threshold](../storage-engine-independent-column-compression/index#column_compression_threshold) | | --[column-compression-zlib-level](../storage-engine-independent-column-compression/index#column_compression_zlib_level), [column\_compression\_zlib\_level](../storage-engine-independent-column-compression/index#column_compression_zlib_level) | | --[column-compression-zlib-strategy](../storage-engine-independent-column-compression/index#column_compression_zlib_strategy), [column\_compression\_zlib\_strategy](../storage-engine-independent-column-compression/index#column_compression_zlib_strategy) | | --[column-compression-zlib-wrap](../storage-engine-independent-column-compression/index#column_compression_zlib_wrap), [column\_compression\_zlib\_wrap](../storage-engine-independent-column-compression/index#column_compression_zlib_wrap) | | [Column\_decompressions](../storage-engine-independent-column-compression/index#column_compressions) | | [Com\_admin\_commands](../server-status-variables/index#com_admin_commands) | | [Com\_alter\_db](../server-status-variables/index#com_alter_db) | | [Com\_alter\_db\_upgrade](../server-status-variables/index#com_alter_db_upgrade) | | [Com\_alter\_event](../server-status-variables/index#com_alter_event) | | [Com\_alter\_function](../server-status-variables/index#com_alter_function) | | [Com\_alter\_procedure](../server-status-variables/index#com_alter_procedure) | | [Com\_alter\_sequence](../server-status-variables/index#com_alter_sequence) | | [Com\_alter\_server](../server-status-variables/index#com_alter_server) | | [Com\_alter\_table](../server-status-variables/index#com_alter_table) | | [Com\_alter\_tablespace](../server-status-variables/index#com_alter_tablespace) | | [Com\_alter\_user](../server-status-variables/index#com_alter_user) | | [Com\_analyze](../server-status-variables/index#com_analyze) | | [Com\_assign\_to\_keycache](../server-status-variables/index#com_assign_to_keycache) | | [Com\_backup](../server-status-variables/index#com_backup) | | [Com\_backup\_lock](../server-status-variables/index#com_backup_lock) | | [Com\_backup\_table](../server-status-variables/index#com_backup_table) | | [Com\_begin](../server-status-variables/index#com_begin) | | [Com\_binlog](../server-status-variables/index#com_binlog) | | [Com\_call\_procedure](../server-status-variables/index#com_call_procedure) | | [Com\_change\_db](../server-status-variables/index#com_change_db) | | [Com\_change\_master](../replication-and-binary-log-server-status-variables/index#com_change_master) | | [Com\_check](../server-status-variables/index#com_check) | | [Com\_checksum](../server-status-variables/index#com_checksum) | | [Com\_commit](../server-status-variables/index#com_commit) | | [Com\_compound\_sql](../server-status-variables/index#com_compound_sql) | | [Com\_create\_db](../server-status-variables/index#com_create_db) | | [Com\_create\_event](../server-status-variables/index#com_create_event) | | [Com\_create\_function](../server-status-variables/index#com_create_function) | | [Com\_create\_index](../server-status-variables/index#com_create_index) | | [Com\_create\_package](../server-status-variables/index#com_create_package) | | [Com\_create\_package\_body](../server-status-variables/index#com_create_package_body) | | [Com\_create\_procedure](../server-status-variables/index#com_create_procedure) | | [Com\_create\_role](../server-status-variables/index#com_create_role) | | [Com\_create\_sequence](../server-status-variables/index#com_create_sequence) | | [Com\_create\_server](../server-status-variables/index#com_create_server) | | [Com\_create\_table](../server-status-variables/index#com_create_table) | | [Com\_create\_temporary\_table](../server-status-variables/index#com_create_temporary_table) | | [Com\_create\_trigger](../server-status-variables/index#com_create_trigger) | | [Com\_create\_udf](../server-status-variables/index#com_create_udf) | | [Com\_create\_user](../server-status-variables/index#com_create_user) | | [Com\_create\_view](../server-status-variables/index#com_create_view) | | [Com\_dealloc\_sql](../server-status-variables/index#com_dealloc_sql) | | [Com\_delete](../server-status-variables/index#com_delete) | | [Com\_delete\_multi](../server-status-variables/index#com_delete_multi) | | [Com\_do](../server-status-variables/index#com_do) | | [Com\_drop\_db](../server-status-variables/index#com_drop_db) | | [Com\_drop\_event](../server-status-variables/index#com_drop_event) | | [Com\_drop\_function](../server-status-variables/index#com_drop_function) | | [Com\_drop\_index](../server-status-variables/index#com_drop_index) | | [Com\_drop\_package](../server-status-variables/index#com_drop_package) | | [Com\_drop\_package\_body](../server-status-variables/index#com_drop_package_body) | | [Com\_drop\_procedure](../server-status-variables/index#com_drop_procedure) | | [Com\_drop\_role](../server-status-variables/index#com_drop_role) | | [Com\_drop\_sequence](../server-status-variables/index#com_drop_sequence) | | [Com\_drop\_server](../server-status-variables/index#com_drop_server) | | [Com\_drop\_table](../server-status-variables/index#com_drop_table) | | [Com\_drop\_temporary\_table](../server-status-variables/index#com_drop_temporary_table) | | [Com\_drop\_trigger](../server-status-variables/index#com_drop_trigger) | | [Com\_drop\_user](../server-status-variables/index#com_drop_user) | | [Com\_drop\_user](../server-status-variables/index#com_drop_user) | | [Com\_drop\_view](../server-status-variables/index#com_drop_view) | | [Com\_empty\_query](../server-status-variables/index#com_empty_query) | | [Com\_execute\_immediate](../server-status-variables/index#com_execute_immediate) | | [Com\_execute\_sql](../server-status-variables/index#com_execute_sql) | | [Com\_flush](../server-status-variables/index#com_flush) | | [Com\_get\_diagnostics](../server-status-variables/index#com_get_diagnostics) | | [Com\_grant](../server-status-variables/index#com_grant) | | [Com\_grant\_role](../server-status-variables/index#com_grant_role) | | [Com\_ha\_close](../server-status-variables/index#com_ha_close) | | [Com\_ha\_open](../server-status-variables/index#com_ha_open) | | [Com\_ha\_read](../server-status-variables/index#com_ha_read) | | [Com\_help](../server-status-variables/index#com_help) | | [Com\_insert](../server-status-variables/index#com_insert) | | [Com\_insert\_select](../server-status-variables/index#com_insert_select) | | [Com\_install\_plugin](../server-status-variables/index#com_install_plugin) | | [Com\_kill](../server-status-variables/index#com_kill) | | [Com\_load](../server-status-variables/index#com_load) | | [Com\_load\_master\_data](../server-status-variables/index#com_load_master_data) | | [Com\_load\_master\_table](../server-status-variables/index#com_load_master_table) | | [Com\_lock\_tables](../server-status-variables/index#com_lock_tables) | | [Com\_multi](../server-status-variables/index#com_multi) | | [Com\_optimize](../server-status-variables/index#com_optimize) | | [Com\_preload\_keys](../server-status-variables/index#com_preload_keys) | | [Com\_prepare\_sql](../server-status-variables/index#com_prepare_sql) | | [Com\_purge](../server-status-variables/index#com_purge) | | [Com\_purge\_before\_date](../server-status-variables/index#com_purge_before_date) | | [Com\_release\_savepoint](../server-status-variables/index#com_release_savepoint) | | [Com\_rename\_table](../server-status-variables/index#com_rename_table) | | [Com\_rename\_user](../server-status-variables/index#com_rename_user) | | [Com\_repair](../server-status-variables/index#com_repair) | | [Com\_replace](../server-status-variables/index#com_replace) | | [Com\_replace\_select](../server-status-variables/index#com_replace_select) | | [Com\_reset](../server-status-variables/index#com_reset) | | [Com\_resignal](../server-status-variables/index#com_resignal) | | [Com\_restore\_table](../server-status-variables/index#com_restore_table) | | [Com\_revoke](../server-status-variables/index#com_revoke) | | [Com\_revoke\_all](../server-status-variables/index#com_revoke_all) | | [Com\_revoke\_grant](../server-status-variables/index#com_revoke_grant) | | [Com\_rollback](../server-status-variables/index#com_rollback) | | [Com\_rollback\_to\_savepoint](../server-status-variables/index#com_rollback_to_savepoint) | | [Com\_savepoint](../server-status-variables/index#com_savepoint) | | [Com\_select](../server-status-variables/index#com_select) | | [Com\_set\_option](../server-status-variables/index#com_set_option) | | [Com\_show\_authors](../server-status-variables/index#com_show_authors) | | [Com\_show\_binlog\_events](../server-status-variables/index#com_show_binlog_events) | | [Com\_show\_binlogs](../server-status-variables/index#com_show_binlogs) | | [Com\_show\_charsets](../server-status-variables/index#com_show_charsets) | | [Com\_show\_client\_statistics](../server-status-variables/index#com_show_client_statistics) | | [Com\_show\_collations](../server-status-variables/index#com_show_collations) | | [Com\_show\_column\_types](../server-status-variables/index#com_show_column_types) | | [Com\_show\_contributors](../server-status-variables/index#com_show_contributors) | | [Com\_show\_create\_db](../server-status-variables/index#com_show_create_db) | | [Com\_show\_create\_event](../server-status-variables/index#com_show_create_event) | | [Com\_show\_create\_func](../server-status-variables/index#com_show_create_func) | | [Com\_show\_create\_package](../server-status-variables/index#com_show_create_package) | | [Com\_show\_create\_package\_body](../server-status-variables/index#com_show_create_package_body) | | [Com\_show\_create\_proc](../server-status-variables/index#com_show_create_proc) | | [Com\_show\_create\_table](../server-status-variables/index#com_show_create_table) | | [Com\_show\_create\_trigger](../server-status-variables/index#com_show_create_trigger) | | [Com\_show\_create\_user](../server-status-variables/index#com_show_create_user) | | [Com\_show\_databases](../server-status-variables/index#com_show_databases) | | [Com\_show\_engine\_logs](../server-status-variables/index#com_show_engine_logs) | | [Com\_show\_engine\_mutex](../server-status-variables/index#com_show_engine_mutex) | | [Com\_show\_engine\_status](../server-status-variables/index#com_show_engine_status) | | [Com\_show\_events](../server-status-variables/index#com_show_events) | | [Com\_show\_errors](../server-status-variables/index#com_show_errors) | | [Com\_show\_explain](../server-status-variables/index#com_show_explain) | | [Com\_show\_fields](../server-status-variables/index#com_show_fields) | | [Com\_show\_function\_status](../server-status-variables/index#com_show_function_status) | | [Com\_show\_generic](../server-status-variables/index#com_show_generic) | | [Com\_show\_grants](../server-status-variables/index#com_show_grants) | | [Com\_show\_keys](../server-status-variables/index#com_show_keys) | | [Com\_show\_index\_statistics](../server-status-variables/index#com_show_index_statistics) | | [Com\_show\_binlog\_status](../replication-and-binary-log-server-status-variables/index#com_show_binlog_status) | | [Com\_show\_master\_status](../replication-and-binary-log-server-status-variables/index#com_show_master_status) | | [Com\_show\_new\_master](../replication-and-binary-log-server-status-variables/index#com_show_new_master) | | [Com\_show\_open\_tables](../server-status-variables/index#com_show_open_tables) | | [Com\_show\_package\_status](../server-status-variables/index#com_show_package_status) | | [Com\_show\_package\_body\_status](../server-status-variables/index#com_show_package_body_status) | | [Com\_show\_plugins](../server-status-variables/index#com_show_plugins) | | [Com\_show\_privileges](../server-status-variables/index#com_show_privileges) | | [Com\_show\_procedure\_status](../server-status-variables/index#com_show_procedure_status) | | [Com\_show\_processlist](../server-status-variables/index#com_show_processlist) | | [Com\_show\_profile](../server-status-variables/index#com_show_profile) | | [Com\_show\_profiles](../server-status-variables/index#com_show_profiles) | | [Com\_show\_relaylog\_events](../server-status-variables/index#com_show_relaylog_events) | | [Com\_show\_slave\_hosts](../replication-and-binary-log-server-status-variables/index#com_show_slave_hosts) | | [Com\_show\_slave\_status](../replication-and-binary-log-server-status-variables/index#com_show_slave_status) | | [Com\_show\_status](../server-status-variables/index#com_show_status) | | [Com\_show\_storage\_engines](../server-status-variables/index#com_show_storage_engines) | | [Com\_show\_table\_statistics](../server-status-variables/index#com_show_table_statistics) | | [Com\_show\_table\_status](../server-status-variables/index#com_show_table_status) | | [Com\_show\_tables](../server-status-variables/index#com_show_tables) | | [Com\_show\_triggers](../server-status-variables/index#com_show_triggers) | | [Com\_show\_user\_statistics](../server-status-variables/index#com_show_user_statistics) | | [Com\_show\_variable](../server-status-variables/index#com_show_variable) | | [Com\_show\_warnings](../server-status-variables/index#com_show_warnings) | | [Com\_shutdown](../server-status-variables/index#com_shutdown) | | [Com\_signal](../server-status-variables/index#com_signal) | | [Com\_slave\_start](../replication-and-binary-log-server-status-variables/index#com_slave_start) | | [Com\_slave\_stop](../replication-and-binary-log-server-status-variables/index#com_slave_stop) | | [Com\_start\_all\_slaves](../replication-and-binary-log-server-status-variables/index#com_start_all_slaves) | | [Com\_start\_slave](../replication-and-binary-log-server-status-variables/index#com_start_slave) | | [Com\_stop\_all\_slaves](../replication-and-binary-log-server-status-variables/index#com_stop_all_slaves) | | [Com\_stop\_slave](../replication-and-binary-log-server-status-variables/index#com_stop_slave) | | [Com\_stmt\_close](../server-status-variables/index#com_stmt_close) | | [Com\_stmt\_execute](../server-status-variables/index#com_stmt_execute) | | [Com\_stmt\_fetch](../server-status-variables/index#com_stmt_fetch) | | [Com\_stmt\_prepare](../server-status-variables/index#com_stmt_prepare) | | [Com\_stmt\_reprepare](../server-status-variables/index#com_stmt_reprepare) | | [Com\_stmt\_reset](../server-status-variables/index#com_stmt_reset) | | [Com\_stmt\_send\_long\_data](../server-status-variables/index#com_stmt_send_long_data) | | [Com\_truncate](../server-status-variables/index#com_truncate) | | [Com\_uninstall\_plugin](../server-status-variables/index#com_uninstall_plugin) | | [Com\_unlock\_tables](../server-status-variables/index#com_unlock_tables) | | [Com\_update](../server-status-variables/index#com_update) | | [Com\_update\_multi](../server-status-variables/index#com_update_multi) | | [Com\_xa\_commit](../server-status-variables/index#com_xa_commit) | | [Com\_xa\_end](../server-status-variables/index#com_xa_end) | | [Com\_xa\_prepare](../server-status-variables/index#com_xa_prepare) | | [Com\_xa\_recover](../server-status-variables/index#com_xa_recover) | | [Com\_xa\_rollback](../server-status-variables/index#com_xa_rollback) | | [Com\_xa\_start](../server-status-variables/index#com_xa_start) | | --[completion-type](../server-system-variables/index#completion_type), [completion\_type](../server-system-variables/index#completion_type) | | [Compression](../server-status-variables/index#compression) | | --[concurrent-insert](../server-system-variables/index#concurrent_insert), [concurrent\_insert](../server-system-variables/index#concurrent_insert) | | --[connect-class-path](../connect-system-variables/index#connect_class_path), [connect\_class\_path](../connect-system-variables/index#connect_class_path) | | --[connect-cond-push](../connect-system-variables/index#connect_cond_push), [connect\_cond\_push](../connect-system-variables/index#connect_cond_push) | | --[connect-conv-size](../connect-system-variables/index#connect_conv_size), [connect\_conv\_size](../connect-system-variables/index#connect_conv_size) | | --[connect-default-depth](../connect-system-variables/index#connect_default_depth), [connect\_default\_depth](../connect-system-variables/index#connect_default_depth) | | --[connect-default-prec](../connect-system-variables/index#connect_default_prec), [connect\_default\_prec](../connect-system-variables/index#connect_default_prec) | | --[connect-enable-mongo](../connect-system-variables/index#connect_enable_mongo), [connect\_enable\_mongo](../connect-system-variables/index#connect_enable_mongo) | | --[connect-exact-info](../connect-system-variables/index#connect_exact_info), [connect\_exact\_info](../connect-system-variables/index#connect_exact_info) | | --[connect-force-bson](../connect-system-variables/index#connect_force_bson), [connect\_force\_bson](../connect-system-variables/index#connect_force_bson) | | --[connect-indx-map](../connect-system-variables/index#connect_indx_map), [connect\_indx\_map](../connect-system-variables/index#connect_indx_map) | | --[connect-java-wrapper](../connect-system-variables/index#connect_java_wrapper), [connect\_java\_wrapper](../connect-system-variables/index#connect_java_wrapper) | | --[connect-json-all-path](../connect-system-variables/index#connect_json_all_path), [connect\_json\_all\_path](../connect-system-variables/index#connect_json_all_path) | | --[connect-json-grp-size](../connect-system-variables/index#connect_json_grp_size), [connect\_json\_grp\_size](../connect-system-variables/index#connect_json_grp_size) | | --[connect-json-null](../connect-system-variables/index#connect_json_null), [connect\_json\_null](../connect-system-variables/index#connect_json_null) | | --[connect-jvm-path](../connect-system-variables/index#connect_jvm_path), [connect\_jvm\_path](../connect-system-variables/index#connect_jvm_path) | | --[connect-timeout](../server-system-variables/index#connect_timeout), [connect\_timeout](../server-system-variables/index#connect_timeout) | | --[connect-type-conv](../connect-system-variables/index#connect_type_conv), [connect\_type\_conv](../connect-system-variables/index#connect_type_conv) | | --[connect-use-tempfile](../connect-system-variables/index#connect_use_tempfile), [connect\_use\_tempfile](../connect-system-variables/index#connect_use_tempfile) | | --[connect-work-size](../connect-system-variables/index#connect_work_size), [connect\_work\_size](../connect-system-variables/index#connect_work_size) | | --[connect-xtrace](../connect-system-variables/index#connect_xtrace), [connect\_xtrace](../connect-system-variables/index#connect_xtrace) | | [Connection\_errors\_accept](../server-status-variables/index#connection_errors_accept) | | [Connection\_errors\_internal](../server-status-variables/index#connection_errors_internal) | | [Connection\_errors\_max\_connections](../server-status-variables/index#connection_errors_max_connections) | | [Connection\_errors\_peer\_address](../server-status-variables/index#connection_errors_peer_address) | | [Connection\_errors\_select](../server-status-variables/index#connection_errors_select) | | [Connection\_errors\_tcpwrap](../server-status-variables/index#connection_errors_tcpwrap) | | [Connections](../server-status-variables/index#connections) | | [--console](../mysqld-options/index#-console) | | [--core-file](../server-system-variables/index#core_file), [core\_file](../server-system-variables/index#core_file) | | [Cpu\_time](../server-status-variables/index#cpu_time) | | --[cracklib-password-check](../cracklib_password_check/index#cracklib_password_check) | | --[cracklib-password-check-dictionary](../cracklib_password_check/index#cracklib_password_check_dictionary), [cracklib\_password\_check-dictionary](../cracklib_password_check/index#cracklib_password_check_dictionary) | | [Created\_tmp\_disk\_tables](../server-status-variables/index#created_tmp_disk_tables) | | [Created\_tmp\_files](../server-status-variables/index#created_tmp_files) | | [Created\_tmp\_tables](../server-status-variables/index#created_tmp_tables) | | -h, --[datadir](../server-system-variables/index#datadir), [datadir](../server-system-variables/index#datadir) | | --[date-format](../server-system-variables/index#date_format), [date\_format](../server-system-variables/index#date_format) | | --[datetime-format](../server-system-variables/index#datetime_format), [datetime\_format](../server-system-variables/index#datetime_format) | | --[deadlock-search-depth-long](../aria-server-system-variables/index#deadlock_search_depth_long), [deadlock\_search\_depth\_long](../aria-server-system-variables/index#deadlock_search_depth_long) | | --[deadlock-search-depth-short](../aria-server-system-variables/index#deadlock_search_depth_short), [deadlock\_search\_depth\_short](../aria-server-system-variables/index#deadlock_search_depth_short) | | --[deadlock-timeout-long](../aria-server-system-variables/index#deadlock_timeout_long), [deadlock\_timeout\_long](../aria-server-system-variables/index#deadlock_timeout_long) | | --[deadlock-timeout-short](../aria-server-system-variables/index#deadlock_timeout_short), [deadlock\_timeout\_short](../aria-server-system-variables/index#deadlock_timeout_short) | | -#, --[debug](../server-system-variables/index#debug), [debug](../server-system-variables/index#debug) | | [--debug-assert-if-crashed-table](../mysqld-options/index#-debug-assert-if-crashed-table) | | [--debug-binlog-fsync-sleep](../mysqld-options/index#-debug-binlog-fsync-sleep) | | [--debug-crc-break](../mysqld-options/index#-debug-crc-break) | | [--debug-flush](../mysqld-options/index#-debug-flush) | | [--debug-no-sync](../mysqld-options/index#-debug-no-sync) | | --[debug-no-thread-alarm](../server-system-variables/index#debug_no_thread_alarm), [debug\_no\_thread\_alarm](../server-system-variables/index#debug_no_thread_alarm) | | [debug\_sync](../server-system-variables/index#debug_sync) | | [--debug-sync-timeout](../mysqld-options/index#-debug-sync-timeout) | | --[default-character-set](../mysqld-options/index#-default-character-set) | | --[default-master-connection](../replication-and-binary-log-server-system-variables/index#default_master_connection), [default\_master\_connection](../replication-and-binary-log-server-system-variables/index#default_master_connection) | | --[default-password-lifetime](../server-system-variables/index#default_password_lifetime), [default\_password\_lifetime](../server-system-variables/index#default_password_lifetime) | | --[default-regex-flags](../server-system-variables/index#default_regex_flags), [default\_regex\_flags](../server-system-variables/index#default_regex_flags) | | --[default-storage-engine](../server-system-variables/index#default_storage_engine), [default\_storage\_engine](../server-system-variables/index#default_storage_engine) | | --[default-table-type](../server-system-variables/index#default_table_type), [default\_table\_type](../server-system-variables/index#default_table_type) | | --[default-tmp-storage-engine](../server-system-variables/index#default_tmp_storage_engine), [default\_tmp\_storage\_engine](../server-system-variables/index#default_tmp_storage_engine) | | --[default-time-zone](../server-system-variables/index#time_zone) | | --[default-week-format](../server-system-variables/index#default_week_format), [default\_week\_format](../server-system-variables/index#default_week_format) | | --[defaults-extra-file](../mysqld-options/index#-defaults-extra-file) | | --[defaults-file](../mysqld-options/index#-defaults-file) | | --[delay-key-write](../server-system-variables/index#delay_key_write), [delay\_key\_write](../server-system-variables/index#delay_key_write) | | [Delayed\_errors](../server-status-variables/index#delayed_errors) | | --[delayed-insert-limit](../server-system-variables/index#delayed_insert_limit), [delayed\_insert\_limit](../server-system-variables/index#delayed_insert_limit) | | [Delayed\_insert\_threads](../server-status-variables/index#delayed_insert_threads) | | --[delayed-insert-timeout](../server-system-variables/index#delayed_insert_timeout), [delayed\_insert\_timeout](../server-system-variables/index#delayed_insert_timeout) | | --[delayed-queue-size](../server-system-variables/index#delayed_queue_size), [delayed\_queue\_size](../server-system-variables/index#delayed_queue_size) | | [Delayed\_writes](../server-status-variables/index#delayed_writes) | | [Delete\_scan](../server-status-variables/index#delete_scan) | | --[des-key-file](../mysqld-options/index#-des-key-file) | | --[disconnect-on-expired-password](../server-system-variables/index#disconnect_on_expired_password), [disconnect\_on\_expired\_password](../server-system-variables/index#disconnect_on_expired_password) | | --[disconnect-slave-event-count](../mysqld-options-full-list/index#-disconnect-slave-event-count) | | --[disks](../disks-plugin/index#disks) | | --[div-precision-increment](../server-system-variables/index#div_precision_increment), [div\_precision\_increment](../server-system-variables/index#div_precision_increment) | | [Empty\_queries](../server-status-variables/index#empty_queries) | | --[encrypt-binlog](../server-system-variables/index#encrypt_binlog), [encrypt\_binlog](../server-system-variables/index#encrypt_binlog) | | --[encrypt-tmp-disk-tables](../server-system-variables/index#encrypt_tmp_disk_tables), [encrypt\_tmp\_disk\_tables](../server-system-variables/index#encrypt_tmp_disk_tables) | | --[encrypt-tmp-files](../server-system-variables/index#encrypt_tmp_files), [encrypt\_tmp\_files](../server-system-variables/index#encrypt_tmp_files) | | --[encryption-algorithm](../server-system-variables/index#encryption_algorithm), [encryption\_algorithm](../server-system-variables/index#encryption_algorithm) | | [enforce\_storage\_engine](../server-system-variables/index#enforce_storage_engine) | | --[engine-condition-pushdown](../server-system-variables/index#engine_condition_pushdown), [engine\_condition\_pushdown](../server-system-variables/index#engine_condition_pushdown) | | --[eq-range-index-dive-limit](../server-system-variables/index#eq_range_index_dive_limit), [eq\_range\_index\_dive\_limit](../server-system-variables/index#eq_range_index_dive_limit) | | [error\_count](../server-system-variables/index#error_count) | | --[event-scheduler](../server-system-variables/index#event_scheduler), [event\_scheduler](../server-system-variables/index#event_scheduler) | | [Executed\_events](../server-status-variables/index#executed_events) | | [Executed\_triggers](../server-status-variables/index#executed_triggers) | | -T, --[exit-info](../mysqld-options-full-list/index#-exit-info) | | --[expensive-subquery-limit](../server-system-variables/index#expensive_subquery_limit), [expensive\_subquery\_limit](../server-system-variables/index#expensive_subquery_limit) | | --[expire-logs-days](../replication-and-binary-log-system-variables/index#expire_logs_days), [expire\_logs\_days](../replication-and-binary-log-system-variables/index#expire_logs_days) | | --[explicit-defaults-for-timestamp](../server-system-variables/index#explicit_defaults_for_timestamp), [explicit\_defaults\_for\_timestamp](../server-system-variables/index#explicit_defaults_for_timestamp) | | --[external-locking](../mysqld-options-full-list/index#-external-locking) | | [external\_user](../server-system-variables/index#external_user) | | --[extra-max-connections](../thread-pool-system-and-status-variables/index#extra_max_connections), [extra\_max\_connections](../thread-pool-system-and-status-variables/index#extra_max_connections) | | --[extra-port](../thread-pool-system-and-status-variables/index#extra_port), [extra\_port](../thread-pool-system-and-status-variables/index#extra_port) | | [Feature\_application\_time\_periods](../server-status-variables/index#feature_application_time_periods) | | [Feature\_check\_constraint](../server-status-variables/index#feature_check_constraint) | | [Feature\_custom\_aggregate\_functions](../server-status-variables/index#feature_custom_aggregate_functions) | | [Feature\_delay\_key\_write](../server-status-variables/index#feature_delay_key_write) | | [Feature\_dynamic\_columns](../server-status-variables/index#feature_dynamic_columns) | | [Feature\_fulltext](../server-status-variables/index#feature_fulltext) | | [Feature\_gis](../server-status-variables/index#feature_gis) | | [Feature\_insert\_returning](../server-status-variables/index#feature_insert_returning) | | [Feature\_invisible\_columns](../server-status-variables/index#feature_invisible_columns) | | [Feature\_json](../server-status-variables/index#feature_json) | | [Feature\_locale](../server-status-variables/index#feature_locale) | | [Feature\_subquery](../server-status-variables/index#feature_subquery) | | [Feature\_timezone](../server-status-variables/index#feature_timezone) | | [Feature\_trigger](../server-status-variables/index#feature_trigger) | | [Feature\_window\_functions](../server-status-variables/index#feature_window_functions) | | [Feature\_xml](../server-status-variables/index#feature_xml) | | --[feedback](../feedback-plugin/index#feedback) | | --[feedback-http-proxy](../feedback-plugin/index#feedback_http_proxy), [feedback\_http\_proxy](../feedback-plugin/index#feedback_http_proxy) | | --[feedback-send-retry-wait](../feedback-plugin/index#feedback_send_retry_wait), [feedback\_send\_retry\_wait](../feedback-plugin/index#feedback_send_retry_wait) | | --[feedback-send-timeout](../feedback-plugin/index#feedback_send_timeout), [feedback\_send\_timeout](../feedback-plugin/index#feedback_send_timeout) | | [feedback\_server\_uid](../feedback-plugin/index#feedback_server_uid) | | --[feedback-url](../feedback-plugin/index#feedback_url), [feedback\_url](../feedback-plugin/index#feedback_url) | | --[feedback-user-info](../feedback-plugin/index#feedback_user_info), [feedback\_user\_info](../feedback-plugin/index#feedback_user_info) | | --[file-key-management-encryption-algorithm](../file-key-management-encryption-plugin/index#file_key_management_encryption_algorithm), [file\_key\_management\_encryption\_algorithm](../file-key-management-encryption-plugin/index#file_key_management_encryption_algorithm) | | --[file-key-management-filekey](../file-key-management-encryption-plugin/index#file_key_management_filekey), [file\_key\_management\_filekey](../file-key-management-encryption-plugin/index#file_key_management_filekey) | | --[file-key-management-filename](../file-key-management-encryption-plugin/index#file_key_management_filename), [file\_key\_management\_filename](../file-key-management-encryption-plugin/index#file_key_management_filename) | | --[flashback](../mysqld-options/index#-flashback) | | --[flush](../server-system-variables/index#flush), [flush](../server-system-variables/index#flush) | | [Flush\_commands](../server-status-variables/index#flush_commands) | | --[flush-time](../server-system-variables/index#flush_time), [flush\_time](../server-system-variables/index#flush_time) | | [foreign\_key\_checks](../server-system-variables/index#foreign_key_checks) | | --[ft-boolean-syntax](../server-system-variables/index#ft_boolean_syntax), [ft\_boolean\_syntax](../server-system-variables/index#ft_boolean_syntax) | | --[ft-max-word-len](../server-system-variables/index#ft_max_word_len), [ft\_max\_word\_len](../server-system-variables/index#ft_max_word_len) | | --[ft-min-word-len](../server-system-variables/index#ft_min_word_len), [ft\_min\_word\_len](../server-system-variables/index#ft_min_word_len) | | --[ft-query-expansion-limit](../server-system-variables/index#ft_query_expansion_limit), [ft\_query\_expansion\_limit](../server-system-variables/index#ft_query_expansion_limit) | | --[ft-stopword-file](../server-system-variables/index#ft_stopword_file), [ft\_stopword\_file](../server-system-variables/index#ft_stopword_file) | | --[gdb](../mysqld-options/index#-gdb) | | --[general-log](../server-system-variables/index#general_log), [general\_log](../server-system-variables/index#general_log) | | --[general-log-file](../server-system-variables/index#general_log_file), [general\_log\_file](../server-system-variables/index#general_log_file) | | --[getopt-prefix-matching](../mysqld-options/index#-getopt-prefix-matching) | | --[group-concat-max-len](../server-system-variables/index#group_concat_max_len), [group\_concat\_max\_len](../server-system-variables/index#group_concat_max_len) | | --[gssapi-keytab-path](../authentication-plugin-gssapi/index#gssapi_keytab_path), [gssapi\_keytab\_path](../authentication-plugin-gssapi/index#gssapi_keytab_path) | | --[gssapi-principal-name](../authentication-plugin-gssapi/index#gssapi_principal_name), [gssapi\_principal\_name](../authentication-plugin-gssapi/index#gssapi_principal_name) | | --[gssapi-mech-name](../authentication-plugin-gssapi/index#gssapi_mech_name), [gssapi\_mech\_name](../authentication-plugin-gssapi/index#gssapi_mech_name) | | [gtid\_binlog\_pos](../global-transaction-id/index#gtid_binlog_pos) | | [gtid\_binlog\_state](../global-transaction-id/index#gtid_binlog_state) | | --[gtid-cleanup-batch-size](../global-transaction-id/index#gtid_cleanup_batch_size), [gtid\_cleanup\_batch\_size](../gtid/index#gtid_cleanup_batch_size) | | [gtid\_current\_pos](../global-transaction-id/index#gtid_current_pos) | | --[gtid-domain-id](../global-transaction-id/index#gtid_domain_id), [gtid\_domain\_id](../global-transaction-id/index#gtid_domain_id) | | --[gtid-ignore-duplicates](../global-transaction-id/index#gtid_ignore_duplicates), [gtid\_ignore\_duplicates](../global-transaction-id/index#gtid_ignore_duplicates) | | [gtid\_pos\_auto\_engines](../gtid/index#gtid_pos_auto_engines) | | [gtid\_seq\_no](../global-transaction-id/index#gtid_seq_no) | | [gtid\_slave\_pos](../global-transaction-id/index#gtid_slave_pos) | | --[gtid-strict-mode](../global-transaction-id/index#gtid_strict_mode), [gtid\_strict\_mode](../global-transaction-id/index#gtid_strict_mode) | | | | -h, --[datadir](../server-system-variables/index#datadir), [datadir](../server-system-variables/index#datadir) | | [Handler\_commit](../server-status-variables/index#handler_commit) | | [Handler\_delete](../server-status-variables/index#handler_delete) | | [Handler\_discover](../server-status-variables/index#handler_discover) | | [Handler\_external\_lock](../server-status-variables/index#handler_external_lock) | | [Handler\_icp\_attempts](../server-status-variables/index#handler_icp_attempts) | | [Handler\_icp\_match](../server-status-variables/index#handler_icp_match) | | [Handler\_mrr\_init](../server-status-variables/index#handler_mrr_init) | | [Handler\_mrr\_key\_refills](../server-status-variables/index#handler_mrr_key_refills) | | [Handler\_mrr\_rowid\_refills](../server-status-variables/index#handler_mrr_rowid_refills) | | [Handler\_prepare](../server-status-variables/index#handler_prepare) | | [Handler\_read\_first](../server-status-variables/index#handler_read_first) | | [Handler\_read\_key](../server-status-variables/index#handler_read_key) | | [Handler\_read\_last](../server-status-variables/index#handler_read_last) | | [Handler\_read\_next](../server-status-variables/index#handler_read_next) | | [Handler\_read\_prev](../server-status-variables/index#handler_read_prev) | | [Handler\_read\_retry](../server-status-variables/index#handler_read_retry) | | [Handler\_read\_rnd](../server-status-variables/index#handler_read_rnd) | | [Handler\_read\_rnd\_deleted](../server-status-variables/index#handler_read_rnd_deleted) | | [Handler\_read\_rnd\_next](../server-status-variables/index#handler_read_rnd_next) | | [Handler\_rollback](../server-status-variables/index#handler_rollback) | | [Handler\_savepoint](../server-status-variables/index#handler_savepoint) | | [Handler\_savepoint\_rollback](../server-status-variables/index#handler_savepoint_rollback) | | [Handler\_tmp\_delete](../server-status-variables/index#handler_tmp_delete) | | [Handler\_tmp\_update](../server-status-variables/index#handler_tmp_update) | | [Handler\_tmp\_write](../server-status-variables/index#handler_tmp_write) | | [Handler\_update](../server-status-variables/index#handler_update) | | [Handler\_write](../server-status-variables/index#handler_write) | | --[handlersocket-accept-balance](../handlersocket-configuration-options/index#handlersocket_accept_balance), [handlersocket\_accept\_balance](../handlersocket-configuration-options/index#handlersocket_accept_balance) | | --[handlersocket-address](../handlersocket-configuration-options/index#handlersocket_address), [handlersocket\_address](../handlersocket-configuration-options/index#handlersocket_address) | | --[handlersocket-backlog](../handlersocket-configuration-options/index#handlersocket_backlog), [handlersocket\_backlog](../handlersocket-configuration-options/index#handlersocket_backlog) | | --[handlersocket-epoll](../handlersocket-configuration-options/index#handlersocket_epoll), [handlersocket\_epoll](../handlersocket-configuration-options/index#handlersocket_epoll) | | --[handlersocket-plain-secret](../handlersocket-configuration-options/index#handlersocket_plain_secret), [handlersocket\_plain\_secret](../handlersocket-configuration-options/index#handlersocket_plain_secret) | | --[handlersocket-plain-secret-wr](../handlersocket-configuration-options/index#handlersocket_plain_secret_wr), [handlersocket\_plain\_secret\_wr](../handlersocket-configuration-options/index#handlersocket_plain_secret_wr) | | --[handlersocket-port](../handlersocket-configuration-options/index#handlersocket_port), [handlersocket\_port](../handlersocket-configuration-options/index#handlersocket_port) | | --[handlersocket-port-wr](../handlersocket-configuration-options/index#handlersocket_port_wr), [handlersocket\_port\_wr](../handlersocket-configuration-options/index#handlersocket_port_wr) | | --[handlersocket-rcvbuf](../handlersocket-configuration-options/index#handlersocket_rcvbuf), [handlersocket\_rcvbuf](../handlersocket-configuration-options/index#handlersocket_rcvbuf) | | --[handlersocket-readsize](../handlersocket-configuration-options/index#handlersocket_readsize), [handlersocket\_readsize](../handlersocket-configuration-options/index#handlersocket_readsize) | | --[handlersocket-sndbuf](../handlersocket-configuration-options/index#handlersocket_sndbuf), [handlersocket\_sndbuf](../handlersocket-configuration-options/index#handlersocket_sndbuf) | | --[handlersocket-threads](../handlersocket-configuration-options/index#handlersocket_threads), [handlersocket\_threads](../handlersocket-configuration-options/index#handlersocket_threads) | | --[handlersocket-threads\_wr](../handlersocket-configuration-options/index#handlersocket_threads_wr), [handlersocket\_threads\_wr](../handlersocket-configuration-options/index#handlersocket_threads_wr) | | --[handlersocket-timeout](../handlersocket-configuration-options/index#handlersocket_timeout), [handlersocket\_timeout](../handlersocket-configuration-options/index#handlersocket_timeout) | | --[handlersocket-verbose](../handlersocket-configuration-options/index#handlersocket_verbose), [handlersocket\_verbose](../handlersocket-configuration-options/index#handlersocket_verbose) | | --[handlersocket-wrlock-timeout](../handlersocket-configuration-options/index#handlersocket_wrlock_timeout), [handlersocket\_wrlock\_timeout](../handlersocket-configuration-options/index#handlersocket_wrlock_timeout) | | [hashicorp-key-management-cache-timeout](../hashicorp-key-management-plugin/index#hashicorp-key-management-cache-timeout) | | [hashicorp-key-management-cache-version-timeout](../hashicorp-key-management-plugin/index#hashicorp-key-management-cache-version-timeout) | | [hashicorp-key-management-caching-enabled](../hashicorp-key-management-plugin/index#hashicorp-key-management-caching-enabled) | | [hashicorp-key-management-check-kv-version](../hashicorp-key-management-plugin/index#hashicorp-key-management-check-kv-version) | | [hashicorp-key-management-retries](../hashicorp-key-management-plugin/index#hashicorp-key-management-retries) | | [hashicorp-key-management-timeout](../hashicorp-key-management-plugin/index#hashicorp-key-management-timeout) | | [hashicorp-key-management-token](../hashicorp-key-management-plugin/index#hashicorp-key-management-token) | | [hashicorp-key-management-use-cache-on-timeout](../hashicorp-key-management-plugin/index#hashicorp-key-management-use-cache-on-timeout) | | [hashicorp-key-management-vault-ca](../hashicorp-key-management-plugin/index#hashicorp-key-management-vault-ca) | | [hashicorp-key-management-vault-url](../hashicorp-key-management-plugin/index#hashicorp-key-management-vault-url) | | [have\_compress](../server-system-variables/index#have_compress) | | [have\_crypt](../server-system-variables/index#have_crypt) | | [have\_csv](../server-system-variables/index#have_csv) | | [have\_dynamic\_loading](../server-system-variables/index#have_dynamic_loading) | | [have\_geometry](../server-system-variables/index#have_geometry) | | [have\_innodb](../innodb-system-variables/index#have_innodb) | | [have\_ndbcluster](../server-system-variables/index#have_ndbcluster) | | [have\_openssl](../ssl-server-system-variables/index#have_openssl) | | [have\_partitioning](../server-system-variables/index#have_partitioning) | | [have\_profiling](../server-system-variables/index#have_profiling) | | [have\_query\_cache](../server-system-variables/index#have_query_cache) | | [have\_rtree\_keys](../server-system-variables/index#have_rtree_keys) | | [have\_ssl](../ssl-server-system-variables/index#have_ssl) | | [have\_symlink](../server-system-variables/index#have_symlink) | | --[help](../mysqld-options/index#-help) | | --[histogram-size](../server-system-variables/index#histogram_size), [histogram\_size](../server-system-variables/index#histogram_size) | | --[histogram-type](../server-system-variables/index#histogram_type), [histogram\_type](../server-system-variables/index#histogram_type) | | --[host-cache-size](../server-system-variables/index#host_cache_size), [host\_cache\_size](../server-system-variables/index#host_cache_size) | | [hostname](../server-system-variables/index#hostname) | | [identity](../server-system-variables/index#identity) | | --[idle-readonly-transaction-timeout](../server-system-variables/index#idle_readonly_transaction_timeout), [idle\_readonly\_transaction\_timeout](../server-system-variables/index#idle_readonly_transaction_timeout) | | --[idle-transaction-timeout](../server-system-variables/index#idle_transaction_timeout), [idle\_transaction\_timeout](../server-system-variables/index#idle_transaction_timeout) | | --[idle-write-transaction-timeout](../server-system-variables/index#idle_write_transaction_timeout), [idle\_write\_transaction\_timeout](../server-system-variables/index#idle_write_transaction_timeout) | | --[ignore-db-dirs](../server-system-variables/index#ignore_db_dirs), [ignore\_db\_dirs](../server-system-variables/index#ignore_db_dirs) | | --[ignore-builtin-innodb](../innodb-system-variables/index#ignore_builtin_innodb), [ignore\_builtin\_innodb](../innodb-system-variables/index#ignore_builtin_innodb) | | --[in-predicate-conversion-threshold](../server-system-variables/index#in_predicate_conversion_threshold), [in\_predicate\_conversion\_threshold](../server-system-variables/index#in_predicate_conversion_threshold) | | [in\_transaction](../server-system-variables/index#in_transaction) | | --[init-connect](../server-system-variables/index#init_connect), [init\_connect](../server-system-variables/index#init_connect) | | --[init-file](../server-system-variables/index#init_file), [init\_file](../server-system-variables/index#init_file) | | --[init-rpl-role](../mysqld-options-full-list/index#-init-rpl-role) | | --[init-slave](../replication-and-binary-log-server-system-variables/index#init_slave), [init\_slave](../replication-and-binary-log-server-system-variables/index#init_slave) | | --[innodb](../mysqld-options/index#-innodb) | | --[innodb-adaptive-checkpoint](../innodb-system-variables/index#innodb_adaptive_checkpoint), [innodb\_adaptive\_checkpoint](../innodb-system-variables/index#innodb_adaptive_checkpoint) | | --[innodb-adaptive-flushing](../innodb-system-variables/index#innodb_adaptive_flushing), [innodb\_adaptive\_flushing](../innodb-system-variables/index#innodb_adaptive_flushing) | | --[innodb-adaptive-flushing-lwm](../innodb-system-variables/index#innodb_adaptive_flushing_lwm), [innodb\_adaptive\_flushing\_lwm](../innodb-system-variables/index#innodb_adaptive_flushing_lwm) | | --[innodb\_adaptive-flushing-method](../innodb-system-variables/index#innodb_adaptive_flushing_method), [innodb\_adaptive\_flushing\_method](../innodb-system-variables/index#innodb_adaptive_flushing_method) | | [Innodb\_adaptive\_hash\_cells](../innodb-status-variables/index#innodb_adaptive_hash_cells) | | [Innodb\_adaptive\_hash\_hash\_searches](../innodb-status-variables/index#innodb_adaptive_hash_hash_searches) | | [Innodb\_adaptive\_hash\_heap\_buffers](../innodb-status-variables/index#innodb_adaptive_hash_heap_buffers) | | --[innodb-adaptive-hash-index](../innodb-system-variables/index#innodb_adaptive_hash_index), [innodb\_adaptive\_hash\_index](../innodb-system-variables/index#innodb_adaptive_hash_index) | | --[innodb-adaptive-hash-index-partitions](../innodb-system-variables/index#innodb_adaptive_hash_index_partitions), [innodb\_adaptive\_hash\_index\_partitions](../innodb-system-variables/index#innodb_adaptive_hash_index_partitions) | | --[innodb-adaptive-hash-index-parts](../innodb-system-variables/index#innodb_adaptive_hash_index_parts), [innodb\_adaptive\_hash\_index\_parts](../innodb-system-variables/index#innodb_adaptive_hash_index_parts) | | [Innodb\_adaptive\_hash\_non\_hash\_searches](../innodb-status-variables/index#innodb_adaptive_hash_non_hash_searches) | | --[innodb-adaptive-max-sleep-delay](../innodb-system-variables/index#innodb_adaptive_max_sleep_delay), [innodb\_adaptive\_max\_sleep\_delay](../innodb-system-variables/index#innodb_adaptive_max_sleep_delay) | | --[innodb-additional-mem-pool-size](../innodb-system-variables/index#innodb_additional_mem_pool_size), [innodb\_additional\_mem\_pool\_size](../innodb-system-variables/index#innodb_additional_mem_pool_size) | | --[innodb-api-bk-commit\_interval](../innodb-system-variables/index#innodb_api_bk_commit_interval), [innodb\_api\_bk\_commit\_interval](../innodb-system-variables/index#innodb_api_bk_commit_interval) | | --[innodb-api-disable-rowlock](../innodb-system-variables/index#innodb_api_disable_rowlock), [innodb\_api\_disable\_rowlock](../innodb-system-variables/index#innodb_api_disable_rowlock) | | --[innodb\_api\_enable\_binlog](../innodb-system-variables/index#innodb_api_enable_binlog), [innodb\_api\_enable\_binlog](../innodb-system-variables/index#innodb_api_enable_binlog) | | --[innodb-api-enable-mdl](../innodb-system-variables/index#innodb_api_enable_mdl), [innodb\_api\_enable\_mdl](../innodb-system-variables/index#innodb_api_enable_mdl) | | --[innodb-api-trx-level](../innodb-system-variables/index#innodb_api_trx_level), [innodb\_api\_trx\_level](../innodb-system-variables/index#innodb_api_trx_level) | | --[innodb-auto-lru-dump](../innodb-system-variables/index#innodb_auto_lru_dump), [innodb-auto-lru-dump](../innodb-system-variables/index#innodb_auto_lru_dump) | | --[innodb-autoextend-increment](../innodb-system-variables/index#innodb_autoextend_increment), [innodb\_autoextend\_increment](../innodb-system-variables/index#innodb_autoextend_increment) | | --[innodb-autoinc-lock-mode](../innodb-system-variables/index#innodb_autoinc_lock_mode), [innodb\_autoinc\_lock\_mode](../innodb-system-variables/index#innodb_autoinc_lock_mode) | | [Innodb\_available\_undo\_logs](../innodb-status-variables/index#innodb_available_undo_logs) | | [Innodb\_background\_log\_sync](../innodb-status-variables/index#innodb_background_log_sync) | | --[innodb-background-scrub-data-check-interval](../innodb-system-variables/index#innodb_background_scrub_data_check_interval), [innodb\_background\_scrub\_data\_check\_interval](../innodb-system-variables/index#innodb_background_scrub_data_check_interval) | | --[innodb-background-scrub-data-compressed](../innodb-system-variables/index#innodb_background_scrub_data_compressed), [innodb\_background\_scrub\_data\_compressed](../innodb-system-variables/index#innodb_background_scrub_data_compressed) | | --[innodb-background-scrub-data-interval](../innodb-system-variables/index#innodb_background_scrub_data_interval), [innodb\_background\_scrub\_data\_interval](../innodb-system-variables/index#innodb_background_scrub_data_interval) | | --[innodb-background-scrub-data-uncompressed](../innodb-system-variables/index#innodb_background_scrub_data_uncompressed), [innodb\_background\_scrub\_data\_uncompressed](../innodb-system-variables/index#innodb_background_scrub_data_uncompressed) | | --[innodb-blocking-buffer-pool-restore](../innodb-system-variables/index#innodb_blocking_buffer_pool_restore), [innodb\_blocking\_buffer\_pool\_restore](../innodb-system-variables/index#innodb_blocking_buffer_pool_restore) | | --[innodb-buf-dump-status-frequency](../innodb-system-variables/index#innodb_buf_dump_status_frequency), [innodb\_buf\_dump\_status\_frequency](../innodb-system-variables/index#innodb_buf_dump_status_frequency) | | [Innodb\_buffer\_pool\_bytes\_data](../innodb-status-variables/index#innodb_buffer_pool_bytes_data) | | [Innodb\_buffer\_pool\_bytes\_dirty](../innodb-status-variables/index#innodb_buffer_pool_bytes_dirty) | | --[innodb-buffer-pool-chunk-size](../innodb-system-variables/index#innodb_buffer_pool_chunk_size), [innodb\_buffer\_pool\_chunk\_size](../innodb-system-variables/index#innodb_buffer_pool_chunk_size) | | --[innodb-buffer-pool-dump-at-shutdown](../innodb-system-variables/index#innodb_buffer_pool_dump_at_shutdown), [innodb\_buffer\_pool\_dump\_at\_shutdown](../innodb-system-variables/index#innodb_buffer_pool_dump_at_shutdown) | | --[innodb-buffer-pool-dump-now](../innodb-system-variables/index#innodb_buffer_pool_dump_now), [innodb\_buffer\_pool\_dump\_now](../innodb-system-variables/index#innodb_buffer_pool_dump_now) | | --[innodb-buffer-pool-dump-pct](../innodb-system-variables/index#innodb_buffer_pool_dump_pct), [innodb\_buffer\_pool\_dump\_pct](../innodb-system-variables/index#innodb_buffer_pool_dump_pct) | | [Innodb\_buffer\_pool\_dump\_status](../innodb-status-variables/index#innodb_buffer_pool_dump_status) | | --[innodb-buffer-pool-evict](../innodb-system-variables/index#innodb_buffer_pool_evict), [innodb\_buffer\_pool\_evict](../innodb-system-variables/index#innodb_buffer_pool_evict) | | --[innodb-buffer-pool-filename](../innodb-system-variables/index#innodb_buffer_pool_filename), [innodb\_buffer\_pool\_filename](../innodb-system-variables/index#innodb_buffer_pool_filename) | | --[innodb-buffer-pool-instances](../innodb-system-variables/index#innodb_buffer_pool_instances), [innodb\_buffer\_pool\_instances](../innodb-system-variables/index#innodb_buffer_pool_instances) | | --[innodb-buffer-pool-load-abort](../innodb-system-variables/index#innodb_buffer_pool_load_abort), [innodb\_buffer\_pool\_load\_abort](../innodb-system-variables/index#innodb_buffer_pool_load_abort) | | --[innodb-buffer-pool-load-at-startup](../innodb-system-variables/index#innodb_buffer_pool_load_at_startup), [innodb\_buffer\_pool\_load\_at\_startup](../innodb-system-variables/index#innodb_buffer_pool_load_at_startup) | | --[innodb-buffer-pool-load-now](../innodb-system-variables/index#innodb_buffer_pool_load_now), [innodb\_buffer\_pool\_load\_now](../innodb-system-variables/index#innodb_buffer_pool_load_now) | | [Innodb\_buffer\_pool\_load\_incomplete](../innodb-status-variables/index#innodb_buffer_pool_load_pagesincomplete) | | --[innodb-buffer-pool-load-pages-abort](../innodb-system-variables/index#innodb_buffer_pool_load_pages_abort), [innodb\_buffer\_pool\_load\_pages\_abort](../innodb-system-variables/index#innodb_buffer_pool_load_pages_abort) | | [Innodb\_buffer\_pool\_load\_status](../innodb-status-variables/index#innodb_buffer_pool_load_status) | | [Innodb\_buffer\_pool\_pages\_data](../innodb-status-variables/index#innodb_buffer_pool_pages_data) | | [Innodb\_buffer\_pool\_pages\_dirty](../innodb-status-variables/index#innodb_buffer_pool_pages_dirty) | | [Innodb\_buffer\_pool\_pages\_flushed](../innodb-status-variables/index#innodb_buffer_pool_pages_flushed) | | [Innodb\_buffer\_pool\_pages\_LRU\_flushed](../innodb-status-variables/index#innodb_buffer_pool_pages_lru_flushed) | | [Innodb\_buffer\_pool\_pages\_LRU\_freed](../innodb-status-variables/index#innodb_buffer_pool_pages_lru_freed) | | [Innodb\_buffer\_pool\_pages\_free](../innodb-status-variables/index#innodb_buffer_pool_pages_free) | | [Innodb\_buffer\_pool\_pages\_made\_not\_young](../innodb-status-variables/index#innodb_buffer_pool_pages_made_not_young) | | [Innodb\_buffer\_pool\_pages\_made\_young](../innodb-status-variables/index#innodb_buffer_pool_pages_made_young) | | [Innodb\_buffer\_pool\_pages\_misc](../innodb-status-variables/index#innodb_buffer_pool_pages_misc) | | [Innodb\_buffer\_pool\_pages\_old](../innodb-status-variables/index#innodb_buffer_pool_pages_old) | | [Innodb\_buffer\_pool\_pages\_total](../innodb-status-variables/index#innodb_buffer_pool_pages_total) | | --[innodb-buffer-pool-populate](../innodb-system-variables/index#innodb_buffer_pool_populate), [innodb\_buffer\_pool\_populate](../innodb-system-variables/index#innodb_buffer_pool_populate) | | [Innodb\_buffer\_pool\_read\_ahead](../innodb-status-variables/index#innodb_buffer_pool_read_ahead) | | [Innodb\_buffer\_pool\_read\_ahead\_evicted](../innodb-status-variables/index#innodb_buffer_pool_read_ahead_evicted) | | [Innodb\_buffer\_pool\_read\_ahead\_rnd](../innodb-status-variables/index#innodb_buffer_pool_read_ahead_rnd) | | [Innodb\_buffer\_pool\_read\_requests](../innodb-status-variables/index#innodb_buffer_pool_read_requests) | | [Innodb\_buffer\_pool\_reads](../innodb-status-variables/index#innodb_buffer_pool_reads) | | [Innodb\_buffer\_pool\_resize\_status](../innodb-status-variables/index#innodb_buffer_pool_resize_status) | | --[innodb-buffer-pool-restore-at-startup](../innodb-system-variables/index#innodb_buffer_pool_restore_at_startup), [innodb\_buffer\_pool\_restore\_at\_startup](../innodb-system-variables/index#innodb_buffer_pool_restore_at_startup) | | --[innodb-buffer-pool-shm-checksum](../innodb-system-variables/index#innodb_buffer_pool_shm_checksum), [innodb\_buffer\_pool\_shm\_checksum](../innodb-system-variables/index#innodb_buffer_pool_shm_checksum) | | --[innodb-buffer-pool-shm-key](../innodb-system-variables/index#innodb_buffer_pool_shm_key), [innodb\_buffer\_pool\_shm\_key](../innodb-system-variables/index#innodb_buffer_pool_shm_key) | | --[innodb-buffer-pool-size](../innodb-system-variables/index#innodb_buffer_pool_size), [innodb\_buffer\_pool\_size](../innodb-system-variables/index#innodb_buffer_pool_size) | | [Innodb\_buffer\_pool\_wait\_free](../innodb-status-variables/index#innodb_buffer_pool_wait_free) | | [Innodb\_buffer\_pool\_write\_requests](../innodb-status-variables/index#innodb_buffer_pool_write_requests) | | [Innodb\_buffered\_aio\_submitted](../innodb-status-variables/index#innodb_buffered_aio_submitted) | | --[innodb-change-buffer-dump](../innodb-system-variables/index#innodb_change_buffer_dump), [innodb\_change\_buffer\_dump](../innodb-system-variables/index#innodb_change_buffer_dump) | | --[innodb-change-buffer-max-size](../innodb-system-variables/index#innodb_change_buffer_max_size), [innodb\_change\_buffer\_max\_size](../innodb-system-variables/index#innodb_change_buffer_max_size) | | --[innodb-change-buffering](../innodb-system-variables/index#innodb_change_buffering), [innodb\_change\_buffering](../innodb-system-variables/index#innodb_change_buffering) | | --[innodb-change-buffering-debug](../innodb-system-variables/index#innodb_change_buffering_debug), [innodb\_change\_buffering\_debug](../innodb-system-variables/index#innodb_change_buffering_debug) | | [Innodb\_checkpoint\_age](../innodb-status-variables/index#innodb_checkpoint_age) | | --[innodb-checkpoint-age-target](../innodb-system-variables/index#innodb_checkpoint_age_target), [innodb\_checkpoint\_age\_target](../innodb-system-variables/index#innodb_checkpoint_age_target) | | [Innodb\_checkpoint\_max\_age](../innodb-status-variables/index#innodb_checkpoint_max_age) | | [Innodb\_checkpoint\_target\_age](../innodb-status-variables/index#innodb_checkpoint_target_age) | | --[innodb-checksum-algorithm](../innodb-system-variables/index#innodb_checksum_algorithm), [innodb\_checksum\_algorithm](../innodb-system-variables/index#innodb_checksum_algorithm) | | --[innodb-checksums](../innodb-system-variables/index#innodb_checksums), [innodb\_checksums](../innodb-system-variables/index#innodb_checksums) | | --[innodb-cleaner-lsn-age-factor](../innodb-system-variables/index#innodb_cleaner_lsn_age_factor), [innodb\_cleaner\_lsn\_age\_factor](../innodb-system-variables/index#innodb_cleaner_lsn_age_factor) | | --[innodb-cmp](../mysqld-options-full-list/index#-innodb-cmp) | | --[innodb-cmp-per-index-enabled](../innodb-system-variables/index#innodb_cmp_per_index_enabled), [innodb\_cmp\_per\_index\_enabled](../innodb-system-variables/index#innodb_cmp_per_index_enabled) | | --[innodb-cmp-reset](../mysqld-options-full-list/index#-innodb-cmp-reset) | | --[innodb-cmpmem](../mysqld-options-full-list/index#-innodb-cmpmem) | | --[innodb-cmpmem-reset](../mysqld-options-full-list/index#-innodb-cmpmem-reset) | | --[innodb-commit-concurrency](../innodb-system-variables/index#innodb_commit_concurrency), [innodb\_commit\_concurrency](../innodb-system-variables/index#innodb_commit_concurrency) | | --[innodb-compression-algorithm](../innodb-system-variables/index#innodb_compression_algorithm), [innodb\_compression\_algorithm](../innodb-system-variables/index#innodb_compression_algorithm) | | --[innodb-compression-default](../innodb-system-variables/index#innodb_compression_default), [innodb\_compression\_default](../innodb-system-variables/index#innodb_compression_default) | | --[innodb-compression-failure-threshold-pct](../innodb-system-variables/index#innodb_compression_failure_threshold_pct), [innodb\_compression\_failure\_threshold\_pct](../innodb-system-variables/index#innodb_compression_failure_threshold_pct) | | --[innodb-compression-level](../innodb-system-variables/index#innodb_compression_level), [innodb\_compression\_level](../innodb-system-variables/index#innodb_compression_level) | | --[innodb-compression-pad-pct-max](../innodb-system-variables/index#innodb_compression_pad_pct_max), [innodb\_compression\_pad\_pct\_max](../innodb-system-variables/index#innodb_compression_pad_pct_max) | | --[innodb-concurrency-tickets](../innodb-system-variables/index#innodb_concurrency_tickets), [innodb\_concurrency\_tickets](../innodb-system-variables/index#innodb_concurrency_tickets) | | --[innodb-corrupt-table-action](../innodb-system-variables/index#innodb_corrupt_table_action), [innodb\_corrupt\_table\_action](../innodb-system-variables/index#innodb_corrupt_table_action) | | [Innodb\_current\_row\_locks](../innodb-status-variables/index#innodb_current_row_locks) | | --[innodb-data-file-path](../innodb-system-variables/index#innodb_data_file_path), [innodb\_data\_file\_path](../innodb-system-variables/index#innodb_data_file_path) | | [Innodb\_data\_fsyncs](../innodb-status-variables/index#innodb_data_fsyncs) | | --[innodb-data-home-dir](../innodb-system-variables/index#innodb_data_home_dir), [innodb\_data\_home\_dir](../innodb-system-variables/index#innodb_data_home_dir) | | [Innodb\_data\_pending\_fsyncs](../innodb-status-variables/index#innodb_data_pending_fsyncs) | | [Innodb\_data\_pending\_reads](../innodb-status-variables/index#innodb_data_pending_reads) | | [Innodb\_data\_pending\_writes](../innodb-status-variables/index#innodb_data_pending_writes) | | [Innodb\_data\_read](../innodb-status-variables/index#innodb_data_read) | | [Innodb\_data\_reads](../innodb-status-variables/index#innodb_data_reads) | | [Innodb\_data\_writes](../innodb-status-variables/index#innodb_data_writes) | | [Innodb\_data\_written](../innodb-status-variables/index#innodb_data_written) | | [Innodb\_dblwr\_pages\_written](../innodb-status-variables/index#innodb_dblwr_pages_written) | | [Innodb\_dblwr\_writes](../innodb-status-variables/index#innodb_dblwr_writes) | | --[innodb-deadlock-detect](../innodb-system-variables/index#innodb_deadlock_detect), [innodb\_deadlock\_detect](../innodb-system-variables/index#innodb_deadlock_detect) | | --[innodb-deadlock-report](../innodb-system-variables/index#innodb_deadlock_report), [innodb\_deadlock\_report](../innodb-system-variables/index#innodb_deadlock_report) | | [Innodb\_deadlocks](../innodb-status-variables/index#innodb_deadlocks) | | --[innodb-default-encryption-key-id](../innodb-system-variables/index#innodb_default_encryption_key_id), [innodb\_default\_encryption\_key\_id](../innodb-system-variables/index#innodb_default_encryption_key_id) | | --[innodb-default-page-encryption-key](../innodb-system-variables/index#innodb_default_page_encryption_key), [innodb\_default\_page\_encryption\_key](../innodb-system-variables/index#innodb_default_page_encryption_key) | | --[innodb-default-row-format](../innodb-system-variables/index#innodb_default_row_format), [innodb\_default\_row\_format](../innodb-system-variables/index#innodb_default_row_format) | | --[innodb-defragment](../innodb-system-variables/index#innodb_defragment), [innodb\_defragment](../innodb-system-variables/index#innodb_defragment) | | [Innodb\_defragment\_compression\_failures](../innodb-status-variables/index#innodb_defragment_compression_failures) | | [Innodb\_defragment\_count](../innodb-status-variables/index#innodb_defragment_count) | | [Innodb\_defragment\_failures](../innodb-status-variables/index#innodb_defragment_failures) | | --[innodb-defragment-fill-factor](../innodb-system-variables/index#innodb_defragment_fill_factor), [innodb\_defragment\_fill\_factor](../innodb-system-variables/index#innodb_defragment_fill_factor) | | --[innodb-defragment-fill-factor-n-recs](../innodb-system-variables/index#innodb_defragment_fill_factor_n_recs), [innodb\_defragment\_fill\_factor\_n\_recs](../innodb-system-variables/index#innodb_defragment_fill_factor_n_recs) | | --[innodb-defragment-frequency](../innodb-system-variables/index#innodb_defragment_frequency), [innodb\_defragment\_frequency](../innodb-system-variables/index#innodb_defragment_frequency) | | --[innodb-defragment-n-pages](../innodb-system-variables/index#innodb_defragment_n_pages), [innodb\_defragment\_n\_pages](../innodb-system-variables/index#innodb_defragment_n_pages) | | --[innodb-defragment-stats-accuracy](../innodb-system-variables/index#innodb_defragment_stats_accuracy), [innodb\_defragment\_stats\_accuracy](../innodb-system-variables/index#innodb_defragment_stats_accuracy) | | --[innodb-dict-size-limit](../innodb-system-variables/index#innodb_dict_size_limit), [innodb\_dict\_size\_limit](../innodb-system-variables/index#innodb_dict_size_limit) | | [Innodb\_dict\_tables](../innodb-status-variables/index#innodb_dict_tables) | | --[innodb-disable-sort-file-cache](../innodb-system-variables/index#innodb_disable_sort_file_cache), [innodb\_disable\_sort\_file\_cache](../innodb-system-variables/index#innodb_disable_sort_file_cache) | | [innodb\_disallow\_writes](../innodb-system-variables/index#innodb_disallow_writes) | | --[innodb-doublewrite](../innodb-system-variables/index#innodb_doublewrite), [innodb\_doublewrite](../innodb-system-variables/index#innodb_doublewrite) | | --[innodb-doublewrite-file](../innodb-system-variables/index#innodb_doublewrite_file), [innodb\_doublewrite\_file](../innodb-system-variables/index#innodb_doublewrite_file) | | --[innodb\_empty-free-list-algorithm](../innodb-system-variables/index#innodb_empty_free_list_algorithm), [innodb\_empty\_free\_list\_algorithm](../innodb-system-variables/index#innodb_empty_free_list_algorithm) | | --[innodb-enable-unsafe-group-commit](../innodb-system-variables/index#innodb_enable_unsafe_group_commit), [innodb\_enable\_unsafe\_group\_commit](../innodb-system-variables/index#innodb_enable_unsafe_group_commit) | | --[innodb-encrypt-log](../innodb-system-variables/index#innodb_encrypt_log), [innodb\_encrypt\_log](../innodb-system-variables/index#innodb_encrypt_log) | | --[innodb-encrypt-tables](../innodb-system-variables/index#innodb_encrypt_tables), [innodb\_encrypt\_tables](../innodb-system-variables/index#innodb_encrypt_tables) | | --[innodb-encrypt-temporary-tables](../innodb-system-variables/index#innodb_encrypt_temporary_tables), [innodb\_encrypt\_temporary\_tables](../innodb-system-variables/index#innodb_encrypt_temporary_tables) | | [Innodb\_encryption\_n\_merge\_blocks\_decrypted](../innodb-status-variables/index#innodb_encryption_n_merge_blocks_decrypted) | | [Innodb\_encryption\_n\_merge\_blocks\_encrypted](../innodb-status-variables/index#innodb_encryption_n_merge_blocks_encrypted) | | [Innodb\_encryption\_n\_rowlog\_blocks\_decrypted](../innodb-status-variables/index#innodb_encryption_n_rowlog_blocks_decrypted) | | [Innodb\_encryption\_n\_rowlog\_blocks\_encrypted](../innodb-status-variables/index#innodb_encryption_n_rowlog_blocks_encrypted) | | [Innodb\_encryption\_n\_temp\_blocks\_decrypted](../innodb-status-variables/index#innodb_encryption_n_temp_blocks_decrypted) | | [Innodb\_encryption\_n\_temp\_blocks\_encrypted](../innodb-status-variables/index#innodb_encryption_n_temp_blocks_encrypted) | | [Innodb\_encryption\_num\_key\_requests](../innodb-status-variables/index#innodb_encryption_num_key_requests) | | --[innodb-encryption-rotate-key-age](../innodb-system-variables/index#innodb_encryption_rotate_key_age), [innodb\_encryption\_rotate\_key\_age](../innodb-system-variables/index#innodb_encryption_rotate_key_age) | | [Innodb\_encryption\_rotation\_estimated\_iops](../innodb-status-variables/index#innodb_encryption_rotation_estimated_iops) | | --[innodb-encryption-rotation-iops](../innodb-system-variables/index#innodb_encryption_rotation_iops), [innodb\_encryption\_rotation\_iops](../innodb-system-variables/index#innodb_encryption_rotation_iops) | | [Innodb\_encryption\_rotation\_pages\_flushed](../innodb-status-variables/index#innodb_encryption_rotation_pages_flushed) | | [Innodb\_encryption\_rotation\_pages\_modified](../innodb-status-variables/index#innodb_encryption_rotation_pages_modified) | | [Innodb\_encryption\_rotation\_pages\_read\_from\_cache](../innodb-status-variables/index#innodb_encryption_rotation_pages_read_from_cache) | | [Innodb\_encryption\_rotation\_pages\_read\_from\_disk](../innodb-status-variables/index#innodb_encryption_rotation_pages_read_from_disk) | | --[innodb-encryption-threads](../innodb-system-variables/index#innodb_encryption_threads), [innodb\_encryption\_threads](../innodb-system-variables/index#innodb_encryption_threads) | | --[innodb-extra-rsegments](../innodb-system-variables/index#innodb_extra_rsegments), [innodb\_extra\_rsegments](../innodb-system-variables/index#innodb_extra_rsegments) | | --[innodb-extra-undoslots](../innodb-system-variables/index#innodb_extra_undoslots), [innodb\_extra\_undoslots](../innodb-system-variables/index#innodb_extra_undoslots) | | --[innodb-fake-changes](../innodb-system-variables/index#innodb_fake_changes), [innodb\_fake\_changes](../innodb-system-variables/index#innodb_fake_changes) | | --[innodb-fast-checksum](../innodb-system-variables/index#innodb_fast_checksum), [innodb\_fast\_checksum](../innodb-system-variables/index#innodb_fast_checksum) | | --[innodb-fast-shutdown](../innodb-system-variables/index#innodb_fast_shutdown), [innodb\_fast\_shutdown](../innodb-system-variables/index#innodb_fast_shutdown) | | --[innodb-fatal-semaphore-wait-threshold](../innodb-system-variables/index#innodb_fatal_semaphore_wait_threshold), [innodb\_fatal\_semaphore\_wait\_threshold](../innodb-system-variables/index#innodb_fatal_semaphore_wait_threshold) | | --[innodb-file-format](../innodb-system-variables/index#innodb_file_format), [innodb\_file\_format](../innodb-system-variables/index#innodb_file_format) | | --[innodb-file-format-check](../innodb-system-variables/index#innodb_file_format_check), [innodb\_file\_format\_check](../innodb-system-variables/index#innodb_file_format_check) | | --[innodb-file-format-max](../innodb-system-variables/index#innodb_file_format_max), [innodb\_file\_format\_max](../innodb-system-variables/index#innodb_file_format_max) | | --[innodb-file-io-threads](../mysqld-options-full-list/index#-innodb-file-io-threads) | | --[innodb-file-per-table](../innodb-system-variables/index#innodb_file_per_table), [innodb\_file\_per\_table](../innodb-system-variables/index#innodb_file_per_table) | | --[innodb-fill-factor](../innodb-system-variables/index#innodb_fill_factor), [innodb\_fill\_factor](../innodb-system-variables/index#innodb_fill_factor) | | --[innodb-flush-log-at-timeout](../innodb-system-variables/index#innodb_flush_log_at_timeout), [innodb\_flush\_log\_at\_timeout](../innodb-system-variables/index#innodb_flush_log_at_timeout) | | --[innodb-flush-log-at-trx-commit](../innodb-system-variables/index#innodb_flush_log_at_trx_commit), [innodb\_flush\_log\_at\_trx\_commit](../innodb-system-variables/index#innodb_flush_log_at_trx_commit) | | --[innodb-flush-method](../innodb-system-variables/index#innodb_flush_method), [innodb\_flush\_method](../innodb-system-variables/index#innodb_flush_method) | | --[innodb-flush-neighbor-pages](../innodb-system-variables/index#innodb_flush_neighbor_pages), [innodb\_flush\_neighbor\_pages](../innodb-system-variables/index#innodb_flush_neighbor_pages) | | --[innodb-flush-neighbors](../innodb-system-variables/index#innodb_flush_neighbors), [innodb\_flush\_neighbors](../innodb-system-variables/index#innodb_flush_neighbors) | | --[innodb-flush-sync](../innodb-system-variables/index#innodb_flush_sync), [innodb\_flush\_sync](../innodb-system-variables/index#innodb_flush_sync) | | --[innodb-flushing-avg-loops](../innodb-system-variables/index#innodb_flushing_avg_loops), [innodb\_flushing\_avg\_loops](../innodb-system-variables/index#innodb_flushing_avg_loops) | | --[innodb-force-load-corrupted](../innodb-system-variables/index#innodb_force_load_corrupted), [innodb\_force\_load\_corrupted](../innodb-system-variables/index#innodb_force_load_corrupted) | | --[innodb-force-primary-key](../innodb-system-variables/index#innodb_force_primary_key), [innodb\_force\_primary\_key](../innodb-system-variables/index#innodb_force_primary_key) | | --[innodb-force-recovery](../innodb-system-variables/index#innodb_force_recovery), [innodb\_force\_recovery](../innodb-system-variables/index#innodb_force_recovery) | | --[innodb-foreground-preflush](../innodb-system-variables/index#innodb_foreground_preflush), [innodb\_foreground\_preflush](../innodb-system-variables/index#innodb_foreground_preflush) | | --[innodb-ft-aux-table](../innodb-system-variables/index#innodb_ft_aux_table), [innodb\_ft\_aux\_table](../innodb-system-variables/index#innodb_ft_aux_table) | | --[innodb-ft-cache-size](../innodb-system-variables/index#innodb_ft_cache_size), [innodb\_ft\_cache\_size](../innodb-system-variables/index#innodb_ft_cache_size) | | --[innodb-ft-enable-diag-print](../innodb-system-variables/index#innodb_ft_enable_diag_print), [innodb\_ft\_enable\_diag\_print](../innodb-system-variables/index#innodb_ft_enable_diag_print) | | --[innodb-ft-enable-stopword](../innodb-system-variables/index#innodb_ft_enable_stopword), [innodb\_ft\_enable\_stopword](../innodb-system-variables/index#innodb_ft_enable_stopword) | | --[innodb-ft-max-token-size](../innodb-system-variables/index#innodb_ft_max_token_size), [innodb\_ft\_max\_token\_size](../innodb-system-variables/index#innodb_ft_max_token_size) | | --[innodb-ft-min-token-size](../innodb-system-variables/index#innodb_ft_min_token_size), [innodb\_ft\_min\_token\_size](../innodb-system-variables/index#innodb_ft_min_token_size) | | --[innodb-ft-num-word-optimize](../innodb-system-variables/index#innodb_ft_num_word_optimize), [innodb\_ft\_num\_word\_optimize](../innodb-system-variables/index#innodb_ft_num_word_optimize) | | --[innodb-ft-result-cache-limit](../innodb-system-variables/index#innodb_ft_result_cache_limit), [innodb\_ft\_result\_cache\_limit](../innodb-system-variables/index#innodb_ft_result_cache_limit) | | --[innodb-ft-server-stopword-table](../innodb-system-variables/index#innodb_ft_server_stopword_table), [innodb\_ft\_server\_stopword\_table](../innodb-system-variables/index#innodb_ft_server_stopword_table) | | --[innodb-ft-sort-pll-degree](../innodb-system-variables/index#innodb_ft_sort_pll_degree), [innodb\_ft\_sort\_pll\_degree](../innodb-system-variables/index#innodb_ft_sort_pll_degree) | | --[innodb-ft-total-cache-size](../innodb-system-variables/index#innodb_ft_total_cache_size), [innodb\_ft\_total\_cache\_size](../innodb-system-variables/index#innodb_ft_total_cache_size) | | --[innodb-ft-user-stopword-table](../innodb-system-variables/index#innodb_ft_user_stopword_table), [innodb\_ft\_user\_stopword\_table](../innodb-system-variables/index#innodb_ft_user_stopword_table) | | [Innodb\_have\_atomic\_builtins](../innodb-status-variables/index#innodb_have_atomic_builtins) | | [Innodb\_have\_bzip2](../innodb-status-variables/index#innodb_have_bzip2) | | [Innodb\_have\_lz4](../innodb-status-variables/index#innodb_have_lz4) | | [Innodb\_have\_lzma](../innodb-status-variables/index#innodb_have_lzma) | | [Innodb\_have\_lzo](../innodb-status-variables/index#innodb_have_lzo) | | [Innodb\_have\_punch\_hole](../innodb-status-variables/index#innodb_have_punch_hole) | | [Innodb\_have\_snappy](../innodb-status-variables/index#innodb_have_snappy) | | [Innodb\_history\_list\_length](../innodb-status-variables/index#innodb_history_list_length) | | --[innodb-ibuf-accel-rate](../innodb-system-variables/index#innodb_ibuf_accel_rate), [innodb\_ibuf\_accel\_rate](../innodb-system-variables/index#innodb_ibuf_accel_rate) | | --[innodb-ibuf-active-contract](../innodb-system-variables/index#innodb_ibuf_active_contract), [innodb\_ibuf\_active\_contract](../innodb-system-variables/index#innodb_ibuf_active_contract) | | [Innodb\_ibuf\_discarded\_delete\_marks](../innodb-status-variables/index#innodb_ibuf_discarded_delete_marks) | | [Innodb\_ibuf\_discarded\_deletes](../innodb-status-variables/index#innodb_ibuf_discarded_deletes) | | [Innodb\_ibuf\_discarded\_inserts](../innodb-status-variables/index#innodb_ibuf_discarded_inserts) | | [Innodb\_ibuf\_free\_list](../innodb-status-variables/index#innodb_ibuf_free_list) | | --[innodb-ibuf-max-size](../innodb-system-variables/index#innodb_ibuf_max_size), [innodb\_ibuf\_max\_size](../innodb-system-variables/index#innodb_ibuf_max_size) | | [Innodb\_ibuf\_merged\_delete\_marks](../innodb-status-variables/index#innodb_ibuf_merged_delete_marks) | | [Innodb\_ibuf\_merged\_deletes](../innodb-status-variables/index#innodb_ibuf_merged_deletes) | | [Innodb\_ibuf\_merged\_inserts](../innodb-status-variables/index#innodb_ibuf_merged_inserts) | | [Innodb\_ibuf\_merges](../innodb-status-variables/index#innodb_ibuf_merges) | | [Innodb\_ibuf\_segment\_size](../innodb-status-variables/index#innodb_ibuf_segment_size) | | [Innodb\_ibuf\_size](../innodb-status-variables/index#innodb_ibuf_size) | | --[innodb-idle-flush-pct](../innodb-system-variables/index#innodb_idle_flush_pct), [innodb\_idle\_flush\_pct](../innodb-system-variables/index#innodb_idle_flush_pct) | | --[innodb-immediate-scrub-data-uncompressed](../innodb-system-variables/index#innodb_immediate_scrub_data_uncompressed), [innodb\_immediate\_scrub\_data\_uncompressed](../innodb-system-variables/index#innodb_immediate_scrub_data_uncompressed) | | --[innodb-import-table-from-xtrabackup](../innodb-system-variables/index#innodb_import_table_from_xtrabackup), [innodb\_import\_table\_from\_xtrabackup](../innodb-system-variables/index#innodb_import_table_from_xtrabackup) | | --[innodb-index-stats](../mysqld-options-full-list/index#-innodb-index-stats) | | [Innodb\_instant\_alter\_column](../innodb-status-variables/index#innodb_instant_alter_column) | | --[innodb-instant-alter-column-allowed](../innodb-system-variables/index#innodb_instant_alter_column_allowed), [innodb\_instant\_alter\_column\_allowed](../innodb-system-variables/index#innodb_instant_alter_column_allowed) | | --[innodb-instrument-semaphores](../innodb-system-variables/index#innodb_instrument_semaphores), [innodb\_instrument\_semaphores](../innodb-system-variables/index#innodb_instrument_semaphores) | | --[innodb-io-capacity](../innodb-system-variables/index#innodb_io_capacity), [innodb\_io\_capacity](../innodb-system-variables/index#innodb_io_capacity) | | --[innodb-io-capacity-max](../innodb-system-variables/index#innodb_io_capacity_max), [innodb\_io\_capacity\_max](../innodb-system-variables/index#innodb_io_capacity_max) | | [innodb\_kill\_idle\_transaction](../innodb-system-variables/index#innodb_kill_idle_transaction) | | --[innodb-large-prefix](../innodb-system-variables/index#innodb_large_prefix), [innodb\_large\_prefix](../innodb-system-variables/index#innodb_large_prefix) | | --[innodb-lazy-drop-table](../innodb-system-variables/index#innodb_lazy_drop_table), [innodb\_lazy\_drop\_table](../innodb-system-variables/index#innodb_lazy_drop_table) | | --[innodb-lock-schedule-algorithm](../innodb-system-variables/index#innodb_lock_schedule_algorithm), [innodb\_lock\_schedule\_algorithm](../innodb-system-variables/index#innodb_lock_schedule_algorithm) | | --[innodb-lock-wait-timeout](../innodb-system-variables/index#innodb_lock_wait_timeout), [innodb\_lock\_wait\_timeout](../innodb-system-variables/index#innodb_lock_wait_timeout) | | --[innodb-lock-waits](../mysqld-options-full-list/index#-innodb-lock-waits) | | --[innodb-locking-fake-changes](../innodb-system-variables/index#innodb_locking_fake_changes), [innodb\_locking\_fake\_changes](../innodb-system-variables/index#innodb_locking_fake_changes) | | --[innodb-locks](../mysqld-options-full-list/index#-innodb-locks) | | --[innodb-locks-unsafe-for-binlog](../innodb-system-variables/index#innodb_locks_unsafe_for_binlog), [innodb\_locks\_unsafe\_for\_binlog](../innodb-system-variables/index#innodb_locks_unsafe_for_binlog) | | --[innodb-log-arch-dir](../innodb-system-variables/index#innodb_log_arch_dir), [innodb\_log\_arch\_dir](../innodb-system-variables/index#innodb_log_arch_dir) | | --[innodb-log-arch-expire-sec](../innodb-system-variables/index#innodb_log_arch_expire_sec), [innodb\_log\_arch\_expire\_sec](../innodb-system-variables/index#innodb_log_arch_expire_sec) | | --[innodb-log-archive](../innodb-system-variables/index#innodb_log_archive), [innodb\_log\_archive](../innodb-system-variables/index#innodb_log_archive) | | --[innodb-log-block-size](../innodb-system-variables/index#innodb_log_block_size), [innodb\_log\_block\_size](../innodb-system-variables/index#innodb_log_block_size) | | --[innodb-log-buffer-size](../innodb-system-variables/index#innodb_log_buffer_size), [innodb\_log\_buffer\_size](../innodb-system-variables/index#innodb_log_buffer_size) | | -- [innodb-log-checksum-algorithm](../innodb-system-variables/index#innodb_log_checksum_algorithm), [innodb\_log\_checksum\_algorithm](../innodb-system-variables/index#innodb_log_checksum_algorithm) | | -- [innodb-log-checksums](../innodb-system-variables/index#innodb_log_checksums), [innodb\_log\_checksums](../innodb-system-variables/index#innodb_log_checksums) | | -- [innodb-log-compressed-pages](../innodb-system-variables/index#innodb_log_compressed_pages), [innodb\_log\_compressed\_pages](../innodb-system-variables/index#innodb_log_compressed_pages) | | --[innodb-log-file-buffering](../innodb-system-variables/index#innodb_log_file_buffering), [innodb\_log\_file\_buffering](../innodb-system-variables/index#innodb_log_file_buffering) | | --[innodb-log-file-size](../innodb-system-variables/index#innodb_log_file_size), [innodb\_log\_file\_size](../innodb-system-variables/index#innodb_log_file_size) | | --[innodb-log-files-in-group](../innodb-system-variables/index#innodb_log_files_in_group), [innodb\_log\_files\_in\_group](../innodb-system-variables/index#innodb_log_files_in_group) | | --[innodb-log-group-home-dir](../innodb-system-variables/index#innodb_log_group_home_dir), [innodb\_log\_group\_home\_dir](../innodb-system-variables/index#innodb_log_group_home_dir) | | --[innodb-log-optimize-ddl](../innodb-system-variables/index#innodb_log_optimize_ddl), [innodb\_log\_optimize\_ddl](../innodb-system-variables/index#innodb_log_optimize_ddl) | | [Innodb\_log\_waits](../innodb-status-variables/index#innodb_log_waits) | | --[innodb-log-write-ahead-size](../innodb-system-variables/index#innodb_log_write_ahead_size), [innodb\_log\_write\_ahead\_size](../innodb-system-variables/index#innodb_log_write_ahead_size) | | [Innodb\_log\_write\_requests](../innodb-status-variables/index#innodb_log_write_requests) | | [Innodb\_log\_writes](../innodb-status-variables/index#innodb_log_writes) | | --[innodb-lru-flush-size](../innodb-system-variables/index#innodb_lru_flush_size), [innodb\_lru\_flush\_size](../innodb-system-variables/index#innodb_lru_flush_size) | | --[innodb-lru-scan-depth](../innodb-system-variables/index#innodb_lru_scan_depth), [innodb\_lru\_scan\_depth](../innodb-system-variables/index#innodb_lru_scan_depth) | | [Innodb\_lsn\_current](../innodb-status-variables/index#innodb_lsn_current) | | [Innodb\_lsn\_flushed](../innodb-status-variables/index#innodb_lsn_flushed) | | [Innodb\_lsn\_last\_checkpoint](../innodb-status-variables/index#innodb_lsn_last_checkpoint) | | [Innodb\_master\_thread\_1\_second\_loops](../innodb-status-variables/index#innodb_master_thread_1_second_loops) | | [Innodb\_master\_thread\_10\_second\_loops](../innodb-status-variables/index#innodb_master_thread_10_second_loops) | | [Innodb\_master\_thread\_active\_loops](../innodb-status-variables/index#innodb_master_thread_active_loops) | | [Innodb\_master\_thread\_background\_loops](../innodb-status-variables/index#innodb_master_thread_background_loops) | | [Innodb\_master\_thread\_idle\_loops](../innodb-status-variables/index#innodb_master_thread_idle_loops) | | [Innodb\_master\_thread\_main\_flush\_loops](../innodb-status-variables/index#innodb_master_thread_main_flush_loops) | | [Innodb\_master\_thread\_sleeps](../innodb-status-variables/index#innodb_master_thread_sleeps) | | --[innodb-max-bitmap-file-size](../innodb-system-variables/index#innodb_max_bitmap_file_size), [innodb\_max\_bitmap\_file\_size](../innodb-system-variables/index#innodb_max_bitmap_file_size) | | --[innodb-max-changed-pages](../innodb-system-variables/index#innodb_max_changed_pages), [innodb\_max\_changed\_pages](../innodb-system-variables/index#innodb_max_changed_pages) | | --[innodb-max-dirty-pages-pct](../innodb-system-variables/index#innodb_max_dirty_pages_pct), [innodb\_max\_dirty\_pages\_pct](../innodb-system-variables/index#innodb_max_dirty_pages_pct) | | --[innodb-max-dirty-pages-pct-lwm](../innodb-system-variables/index#innodb_max_dirty_pages_pct_lwm), [innodb\_max\_dirty\_pages\_pct\_lwm](../innodb-system-variables/index#innodb_max_dirty_pages_pct_lwm) | | --[innodb-max-purge-lag](../innodb-system-variables/index#innodb_max_purge_lag), [innodb\_max\_purge\_lag](../innodb-system-variables/index#innodb_max_purge_lag) | | --[innodb-max-purge-lag-delay](../innodb-system-variables/index#innodb_max_purge_lag_delay), [innodb\_max\_purge\_lag\_delay](../innodb-system-variables/index#innodb_max_purge_lag_delay) | | --[innodb-max-purge-lag-wait](../innodb-system-variables/index#innodb_max_purge_lag_wait), [innodb\_max\_purge\_lag\_wait](../innodb-system-variables/index#innodb_max_purge_lag_wait) | | [Innodb\_max\_trx\_id](../innodb-status-variables/index#innodb_max_trx_id) | | --[innodb-max-undo-log-size](../innodb-system-variables/index#innodb_max_undo_log_size), [innodb\_max\_undo\_log\_size](../innodb-system-variables/index#innodb_max_undo_log_size) | | [Innodb\_mem\_adaptive\_hash](../innodb-status-variables/index#innodb_mem_adaptive_hash) | | [Innodb\_mem\_dictionary](../innodb-status-variables/index#innodb_mem_dictionary) | | [Innodb\_mem\_total](../innodb-status-variables/index#innodb_mem_total) | | --[innodb-merge-sort-block-size](../innodb-system-variables/index#innodb_merge_sort_block_size), [innodb\_merge\_sort\_block\_size](../innodb-system-variables/index#innodb_merge_sort_block_size) | | --[innodb-mirrored-log-groups](../innodb-system-variables/index#innodb_mirrored_log_groups), [innodb\_mirrored\_log\_groups](../innodb-system-variables/index#innodb_mirrored_log_groups) | | --[innodb-monitor-disable](../innodb-system-variables/index#innodb_monitor_disable), [innodb\_monitor\_disable](../innodb-system-variables/index#innodb_monitor_disable) | | --[innodb-monitor-enable](../innodb-system-variables/index#innodb_monitor_enable), [innodb\_monitor\_enable](../innodb-system-variables/index#innodb_monitor_enable) | | --[innodb-monitor-reset](../innodb-system-variables/index#innodb_monitor_reset), [innodb\_monitor\_reset](../innodb-system-variables/index#innodb_monitor_reset) | | --[innodb-monitor-reset-all](../innodb-system-variables/index#innodb_monitor_reset_all), [innodb\_monitor\_reset\_all](../innodb-system-variables/index#innodb_monitor_reset_all) | | --[innodb-mtflush-threads](../innodb-system-variables/index#innodb_mtflush_threads), [innodb\_mtflush\_threads](../innodb-system-variables/index#innodb_mtflush_threads) | | [Innodb\_mutex\_os\_waits](../innodb-status-variables/index#innodb_mutex_os_waits) | | [Innodb\_mutex\_spin\_rounds](../innodb-status-variables/index#innodb_mutex_spin_rounds) | | [Innodb\_mutex\_spin\_waits](../innodb-status-variables/index#innodb_mutex_spin_waits) | | [Innodb\_num\_index\_pages\_written](../innodb-status-variables/index#innodb_num_index_pages_written) | | [Innodb\_num\_non\_index\_pages\_written](../innodb-status-variables/index#innodb_num_non_index_pages_written) | | [Innodb\_num\_open\_files](../innodb-status-variables/index#innodb_num_open_files) | | [Innodb\_num\_page\_compressed\_trim\_op](../innodb-status-variables/index#innodb_num_page_compressed_trim_op) | | [Innodb\_num\_page\_compressed\_trim\_op\_saved](../innodb-status-variables/index#innodb_num_page_compressed_trim_op_saved) | | [Innodb\_num\_pages\_encrypted](../innodb-status-variables/index#innodb_num_pages_encrypted) | | [Innodb\_num\_pages\_page\_compressed](../innodb-status-variables/index#innodb_num_pages_page_compressed) | | [Innodb\_num\_pages\_page\_compression\_error](../innodb-status-variables/index#innodb_num_pages_page_compression_error) | | [Innodb\_num\_pages\_page\_decompressed](../innodb-status-variables/index#innodb_num_pages_page_decompressed) | | [Innodb\_num\_pages\_page\_decrypted](../innodb-status-variables/index#innodb_num_pages_page_decrypted) | | [Innodb\_num\_pages\_page\_encryption\_error](../innodb-status-variables/index#innodb_num_pages_page_encryption_error) | | --[innodb-numa-interleave](../innodb-system-variables/index#innodb_numa_interleave), [innodb\_numa\_interleave](../innodb-system-variables/index#innodb_numa_interleave) | | --[innodb-old-blocks-pct](../innodb-system-variables/index#innodb_old_blocks_pct), [innodb\_old\_blocks\_pct](../innodb-system-variables/index#innodb_old_blocks_pct) | | --[innodb-old-blocks-time](../innodb-system-variables/index#innodb_old_blocks_time), [innodb\_old\_blocks\_time](../innodb-system-variables/index#innodb_old_blocks_time) | | [Innodb\_oldest\_view\_low\_limit\_trx\_id](../innodb-status-variables/index#innodb_oldest_view_low_limit_trx_id) | | --[innodb-online-alter-log-max-size](../innodb-system-variables/index#innodb_online_alter_log_max_size), [innodb\_online\_alter\_log\_max\_size](../innodb-system-variables/index#innodb_online_alter_log_max_size) | | [Innodb\_onlineddl\_pct\_progress](../innodb-status-variables/index#innodb_onlineddl_pct_progress) | | [Innodb\_onlineddl\_rowlog\_pct\_used](../innodb-status-variables/index#innodb_onlineddl_rowlog_pct_used) | | [Innodb\_onlineddl\_rowlog\_rows](../innodb-status-variables/index#innodb_onlineddl_rowlog_rows) | | --[innodb-open-files](../innodb-system-variables/index#innodb_open_files), [innodb\_open\_files](../innodb-system-variables/index#innodb_open_files) | | --[innodb-optimize-fulltext-only](../innodb-system-variables/index#innodb_optimize_fulltext_only), [innodb\_optimize\_fulltext\_only](../innodb-system-variables/index#innodb_optimize_fulltext_only) | | [Innodb\_os\_log\_fsyncs](../innodb-status-variables/index#innodb_os_log_fsyncs) | | [Innodb\_os\_log\_pending\_fsyncs](../innodb-status-variables/index#innodb_os_log_pending_fsyncs) | | [Innodb\_os\_log\_pending\_writes](../innodb-status-variables/index#innodb_os_log_pending_writes) | | [Innodb\_os\_log\_written](../innodb-status-variables/index#innodb_os_log_written) | | --[innodb-page-cleaners](../innodb-system-variables/index#innodb_page_cleaners), [innodb\_page\_cleaners](../innodb-system-variables/index#innodb_page_cleaners) | | [Innodb\_page\_compression\_saved](../innodb-status-variables/index#innodb_page_compression_saved) | | [Innodb\_page\_compression\_trim\_sect512](../innodb-status-variables/index#innodb_page_compression_trim_sect512) | | [Innodb\_page\_compression\_trim\_sect1024](../innodb-status-variables/index#innodb_page_compression_trim_sect1024) | | [Innodb\_page\_compression\_trim\_sect2048](../innodb-status-variables/index#innodb_page_compression_trim_sect2048) | | [Innodb\_page\_compression\_trim\_sect4096](../innodb-status-variables/index#innodb_page_compression_trim_sect4096) | | [Innodb\_page\_compression\_trim\_sect8192](../innodb-status-variables/index#innodb_page_compression_trim_sect8192) | | [Innodb\_page\_compression\_trim\_sect16384](../innodb-status-variables/index#innodb_page_compression_trim_sect16384) | | [Innodb\_page\_compression\_trim\_sect32768](../innodb-status-variables/index#innodb_page_compression_trim_sect32768) | | --[innodb-page-size](../innodb-system-variables/index#innodb_page_size), [innodb\_page\_size](../innodb-system-variables/index#innodb_page_size) | | [Innodb\_page\_size](../innodb-status-variables/index#innodb_page_size) | | [Innodb\_pages\_created](../innodb-status-variables/index#innodb_pages_created) | | [Innodb\_pages\_read](../innodb-status-variables/index#innodb_pages_read) | | [Innodb\_pages0\_read](../innodb-status-variables/index#innodb_pages0_read) | | [Innodb\_pages\_written](../innodb-status-variables/index#innodb_pages_written) | | --[innodb-pass-corrupt-table](../innodb-system-variables/index#innodb_pass_corrupt_table), [innodb-pass-corrupt-table](../innodb-system-variables/index#innodb_pass_corrupt_table) | | --[innodb-prefix-index-cluster-optimization](../innodb-system-variables/index#innodb_prefix_index_cluster_optimization), [innodb\_prefix\_index\_cluster\_optimization](../innodb-system-variables/index#innodb_prefix_index_cluster_optimization) | | --[innodb-print-all-deadlocks](../innodb-system-variables/index#innodb_print_all_deadlocks), [innodb\_print\_all\_deadlocks](../innodb-system-variables/index#innodb_print_all_deadlocks) | | --[innodb-purge-batch-size](../innodb-system-variables/index#innodb_purge_batch_size), [innodb\_purge\_batch\_size](../innodb-system-variables/index#innodb_purge_batch_size) | | --[innodb-purge-rseg-truncate-frequency](../innodb-system-variables/index#innodb_purge_rseg_truncate_frequency), [innodb\_purge\_rseg\_truncate\_frequency](../innodb-system-variables/index#innodb_purge_rseg_truncate_frequency) | | --[innodb-purge-threads](../innodb-system-variables/index#innodb_purge_threads), [innodb\_purge\_threads](../innodb-system-variables/index#innodb_purge_threads) | | [Innodb\_purge\_trx\_id](../innodb-status-variables/index#innodb_purge_trx_id) | | [Innodb\_purge\_undo\_no](../innodb-status-variables/index#innodb_purge_undo_no) | | --[innodb-random-read-ahead](../innodb-system-variables/index#innodb_random_read_ahead), [innodb\_random\_read\_ahead](../innodb-system-variables/index#innodb_random_read_ahead) | | --[innodb-read-ahead](../innodb-system-variables/index#innodb_read_ahead), [innodb\_read\_ahead](../innodb-system-variables/index#innodb_read_ahead) | | --[innodb-read-ahead-threshold](../innodb-system-variables/index#innodb_read_ahead_threshold), [innodb\_read\_ahead\_threshold](../innodb-system-variables/index#innodb_read_ahead_threshold) | | --[innodb-read-io-threads](../innodb-system-variables/index#innodb_read_io_threads), [innodb\_read\_io\_threads](../innodb-system-variables/index#innodb_read_io_threads) | | --[innodb-read-only](../innodb-system-variables/index#innodb_read_only), [innodb\_read\_only](../innodb-system-variables/index#innodb_read_only) | | [Innodb\_read\_views\_memory](../innodb-status-variables/index#innodb_read_views_memory) | | --[innodb-recovery-stats](../innodb-system-variables/index#innodb_recovery_stats), [innodb\_recovery\_stats](../innodb-system-variables/index#innodb_recovery_stats) | | --[innodb-recovery-update-relay-log](../innodb-system-variables/index#innodb_recovery_update_relay_log), [innodb-recovery-update-relay-log](../innodb-system-variables/index#innodb_recovery_update_relay_log) | | --[innodb-replication-delay](../innodb-system-variables/index#innodb_replication_delay), [innodb\_replication\_delay](../innodb-system-variables/index#innodb_replication_delay) | | --[innodb-rollback-on-timeout](../innodb-system-variables/index#innodb_rollback_on_timeout), [innodb\_rollback\_on\_timeout](../innodb-system-variables/index#innodb_rollback_on_timeout) | | --[innodb-rollback-segments](../innodb-system-variables/index#innodb_rollback_segments), [innodb\_rollback\_segments](../innodb-system-variables/index#innodb_rollback_segments) | | [Innodb\_row\_lock\_current\_waits](../innodb-status-variables/index#innodb_row_lock_current_waits) | | [Innodb\_row\_lock\_numbers](../innodb-status-variables/index#innodb_row_lock_numbers) | | [Innodb\_row\_lock\_time](../innodb-status-variables/index#innodb_row_lock_time) | | [Innodb\_row\_lock\_time\_avg](../innodb-status-variables/index#innodb_row_lock_time_avg) | | [Innodb\_row\_lock\_time\_max](../innodb-status-variables/index#innodb_row_lock_time_max) | | [Innodb\_row\_lock\_waits](../innodb-status-variables/index#innodb_row_lock_waits) | | [Innodb\_rows\_deleted](../innodb-status-variables/index#innodb_rows_deleted) | | [Innodb\_rows\_inserted](../innodb-status-variables/index#innodb_rows_inserted) | | [Innodb\_rows\_read](../innodb-status-variables/index#innodb_rows_read) | | [Innodb\_rows\_updated](../innodb-status-variables/index#innodb_rows_updated) | | --[innodb-rseg](../mysqld-options-full-list/index#-innodb-rseg) | | [Innodb\_s\_lock\_os\_waits](../innodb-status-variables/index#innodb_s_lock_os_waits) | | [Innodb\_s\_lock\_spin\_rounds](../innodb-status-variables/index#innodb_s_lock_spin_rounds) | | [Innodb\_s\_lock\_spin\_waits](../innodb-status-variables/index#innodb_s_lock_spin_waits) | | --[innodb\_safe\_truncate](../innodb-system-variables/index#innodb_safe_truncate), [innodb\_safe\_truncate](../innodb-system-variables/index#innodb_safe_truncate) | | --[innodb-sched-priority-cleaner](../innodb-system-variables/index#innodb_sched_priority_cleaner), [innodb\_sched\_priority\_cleaner](../innodb-system-variables/index#innodb_sched_priority_cleaner) | | [Innodb\_scrub\_background\_page\_reorganizations](../innodb-status-variables/index#innodb_scrub_background_page_reorganizations) | | [Innodb\_scrub\_background\_page\_split\_failures\_missing\_index](../innodb-status-variables/index#innodb_scrub_background_page_split_failures_missing_index) | | [Innodb\_scrub\_background\_page\_split\_failures\_out\_of\_filespace](../innodb-status-variables/index#innodb_scrub_background_page_split_failures_out_of_filespace) | | [Innodb\_scrub\_background\_page\_split\_failures\_underflow](../innodb-status-variables/index#innodb_scrub_background_page_split_failures_underflow) | | [Innodb\_scrub\_background\_page\_split\_failures\_unknown](../innodb-status-variables/index#innodb_scrub_background_page_split_failures_unknown) | | [Innodb\_scrub\_background\_page\_splits](../innodb-status-variables/index#innodb_scrub_background_page_splits) | | --[innodb-scrub-log](../innodb-system-variables/index#innodb_scrub_log), [innodb\_scrub\_log](../innodb-system-variables/index#innodb_scrub_log) | | [Innodb\_scrub\_log](../innodb-status-variables/index#innodb_scrub_log) | | --[innodb-scrub-log-interval](../innodb-system-variables/index#innodb_scrub_log_interval), [innodb\_scrub\_log\_interval](../innodb-system-variables/index#innodb_scrub_log_interval) | | --[innodb-scrub-log-speed](../innodb-system-variables/index#innodb_scrub_log_speed), [innodb\_scrub\_log\_speed](../innodb-system-variables/index#innodb_scrub_log_speed) | | [Innodb\_secondary\_index\_triggered\_cluster\_reads](../innodb-status-variables/index#innodb_secondary_index_triggered_cluster_reads) | | [Innodb\_secondary\_index\_triggered\_cluster\_reads\_avoided](../innodb-status-variables/index#innodb_secondary_index_triggered_cluster_reads_avoided) | | --[innodb-show-locks-held](../innodb-system-variables/index#innodb_show_locks_held), [innodb-show-locks-held](../innodb-system-variables/index#innodb_show_locks_held) | | --[innodb-show-verbose-locks](../innodb-system-variables/index#innodb_show_verbose_locks), [innodb\_show\_verbose\_locks](../innodb-system-variables/index#innodb_show_verbose_locks) | | [innodb\_simulate\_comp\_failures](../innodb-system-variables/index#innodb_simulate_comp_failures) | | --[innodb-sort-buffer-size](../innodb-system-variables/index#innodb_sort_buffer_size), [innodb\_sort\_buffer\_size](../innodb-system-variables/index#innodb_sort_buffer_size) | | --[innodb-spin-wait-delay](../innodb-system-variables/index#innodb_spin_wait_delay), [innodb\_spin\_wait\_delay](../innodb-system-variables/index#innodb_spin_wait_delay) | | --[innodb-stats-auto-recalc](../innodb-system-variables/index#innodb_stats_auto_recalc), [innodb\_stats\_auto\_recalc](../innodb-system-variables/index#innodb_stats_auto_recalc) | | --[innodb-stats-auto-update](../innodb-system-variables/index#innodb_stats_auto_update), [innodb\_stats\_auto\_update](../innodb-system-variables/index#innodb_stats_auto_update) | | --[innodb-stats-include-delete-marked](../innodb-system-variables/index#innodb_stats_include_delete_marked), [innodb\_stats\_include\_delete\_marked](../innodb-system-variables/index#innodb_stats_include_delete_marked) | | --[innodb-stats-method](../innodb-system-variables/index#innodb_stats_method), [innodb\_stats\_method](../innodb-system-variables/index#innodb_stats_method) | | --[innodb-stats-modified-counter](../innodb-system-variables/index#innodb_stats_modified_counter), [innodb\_stats\_modified\_counter](../innodb-system-variables/index#innodb_stats_modified_counter) | | --[innodb-stats-on-metadata](../innodb-system-variables/index#innodb_stats_on_metadata), [innodb-stats-on-metadata](../innodb-system-variables/index#innodb_stats_on_metadata) | | --[innodb-stats-persistent](../innodb-system-variables/index#innodb_stats_persistent), [innodb\_stats\_persistent](../innodb-system-variables/index#innodb_stats_persistent) | | --[innodb-stats-persistent-sample-pages](../innodb-system-variables/index#innodb_stats_persistent_sample_pages), [innodb\_stats\_persistent\_sample\_pages](../innodb-system-variables/index#innodb_stats_persistent_sample_pages) | | --[innodb-stats-sample-pages](../innodb-system-variables/index#innodb_stats_sample_pages), [innodb\_stats\_sample\_pages](../innodb-system-variables/index#innodb_stats_sample_pages) | | --[innodb-stats-traditional](../innodb-system-variables/index#innodb_stats_traditional), [innodb\_stats\_traditional](../innodb-system-variables/index#innodb_stats_traditional) | | --[innodb-stats-transient-sample-pages](../innodb-system-variables/index#innodb_stats_transient_sample_pages), [innodb\_stats\_transient\_sample\_pages](../innodb-system-variables/index#innodb_stats_transient_sample_pages) | | --[innodb-stats-update-need-lock](../innodb-system-variables/index#innodb_stats_update_need_lock), [innodb\_stats\_update\_need\_lock](../innodb-system-variables/index#innodb_stats_update_need_lock) | | --[innodb-status-file](../mysqld-options/index#-innodb-status-file) | | --[innodb-status-output](../innodb-system-variables/index#innodb_status_output), [innodb\_status\_output](../innodb-system-variables/index#innodb_status_output) | | --[innodb-status-output-locks](../innodb-system-variables/index#innodb_status_output_locks), [innodb\_status\_output\_locks](../innodb-system-variables/index#innodb_status_output_locks) | | --[innodb-strict-mode](../innodb-system-variables/index#innodb_strict_mode), [innodb\_strict\_mode](../innodb-system-variables/index#innodb_strict_mode) | | --[innodb-support-xa](../innodb-system-variables/index#innodb_support_xa), [innodb\_support\_xa](../innodb-system-variables/index#innodb_support_xa) | | --[innodb-sync-array-size](../innodb-system-variables/index#innodb_sync_array_size), [innodb\_sync\_array\_size](../innodb-system-variables/index#innodb_sync_array_size) | | --[innodb-sync-spin-loops](../innodb-system-variables/index#innodb_sync_spin_loops), [innodb\_sync\_spin\_loops](../innodb-system-variables/index#innodb_support_xa) | | --[innodb-sys-indexes](../mysqld-options/index#-innodb-sys-indexes) | | --[innodb-sys-stats](../mysqld-options/index#-innodb-sys-stats) | | --[innodb-sys-tables](../mysqld-options/index#-innodb-sys-tables) | | [Innodb\_system\_rows\_deleted](../innodb-status-variables/index#innodb_system_rows_deleted) | | [Innodb\_system\_rows\_inserted](../innodb-status-variables/index#innodb_system_rows_inserted) | | [Innodb\_system\_rows\_read](../innodb-status-variables/index#innodb_system_rows_read) | | [Innodb\_system\_rows\_updated](../innodb-status-variables/index#innodb_system_rows_updated) | | --[innodb-table-locks](../innodb-system-variables/index#innodb_table_locks), [innodb\_table\_locks](../innodb-system-variables/index#innodb_table_locks) | | --[innodb-table-stats](../mysqld-options/index#-innodb-table-stats) | | --[innodb\_temp\_data\_file\_path](../innodb-system-variables/index#innodb_temp_data_file_path), [innodb\_temp\_data\_file\_path](../innodb-system-variables/index#innodb_temp_data_file_path) | | --[innodb-thread-concurrency](../innodb-system-variables/index#innodb_thread_concurrency), [innodb\_thread\_concurrency](../innodb-system-variables/index#innodb_thread_concurrency) | | --[innodb-thread-concurrency-timer-based](../innodb-system-variables/index#innodb_thread_concurrency_timer_based), [innodb\_thread\_concurrency\_timer\_based](../innodb-system-variables/index#innodb_thread_concurrency_timer_based) | | --[innodb-thread-sleep-delay](../innodb-system-variables/index#innodb_thread_sleep_delay), [innodb\_thread\_sleep\_delay](../innodb-system-variables/index#innodb_thread_sleep_delay) | | --[innodb-tmpdir](../innodb-system-variables/index#innodb_tmpdir), [innodb\_tmpdir](../innodb-system-variables/index#innodb_tmpdir) | | --[innodb-track-changed-pages](../innodb-system-variables/index#innodb_track_changed_pages), [innodb\_track\_changed\_pages](../innodb-system-variables/index#innodb_track_changed_pages) | | --[innodb-track-redo-log-now](../innodb-system-variables/index#innodb_track_redo_log_now), [innodb\_track\_redo\_log\_now](../innodb-system-variables/index#innodb_track_redo_log_now) | | --[innodb-trx](../mysqld-options/index#-innodb-trx) | | [Innodb\_truncated\_status\_writes](../innodb-status-variables/index#innodb_truncated_status_writes) | | --[innodb-undo-directory](../innodb-system-variables/index#innodb_undo_directory), [innodb\_undo\_directory](../innodb-system-variables/index#innodb_undo_directory) | | --[innodb-undo-log-truncate](../innodb-system-variables/index#innodb_undo_log_truncate), [innodb\_undo\_log\_truncate](../innodb-system-variables/index#innodb_undo_log_truncate) | | --[innodb-undo-logs](../innodb-system-variables/index#innodb_undo_logs), [innodb\_undo\_logs](../innodb-system-variables/index#innodb_undo_logs) | | --[innodb-undo-tablespaces](../innodb-system-variables/index#innodb_undo_tablespaces), [innodb\_undo\_tablespaces](../innodb-system-variables/index#innodb_undo_tablespaces) | | [Innodb\_undo\_truncations](../innodb-status-variables/index#innodb_undo_truncations) | | --[innodb-use-atomic-writes](../innodb-system-variables/index#innodb_use_atomic_writes), [innodb\_use\_atomic\_writes](../innodb-system-variables/index#innodb_use_atomic_writes) | | --[innodb-use-fallocate](../innodb-system-variables/index#innodb_use_fallocate), [innodb\_use\_fallocate](../innodb-system-variables/index#innodb_use_fallocate) | | --[innodb-use-global-flush-log-at-trx-commit](../innodb-system-variables/index#innodb_use_global_flush_log_at_trx_commit), [innodb\_use\_global\_flush\_log\_at\_trx\_commit](../innodb-system-variables/index#innodb_use_global_flush_log_at_trx_commit) | | --[innodb-use-mtflush](../innodb-system-variables/index#innodb_use_mtflush), [innodb\_use\_mtflush](../innodb-system-variables/index#innodb_use_mtflush) | | --[innodb-use-native\_aio](../innodb-system-variables/index#innodb_use_native_aio), [innodb\_use\_native\_aio](../innodb-system-variables/index#innodb_use_native_aio) | | --[innodb-use-purge-thread](../innodb-system-variables/index#innodb_use_purge_thread), [innodb\_use\_purge\_thread](../innodb-system-variables/index#innodb_use_purge_thread) | | --[innodb-use-stacktrace](../innodb-system-variables/index#innodb_use_stacktrace), [innodb\_use\_stacktrace](../innodb-system-variables/index#innodb_use_stacktrace) | | --[innodb-use-sys-malloc](../innodb-system-variables/index#innodb_use_sys_malloc), [innodb\_use\_sys\_malloc](../innodb-system-variables/index#innodb_use_sys_malloc) | | --[innodb-use-sys-stats-table](../innodb-system-variables/index#innodb_use_sys_stats_table), [innodb\_use\_sys\_stats\_table](../innodb-system-variables/index#innodb_use_sys_stats_table) | | --[innodb-use-trim](../innodb-system-variables/index#innodb_use_trim), [innodb\_use\_trim](../innodb-system-variables/index#innodb_use_trim) | | [innodb\_version](../innodb-system-variables/index#innodb_version) | | --[innodb-write-io-threads](../innodb-system-variables/index#innodb_write_io_threads), [innodb\_write\_io\_threads](../innodb-system-variables/index#innodb_write_io_threads) | | [Innodb\_x\_lock\_os\_waits](../innodb-status-variables/index#innodb_x_lock_os_waits) | | [Innodb\_x\_lock\_spin\_rounds](../innodb-status-variables/index#innodb_x_lock_spin_rounds) | | [Innodb\_x\_lock\_spin\_waits](../innodb-status-variables/index#innodb_x_lock_spin_waits) | | --[insert\_id](../server-system-variables/index#insert_id) | | --[install](../mysqld-options/index#-install) | | --[install-manual](../mysqld-options/index#-install-manual) | | --[interactive-timeout](../server-system-variables/index#interactive_timeout), [interactive\_timeout](../server-system-variables/index#interactive_timeout) | | --[join-buffer-size](../server-system-variables/index#join_buffer_size), [join\_buffer\_size](../server-system-variables/index#join_buffer_size) | | --[join-buffer-space-limit](../server-system-variables/index#join_buffer_space_limit), [join\_buffer\_space\_limit](../server-system-variables/index#join_buffer_space_limit) | | --[join-cache-level](../server-system-variables/index#join_cache_level), [join\_cache\_level](../server-system-variables/index#join_cache_level) | | --[keep-files-on-create](../server-system-variables/index#keep_files_on_create), [keep\_files\_on\_create](../server-system-variables/index#keep_files_on_create) | | [Key\_blocks\_not\_flushed](../server-status-variables/index#key_blocks_not_flushed) | | [Key\_blocks\_unused](../server-status-variables/index#key_blocks_unused) | | [Key\_blocks\_used](../server-status-variables/index#key_blocks_used) | | [Key\_blocks\_warm](../server-status-variables/index#key_blocks_warm) | | --[key-buffer-size](../myisam-system-variables/index#key_buffer_size), [key\_buffer\_size](../myisam-system-variables/index#key_buffer_size) | | --[key-cache-age-threshold](../myisam-system-variables/index#key_cache_age_threshold), [key\_cache\_age\_threshold](../myisam-system-variables/index#key_cache_age_threshold) | | --[key-cache-block-size](../myisam-system-variables/index#key_cache_block_size), [key\_cache\_block\_size](../myisam-system-variables/index#key_cache_block_size) | | --[key-cache-division-limit](../myisam-system-variables/index#key_cache_division_limit), [key\_cache\_division\_limit](../myisam-system-variables/index#key_cache_division_limit) | | --[key-cache-file-hash-size](../myisam-system-variables/index#key_cache_file_hash_size), [key\_cache\_file\_hash\_size](../myisam-system-variables/index#key_cache_file_hash_size) | | --[key-cache-segments](../myisam-system-variables/index#key_cache_segments), [key\_cache\_segments](../myisam-system-variables/index#key_cache_segments) | | [Key\_read\_requests](../server-status-variables/index#key_read_requests) | | [Key\_reads](../server-status-variables/index#key_reads) | | [Key\_write\_requests](../server-status-variables/index#key_write_requests) | | [Key\_writes](../server-status-variables/index#key_writes) | | -L, --[language](../server-system-variables/index#language), [language](../server-system-variables/index#language) | | [large\_files\_support](../server-system-variables/index#large_files_support) | | [large\_page\_size](../server-system-variables/index#large_page_size) | | --[large-pages](../server-system-variables/index#large_pages), [large\_pages](../server-system-variables/index#large_pages) | | [last\_gtid](../gtid/index#last_gtid) | | [last\_insert\_id](../server-system-variables/index#last_insert_id) | | [Last\_query\_cost](../server-status-variables/index#last_query_cost) | | --[lc-messages](../server-system-variables/index#lc_messages), [lc\_messages](../server-system-variables/index#lc_messages) | | --[lc-messages-dir](../server-system-variables/index#lc_messages_dir), [lc\_messages\_dir](../server-system-variables/index#lc_messages_dir) | | --[lc-time-names](../server-system-variables/index#lc_time_names), [lc\_time\_names](../server-system-variables/index#lc_time_names) | | [license](../server-system-variables/index#license) | | --[local-infile](../server-system-variables/index#local_infile), [local\_infile](../server-system-variables/index#local_infile) | | --[lock-wait-timeout](../server-system-variables/index#lock_wait_timeout), [lock\_wait\_timeout](../server-system-variables/index#lock_wait_timeout) | | [locked\_in\_memory](../server-system-variables/index#locked_in_memory) | | -l, --[log](../server-system-variables/index#log), [log](../server-system-variables/index#log) | | --[log-basename](../mysqld-options-full-list/index#-log-basename) | | --[log-bin](../replication-and-binary-log-server-system-variables/index#log_bin), [log\_bin](../replication-and-binary-log-server-system-variables/index#log_bin) | | [log\_bin\_basename](../replication-and-binary-log-server-system-variables/index#log_bin_basename) | | --[log-bin-compress](../replication-and-binary-log-server-system-variables/index#log_bin_compress), [log\_bin\_compress](../replication-and-binary-log-server-system-variables/index#log_bin_compress) | | --[log-bin-compress-min-len](../replication-and-binary-log-server-system-variables/index#log_bin_compress_min_len), [log\_bin\_compress\_min\_len](../replication-and-binary-log-server-system-variables/index#log_bin_compress_min_len) | | --[log-bin-index](../replication-and-binary-log-server-system-variables/index#log_bin_index), [log\_bin\_index](../replication-and-binary-log-server-system-variables/index#log_bin_index) | | --[log-bin-trust-function-creators](../replication-and-binary-log-server-system-variables/index#log_bin_trust_function_creators), [log\_bin\_trust\_function\_creators](../replication-and-binary-log-server-system-variables/index#log_bin_trust_function_creators) | | --[log-bin-trust-routine-creators](../mysqld-options-full-list/index#-log-bin-trust-routine-creators) | | --[log-ddl-recovery](../mysqld-options/index#-log-ddl-recovery) | | --[log-disabled-statements](../server-system-variables/index#log_disabled_statements), [log\_disabled\_statements](../server-system-variables/index#log_disabled_statements) | | --[log-error](../server-system-variables/index#log_error), [log\_error](../server-system-variables/index#log_error) | | -0, --[log-long-format](../mysqld-options-full-list/index#-log-long-format) | | --[log-output](../server-system-variables/index#log_output), [log\_output](../server-system-variables/index#log_output) | | --[log-queries-not-using-indexes](../server-system-variables/index#log_queries_not_using_indexes), [log\_queries\_not\_using\_indexes](../server-system-variables/index#log_queries_not_using_indexes) | | --[log-short-format](../mysqld-options-full-list/index#-log-short-format) | | --[log-slave-updates](../replication-and-binary-log-server-system-variables/index#log_slave_updates), [log\_slave\_updates](../replication-and-binary-log-server-system-variables/index#log_slave_updates) | | --[log-slow-admin-statements](../server-system-variables/index#log_slow_admin_statements), [log\_slow\_admin\_statements](../server-system-variables/index#log_slow_admin_statements) | | --[log-slow-disabled-statements](../server-system-variables/index#log_slow_disabled_statements), [log\_slow\_disabled\_statements](../server-system-variables/index#log_slow_disabled_statements) | | --[log-slow-file](../mysqld-options-full-list/index#-log-slow-file) | | --[log-slow-filter](../server-system-variables/index#log_slow_filter), [log\_slow\_filter](../server-system-variables/index#log_slow_filter) | | --[log-slow-queries](../server-system-variables/index#log_slow_queries), [log\_slow\_queries](../server-system-variables/index#log_slow_queries) | | --[log-slow-rate-limit](../server-system-variables/index#log_slow-_rate_limit), [log\_slow\_rate\_limit](../server-system-variables/index#log_slow_rate_limit) | | --[log-slow-slave-statements](../replication-and-binary-log-server-system-variables/index#log_slow_slave_statements), [log\_slow\_slave\_statements](../replication-and-binary-log-server-system-variables/index#log_slow_slave_statements) | | --[log-slow-time](../mysqld-options-full-list/index#-log-slow-time) | | --[log-slow-verbosity](../server-system-variables/index#log_slow_verbosity), [log\_slow\_verbosity](../server-system-variables/index#log_slow_verbosity) | | --[log-tc](../mysqld-options-full-list/index#-log-tc) | | --[log-tc-size](../server-system-variables/index#log_tc_size), [log\_tc\_size](../server-system-variables/index#log_tc_size) | | -W, --[log-warnings](../server-system-variables/index#log_warnings), [log\_warnings](../server-system-variables/index#log_warnings) | | --[long-query-time](../server-system-variables/index#long_query_time), [long\_query\_time](../server-system-variables/index#long_query_time) | | --[log-isam](../mysqld-options/index#-log-isam) | | --[low-priority-updates](../server-system-variables/index#low_priority_updates), [low\_priority\_updates](../server-system-variables/index#low_priority_updates) | | [lower\_case\_file\_system](../server-system-variables/index#lower_case_file_system) | | --[lower-case-table-names](../server-system-variables/index#lower_case_table_names), [lower\_case\_table\_names](../server-system-variables/index#lower_case_table_names) | | --[master-connect-retry](../mysqld-options/index#-master-connect-retry) | | [Master\_gtid\_wait\_count](../replication-and-binary-log-status-variables/index#master_gtid_wait_count) | | [Master\_gtid\_wait\_time](../replication-and-binary-log-status-variables/index#master_gtid_wait_time) | | [Master\_gtid\_wait\_timeouts](../replication-and-binary-log-status-variables/index#master_gtid_wait_timeouts) | | --[master-host](../mysqld-options/index#-master-host) | | --[master-info-file](../mysqld-options/index#-master-info-file) | | --[master-password](../mysqld-options/index#-master-password) | | --[master-port](../mysqld-options/index#-master-port) | | --[master-retry-count](../mysqld-options/index#-master-retry-count) | | --[master-ssl](../mysqld-options/index#-master-ssl) | | --[master-ssl-ca](../mysqld-options/index#-master-ssl-ca) | | --[master-ssl-capath](../mysqld-options/index#-master-ssl-capath) | | --[master-ssl-cert](../mysqld-options/index#-master-ssl-cert) | | --[master-ssl-cipher](../mysqld-options/index#-master-ssl-cipher) | | --[master-ssl-key](../mysqld-options/index#-master-ssl-key) | | --[master-user](../mysqld-options/index#-master-user) | | --[master-verify-checksum](../replication-and-binary-log-server-system-variables/index#master_verify_checksum), [master\_verify\_checksum](../replication-and-binary-log-server-system-variables/index#master_verify_checksum) | | --[max-allowed-packet](../server-system-variables/index#max_allowed_packet), [max\_allowed\_packet](../server-system-variables/index#max_allowed_packet) | | --[max-binlog-dump-events](../mysqld-options/index#-max-binlog-dump-events) | | --[max-binlog-cache-size](../server-system-variables/index#max_binlog_cache_size), [max\_binlog\_cache\_size](../server-system-variables/index#max_binlog_cache_size) | | --[max-binlog-size](../server-system-variables/index#max_binlog_size), [max\_binlog\_size](../server-system-variables/index#max_binlog_size) | | --[max-binlog-stmt-cache-size](../server-system-variables/index#max_binlog_stmt_cache_size), [max\_binlog\_stmt\_cache\_size](../server-system-variables/index#max_binlog_stmt_cache_size) | | --[max-connect-errors](../server-system-variables/index#max_connect_errors), [max\_connect\_errors](../server-system-variables/index#max_connect_errors) | | --[max-connections](../server-system-variables/index#max_connections), [max\_connections](../server-system-variables/index#max_connections) | | --[max-delayed-threads](../server-system-variables/index#max_delayed_threads), [max\_delayed\_threads](../server-system-variables/index#max_delayed_threads) | | --[max-digest-length](../server-system-variables/index#max_digest_length), [max\_digest\_length](../server-system-variables/index#max_digest_length) | | --[max-error-count](../server-system-variables/index#max_error_count), [max\_error\_count](../server-system-variables/index#max_error_count) | | --[max-heap-table-size](../server-system-variables/index#max_heap_table_size), [max\_heap\_table\_size](../server-system-variables/index#max_heap_table_size) | | [max\_insert\_delayed\_threads](../server-system-variables/index#max_insert_delayed_threads) | | --[max-join-size](../server-system-variables/index#max_join_size), [max\_join\_size](../server-system-variables/index#max_join_size) | | --[max-length-for-sort-data](../server-system-variables/index#max_length_for_sort_data), [max\_length\_for\_sort\_data](../server-system-variables/index#max_length_for_sort_data) | | --[max-long-data-size](../server-system-variables/index#max_long_data_size), [max\_long\_data\_size](../server-system-variables/index#max_long_data_size) | | --[max-prepared-stmt-count](../server-system-variables/index#max_prepared_stmt_count), [max\_prepared\_stmt\_count](../server-system-variables/index#max_prepared_stmt_count) | | --[max-password-errors](../server-system-variables/index#max_password_errors), [max\_password\_errors](../server-system-variables/index#max_password_errors) | | --[max-recursive-iterations](../server-system-variables/index#max_recursive_iterations), [max\_recursive\_iterations](../server-system-variables/index#max_recursive_iterations) | | --[max-relay-log-size](../replication-and-binary-log-server-system-variables/index#max_relay_log_size), [max\_relay\_log\_size](../replication-and-binary-log-server-system-variables/index#max_relay_log_size) | | --[max-rowid-filter-size](../server-system-variables/index#max_rowid_filter_size), [max\_rowid\_filter\_size](../server-system-variables/index#max_rowid_filter_size) | | --[max-seeks-for-key](../server-system-variables/index#max_seeks_for_key), [max\_seeks\_for\_key](../server-system-variables/index#max_seeks_for_key) | | --[max-session-mem-used](../server-system-variables/index#max_session_mem_used), [max\_session\_mem\_used](../server-system-variables/index#max_session_mem_used) | | --[max-sort-length](../server-system-variables/index#max_sort_length), [max\_sort\_length](../server-system-variables/index#max_sort_length) | | --[max-sp-recursion-depth](../server-system-variables/index#max_sp_recursion_depth), [max\_sp\_recursion\_depth](../server-system-variables/index#max_sp_recursion_depth) | | --[max-statement-time](../server-system-variables/index#max_statement_time), [max\_statement\_time](../server-system-variables/index#max_statement_time) | | [Max\_statement\_time\_exceeded](../server-status-variables/index#max_statement_time_exceeded) | | --[max-tmp-tables](../server-system-variables/index#max_tmp_tables), [max\_tmp\_tables](../server-system-variables/index#max_tmp_tables) | | [Max\_used\_connections](../server-status-variables/index#max_used_connections) | | --[max-user-connections](../server-system-variables/index#max_user_connections), [max\_user\_connections](../server-system-variables/index#max_user_connections) | | --[max-write-lock-count](../server-system-variables/index#max_write_lock_count), [max\_write\_lock\_count](../server-system-variables/index#max_write_lock_count) | | --[memlock](../mysqld-options/index#-memlock) | | [Memory\_used](../server-status-variables/index#memory_used) | | [Memory\_used\_initial](../server-status-variables/index#memory_used_initial) | | --[metadata-locks-cache-size](../server-system-variables/index#metadata_locks_cache_size), [metadata\_locks\_cache\_size](../server-system-variables/index#metadata_locks_cache_size) | | --[metadata-locks-hash-instances](../server-system-variables/index#metadata_locks_hash_instances), [metadata\_locks\_hash\_instances](../server-system-variables/index#metadata_locks_hash_instances) | | --[min-examined-row-limit](../server-system-variables/index#min_examined_row_limit), [min-examined-row-limit](../server-system-variables/index#min_examined_row_limit) | | [mroonga\_action\_on\_fulltext\_query\_error](../mroonga-system-variables/index#mroonga_action_on_fulltext_query_error) | | [mroonga\_boolean\_mode\_syntax\_flags](../mroonga-system-variables/index#mroonga_boolean_mode_syntax_flags) | | [Mroonga\_count\_skip](../mroonga-status-variables/index#mroonga_count_skip) | | [mroonga\_database\_path\_prefix](../mroonga-system-variables/index#mroonga_database_path_prefix) | | [mroonga\_default\_parser](../mroonga-system-variables/index#mroonga_default_parser) | | [mroonga\_default\_tokenizer](../mroonga-system-variables/index#mroonga_default_tokenizer) | | [mroonga\_default\_wrapper\_engine](../mroonga-system-variables/index#mroonga_default_wrapper_engine) | | [mroonga\_dry\_write](../mroonga-system-variables/index#mroonga_dry_write) | | [mroonga\_enable\_operations\_recording](../mroonga-system-variables/index#mroonga_enable_operations_recording) | | [mroonga\_enable\_optimization](../mroonga-system-variables/index#mroonga_enable_optimization) | | [Mroonga\_fast\_order\_limit](../mroonga-status-variables/index#mroonga_fast_order_limit) | | [mroonga\_libgroonga\_embedded](../mroonga-system-variables/index#mroonga_libgroonga_embedded) | | [mroonga\_libgroonga\_support\_zlib](../mroonga-system-variables/index#mroonga_libgroonga_support_zlib) | | [mroonga\_libgroonga\_support\_zstd](../mroonga-system-variables/index#mroonga_libgroonga_support_zstd) | | [mroonga\_libgroonga\_version](../mroonga-system-variables/index#mroonga_libgroonga_version) | | [mroonga\_log\_file](../mroonga-system-variables/index#mroonga_log_file) | | [mroonga\_log\_level](../mroonga-system-variables/index#mroonga_log_level) | | [mroonga\_match\_escalation\_threshold](../mroonga-system-variables/index#mroonga_match_escalation_threshold) | | [mroonga\_max\_n\_records\_for\_estimate](../mroonga-system-variables/index#mroonga_max_n_records_for_estimate) | | [mroonga\_query\_log\_file](../mroonga-system-variables/index#mroonga_query_log_file) | | [mroonga\_vector\_column\_delimiter](../mroonga-system-variables/index#mroonga_vector_column_delimiter) | | [mroonga\_version](../mroonga-system-variables/index#mroonga_version) | | --[mrr-buffer-size](../server-system-variables/index#mrr_buffer_size), [mrr\_buffer\_size](../server-system-variables/index#mrr_buffer_size) | | --[multi-range-count](../server-system-variables/index#multi_range_count), [multi\_range\_count](../server-system-variables/index#multi_range_count) | | --[myisam-block-size](../myisam-server-system-variables/index#myisam_block_size), [myisam\_block\_size](../myisam-server-system-variables/index#myisam_block_size) | | --[myisam-data-pointer-size](../myisam-server-system-variables/index#myisam_data_pointer_size), [myisam\_data\_pointer\_size](../myisam-server-system-variables/index#myisam_data_pointer_size) | | --[myisam-max-extra-sort-file-size](../myisam-server-system-variables/index#myisam_max_extra_sort_file_size), [myisam\_max\_extra\_sort\_file\_size](../myisam-server-system-variables/index#myisam_max_extra_sort_file_size) | | --[myisam-max-sort-file-size](../myisam-server-system-variables/index#myisam_max_sort_file_size), [myisam\_max\_sort\_file\_size](../myisam-server-system-variables/index#myisam_max_sort_file_size) | | --[myisam-mmap-size](../myisam-server-system-variables/index#myisam_mmap_size), [myisam\_mmap\_size](../myisam-server-system-variables/index#myisam_mmap_size) | | --[myisam-recover-options](../myisam-server-system-variables/index#myisam_recover_options), [myisam\_recover\_options](../myisam-server-system-variables/index#myisam_recover_options) | | --[myisam-repair-threads](../myisam-server-system-variables/index#myisam_repair_threads), [myisam\_repair\_threads](../myisam-server-system-variables/index#myisam_repair_threads) | | --[myisam-sort-buffer-size](../myisam-server-system-variables/index#myisam_sort_buffer_size), [myisam\_sort\_buffer\_size](../myisam-server-system-variables/index#myisam_sort_buffer_size) | | --[myisam-stats-method](../myisam-server-system-variables/index#myisam_stats_method), [myisam\_stats\_method](../myisam-server-system-variables/index#myisam_stats_method) | | --[myisam-use-mmap](../myisam-server-system-variables/index#myisam_use_mmap), [myisam\_use\_mmap](../myisam-server-system-variables/index#myisam_use_mmap) | | --[mysql56-temporal-format](../server-system-variables/index#mysql56_temporal_format), [mysql56\_temporal\_format](../server-system-variables/index#mysql56_temporal_format) | | --[named-pipe](../server-system-variables/index#named_pipe), [named\_pipe](../server-system-variables/index#named_pipe) | | --[ndb-use-copying-alter-table](../mysqld-options/index#-ndb-use-copying-alter-table) | | --[net-buffer-length](../server-system-variables/index#net_buffer_length), [net\_buffer\_length](../server-system-variables/index#net_buffer_length) | | --[net-read-timeout](../server-system-variables/index#net_read_timeout), [net\_read\_timeout](../server-system-variables/index#net_read_timeout) | | --[net-retry-count](../server-system-variables/index#net_retry_count), [net\_retry\_count](../server-system-variables/index#net_retry_count) | | --[net-write-timeout](../server-system-variables/index#net_write_timeout), [net\_write\_timeout](../server-system-variables/index#net_write_timeout) | | [Not\_flushed\_delayed\_rows](../server-status-variables/index#not_flushed_delayed_rows) | | --[new](../mysqld-options/index#-new) | | --[old](../server-system-variables/index#old), [old](../server-system-variables/index#old) | | --[old-alter-table](../server-system-variables/index#old_alter_table), [old\_alter\_table](../server-system-variables/index#old_alter_table) | | --[old-mode](../server-system-variables/index#old_mode), [old\_mode](../server-system-variables/index#old_mode) | | --[old-passwords](../server-system-variables/index#old_passwords), [old\_passwords](../server-system-variables/index#old_passwords) | | --[old-style-user-limits](../mysqld-options/index#-old-style-user-limits) | | --[one-thread](../mysqld-options/index#-one-thread) | | [Open\_files](../server-status-variables/index#open_files) | | --[open-files-limit](../server-system-variables/index#open_files_limit), [open\_files\_limit](../server-system-variables/index#open_files_limit) | | [Open\_streams](../server-status-variables/index#open_streams) | | [Open\_table\_definitions](../server-status-variables/index#open_table_definitions) | | [Open\_tables](../server-status-variables/index#open_tables) | | [Opened\_files](../server-status-variables/index#opened_files) | | [Opened\_plugin\_libraries](../server-status-variables/index#opened_plugin_libraries) | | [Opened\_table\_definitions](../server-status-variables/index#opened_table_definitions) | | [Opened\_tables](../server-status-variables/index#opened_tables) | | [Opened\_views](../server-status-variables/index#opened_views) | | --[optimizer-max-sel-arg-weight](../server-system-variables/index#optimizer_max_sel_arg_weight) , [optimizer\_max\_sel\_arg\_weight](../server-system-variables/index#optimizer_max_sel_arg_weight) | | --[optimizer-prune-level](../server-system-variables/index#optimizer_prune_level) , [optimizer\_prune\_level](../server-system-variables/index#optimizer_prune_level) | | --[optimizer-search-depth](../server-system-variables/index#optimizer_search_depth), [optimizer\_search\_depth](../server-system-variables/index#optimizer_search_depth) | | --[optimizer-selectivity-sampling-limit](../server-system-variables/index#optimizer_selectivity_sampling_limit), [optimizer\_selectivity\_sampling\_limit](../server-system-variables/index#optimizer_selectivity_sampling_limit) | | --[optimizer-switch](../server-system-variables/index#optimizer_switch), [optimizer\_switch](../server-system-variables/index#optimizer_switch) | | --[optimizer-trace](../server-system-variables/index#optimizer_trace), [optimizer\_trace](../server-system-variables/index#optimizer_trace) | | --[optimizer-trace-max-mem-size](../server-system-variables/index#optimizer_trace_max_mem_size), [optimizer\_trace\_max\_mem\_size](../server-system-variables/index#optimizer_trace_max_mem_size) | | --[optimizer-use-condition-selectivity](../server-system-variables/index#optimizer_use_condition_selectivity), [optimizer\_use\_condition\_selectivity](../server-system-variables/index#optimizer_use_condition_selectivity) | | [oqgraph\_allow\_create\_integer\_latch](../oqgraph-system-and-status-variables/index#oqgraph_allow_create_integer_latch) | | [Oqgraph\_boost\_version](../oqgraph-status-variables/index#oqgraph_boost_version) | | [Oqgraph\_compat\_mode](../oqgraph-status-variables/index#oqgraph_compat_mode) | | [Oqgraph\_verbose\_debug](../oqgraph-status-variables/index#oqgraph_verbose_debug) | | --[pam-debug](../authentication-plugin-pam/index#pam_debug), [pam\_debug](../authentication-plugin-pam/index#pam_debug) | | -P, --[port](../server-system-variables/index#port), [port](../server-system-variables/index#port) | | --[pam-use-cleartext-plugin](../authentication-plugin-pam/index#pam_use_cleartext_plugin), [pam\_use\_cleartext\_plugin](../authentication-plugin-pam/index#pam_use_cleartext_plugin) | | --[pam-windbind-workaround](../authentication-plugin-pam/index#pam_winbind_workaround), [pam\_windbind\_workaround](../authentication-plugin-pam/index#pam_winbind_workaround) | | --[password-reuse-check-interval](../password_reuse_check_interval/index), [password\_reuse\_check\_interval](../password_reuse_check_interval/index) | | --pbxt | | --[pbxt-auto-increment-mode](../pbxt-system-variables/index#pbxt_auto_increment_mode) | | --[pbxt-checkpoint-frequency](../pbxt-system-variables/index#pbxt_checkpoint_frequency) | | --[pbxt-data-file-grow-size](../pbxt-system-variables/index#pbxt_data_file_grow_size) | | --[pbxt-data-log-threshold](../pbxt-system-variables/index#pbxt_data_log_threshold) | | --[pbxt-flush-log-at-trx-commit](../pbxt-system-variables/index#pbxt_flush_log_at_trx_commit) | | --[pbxt-garbage-threshold](../pbxt-system-variables/index#pbxt_garbage_threshold) | | --[pbxt-index-cache-size](../pbxt-system-variables/index#pbxt_index_cache_size) | | --[pbxt-log-buffer-size](../pbxt-system-variables/index#pbxt_log_buffer_size) | | --[pbxt-log-cache-size](../pbxt-system-variables/index#pbxt_log_cache_size) | | --[pbxt-log-file-count](../pbxt-system-variables/index#pbxt_log_file_count) | | --[pbxt-log-file-threshold](../pbxt-system-variables/index#pbxt_log_file_threshold) | | --[pbxt-max-threads](../pbxt-system-variables/index#options-for-pbxt) | | --[pbxt-offline-log-function](../pbxt-system-variables/index#pbxt_offline_log_function) | | --[pbxt-record-cache-size](../pbxt-system-variables/index#pbxt_record_cache_size) | | --[pbxt-row-file-grow-size](../pbxt-system-variables/index#pbxt_row_file_grow_size) | | --[pbxt-statistics](../pbxt-system-variables/index#options-for-pbxt) | | --[pbxt-sweeper-priority](../pbxt-system-variables/index#pbxt_sweeper_priority) | | --[pbxt-support-xa](../pbxt-system-variables/index#pbxt_support_xa) | | --[pbxt-transaction-buffer-size](../pbxt-system-variables/index#pbxt_transaction_buffer_size) | | --[performance-schema](../performance-schema-system-variables/index#performance_schema), [performance\_schema](../performance-schema-system-variables/index#performance_schema) | | [Performance\_schema\_accounts\_lost](../performance-schema-status-variables/index#performance_schema_accounts_lost) | | --[performance-schema-accounts-size](../performance-schema-system-variables/index#performance_schema_accounts_size), [performance\_schema\_accounts\_size](../performance-schema-system-variables/index#performance_schema_accounts_size) | | [Performance\_schema\_cond\_classes\_lost](../performance-schema-status-variables/index#performance_schema_cond_classes_lost) | | [Performance\_schema\_cond\_instances\_lost](../performance-schema-status-variables/index#performance_schema_cond_instances_lost) | | [--performance-schema-consumer-events-stages-current](../mysqld-options/index#-performance-schema-consumer-events-stages-current) | | [--performance-schema-consumer-events-stages-history](../mysqld-options/index#-performance-schema-consumer-events-stages-history) | | [--performance-schema-consumer-events-stages-history-long](../mysqld-options/index#-performance-schema-consumer-events-stages-history-long) | | [--performance-schema-consumer-events-statements-current](../mysqld-options/index#-performance-schema-consumer-events-statements-current) | | [--performance-schema-consumer-events-statements-history](../mysqld-options/index#-performance-schema-consumer-events-statements-history) | | [--performance-schema-consumer-events-statements-history-long](../mysqld-options/index#-performance-schema-consumer-events-statements-history-long) | | [--performance-schema-consumer-events-waits-current](../mysqld-options/index#-performance-schema-consumer-events-waits-current) | | [--performance-schema-consumer-events-waits-history](../mysqld-options/index#-performance-schema-consumer-events-waits-history) | | [--performance-schema-consumer-events-waits-history-long](../mysqld-options/index#-performance-schema-consumer-events-waits-history-long) | | [--performance-schema-consumer-global-instrumentation](../mysqld-options/index#-performance-schema-consumer-global-instrumentation) | | [--performance-schema-consumer-statements-digest](../mysqld-options/index#-performance-schema-consumer-statements-digest) | | [--performance-schema-consumer-thread-instrumentation](../mysqld-options/index#-performance-schema-consumer-thread-instrumentation) | | [Performance\_schema\_digest\_lost](../performance-schema-status-variables/index#performance_schema_digest_lost) | | --[performance-schema-digests-size](../performance-schema-system-variables/index#performance_schema_digests_size), [performance\_schema\_digests\_size](../performance-schema-system-variables/index#performance_schema_digests_size) | | --[performance-schema-events-stages-history-long-size](../performance-schema-system-variables/index#performance_schema_events_stages_history_long_size), [performance\_schema\_events\_stages\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_stages_history_long_size) | | --[performance-schema-events-stages-history-size](../performance-schema-system-variables/index#performance_schema_events_stages_history_size), [performance\_schema\_events\_stages\_history\_size](../performance-schema-system-variables/index#performance_schema_events_stages_history_size) | | --[performance-schema-events-statements-history-long-size](../performance-schema-system-variables/index#performance_schema_events_statements_history_long_size), [performance\_schema\_events\_statements\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_statements_history_long_size) | | --[performance-schema-events-statements-history-size](../performance-schema-system-variables/index#performance_schema_events_statements_history_size), [performance\_schema\_events\_statements\_history\_size](../performance-schema-system-variables/index#performance_schema_events_statements_history_size) | | --[performance-schema-events-transactions-history-long-size](../performance-schema-system-variables/index#performance_schema_events_transactions_history_long_size), [performance\_schema\_events\_transactions\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_transactions_history_long_size) | | --[performance-schema-events-transactions-history-size](../performance-schema-system-variables/index#performance_schema_events_transactions_history_size), [performance\_schema\_events\_transactions\_history\_size](../performance-schema-system-variables/index#performance_schema_events_transactions_history_size) | | --[performance-schema-events-waits-history-long-size](../performance-schema-system-variables/index#performance_schema_events_waits_history_long_size), [performance\_schema\_events\_waits\_history\_long\_size](../performance-schema-system-variables/index#performance_schema_events_waits_history_long_size) | | --[performance-schema-events-waits-history-size](../performance-schema-system-variables/index#performance_schema_events_waits_history_size), [performance\_schema\_events\_waits\_history\_size](../performance-schema-system-variables/index#performance_schema_events_waits_history_size) | | [Performance\_schema\_file\_classes\_lost](../performance-schema-status-variables/index#performance_schema_file_classes_lost) | | [Performance\_schema\_file\_handles\_lost](../performance-schema-status-variables/index#performance_schema_file_handles_lost) | | [Performance\_schema\_file\_instances\_lost](../performance-schema-status-variables/index#performance_schema_file_instances_lost) | | [Performance\_schema\_hosts\_lost](../performance-schema-status-variables/index#performance_schema_accounts_lost) | | --[performance-schema-hosts-size](../performance-schema-system-variables/index#performance_schema_hosts_size), [performance\_schema\_hosts\_size](../performance-schema-system-variables/index#performance_schema_hosts_size) | | [Performance\_schema\_locker\_lost](../performance-schema-status-variables/index#performance_schema_locker_lost) | | [Performance\_schema\_index\_stat\_lost](../performance-schema-status-variables/index#performance_schema_index_stat_lost) | | --[performance-schema-max-cond-classes](../performance-schema-system-variables/index#performance_schema_max_cond_classes), [performance\_schema\_max\_cond\_classes](../performance-schema-system-variables/index#performance_schema_max_cond_classes) | | --[performance-schema-max-cond-instances](../performance-schema-system-variables/index#performance_schema_max_cond_instances), [performance\_schema\_max\_cond\_instances](../performance-schema-system-variables/index#performance_schema_max_cond_instances) | | --[performance-schema-max-digest-length](../performance-schema-system-variables/index#performance_schema_max_digest_length), [performance\_schema\_max\_digest\_length](../performance-schema-system-variables/index#performance_schema_max_digest_length) | | --[performance-schema-max-file-classes](../performance-schema-system-variables/index#performance_schema_max_file_classes), [performance\_schema\_max\_file\_classes](../performance-schema-system-variables/index#performance_schema_max_file_classes) | | --[performance-schema-max-file-handles](../performance-schema-system-variables/index#performance_schema_max_file_handles), [performance\_schema\_max\_file\_handles](../performance-schema-system-variables/index#performance_schema_max_file_handles) | | --[performance-schema-max-file-instances](../performance-schema-system-variables/index#performance_schema_max_file_instances), [performance\_schema\_max\_file\_instances](../performance-schema-system-variables/index#performance_schema_max_file_instances) | | --[performance-schema-max-index-stat](../performance-schema-system-variables/index#performance_schema_max_index_stat), [performance\_schema\_max\_index\_stat](../performance-schema-system-variables/index#performance_schema_max_index_stat) | | --[performance-schema-max-memory-classes](../performance-schema-system-variables/index#performance_schema_max_memory_classes), [performance\_schema\_max\_memory\_classes](../performance-schema-system-variables/index#performance_schema_max_memory_classes) | | --[performance-schema-max-metadata-locks](../performance-schema-system-variables/index#performance_schema_max_metadata_locks), [performance\_schema\_max\_metadata\_locks](../performance-schema-system-variables/index#performance_schema_max_metadata_locks) | | --[performance-schema-max-mutex-classes](../performance-schema-system-variables/index#performance_schema_max_mutex_classes), [performance\_schema\_max\_mutex\_classes](../performance-schema-system-variables/index#performance_schema_max_mutex_classes) | | --[performance-schema-max-mutex-instances](../performance-schema-system-variables/index#performance_schema_max_mutex_instances), [performance\_schema\_max\_mutex\_instances](../performance-schema-system-variables/index#performance_schema_max_mutex_instances) | | --[performance-schema-max-prepared-statement-instances](../performance-schema-system-variables/index#performance_schema_max_prepared_statement_instances), [performance\_schema\_max\_prepared\_statement\_instances](../performance-schema-system-variables/index#performance_schema_max_prepared_statement_instances) | | --[performance-schema-max-program-instances](../performance-schema-system-variables/index#performance_schema_max_program_instances), [performance\_schema\_max\_program\_instances](../performance-schema-system-variables/index#performance_schema_max_program_instances) | | --[performance-schema-max-sql-text-length](../performance-schema-system-variables/index#performance_schema_max_sql_text_length), [performance\_schema\_max\_sql\_text\_length](../performance-schema-system-variables/index#performance_schema_max_sql_text_length) | | --[performance-schema-max-rwlock-classes](../performance-schema-system-variables/index#performance_schema_max_rwlock_classes), [performance\_schema\_max\_rwlock\_classes](../performance-schema-system-variables/index#performance_schema_max_rwlock_classes) | | --[performance-schema-max-rwlock-instances](../performance-schema-system-variables/index#performance_schema_max_rwlock_instances), [performance\_schema\_max\_rwlock\_instances](../performance-schema-system-variables/index#performance_schema_max_rwlock_instances) | | --[performance-schema-max-socket-classes](../performance-schema-system-variables/index#performance_schema_max_socket_classes), [performance\_schema\_max\_socket\_classes](../performance-schema-system-variables/index#performance_schema_max_socket_classes) | | --[performance-schema-max-socket-instances](../performance-schema-system-variables/index#performance_schema_max_socket_instances), [performance\_schema\_max\_socket\_instances](../performance-schema-system-variables/index#performance_schema_max_socket_instances) | | --[performance-schema-max-stage-classes](../performance-schema-system-variables/index#performance_schema_max_stage_classes), [performance\_schema\_max\_stage\_classes](../performance-schema-system-variables/index#performance_schema_max_stage_classes) | | --[performance-schema-max-statement-classes](../performance-schema-system-variables/index#performance_schema_max_statement_classes), [performance\_schema\_max\_statement\_classes](../performance-schema-system-variables/index#performance_schema_max_statement_classes) | | --[performance-schema-max-statement-stack](../performance-schema-system-variables/index#performance_schema_max_statement_stack), [performance\_schema\_max\_statement\_stack](../performance-schema-system-variables/index#performance_schema_max_statement_stack) | | --[performance-schema-max-table-handles](../performance-schema-system-variables/index#performance_schema_max_table_handles), [performance\_schema\_max\_table\_handles](../performance-schema-system-variables/index#performance_schema_max_table_handles) | | --[performance-schema-max-table-instances](../performance-schema-system-variables/index#performance_schema_max_table_instances), [performance\_schema\_max\_table\_instances](../performance-schema-system-variables/index#performance_schema_max_table_instances) | | --[performance-schema-max-table-lock-stat](../performance-schema-system-variables/index#performance_schema_max_table_lock_stat), [performance\_schema\_max\_table\_lock\_stat](../performance-schema-system-variables/index#performance_schema_max_table_lock_stat) | | --[performance-schema-max-thread-classes](../performance-schema-system-variables/index#performance_schema_max_thread_classes), [performance\_schema\_max\_thread\_classes](../performance-schema-system-variables/index#performance_schema_max_thread_classes) | | --[performance-schema-max-thread-instances](../performance-schema-system-variables/index#performance_schema_max_thread_instances), [performance\_schema\_max\_thread\_instances](../performance-schema-system-variables/index#performance_schema_max_thread_instances) | | [Performance\_schema\_memory\_classes\_lost](../performance-schema-status-variables/index#performance_schema_memory_classes_lost) | | [Performance\_schema\_metadata\_lock\_lost](../performance-schema-status-variables/index#performance_schema_metadata_lock_lost) | | [Performance\_schema\_mutex\_classes\_lost](../performance-schema-status-variables/index#performance_schema_mutex_classes_lost) | | [Performance\_schema\_mutex\_instances\_lost](../performance-schema-status-variables/index#performance_schema_mutex_instances_lost) | | [Performance\_schema\_nested\_statement\_lost](../performance-schema-status-variables/index#performance_schema_nested_statement_lost) | | [Performance\_schema\_prepared\_statements\_lost](../performance-schema-status-variables/index#performance_schema_prepared_statements_lost) | | [Performance\_schema\_program\_lost](../performance-schema-status-variables/index#performance_schema_program_lost) | | [Performance\_schema\_rwlock\_classes\_lost](../performance-schema-status-variables/index#performance_schema_rwlock_classes_lost) | | [Performance\_schema\_rwlock\_instances\_lost](../performance-schema-status-variables/index#performance_schema_rwlock_instances_lost) | | [Performance\_schema\_session\_connect\_attrs\_lost](../performance-schema-status-variables/index#performance_schema_session_connect_attrs_lost) | | [Performance\_schema\_socket\_classes\_lost](../performance-schema-status-variables/index#performance_schema_socket_classes_lost) | | [Performance\_schema\_socket\_instances\_lost](../performance-schema-status-variables/index#performance_schema_socket_instances_lost) | | [Performance\_schema\_stage\_classes\_lost](../performance-schema-status-variables/index#performance_schema_stage_classes_lost) | | [Performance\_schema\_stage\_classes\_lost](../performance-schema-status-variables/index#performance_schema_stage_classes_lost) | | [Performance\_schema\_statement\_classes\_lost](../performance-schema-status-variables/index#performance_schema_statement_classes_lost) | | --[performance-schema-session-connect-attrs-size](../performance-schema-system-variables/index#performance_schema_session_connect_attrs_size), [performance\_schema\_session\_connect\_attrs\_size](../performance-schema-system-variables/index#performance_schema_session_connect_attrs_size) | | --[performance-schema-setup-actors-size](../performance-schema-system-variables/index#performance_schema_setup_actors_size), [performance\_schema\_setup\_actors\_size](../performance-schema-system-variables/index#performance_schema_setup_actors_size) | | --[performance-schema-setup-objects-size](../performance-schema-system-variables/index#performance_schema_setup_objects_size), [performance\_schema\_setup\_objects\_size](../performance-schema-system-variables/index#performance_schema_setup_objects_size) | | [Performance\_schema\_table\_handles\_lost](../performance-schema-status-variables/index#performance_schema_table_handles_lost) | | [Performance\_schema\_table\_instances\_lost](../performance-schema-status-variables/index#performance_schema_table_instances_lost) | | [Performance\_schema\_table\_lock\_stat\_lost](../performance-schema-status-variables/index#performance_schema_table_lock_stat_lost) | | [Performance\_schema\_thread\_classes\_lost](../performance-schema-status-variables/index#performance_schema_thread_classes_lost) | | [Performance\_schema\_thread\_instances\_lost](../performance-schema-status-variables/index#performance_schema_thread_instances_lost) | | [Performance\_schema\_schema\_users\_lost](../performance-schema-status-variables/index#performance_schema_schema_users_lost) | | --[performance\_schema\_users\_size](../performance-schema-system-variables/index#performance_schema_users_size), [performance\_schema\_users\_size](../performance-schema-system-variables/index#performance-schema-users-size) | | --[pid-file](../server-system-variables/index#pid_file), [pid\_file](../server-system-variables/index#pid_file) | | --[plugin-load](../mysqld-options/index#-plugin-load) | | --[plugin-load-add](../mysqld-options/index#-plugin-load-add) | | --[plugin-dir](../server-system-variables/index#plugin_dir), [plugin\_dir](../server-system-variables/index#plugin_dir) | | --[plugin-maturity](../server-system-variables/index#plugin_maturity), [plugin\_maturity](../server-system-variables/index#plugin_maturity) | | -P, --[port](../server-system-variables/index#port), [port](../server-system-variables/index#port) | | --[port-open-timeout](../mysqld-options/index#-port-open-timeout) | | --[preload-buffer-size](../server-system-variables/index#preload_buffer_size), [preload\_buffer\_size](../server-system-variables/index#preload_buffer_size) | | [Prepared\_stmt\_count](../server-status-variables/index#prepared_stmt_count) | | [profiling](../server-system-variables/index#profiling) | | --[profiling-history-size](../server-system-variables/index#profiling_history_size), [profiling\_history\_size](../server-system-variables/index#profiling_history_size) | | --[progress-report-time](../server-system-variables/index#progress_report_time), [progress\_report\_time](../server-system-variables/index#progress_report_time) | | [protocol\_version](../server-system-variables/index#protocol_version) | | --[proxy-protocol-networks](../server-system-variables/index#proxy_protocol_networks), [proxy\_protocol\_networks](../server-system-variables/index#proxy_protocol_networks) | | [proxy\_user](../server-system-variables/index#proxy_user) | | [pseudo\_slave\_mode](../server-system-variables/index#pseudo_slave_mode) | | [pseudo\_thread\_id](../server-system-variables/index#pseudo_thread_id) | | [Qcache\_free\_blocks](../server-status-variables/index#qcache_free_blocks) | | [Qcache\_free\_memory](../server-status-variables/index#qcache_free_memory) | | [Qcache\_hits](../server-status-variables/index#qcache_hits) | | [Qcache\_inserts](../server-status-variables/index#qcache_inserts) | | [Qcache\_lowmem\_prunes](../server-status-variables/index#qcache_lowmem_prunes) | | [Qcache\_not\_cached](../server-status-variables/index#qcache_not_cached) | | [Qcache\_queries\_in\_cache](../server-status-variables/index#qcache_queries_in_cache) | | [Qcache\_total\_blocks](../server-status-variables/index#qcache_total_blocks) | | [Queries](../server-status-variables/index#queries) | | --[query-alloc-block-size](../server-system-variables/index#query_alloc_block_size), [query\_alloc\_block\_size](../server-system-variables/index#query_alloc_block_size) | | --[query-cache-info](../query-cache-information-plugin/index#query_cache_info) | | --[query-cache-limit](../server-system-variables/index#query_cache_limit), [query\_cache\_limit](../server-system-variables/index#query_cache_limit) | | --[query-cache-min-res-unit](../server-system-variables/index#query_cache_min_res_unit), [query\_cache\_min\_res\_unit](../server-system-variables/index#query_cache_min_res_unit) | | --[query-cache-size](../server-system-variables/index#query_cache_size), [query\_cache\_size](../server-system-variables/index#query_cache_size) | | --[query-cache-strip-comments](../server-system-variables/index#query_cache_strip_comments), [query\_cache\_strip\_comments](../server-system-variables/index#query_cache_strip_comments) | | --[query-cache-type](../server-system-variables/index#query_cache_type), [query\_cache\_type](../server-system-variables/index#query_cache_type) | | --[query-cache-wlock-invalidate](../server-system-variables/index#query_cache_wlock_invalidate), [query\_cache\_wlock\_invalidate](../server-system-variables/index#query_cache_wlock_invalidate) | | --[query-prealloc-size](../server-system-variables/index#query_prealloc_size), [query\_prealloc\_size](../server-system-variables/index#query_prealloc_size) | | --[query-response-time](../query-response-time-plugin/index#query_response_time) | | --[query-response-time-audit](../query-response-time-plugin/index#query_response_time_audit) | | [query\_response\_time\_flush](../query_response_time-plugin/index#query_response_time_flush) | | --[query-response-time-range-base](../query_response_time-plugin/index#query_response_time_range_base) , [query\_response\_time\_range\_base](../query_response_time-plugin/index#query_response_time_range_base) | | [query\_response\_time\_exec\_time\_debug](../query_response_time-plugin/index#query_response_time_exec_time_debug) | | --[query-response-time-stats](../query_response_time-plugin/index#query_response_time_stats), [query\_response\_time\_stats](../query_response_time-plugin/index#query_response_time_stats) | | [Questions](../server-status-variables/index#questions) | | -r, --[chroot](../mysqld-options/index#-chroot) | | [rand\_seed1](../server-system-variables/index#rand_seed1) | | [rand\_seed2](../server-system-variables/index#rand_seed2) | | --[range-alloc-block-size](../server-system-variables/index#range_alloc_block_size), [range\_alloc\_block\_size](../server-system-variables/index#range_alloc_block_size) | | --[read-buffer-size](../server-system-variables/index#read_buffer_size), [read\_buffer\_size](../server-system-variables/index#read_buffer_size) | | --[read-binlog-speed-limit](../replication-and-binary-log-server-system-variables/index#read_binlog_speed_limit), [read\_binlog\_speed\_limit](../replication-and-binary-log-server-system-variables/index#read_binlog_speed_limit) | | --[read-only](../server-system-variables/index#read_only), [read\_only](../server-system-variables/index#read_only) | | --[read-rnd-buffer-size](../server-system-variables/index#read_rnd_buffer_size), [read\_rnd\_buffer\_size](../server-system-variables/index#read_rnd_buffer_size) | | --[record-buffer](../mysqld-options/index#-record-buffer) | | --[relay-log](../replication-and-binary-log-server-system-variables/index#relay_log), [relay\_log](../replication-and-binary-log-server-system-variables/index#relay_log) | | [relay\_log\_basename](../replication-and-binary-log-server-system-variables/index#relay_log_basename) | | --[relay-log-index](../replication-and-binary-log-server-system-variables/index#relay_log_index), [relay\_log\_index](../replication-and-binary-log-server-system-variables/index#relay_log_index) | | --[relay-log-info-file](../replication-and-binary-log-server-system-variables/index#relay_log_info_file), [relay\_log\_info\_file](../replication-and-binary-log-server-system-variables/index#relay_log_info_file) | | --[relay-log-purge](../replication-and-binary-log-server-system-variables/index#relay_log_purge), [relay\_log\_purge](../replication-and-binary-log-server-system-variables/index#relay_log_purge) | | --[relay-log-recovery](../replication-and-binary-log-server-system-variables/index#relay_log_recovery), [relay\_log\_recovery](../replication-and-binary-log-server-system-variables/index#relay_log_recovery) | | --[relay-log-space-limit](../replication-and-binary-log-server-system-variables/index#relay_log_space_limit), [relay\_log\_space\_limit](../replication-and-binary-log-server-system-variables/index#relay_log_space_limit) | | --[remove](../mysqld-options/index#-remove) | | --[replicate-annotate-row-events](../replication-and-binary-log-server-system-variables/index#replicate_annotate_row_events), [replicate\_annotate\_row\_events](../replication-and-binary-log-server-system-variables/index#replicate_annotate_row_events) | | --[replicate-do-db](../replication-and-binary-log-server-system-variables/index#replicate_do_db), [replicate\_do\_db](../replication-and-binary-log-server-system-variables/index#replicate_do_db) | | --[replicate-do-table](../replication-and-binary-log-server-system-variables/index#replicate_do_table), [replicate\_do\_table](../replication-and-binary-log-server-system-variables/index#replicate_do_table) | | --[replicate-events-marked-for-skip](../replication-and-binary-log-server-system-variables/index#replicate_events_marked_for_skip), [replicate\_events\_marked\_for\_skip](../replication-and-binary-log-server-system-variables/index#replicate_events_marked_for_skip) | | --[replicate-ignore-db](../replication-and-binary-log-server-system-variables/index#replicate_ignore_db), [replicate\_ignore\_db](../replication-and-binary-log-server-system-variables/index#replicate_ignore_db) | | --[replicate-ignore-table](../replication-and-binary-log-server-system-variables/index#replicate_ignore_table), [replicate\_ignore\_table](../replication-and-binary-log-server-system-variables/index#replicate_ignore_table) | | --[replicate-rewrite-db](../mysqld-options/index#-replicate-rewrite-db) | | --[replicate-same-server-id](../mysqld-options/index#-replicate-same-server-id) | | --[replicate-wild-do-table](../replication-and-binary-log-server-system-variables/index#replicate_wild_do_table), [replicate\_wild\_do\_table](../replication-and-binary-log-server-system-variables/index#replicate_wild_do_table) | | --[replicate-wild-ignore-table](../replication-and-binary-log-server-system-variables/index#replicate_wild_ignore_table), [replicate\_wild\_ignore\_table](../replication-and-binary-log-server-system-variables/index#replicate_wild_ignore_table) | | --[report-host](../replication-and-binary-log-server-system-variables/index#report_host), [report\_host](../replication-and-binary-log-server-system-variables/index#report_host) | | --[report-password](../replication-and-binary-log-server-system-variables/index#report_password), [report\_password](../replication-and-binary-log-server-system-variables/index#report_password) | | --[report-port](../replication-and-binary-log-server-system-variables/index#report_password), [report\_port](../replication-and-binary-log-server-system-variables/index#report_password) | | --[report-user](../replication-and-binary-log-server-system-variables/index#report_user), [report\_user](../replication-and-binary-log-server-system-variables/index#report_user) | | --[require-secure-transport](../server-system-variables/index#require_secure_transport), [require\_secure\_transport](../server-system-variables/index#require_secure_transport) | | --[rocksdb-access-hint-on-compaction-start](../myrocks-system-variables/index#rocksdb_access_hint_on_compaction_start), [rocksdb\_access\_hint\_on\_compaction\_start](../myrocks-system-variables/index#rocksdb_access_hint_on_compaction_start) | | --[rocksdb-advise-random-on-open](../myrocks-system-variables/index#rocksdb_advise_random_on_open), [rocksdb\_advise\_random\_on\_open](../myrocks-system-variables/index#rocksdb_advise_random_on_open) | | --[rocksdb-allow-concurrent-memtable-write](../myrocks-system-variables/index#rocksdb_allow_concurrent_memtable_write), [rocksdb\_allow\_concurrent\_memtable\_write](../myrocks-system-variables/index#rocksdb_allow_concurrent_memtable_write) | | --[rocksdb-allow-mmap-reads](../myrocks-system-variables/index#rocksdb_allow_mmap_reads), [rocksdb\_allow\_mmap\_reads](../myrocks-system-variables/index#rocksdb_allow_mmap_reads) | | --[rocksdb-allow-mmap-writes](../myrocks-system-variables/index#rocksdb_allow_mmap_writes), [rocksdb\_allow\_mmap\_writes](../myrocks-system-variables/index#rocksdb_allow_mmap_writes) | | --[rocksdb-allow-to-start-after-corruption](../myrocks-system-variables/index#rocksdb_allow_to_start_after_corruption), [rocksdb\_allow\_to\_start\_after\_corruption](../myrocks-system-variables/index#rocksdb_allow_to_start_after_corruption) | | --[rocksdb-background-sync](../myrocks-system-variables/index#rocksdb_background_sync), [rocksdb\_background\_sync](../myrocks-system-variables/index#rocksdb_background_sync) | | --[rocksdb\_base-background-compactions](../myrocks-system-variables/index#rocksdb_base_background_compactions), [rocksdb\_base\_background\_compactions](../myrocks-system-variables/index#rocksdb_base_background_compactions) | | --[rocksdb-blind-delete-primary-key](../myrocks-system-variables/index#rocksdb_blind_delete_primary_key), [rocksdb\_blind\_delete\_primary\_key](../myrocks-system-variables/index#rocksdb_blind_delete_primary_key) | | --[rocksdb-block-cache-size](../myrocks-system-variables/index#rocksdb_block_cache_size), [rocksdb\_block\_cache\_size](../myrocks-system-variables/index#rocksdb_block_cache_size) | | --[rocksdb\_block\_restart\_interval](../myrocks-system-variables/index#rocksdb-block-restart-interval), [rocksdb\_block\_restart\_interval](../myrocks-system-variables/index#rocksdb_block_restart_interval) | | [Rocksdb\_block\_cache\_add](../myrocks-status-variables/index#rocksdb_block_cache_add) | | [Rocksdb\_block\_cache\_add\_failures](../myrocks-status-variables/index#rocksdb_block_cache_add_failures) | | [Rocksdb\_block\_bytes\_read](../myrocks-status-variables/index#rocksdb_block_cache_bytes_read) | | [Rocksdb\_block\_bytes\_write](../myrocks-status-variables/index#rocksdb_block_cache_bytes_write) | | [Rocksdb\_block\_cache\_data\_add](../myrocks-status-variables/index#rocksdb_block_cache_data_add) | | [Rocksdb\_block\_cache\_data\_bytes\_insert](../myrocks-status-variables/index#rocksdb_block_cache_data_bytes_insert) | | [Rocksdb\_block\_cache\_data\_hit](../myrocks-status-variables/index#rocksdb_block_cache_data_hit) | | [Rocksdb\_block\_cache\_data\_miss](../myrocks-status-variables/index#rocksdb_block_cache_data_miss) | | [Rocksdb\_block\_cache\_filter\_add](../myrocks-status-variables/index#rocksdb_block_cache_filter_add) | | [Rocksdb\_block\_cache\_filter\_bytes\_evict](../myrocks-status-variables/index#rocksdb_block_cache_filter_bytes_evict) | | [Rocksdb\_block\_cache\_filter\_bytes\_insert](../myrocks-status-variables/index#rocksdb_block_cache_filter_bytes_insert) | | [Rocksdb\_block\_cache\_filter\_hit](../myrocks-status-variables/index#rocksdb_block_cache_filter_hit) | | [Rocksdb\_block\_cache\_filter\_miss](../myrocks-status-variables/index#rocksdb_block_cache_filter_miss) | | [Rocksdb\_block\_cache\_hit](../myrocks-status-variables/index#rocksdb_block_cache_hit) | | [Rocksdb\_block\_cache\_index\_add](../myrocks-status-variables/index#rocksdb_block_cache_index_add) | | [Rocksdb\_block\_cache\_index\_bytes\_evict](../myrocks-status-variables/index#rocksdb_block_cache_index_bytes_evict) | | [Rocksdb\_block\_cache\_index\_bytes\_insert](../myrocks-status-variables/index#rocksdb_block_cache_index_bytes_insert) | | [Rocksdb\_block\_cache\_index\_hit](../myrocks-status-variables/index#rocksdb_block_cache_index_hit) | | [Rocksdb\_block\_cache\_index\_miss](../myrocks-status-variables/index#rocksdb_block_cache_index_miss) | | [Rocksdb\_block\_cache\_miss](../myrocks-status-variables/index#rocksdb_block_cache_miss) | | [Rocksdb\_block\_cachecompressed\_hit](../myrocks-status-variables/index#rocksdb_block_cachecompressed_hit) | | [Rocksdb\_block\_cachecompressed\_miss](../myrocks-status-variables/index#rocksdb_block_cachecompressed_miss) | | --[rocksdb-block-size](../myrocks-system-variables/index#rocksdb_block_size), [rocksdb\_block\_size](../myrocks-system-variables/index#rocksdb_block_size) | | --[rocksdb-block-size-deviation](../myrocks-system-variables/index#rocksdb_block_size_deviation), [rocksdb\_block\_size\_deviation](../myrocks-system-variables/index#rocksdb_block_size_deviation) | | [Rocksdb\_bloom\_filter\_full\_positive](../myrocks-status-variables/index#rocksdb_bloom_filter_full_positive) | | [Rocksdb\_bloom\_filter\_full\_true\_positive](../myrocks-status-variables/index#rocksdb_bloom_filter_full_true_positive) | | [Rocksdb\_bloom\_filter\_prefix\_checked](../myrocks-status-variables/index#rocksdb_bloom_filter_prefix_checked) | | [Rocksdb\_bloom\_filter\_prefix\_useful](../myrocks-status-variables/index#rocksdb_bloom_filter_prefix_useful) | | [Rocksdb\_bloom\_filter\_useful](../myrocks-status-variables/index#rocksdb_bloom_filter_useful) | | --[rocksdb-bulk-load](../myrocks-system-variables/index#rocksdb_bulk_load), [rocksdb\_bulk\_load](../myrocks-system-variables/index#rocksdb_bulk_load) | | --[rocksdb-bulk-load\_allow\_sk](../myrocks-system-variables/index#rocksdb_bulk_load_allow_sk), [rocksdb\_bulk\_load\_allow\_sk](../myrocks-system-variables/index#rocksdb_bulk_load_allow_sk) | | --[rocksdb-bulk-load\_allow\_unsorted](../myrocks-system-variables/index#rocksdb_bulk_load_allow_unsorted), [rocksdb\_bulk\_load\_allow\_unsorted](../myrocks-system-variables/index#rocksdb_bulk_load_allow_unsorted) | | --[rocksdb-bulk-load-size](../myrocks-system-variables/index#rocksdb_bulk_load_size), [rocksdb\_bulk\_load\_size](../myrocks-system-variables/index#rocksdb_bulk_load_size) | | --[rocksdb-bytes-per-sync](../myrocks-system-variables/index#rocksdb_bytes_per_sync), [rocksdb\_bytes\_per\_sync](../myrocks-system-variables/index#rocksdb_bytes_per_sync) | | [Rocksdb\_bytes\_read](../myrocks-status-variables/index#rocksdb_bytes_read) | | [Rocksdb\_bytes\_written](../myrocks-status-variables/index#rocksdb_bytes_written) | | --[rocksdb-cache-dump](../myrocks-system-variables/index#rocksdb_cache_dump), [rocksdb\_cache\_dump](../myrocks-system-variables/index#rocksdb_cache_dump) | | --[rocksdb-cache-high-pri-pool-ratio](../myrocks-system-variables/index#rocksdb_cache_high_pri_pool_ratio), [rocksdb\_cache\_high\_pri\_pool\_ratio](../myrocks-system-variables/index#rocksdb_cache_high_pri_pool_ratio) | | --[rocksdb-cache-index-and-filter-blocks](../myrocks-system-variables/index#rocksdb_cache_index_and_filter_blocks), [rocksdb\_cache\_index\_and\_filter\_blocks](../myrocks-system-variables/index#rocksdb_cache_index_and_filter_blocks) | | --[rocksdb-cache-index-and-filter-with-high-priority](../myrocks-system-variables/index#rocksdb_cache_index_and_filter_with_high_priority), [rocksdb\_cache\_index\_and\_filter\_with\_high\_priority](../myrocks-system-variables/index#rocksdb_cache_index_and_filter_with_high_priority) | | --[rocksdb-checksums-pct](../myrocks-system-variables/index#rocksdb_checksums_pct), [rocksdb\_checksums\_pct](../myrocks-system-variables/index#rocksdb_checksums_pct) | | --[rocksdb-collect-sst-properties](../myrocks-system-variables/index#rocksdb_collect_sst_properties), [rocksdb\_collect\_sst\_properties](../myrocks-system-variables/index#rocksdb_collect_sst_properties) | | --[rocksdb-commit-in-the-middle](../myrocks-system-variables/index#rocksdb_commit_in_the_middle), [rocksdb\_commit\_in\_the\_middle](../myrocks-system-variables/index#rocksdb_commit_in_the_middle) | | --[rocksdb-commit-time-batch-for-recovery](../myrocks-system-variables/index#rocksdb_commit_time_batch_for_recovery), [rocksdb\_commit\_time\_batch\_for\_recovery](../myrocks-system-variables/index#rocksdb_commit_time_batch_for_recovery) | | --[rocksdb-compact-cf](../myrocks-system-variables/index#rocksdb_compact_cf), [rocksdb\_compact\_cf](../myrocks-system-variables/index#rocksdb_compact_cf) | | [Rocksdb\_compact\_read\_bytes](../myrocks-status-variables/index#rocksdb_compact_read_bytes) | | [Rocksdb\_compact\_write\_bytes](../myrocks-status-variables/index#rocksdb_compact_write_bytes) | | [Rocksdb\_compaction\_key\_drop\_new](../myrocks-status-variables/index#rocksdb_compaction_key_drop_new) | | [Rocksdb\_compaction\_key\_drop\_obsolete](../myrocks-status-variables/index#rocksdb_compaction_key_drop_obsolete) | | [Rocksdb\_compaction\_key\_drop\_user](../myrocks-status-variables/index#rocksdb_compaction_key_drop_user) | | --[rocksdb-compaction-readahead-size](../myrocks-system-variables/index#rocksdb_compaction_readahead_size), [rocksdb\_compaction\_readahead\_size](../myrocks-system-variables/index#rocksdb_compaction_readahead_size) | | --[rocksdb-compaction-sequential-deletes](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes), [rocksdb\_compaction\_sequential\_deletes](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes) | | --[rocksdb-compaction-sequential-deletes-count-sd](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_count_sd), [rocksdb\_compaction\_sequential\_deletes\_count\_sd](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_count_sd) | | --[rocksdb-concurrent-prepare](../myrocks-system-variables/index#rocksdb_concurrent_prepare), [rocksdb\_concurrent\_prepare](../myrocks-system-variables/index#rocksdb_concurrent_prepare) | | --[rocksdb-compaction-sequential-deletes-file-size](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_file_size), [rocksdb\_compaction\_sequential\_deletes\_file\_size](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_file_size) | | --[rocksdb-compaction-sequential-deletes-window](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_window), [rocksdb\_compaction\_sequential\_deletes\_window](../myrocks-system-variables/index#rocksdb_compaction_sequential_deletes_window) | | [Rocksdb\_covered\_secondary\_key\_lookups](../myrocks-status-variables/index#rocksdb_covered_secondary_key_lookups) | | --[rocksdb-create-checkpoint](../myrocks-system-variables/index#rocksdb_create_checkpoint), [rocksdb\_create\_checkpoint](../myrocks-system-variables/index#rocksdb_create_checkpoint) | | --[rocksdb-create-if-missing](../myrocks-system-variables/index#rocksdb_create_if_missing), [rocksdb\_create\_if\_missing](../myrocks-system-variables/index#rocksdb_create_if_missing) | | --[rocksdb-create-missing-column-families](../myrocks-system-variables/index#rocksdb_create_missing_column_families), [rocksdb\_create\_missing\_column\_families](../myrocks-system-variables/index#rocksdb_create_missing_column_families) | | --[rocksdb-datadir](../myrocks-system-variables/index#rocksdb_datadir), [rocksdb\_datadir](../myrocks-system-variables/index#rocksdb_datadir) | | --[rocksdb-db-write-buffer-size](../myrocks-system-variables/index#rocksdb_db_write_buffer_size), [rocksdb\_db\_write\_buffer\_size](../myrocks-system-variables/index#rocksdb_db_write_buffer_size) | | --[rocksdb-deadlock-detect](../myrocks-system-variables/index#rocksdb_deadlock_detect), [rocksdb\_deadlock\_detect](../myrocks-system-variables/index#rocksdb_deadlock_detect) | | --[rocksdb-deadlock-detect-depth](../myrocks-system-variables/index#rocksdb_deadlock_detect_depth), [rocksdb\_deadlock\_detect\_depth](../myrocks-system-variables/index#rocksdb_deadlock_detect_depth) | | --[rocksdb-debug-manual-compaction-delay](../myrocks-system-variables/index#rocksdb_debug_manual_compaction_delay), [rocksdb\_debug\_manual\_compaction\_delay](../myrocks-system-variables/index#rocksdb_debug_manual_compaction_delay) | | --[rocksdb-debug-optimizer-no-zero-cardinality](../myrocks-system-variables/index#rocksdb_debug_optimizer_no_zero_cardinality), [rocksdb\_debug\_optimizer\_no\_zero\_cardinality](../myrocks-system-variables/index#rocksdb_debug_optimizer_no_zero_cardinality) | | --[rocksdb-debug-ttl-ignore-pk](../myrocks-system-variables/index#rocksdb_debug_ttl_ignore_pk), [rocksdb\_debug\_ttl\_ignore\_pk](../myrocks-system-variables/index#rocksdb_debug_ttl_ignore_pk) | | --[rocksdb-debug-ttl-read-filter-ts](../myrocks-system-variables/index#rocksdb_debug_ttl_read_filter_ts), [rocksdb\_debug\_ttl\_read\_filter\_ts](../myrocks-system-variables/index#rocksdb_debug_ttl_read_filter_ts) | | --[rocksdb-debug-ttl-rec-ts](../myrocks-system-variables/index#rocksdb_debug_ttl_rec_ts), [rocksdb\_debug\_ttl\_rec\_ts](../myrocks-system-variables/index#rocksdb_debug_ttl_rec_ts) | | --[rocksdb-debug-ttl-snapshot-ts](../myrocks-system-variables/index#rocksdb_debug_ttl_snapshot_ts), [rocksdb\_debug\_ttl\_snapshot\_ts](../myrocks-system-variables/index#rocksdb_debug_ttl_snapshot_ts) | | --[rocksdb-default-cf-options](../myrocks-system-variables/index#rocksdb_default_cf_options), [rocksdb\_default\_cf\_options](../myrocks-system-variables/index#rocksdb_default_cf_options) | | --[rocksdb-delayed-write-rate](../myrocks-system-variables/index#rocksdb_delayed_write_rate), [rocksdb\_delayed\_write\_rate](../myrocks-system-variables/index#rocksdb_delayed_write_rate) | | --[rocksdb-delete-cf](../myrocks-system-variables/index#rocksdb_delete_cf), [rocksdb\_delete\_cf](../myrocks-system-variables/index#rocksdb_delete_cf) | | --[rocksdb-delete-obsolete-files-period-micros](../myrocks-system-variables/index#rocksdb_delete_obsolete_files_period_micros), [rocksdb\_delete\_obsolete\_files\_period\_micros](../myrocks-system-variables/index#rocksdb_delete_obsolete_files_period_micros) | | --[rocksdb-enable-2pc](../myrocks-system-variables/index#rocksdb_enable_2pc), [rocksdb\_enable\_2pc](../myrocks-system-variables/index#rocksdb_enable_2pc) | | --[rocksdb-enable-bulk-load-api](../myrocks-system-variables/index#rocksdb_enable_bulk_load_api), [rocksdb\_enable\_bulk\_load\_api](../myrocks-system-variables/index#rocksdb_enable_bulk_load_api) | | --[rocksdb-enable-insert-with-update-caching](../myrocks-system-variables/index#rocksdb_enable_insert_with_update_caching), [rocksdb\_enable\_insert\_with\_update\_caching](../myrocks-system-variables/index#rocksdb_enable_insert_with_update_caching) | | --[rocksdb-enable-thread-tracking](../myrocks-system-variables/index#rocksdb_enable_thread_tracking), [rocksdb\_enable\_thread\_tracking](../myrocks-system-variables/index#rocksdb_enable_thread_tracking) | | --[rocksdb-enable-ttl](../myrocks-system-variables/index#rocksdb_enable_ttl), [rocksdb\_enable\_ttl](../myrocks-system-variables/index#rocksdb_enable_ttl) | | --[rocksdb-enable-ttl-read-filtering](../myrocks-system-variables/index#rocksdb_enable_ttl_read_filtering), [rocksdb\_enable\_ttl\_read\_filtering](../myrocks-system-variables/index#rocksdb_enable_ttl_read_filtering) | | --[rocksdb-enable-write-thread-adaptive-yield](../myrocks-system-variables/index#rocksdb_enable_write_thread_adaptive_yield), [rocksdb\_enable\_write\_thread\_adaptive\_yield](../myrocks-system-variables/index#rocksdb_enable_write_thread_adaptive_yield) | | --[rocksdb-error-if-exists](../myrocks-system-variables/index#rocksdb_error_if_exists), [rocksdb\_error\_if\_exists](../myrocks-system-variables/index#rocksdb_error_if_exists) | | --[rocksdb-error-on-suboptimal-collation](../myrocks-system-variables/index#rocksdb_error_on_suboptimal_collation), [rocksdb\_on\_suboptimal\_collation](../myrocks-system-variables/index#rocksdb_error_on_suboptimal_collation) | | --[rocksdb-flush-log-at-trx-commit](../myrocks-system-variables/index#rocksdb_flush_log_at_trx_commit), [rocksdb\_flush\_log\_at\_trx\_commit](../myrocks-system-variables/index#rocksdb_flush_log_at_trx_commit) | | --[rocksdb-flush-memtable-on-analyze](../myrocks-system-variables/index#rocksdb_flush_memtable_on_analyze), [rocksdb\_flush\_memtable\_on\_analyze](../myrocks-system-variables/index#rocksdb_flush_memtable_on_analyze) | | [Rocksdb\_flush\_write\_bytes](../myrocks-status-variables/index#rocksdb_flush_write_bytes) | | --[rocksdb-force-compute-memtable-stats](../myrocks-system-variables/index#rocksdb_force_compute_memtable_stats), [rocksdb\_force\_compute\_memtable\_stats](../myrocks-system-variables/index#rocksdb_force_compute_memtable_stats) | | --[rocksdb-force-compute-memtable-stats-cachetime](../myrocks-system-variables/index#rocksdb_force_compute_memtable_stats_cachetime), [rocksdb\_force\_compute\_memtable\_stats\_cachetime](../myrocks-system-variables/index#rocksdb_force_compute_memtable_stats_cachetime) | | --[rocksdb-force-flush-memtable-and-lzero-now](../myrocks-system-variables/index#rocksdb_force_flush_memtable_and_lzero_now), [rocksdb\_force\_flush\_memtable\_and\_lzero\_now](../myrocks-system-variables/index#rocksdb_force_flush_memtable_and_lzero_now) | | --[rocksdb-force-flush-memtable-now](../myrocks-system-variables/index#rocksdb_force_flush_memtable_now), [rocksdb\_force\_flush\_memtable\_now](../myrocks-system-variables/index#rocksdb_force_flush_memtable_now) | | --[rocksdb-force-index-records-in-range](../myrocks-system-variables/index#rocksdb_force_index_records_in_range), [rocksdb\_force\_index\_records\_in\_range](../myrocks-system-variables/index#rocksdb_force_index_records_in_range) | | [Rocksdb\_get\_hit\_l0](../myrocks-status-variables/index#rocksdb_get_hit_l0) | | [Rocksdb\_get\_hit\_l1](../myrocks-status-variables/index#rocksdb_get_hit_l1) | | [Rocksdb\_get\_hit\_l2\_and\_up](../myrocks-status-variables/index#rocksdb_get_hit_l2_and_up) | | [Rocksdb\_getupdatessince\_calls](../myrocks-status-variables/index#rocksdb_getupdatessince_calls) | | --[rocksdb-git-hash](../myrocks-system-variables/index#rocksdb_git_hash), [rocksdb\_git\_hash](../myrocks-system-variables/index#rocksdb_git_hash) | | --[rocksdb-hash-index-allow-collision](../myrocks-system-variables/index#rocksdb_hash_index_allow_collision), [rocksdb\_hash\_index\_allow\_collision](../myrocks-system-variables/index#rocksdb_hash_index_allow_collision) | | --[rocksdb-ignore-unknown-options](../myrocks-system-variables/index#rocksdb_ignore_unknown_options), [rocksdb\_ignore\_unknown\_options](../myrocks-system-variables/index#rocksdb_ignore_unknown_options) | | --[rocksdb-index-type](../myrocks-system-variables/index#rocksdb_index_type), [rocksdb\_index\_type](../myrocks-system-variables/index#rocksdb_index_type) | | --[rocksdb-info-log-level](../myrocks-system-variables/index#rocksdb_info_log_level), [rocksdb\_info\_log\_level](../myrocks-system-variables/index#rocksdb_info_log_level) | | --[rocksdb-io-write-timeout](../myrocks-system-variables/index#rocksdb_io_write_timeout), [rocksdb\_io\_write\_timeout](../myrocks-system-variables/index#rocksdb_io_write_timeout) | | --[rocksdb-is-fd-close-on-exec](../myrocks-system-variables/index#rocksdb_is_fd_close_on_exec), [rocksdb\_is\_fd\_close\_on\_exec](../myrocks-system-variables/index#rocksdb_is_fd_close_on_exec) | | [Rocksdb\_iter\_bytes\_read](../myrocks-status-variables/index#rocksdb_iter_bytes_read) | | --[rocksdb-keep-log-file-num](../myrocks-system-variables/index#rocksdb_keep_log_file_num), [rocksdb\_keep\_log\_file\_num](../myrocks-system-variables/index#rocksdb_keep_log_file_num) | | [Rocksdb\_l0\_num\_files\_stall\_micros](../myrocks-status-variables/index#rocksdb_l0_num_files_stall_micros) | | [Rocksdb\_l0\_slowdown\_micros](../myrocks-status-variables/index#rocksdb_l0_slowdown_micros) | | --[rocksdb-large-prefix](../myrocks-system-variables/index#rocksdb_large_prefix), [rocksdb\_large\_prefix](../myrocks-system-variables/index#rocksdb_large_prefix) | | --[rocksdb-lock-scanned-rows](../myrocks-system-variables/index#rocksdb_lock_scanned_rows), [rocksdb\_lock\_scanned\_rows](../myrocks-system-variables/index#rocksdb_lock_scanned_rows) | | --[rocksdb-lock-wait-timeout](../myrocks-system-variables/index#rocksdb_lock_wait_timeout), [rocksdb\_lock\_wait\_timeout](../myrocks-system-variables/index#rocksdb_lock_wait_timeout) | | --[rocksdb-log-dir](../myrocks-system-variables/index#rocksdb_log_dir), [rocksdb\_log\_dir](../myrocks-system-variables/index#rocksdb_log_dir) | | --[rocksdb-log-file-time-to-roll](../myrocks-system-variables/index#rocksdb_log_file_time_to_roll), [rocksdb\_log\_file\_time\_to\_roll](../myrocks-system-variables/index#rocksdb_log_file_time_to_roll) | | --[rocksdb-manifest-preallocation-size](../myrocks-system-variables/index#rocksdb_manifest_preallocation_size), [rocksdb\_manifest\_preallocation\_size](../myrocks-system-variables/index#rocksdb_manifest_preallocation_size) | | --[rocksdb-manual-compaction-threads](../myrocks-system-variables/index#rocksdb_manual_compaction_threads), [rocksdb\_manual\_compaction\_threads](../myrocks-system-variables/index#rocksdb_manual_compaction_threads) | | [Rocksdb\_manual\_compactions\_processed](../myrocks-status-variables/index#rocksdb_manual_compactions_processed) | | [Rocksdb\_manual\_compactions\_running](../myrocks-status-variables/index#rocksdb_manual_compactions_running) | | --[rocksdb-manual-wal-flush](../myrocks-system-variables/index#rocksdb_manual_wal_flush), [rocksdb\_manual\_wal\_flush](../myrocks-system-variables/index#rocksdb_manual_wal_flush) | | --[rocksdb-master-skip-tx-api](../myrocks-system-variables/index#rocksdb_master_skip_tx_api), [rocksdb\_master\_skip\_tx\_api](../myrocks-system-variables/index#rocksdb_master_skip_tx_api) | | --[rocksdb-max-background-compactions](../myrocks-system-variables/index#rocksdb_max_background_compactions), [rocksdb\_max\_background\_compactions](../myrocks-system-variables/index#rocksdb_max_background_compactions) | | --[rocksdb-max-latest-deadlocks](../myrocks-system-variables/index#rocksdb_max_latest_deadlocks), [rocksdb\_max\_latest\_deadlocks](../myrocks-system-variables/index#rocksdb_max_latest_deadlocks) | | --[rocksdb-max-background-flushes](../myrocks-system-variables/index#rocksdb_max_background_flushes), [rocksdb\_max\_background\_flushes](../myrocks-system-variables/index#rocksdb_max_background_flushes) | | --[rocksdb-max-background-jobs](../myrocks-system-variables/index#rocksdb_max_background_jobs), [rocksdb\_max\_background\_jobs](../myrocks-system-variables/index#rocksdb_max_background_jobs) | | --[rocksdb-max-log-file-size](../myrocks-system-variables/index#rocksdb_max_log_file_size), [rocksdb\_max\_log\_file\_size](../myrocks-system-variables/index#rocksdb_max_log_file_size) | | --[rocksdb-max-manifest-file-size](../myrocks-system-variables/index#rocksdb_max_manifest_file_size), [rocksdb\_max\_manifest\_file\_size](../myrocks-system-variables/index#rocksdb_max_manifest_file_size) | | --[rocksdb-max-manual-compactions](../myrocks-system-variables/index#rocksdb_max_manual_compactions), [rocksdb\_max\_manual\_compactions](../myrocks-system-variables/index#rocksdb_max_manual_compactions) | | --[rocksdb-max-open-files](../myrocks-system-variables/index#rocksdb_max_open_files), [rocksdb\_max\_open\_files](../myrocks-system-variables/index#rocksdb_max_open_files) | | --[rocksdb-max-row-locks](../myrocks-system-variables/index#rocksdb_max_row_locks), [rocksdb\_max\_row\_locks](../myrocks-system-variables/index#rocksdb_max_row_locks) | | --[rocksdb-max-subcompactions](../myrocks-system-variables/index#rocksdb_max_subcompactions), [rocksdb\_max\_subcompactions](../myrocks-system-variables/index#rocksdb_max_subcompactions) | | --[rocksdb-max-total-wal-size](../myrocks-system-variables/index#rocksdb_max_total_wal_size), [rocksdb\_max\_total\_wal\_size](../myrocks-system-variables/index#rocksdb_max_total_wal_size) | | [Rocksdb\_memtable\_compaction\_micros](../myrocks-status-variables/index#rocksdb_memtable_compaction_micros) | | [Rocksdb\_memtable\_hit](../myrocks-status-variables/index#rocksdb_memtable_hit) | | [Rocksdb\_memtable\_miss](../myrocks-status-variables/index#rocksdb_memtable_miss) | | [Rocksdb\_memtable\_total](../myrocks-status-variables/index#rocksdb_memtable_total) | | [Rocksdb\_memtable\_unflushed](../myrocks-status-variables/index#rocksdb_memtable_unflushed) | | --[rocksdb-merge-buf-size](../myrocks-system-variables/index#rocksdb_merge_buf_size), [rocksdb\_merge\_buf\_size](../myrocks-system-variables/index#rocksdb_merge_buf_size) | | --[rocksdb-merge-combine-read-size](../myrocks-system-variables/index#rocksdb_merge_combine_read_size), [rocksdb\_merge\_combine\_read\_size](../myrocks-system-variables/index#rocksdb_merge_combine_read_size) | | --[rocksdb-merge-tmp-file-removal-delay-ms](../myrocks-system-variables/index#rocksdb_merge_tmp_file_removal_delay_ms), [rocksdb\_merge\_tmp\_file\_removal\_delay\_ms](../myrocks-system-variables/index#rocksdb_merge_tmp_file_removal_delay_ms) | | --[rocksdb-new-table-reader-for-compaction-inputs](../myrocks-system-variables/index#rocksdb_new_table_reader_for_compaction_inputs), [rocksdb\_new\_table\_reader\_for\_compaction\_inputs](../myrocks-system-variables/index#rocksdb_new_table_reader_for_compaction_inputs) | | --[rocksdb-no-block-cache](../myrocks-system-variables/index#rocksdb_no_block_cache), [rocksdb\_no\_block\_cache](../myrocks-system-variables/index#rocksdb_no_block_cache) | | [Rocksdb\_no\_file\_closes](../myrocks-status-variables/index#rocksdb_no_file_closes) | | [Rocksdb\_no\_file\_errors](../myrocks-status-variables/index#rocksdb_no_file_errors) | | [Rocksdb\_no\_file\_opens](../myrocks-status-variables/index#rocksdb_no_file_opens) | | [Rocksdb\_num\_iterators](../myrocks-status-variables/index#rocksdb_num_iterators) | | [Rocksdb\_number\_block\_not\_compressed](../myrocks-status-variables/index#rocksdb_number_block_not_compressed) | | [Rocksdb\_db\_next](../myrocks-status-variables/index#rocksdb_number_db_next) | | [Rocksdb\_db\_next\_found](../myrocks-status-variables/index#rocksdb_number_db_next_found) | | [Rocksdb\_db\_prev](../myrocks-status-variables/index#rocksdb_number_db_prev) | | [Rocksdb\_db\_prev\_found](../myrocks-status-variables/index#rocksdb_number_db_prev_found) | | [Rocksdb\_db\_seek](../myrocks-status-variables/index#rocksdb_number_db_seek) | | [Rocksdb\_db\_seek\_found](../myrocks-status-variables/index#rocksdb_number_db_seek_found) | | [Rocksdb\_number\_deletes\_filtered](../myrocks-status-variables/index#rocksdb_number_deletes_filtered) | | [Rocksdb\_number\_keys\_read](../myrocks-status-variables/index#rocksdb_number_keys_read) | | [Rocksdb\_number\_keys\_updated](../myrocks-status-variables/index#rocksdb_number_keys_updated) | | [Rocksdb\_number\_keys\_written](../myrocks-status-variables/index#rocksdb_number_keys_written) | | [Rocksdb\_number\_merge\_failures](../myrocks-status-variables/index#rocksdb_number_merge_failures) | | [Rocksdb\_number\_multiget\_bytes\_read](../myrocks-status-variables/index#rocksdb_number_multiget_bytes_read) | | [Rocksdb\_number\_multiget\_get](../myrocks-status-variables/index#rocksdb_number_multiget_get) | | [Rocksdb\_number\_multiget\_keys\_read](../myrocks-status-variables/index#rocksdb_number_multiget_keys_read) | | [Rocksdb\_number\_reseeks\_iteration](../myrocks-status-variables/index#rocksdb_number_reseeks_iteration) | | [Rocksdb\_number\_sst\_entry\_delete](../myrocks-status-variables/index#rocksdb_number_sst_entry_delete) | | [Rocksdb\_number\_sst\_entry\_merge](../myrocks-status-variables/index#rocksdb_number_sst_entry_merge) | | [Rocksdb\_number\_sst\_entry\_other](../myrocks-status-variables/index#rocksdb_number_sst_entry_other) | | [Rocksdb\_number\_sst\_entry\_put](../myrocks-status-variables/index#rocksdb_number_sst_entry_put) | | [Rocksdb\_number\_sst\_entry\_singledelete](../myrocks-status-variables/index#rocksdb_number_sst_entry_singledelete) | | [Rocksdb\_number\_superversion\_acquires](../myrocks-status-variables/index#rocksdb_number_superversion_acquires) | | [Rocksdb\_number\_superversion\_cleanups](../myrocks-status-variables/index#rocksdb_number_superversion_cleanups) | | [Rocksdb\_number\_superversion\_releases](../myrocks-status-variables/index#rocksdb_number_superversion_releases) | | --[rocksdb-override-cf-options](../myrocks-system-variables/index#rocksdb_override_cf_options), [rocksdb\_override\_cf\_options](../myrocks-system-variables/index#rocksdb_override_cf_options) | | --[rocksdb-paranoid-checks](../myrocks-system-variables/index#rocksdb_paranoid_checks), [rocksdb\_paranoid\_checks](../myrocks-system-variables/index#rocksdb_paranoid_checks) | | --[rocksdb-pause-background-work](../myrocks-system-variables/index#rocksdb_pause_background_work), [rocksdb\_pause\_background\_work](../myrocks-system-variables/index#rocksdb_pause_background_work) | | --[rocksdb-perf-context-level](../myrocks-system-variables/index#rocksdb_perf_context_level), [rocksdb\_perf\_context\_level](../myrocks-system-variables/index#rocksdb_perf_context_level) | | --[rocksdb-persistent-cache-path](../myrocks-system-variables/index#rocksdb_persistent_cache_path), [rocksdb\_persistent\_cache\_path](../myrocks-system-variables/index#rocksdb_persistent_cache_path) | | --[rocksdb-persistent-cache-size-mb](../myrocks-system-variables/index#rocksdb_persistent_cache_size_mb), [rocksdb\_persistent\_cache\_size\_mb](../myrocks-system-variables/index#rocksdb_persistent_cache_size_mb) | | --[rocksdb-pin-l0-filter-and-index-blocks-in-cache](../myrocks-system-variables/index#rocksdb_pin_l0_filter_and_index_blocks_in_cache), [rocksdb\_pin\_l0\_filter\_and\_index\_blocks\_in\_cache](../myrocks-system-variables/index#rocksdb_pin_l0_filter_and_index_blocks_in_cache) | | --[rocksdb-print-snapshot-conflict-queries](../myrocks-system-variables/index#rocksdb_print_snapshot_conflict_queries), [rocksdb\_print\_snapshot\_conflict\_queries](../myrocks-system-variables/index#rocksdb_print_snapshot_conflict_queries) | | [Rocksdb\_queries\_point](../myrocks-status-variables/index#rocksdb_queries_point) | | [Rocksdb\_queries\_range](../myrocks-status-variables/index#rocksdb_queries_range) | | --[rocksdb-rate-limiter-bytes-per-sec](../myrocks-system-variables/index#rocksdb_rate_limiter_bytes_per_sec), [rocksdb\_rate\_limiter\_bytes\_per\_sec](../myrocks-system-variables/index#rocksdb_rate_limiter_bytes_per_sec) | | --[rocksdb-read-free-rpl-tables](../myrocks-system-variables/index#rocksdb_read_free_rpl_tables), [rocksdb\_read\_free\_rpl\_tables](../myrocks-system-variables/index#rocksdb_read_free_rpl_tables) | | --[rocksdb-records-in-range](../myrocks-system-variables/index#rocksdb_records_in_range), [rocksdb\_records\_in\_range](../myrocks-system-variables/index#rocksdb_records_in_range) | | --[rocksdb-remove-mariabackup-checkpoint](../myrocks-system-variables/index#rocksdb_remove_mariabackup_checkpoint), [rocksdb\_remove\_mariabackup\_checkpoint](../myrocks-system-variables/index#rocksdb_remove_mariabackup_checkpoint) | | --[rocksdb-reset-stats](../myrocks-system-variables/index#rocksdb_reset_stats), [rocksdb\_reset\_stats](../myrocks-system-variables/index#rocksdb_reset_stats) | | --[rocksdb-rollback-on-timeout](../myrocks-system-variables/index#rocksdb_rollback_on_timeout), [rocksdb\_rollback\_on\_timeout](../myrocks-system-variables/index#rocksdb_rollback_on_timeout) | | [Rocksdb\_row\_lock\_deadlocks](../myrocks-status-variables/index#rocksdb_row_lock_deadlocks) | | [Rocksdb\_row\_lock\_wait\_timeouts](../myrocks-status-variables/index#rocksdb_row_lock_wait_timeouts) | | [Rocksdb\_rows\_deleted](../myrocks-status-variables/index#rocksdb_rows_deleted) | | [Rocksdb\_rows\_deleted\_blind](../myrocks-status-variables/index#rocksdb_rows_deleted_blind) | | [Rocksdb\_rows\_expired](../myrocks-status-variables/index#rocksdb_rows_expired) | | [Rocksdb\_rows\_filtered](../myrocks-status-variables/index#rocksdb_rows_filtered) | | [Rocksdb\_rows\_inserted](../myrocks-status-variables/index#rocksdb_rows_inserted) | | [Rocksdb\_rows\_read](../myrocks-status-variables/index#rocksdb_rows_read) | | [Rocksdb\_rows\_updated](../myrocks-status-variables/index#rocksdb_rows_updated) | | --[rocksdb-seconds-between-stat-computes](../myrocks-system-variables/index#rocksdb_seconds_between_stat_computes), [rocksdb\_seconds\_between\_stat\_computes](../myrocks-system-variables/index#rocksdb_seconds_between_stat_computes) | | --[rocksdb-signal-drop-index-thread](../myrocks-system-variables/index#rocksdb_signal_drop_index_thread), [rocksdb\_signal\_drop\_index\_thread](../myrocks-system-variables/index#rocksdb_signal_drop_index_thread) | | --[rocksdb-sim-cache-size](../myrocks-system-variables/index#rocksdb_sim_cache_size), [rocksdb\_sim\_cache\_size](../myrocks-system-variables/index#rocksdb_sim_cache_size) | | --[rocksdb-skip-bloom-filter-on-read](../myrocks-system-variables/index#rocksdb_skip_bloom_filter_on_read), [rocksdb\_skip\_bloom\_filter\_on\_read](../myrocks-system-variables/index#rocksdb_skip_bloom_filter_on_read) | | --[rocksdb-skip-fill-cache](../myrocks-system-variables/index#rocksdb_skip_fill_cache), [rocksdb\_skip\_fill\_cache](../myrocks-system-variables/index#rocksdb_skip_fill_cache) | | --[rocksdb-skip-unique-check-tables](../myrocks-system-variables/index#rocksdb_skip_unique_check_tables), [rocksdb\_skip\_unique\_check\_tables](../myrocks-system-variables/index#rocksdb_skip_unique_check_tables) | | [Rocksdb\_snapshot\_conflict\_errors](../myrocks-status-variables/index#rocksdb_snapshot_conflict_errors) | | --[rocksdb-sst-mgr-rate-bytes-per-sec](../myrocks-system-variables/index#rocksdb_sst_mgr_rate_bytes_per_sec), [rocksdb\_sst\_mgr\_rate\_bytes\_per\_sec](../myrocks-system-variables/index#rocksdb_sst_mgr_rate_bytes_per_sec) | | [Rocksdb\_stall\_l0\_file\_count\_limit\_slowdowns](../myrocks-status-variables/index#rocksdb_stall_l0_file_count_limit_slowdowns) | | [Rocksdb\_stall\_l0\_file\_count\_limit\_stops](../myrocks-status-variables/index#rocksdb_stall_l0_file_count_limit_stops) | | [Rocksdb\_stall\_locked\_l0\_file\_count\_limit\_slowdowns](../myrocks-status-variables/index#rocksdb_stall_locked_l0_file_count_limit_slowdowns) | | [Rocksdb\_stall\_locked\_l0\_file\_count\_limit\_stops](../myrocks-status-variables/index#rocksdb_stall_locked_l0_file_count_limit_stops) | | [Rocksdb\_stall\_memtable\_limit\_slowdowns](../myrocks-status-variables/index#rocksdb_stall_memtable_limit_slowdowns) | | [Rocksdb\_stall\_memtable\_limit\_stops](../myrocks-status-variables/index#rocksdb_stall_memtable_limit_stops) | | [Rocksdb\_stall\_micros](../myrocks-status-variables/index#rocksdb_stall_micros) | | [Rocksdb\_stall\_pending\_compaction\_limit\_slowdowns](../myrocks-status-variables/index#rocksdb_stall_pending_compaction_limit_slowdowns) | | [Rocksdb\_stall\_pending\_compaction\_limit\_stops](../myrocks-status-variables/index#rocksdb_stall_pending_compaction_limit_stops) | | [Rocksdb\_stall\_total\_slowdowns](../myrocks-status-variables/index#rocksdb_stall_total_slowdowns) | | [Rocksdb\_stall\_total\_stops](../myrocks-status-variables/index#rocksdb_stall_total_stops) | | --[rocksdb-stats-dump-period-sec](../myrocks-system-variables/index#rocksdb_stats_dump_period_sec), [rocksdb\_stats\_dump\_period\_sec](../myrocks-system-variables/index#rocksdb_stats_dump_period_sec) | | --[rocksdb-stats-level](../myrocks-system-variables/index#rocksdb_stats_level), [rocksdb\_stats\_level](../myrocks-system-variables/index#rocksdb_stats_level) | | --[rocksdb-stats-recalc-rate](../myrocks-system-variables/index#rocksdb_stats_recalc_rate), [rocksdb\_stats\_recalc\_rate](../myrocks-system-variables/index#rocksdb_stats_recalc_rate) | | --[rocksdb-store-row-debug-checksums](../myrocks-system-variables/index#rocksdb_store_row_debug_checksums), [rocksdb\_store\_row\_debug\_checksums](../myrocks-system-variables/index#rocksdb_store_row_debug_checksums) | | --[rocksdb-strict-collation-check](../myrocks-system-variables/index#rocksdb_strict_collation_check), [rocksdb\_strict\_collation\_check](../myrocks-system-variables/index#rocksdb_strict_collation_check) | | --[rocksdb-strict-collation-exceptions](../myrocks-system-variables/index#rocksdb_strict_collation_exceptions), [rocksdb\_strict\_collation\_exceptions](../myrocks-system-variables/index#rocksdb_strict_collation_exceptions) | | --[rocksdb-supported-compression-types](../myrocks-system-variables/index#rocksdb_supported_compression_types), [rocksdb\_supported\_compression\_types](../myrocks-system-variables/index#rocksdb_supported_compression_types) | | [Rocksdb\_system\_rows\_deleted](../myrocks-status-variables/index#rocksdb_system_rows_deleted) | | [Rocksdb\_system\_rows\_inserted](../myrocks-status-variables/index#rocksdb_system_rows_inserted) | | [Rocksdb\_system\_rows\_read](../myrocks-status-variables/index#rocksdb_system_rows_read) | | [Rocksdb\_system\_rows\_updated](../myrocks-status-variables/index#rocksdb_system_rows_updated) | | --[rocksdb-table-cache-numshardbits](../myrocks-system-variables/index#rocksdb_table_cache_numshardbits), [rocksdb\_table\_cache\_numshardbits](../myrocks-system-variables/index#rocksdb_table_cache_numshardbits) | | --[rocksdb-table-stats-sampling-pct](../myrocks-system-variables/index#rocksdb_table_stats_sampling_pct), [rocksdb\_table\_stats\_sampling\_pct](../myrocks-system-variables/index#rocksdb_table_stats_sampling_pct) | | --[rocksdb-tmpdir](../myrocks-system-variables/index#rocksdb_tmpdir), [rocksdb\_tmpdir](../myrocks-system-variables/index#rocksdb_tmpdir) | | --[rocksdb-trace-sst-api](../myrocks-system-variables/index#rocksdb_trace_sst_api), [rocksdb\_trace\_sst\_api](../myrocks-system-variables/index#rocksdb_trace_sst_api) | | --[rocksdb-two-write-queues](../myrocks-system-variables/index#rocksdb_two_write_queues), [rocksdb\_two\_write\_queues](../myrocks-system-variables/index#rocksdb_two_write_queues) | | --[rocksdb-unsafe-for-binlog](../myrocks-system-variables/index#rocksdb_unsafe_for_binlog), [rocksdb\_unsafe\_for\_binlog](../myrocks-system-variables/index#rocksdb_unsafe_for_binlog) | | --[rocksdb-update-cf-options](../myrocks-system-variables/index#rocksdb_update_cf_options), [rocksdb\_update\_cf\_options](../myrocks-system-variables/index#rocksdb_update_cf_options) | | --[rocksdb-use-adaptive-mutex](../myrocks-system-variables/index#rocksdb_use_adaptive_mutex), [rocksdb\_use\_adaptive\_mutex](../myrocks-system-variables/index#rocksdb_use_adaptive_mutex) | | --[rocksdb-use-clock-cache](../myrocks-system-variables/index#rocksdb_use_clock_cache), [rocksdb\_use\_clock\_cache](../myrocks-system-variables/index#rocksdb_use_clock_cache) | | --[rocksdb-use-direct-io-for-flush-and-compaction](../myrocks-system-variables/index#rocksdb_use_direct_io_for_flush_and_compaction), [rocksdb\_use\_direct\_io\_for\_flush\_and\_compaction](../myrocks-system-variables/index#rocksdb_use_direct_io_for_flush_and_compaction) | | --[rocksdb-use-direct-reads](../myrocks-system-variables/index#rocksdb_use_direct_reads), [rocksdb\_use\_direct\_reads](../myrocks-system-variables/index#rocksdb_use_direct_reads) | | --[rocksdb-use-fsync](../myrocks-system-variables/index#rocksdb_use_fsync), [rocksdb\_use\_fsync](../myrocks-system-variables/index#rocksdb_use_fsync) | | --[rocksdb-validate-tables](../myrocks-system-variables/index#rocksdb_validate_tables), [rocksdb\_validate\_tables](../myrocks-system-variables/index#rocksdb_validate_tables) | | --[rocksdb-verify-row-debug-checksums](../myrocks-system-variables/index#rocksdb_verify_row_debug_checksums), [rocksdb\_verify\_row\_debug\_checksums](../myrocks-system-variables/index#rocksdb_verify_row_debug_checksums) | | [Rocksdb\_wal\_bytes](../myrocks-status-variables/index#rocksdb_wal_bytes) | | --[rocksdb-wal-bytes-per-sync](../myrocks-system-variables/index#rocksdb_wal_bytes_per_sync), [rocksdb\_wal\_bytes\_per\_sync](../myrocks-system-variables/index#rocksdb_wal_bytes_per_sync) | | --[rocksdb-wal-dir](../myrocks-system-variables/index#rocksdb_wal_dir), [rocksdb\_wal\_dir](../myrocks-system-variables/index#rocksdb_wal_dir) | | [Rocksdb\_wal\_group\_syncs](../myrocks-status-variables/index#rocksdb_wal_group_syncs) | | --[rocksdb-wal-recovery-mode](../myrocks-system-variables/index#rocksdb_wal_recovery_mode), [rocksdb\_wal\_recovery\_mode](../myrocks-system-variables/index#rocksdb_wal_recovery_mode) | | --[rocksdb-wal-size-limit-mb](../myrocks-system-variables/index#rocksdb_wal_size_limit_mb), [rocksdb\_wal\_size\_limit\_mb](../myrocks-system-variables/index#rocksdb_wal_size_limit_mb) | | [Rocksdb\_wal\_synced](../myrocks-status-variables/index#rocksdb_wal_synced) | | --[rocksdb-wal-ttl-seconds](../myrocks-system-variables/index#rocksdb_wal_ttl_seconds), [rocksdb\_wal\_ttl\_seconds](../myrocks-system-variables/index#rocksdb_wal_ttl_seconds) | | --[rocksdb-whole-key-filtering](../myrocks-system-variables/index#rocksdb_whole_key_filtering), [rocksdb\_whole\_key\_filtering](../myrocks-system-variables/index#rocksdb_whole_key_filtering) | | --[rocksdb-write-batch-max-bytes](../myrocks-system-variables/index#rocksdb_write_batch_max_bytes), [rocksdb\_write\_batch\_max\_bytes](../myrocks-system-variables/index#rocksdb_write_batch_max_bytes) | | --[rocksdb-write-disable-wal](../myrocks-system-variables/index#rocksdb_write_disable_wal), [rocksdb\_write\_disable\_wal](../myrocks-system-variables/index#rocksdb_write_disable_wal) | | --[rocksdb-write-ignore-missing-column-families](../myrocks-system-variables/index#rocksdb_write_ignore_missing_column_families), [rocksdb\_write\_ignore\_missing\_column\_families](../myrocks-system-variables/index#rocksdb_write_ignore_missing_column_families) | | --[rocksdb-write-policy](../myrocks-system-variables/index#rocksdb_write_policy), [rocksdb\_write\_policy](../myrocks-system-variables/index#rocksdb_write_policy) | | [Rocksdb\_write\_other](../myrocks-status-variables/index#rocksdb_write_other) | | [Rocksdb\_write\_self](../myrocks-status-variables/index#rocksdb_write_self) | | [Rocksdb\_write\_timedout](../myrocks-status-variables/index#rocksdb_write_timedout) | | [Rocksdb\_write\_wal](../myrocks-status-variables/index#rocksdb_write_wal) | | --[rowid-merge-buff-size](../server-system-variables/index#rowid_merge_buff_size), [rowid\_merge\_buff\_size](../server-system-variables/index#rowid_merge_buff_size) | | [Resultset\_metadata\_skipped](../server-status-variables/index#resultset_metadata_skipped) | | [Rows\_read](../server-status-variables/index#rows_read) | | [Rows\_sent](../server-status-variables/index#rows_sent) | | [Rows\_tmp\_read](../server-status-variables/index#rows_tmp_read) | | --[rpl-recovery-rank](../server-system-variables/index#rpl_recovery_rank), [rpl\_recovery\_rank](../server-system-variables/index#rpl_recovery_rank) | | [Rpl\_semi\_sync\_master\_clients](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_clients) | | [rpl-semi-sync-master-enabled](../semisynchronous-replication/index#rpl_semi_sync_master_enabled) [rpl\_semi\_sync\_master\_enabled](../semisynchronous-replication/index#rpl_semi_sync_master_enabled) | | [Rpl\_semi\_sync\_master\_net\_avg\_wait\_time](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_net_avg_wait_time) | | [Rpl\_semi\_sync\_master\_net\_wait\_time](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_net_wait_time) | | [Rpl\_semi\_sync\_master\_net\_waits](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_net_waits) | | [Rpl\_semi\_sync\_master\_no\_times](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_no_times) | | [Rpl\_semi\_sync\_master\_no\_tx](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_no_tx) | | [Rpl\_semi\_sync\_master\_status](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_status) | | [Rpl\_semi\_sync\_master\_timefunc\_failures](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_timefunc_failures) | | [rpl-semi-sync-master-timeout](../semisynchronous-replication/index#rpl_semi_sync_master_timeout), [rpl\_semi\_sync\_master\_timeout](../semisynchronous-replication/index#rpl_semi_sync_master_timeout) | | [rpl-semi-sync-master-trace-level](../semisynchronous-replication/index#rpl_semi_sync_master_trace_level) , [rpl\_semi\_sync\_master\_trace\_level](../semisynchronous-replication/index#rpl_semi_sync_master_trace_level) | | [Rpl\_semi\_sync\_master\_tx\_avg\_wait\_time](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_tx_avg_wait_time) | | [Rpl\_semi\_sync\_master\_tx\_wait\_time](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_tx_wait_time) | | [Rpl\_semi\_sync\_master\_tx\_waits](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_tx_waits) | | [rpl-semi-sync-master-wait-no-slave](../semisynchronous-replication/index#rpl_semi_sync_master_wait_no_slave), [rpl\_semi\_sync\_master\_wait\_no\_slave](../semisynchronous-replication/index#rpl_semi_sync_master_wait_no_slave) | | [rpl-semi-sync-master-wait-point](../semisynchronous-replication/index#rpl_semi_sync_master_wait_point), [rpl\_semi\_sync\_master\_wait\_point](../semisynchronous-replication/index#rpl_semi_sync_master_wait_point) | | [Rpl\_semi\_sync\_master\_wait\_pos\_backtraverse](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_wait_pos_backtraverse) | | [Rpl\_semi\_sync\_master\_wait\_sessions](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_wait_sessions) | | [Rpl\_semi\_sync\_master\_yes\_tx](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_master_yes_tx) | | [rpl-semi-sync-slave-delay-master](../semisynchronous-replication/index#rpl_semi_sync_slave_delay_master), [rpl\_semi\_sync\_slave\_delay\_master](../semisynchronous-replication/index#rpl_semi_sync_slave_delay_master) | | [rpl-semi-sync-slave-enabled](../semisynchronous-replication/index#rpl_semi_sync_slave_enabled), [rpl\_semi\_sync\_slave\_enabled](../semisynchronous-replication/index#rpl_semi_sync_slave_enabled) | | [rpl-semi-sync-slave-kill-conn-timeout](../semisynchronous-replication/index#rpl_semi_sync_slave_kill_conn_timeout), [rpl\_semi\_sync\_slave\_kill\_conn\_timeout](../semisynchronous-replication/index#rpl_semi_sync_slave_kill_conn_timeout) | | [Rpl\_semi\_sync\_slave\_status](../semisynchronous-replication-plugin-status-variables/index#rpl_semi_sync_slave_status) | | [rpl-semi-sync-slave-trace-level](../semisynchronous-replication/index#rpl_semi_sync_slave_trace_level), [rpl\_semi\_sync\_slave\_trace\_level](../semisynchronous-replication/index#rpl_semi_sync_slave_trace_level) | | [Rpl\_status](../replication-and-binary-log-server-status-variables/index#rpl_status) | | [Rpl\_transactions\_multi\_engine](../replication-and-binary-log-status-variables/index#rpl_transactions_multi_engine) | | -s, --[symbolic-links](../mysqld-options/index#-symbolic-links) | | --[s3-access-key](../s3-storage-engine-system-variables/index#s3_access_key), [s3\_access\_key](../s3-storage-engine-system-variables/index#s3_access_key) | | --[s3-block-size](../s3-storage-engine-system-variables/index#s3_block_size), [s3\_block\_size](../s3-storage-engine-system-variables/index#s3_block_size) | | --[s3-bucket](../s3-storage-engine-system-variables/index#s3_bucket), [s3\_bucket](../s3-storage-engine-system-variables/index#s3_bucket) | | --[s3-debug](../s3-storage-engine-system-variables/index#s3_debug), [s3\_debug](../s3-storage-engine-system-variables/index#s3_debug) | | --[s3-host-name](../s3-storage-engine-system-variables/index#s3_host_name), [s3\_host\_name](../s3-storage-engine-system-variables/index#s3_host_name) | | --[s3-pagecache-age-threshold](../s3-storage-engine-system-variables/index#s3_pagecache_age_threshold), [s3\_pagecache\_age\_threshold](../s3-storage-engine-system-variables/index#s3_pagecache_age_threshold) | | --[s3-pagecache-buffer-size](../s3-storage-engine-system-variables/index#s3_pagecache_buffer_size), [s3\_pagecache\_buffer\_size](../s3-storage-engine-system-variables/index#s3_pagecache_buffer_size) | | --[s3-pagecache-division-limit](../s3-storage-engine-system-variables/index#s3_pagecache_division_limit), [s3\_pagecache\_division\_limit](../s3-storage-engine-system-variables/index#s3_pagecache_division_limit) | | --[s3-pagecache-file-hash-size](../s3-storage-engine-system-variables/index#s3_pagecache_file_hash_size), [s3\_pagecache\_file\_hash\_size](../s3-storage-engine-system-variables/index#s3_pagecache_file_hash_size) | | --[s3-port](../s3-storage-engine-system-variables/index#s3_port), [s3\_port](../s3-storage-engine-system-variables/index#s3_port) | | --[s3-protocol-version](../s3-storage-engine-system-variables/index#s3_protocol_version), [s3\_protocol\_version](../s3-storage-engine-system-variables/index#s3_protocol_version) | | --[s3-region](../s3-storage-engine-system-variables/index#s3_region), [s3\_region](../s3-storage-engine-system-variables/index#s3_region) | | --[s3-secret-key](../s3-storage-engine-system-variables/index#s3_secret_key), [s3\_secret\_key](../s3-storage-engine-system-variables/index#s3_secret_key) | | --[s3-slave-ignore-updates](../s3-storage-engine-system-variables/index#s3_slave_ignore_updates), [s3\_slave\_ignore\_updates](../s3-storage-engine-system-variables/index#s3_slave_ignore_updates) | | --[s3-use\_http](../s3-storage-engine-system-variables/index#s3_use_http), [s3\_use\_http](../s3-storage-engine-system-variables/index#s3_use_http) | | --[safe-mode](../mysqld-options/index#-safe-mode) | | --[safe-show-database](../server-system-variables/index#safe_show_database), [safe\_show\_database](../server-system-variables/index#safe_show_database) | | --[safe-user-create](../mysqld-options/index#-safe-user-create) | | --[safemalloc-mem-limit](../mysqld-options/index#-safemalloc-mem-limit) | | --[secure-auth](../server-system-variables/index#secure_auth), [secure\_auth](../server-system-variables/index#secure_auth) | | --[secure-file-priv](../server-system-variables/index#secure_file_priv), [secure\_file\_priv](../server-system-variables/index#secure_file_priv) | | --[secure-timestamp](../server-system-variables/index#secure_timestamp), [secure\_timestamp](../server-system-variables/index#secure_timestamp) | | [Select\_full\_join](../server-status-variables/index#select_full_join) | | [Select\_full\_range\_join](../server-status-variables/index#select_full_range_join) | | [Select\_range](../server-status-variables/index#select_range) | | [Select\_range\_check](../server-status-variables/index#select_range_check) | | [Select\_scan](../server-status-variables/index#select_scan) | | --[server-audit](../mariadb-audit-plugin-options-and-system-variables/index#server_audit) | | [Server\_audit\_active](../server_audit-status-variables/index#server_audit_active) | | [Server\_audit\_current\_log](../server_audit-status-variables/index#server_audit_current_log) | | --[server-audit-events](../server_audit-system-variables/index#server_audit_events), [server\_audit\_events](../server_audit-system-variables/index#server_audit_events) | | --[server-audit-excl-users](../server_audit-system-variables/index#server_audit_excl_users), [server\_audit\_excl\_users](../server_audit-system-variables/index#server_audit_excl_users) | | --[server-audit-file-path](../server_audit-system-variables/index#server_audit_file_path), [server\_audit\_file\_path](../server_audit-system-variables/index#server_audit_file_path) | | [Server\_audit\_last\_error](../server_audit-status-variables/index#server_audit_last_error) | | --[server-audit-file-rotate-now](../server_audit-system-variables/index#server_audit_file_rotate_now), [server\_audit\_file\_rotate\_now](../server_audit-system-variables/index#server_audit_file_rotate_now) | | --[server-audit-file-rotate-size](../server_audit-system-variables/index#server_audit_file_rotate_size), [server\_audit\_file\_rotate\_size](../server_audit-system-variables/index#server_audit_file_rotate_size) | | --[server-audit-file-rotations](../server_audit-system-variables/index#server_audit_file_rotations), [server\_audit\_file\_rotations](../server_audit-system-variables/index#server_audit_file_rotations) | | --[server-audit-incl-users](../server_audit-system-variables/index#server_audit_incl_users), [server\_audit\_incl\_users](../server_audit-system-variables/index#server_audit_incl_users) | | --[server-audit-loc-info](../server_audit-system-variables/index#server_audit_loc_info), [server\_audit\_loc\_info](../server_audit-system-variables/index#server_audit_loc_info) | | --[server-audit-logging](../server_audit-system-variables/index#server_audit_logging), [server\_audit\_logging](../server_audit-system-variables/index#server_audit_logging) | | --[server-audit-mode](../server_audit-system-variables/index#server_audit_mode), [server\_audit\_mode](../server_audit-system-variables/index#server_audit_mode) | | --[server-audit-output-type](../server_audit-system-variables/index#server_audit_output_type), [server\_audit\_output\_type](../server_audit-system-variables/index#server_audit_output_type) | | --[server-audit-query-limit](../server_audit-system-variables/index#server_audit_query_limit), [server\_audit\_query\_limit](../server_audit-system-variables/index#server_audit_query_limit) | | --[server-audit-syslog-facility](../server_audit-system-variables/index#server_audit_syslog_facility), [server\_audit\_syslog\_facility](../server_audit-system-variables/index#server_audit_syslog_facility) | | --[server-audit-syslog-ident](../server_audit-system-variables/index#server_audit_syslog_ident), [server\_audit\_syslog\_ident](../server_audit-system-variables/index#server_audit_syslog_ident) | | --[server-audit-syslog-info](../server_audit-system-variables/index#server_audit_syslog_info), [server\_audit\_syslog\_info](../server_audit-system-variables/index#server_audit_syslog_info) | | --[server-audit-syslog-priority](../server_audit-system-variables/index#server_audit_syslog_priority), [server\_audit\_syslog\_priority](../server_audit-system-variables/index#server_audit_syslog_priority) | | [Server\_audit\_writes\_failed](../server_audit-status-variables/index#server_audit_writes_failed) | | --[server-id](../replication-and-binary-log-server-system-variables/index#server_id), [server\_id](../replication-and-binary-log-server-system-variables/index#server_id) | | --[session-track-schema](../server-system-variables/index#session_track_schema), [session\_track\_schema](../server-system-variables/index#session_track_schema) | | --[session-track-state-change](../server-system-variables/index#session_track_state_change), [session\_track\_state\_change](../server-system-variables/index#session_track_state_change) | | --[session-track-system-variables](../server-system-variables/index#session_track_system_variables), [session\_track\_system\_variables](../server-system-variables/index#session_track_system_variables) | | --[session-track-transaction-info](../server-system-variables/index#session_track_transaction_info), [session\_track\_transaction\_info](../server-system-variables/index#session_track_transaction_info) | | -O, --[set-variable](../mysqld-options/index#-set-variable) | | [shared\_memory](../server-system-variables/index#shared_memory) | | [shared\_memory\_base\_name](../server-system-variables/index#shared_memory_base_name) | | --[show\_old\_temporals](../server-system-variables/index#show_old_temporals), [show\_old\_temporals](../server-system-variables/index#show_old_temporals) | | --[show-slave-auth-info](../mysqld-options/index#-show-slave-auth-info) | | --[silent-startup](../mysqld-options/index#-silent-startup) | | --[simple-password-check-digits](../simple_password_check/index#simple_password_check_digits), [simple\_password\_check\_digits](../simple_password_check/index#simple_password_check_digits) | | --[simple\_password-check-letters-same-case](../simple_password_check/index#simple_password_check_letters_same_case), [simple\_password\_check\_letters\_same\_case](../simple_password_check/index#simple_password_check_letters_same_case) | | --[simple-password-check-minimal\_length](../simple_password_check/index#simple_password_check_minimal_length), [simple\_password\_check\_minimal\_length](../simple_password_check/index#simple_password_check_minimal_length) | | --[simple\_password-check-other-characters](../simple_password_check/index#simple_password_check_other_characters), [simple\_password\_check\_other\_characters](../simple_password_check/index#simple_password_check_other_characters) | | --[skip-automatic-sp-privileges](../server-system-variables/index#automatic_sp_privileges) | | --[skip-bdb](../mysqld-options/index#-skip-bdb) | | --[skip-external-locking](../server-system-variables/index#skip_external_locking), [skip\_external\_locking](../server-system-variables/index#skip_external_locking) | | --[skip-grant-tables](../mysqld-options/index#-skip-grant-tables) | | --[skip-host-cache](../mysqld-options/index#-skip-host-cache) | | --[skip-innodb](../mysqld-options/index#-innodb) | | --[skip-innodb-checksums](../innodb-system-variables/index#innodb_checksums) | | --[skip-innodb-doublewrite](../innodb-system-variables/index#innodb_doublewrite) | | --[skip-large-pages](../server-system-variables/index#large_pages) | | --[skip-log-error](../server-system-variables/index#log_error) | | --[skip-name-resolve](../server-system-variables/index#skip_name_resolve), [skip\_name\_resolve](../server-system-variables/index#skip_name_resolve) | | --[skip-new](../mysqld-options/index#-skip-new) | | --[skip-networking](../server-system-variables/index#skip_networking), [skip\_networking](../server-system-variables/index#skip_networking) | | [skip\_parallel\_replication](../replication-and-binary-log-server-system-variables/index#skip_parallel_replication) | | --[skip-partition](../mysqld-options/index#-skip-partition) | | [skip\_replication](../replication-and-binary-log-server-system-variables/index#skip_replication) | | --[skip-show-database](../server-system-variables/index#skip_show_database), [skip\_show\_database](../server-system-variables/index#skip_show_database) | | --[skip-slave-start](../mysqld-options/index#-skip-slave-start) | | --[skip-ssl](../mysqld-options/index#-skip-ssl) | | --[skip-stack-trace](../mysqld-options/index#-skip-stack-trace) | | --[skip-symbolic-links](../mysqld-options/index#-skip-symbolic-links) | | --[skip-symlink](../mysqld-options/index#-skip-symlink) | | --[skip-thread-priority](../mysqld-options/index#-skip-thread-priority) | | --[slave-compressed-protocol](../replication-and-binary-log-server-system-variables/index#slave_compressed_protocol), [slave\_compressed\_protocol](../replication-and-binary-log-server-system-variables/index#slave_compressed_protocol) | | [Slave\_connections](../replication-and-binary-log-server-status-variables/index#slave_connections) | | --[slave-ddl-exec-mode](../replication-and-binary-log-server-system-variables/index#slave_ddl_exec_mode), [slave\_ddl\_exec\_mode](../replication-and-binary-log-server-system-variables/index#slave_ddl_exec_mode) | | --[slave-domain-parallel-threads](../replication-and-binary-log-server-system-variables/index#slave_domain_parallel_threads), [slave\_domain\_parallel\_threads](../replication-and-binary-log-server-system-variables/index#slave_domain_parallel_threads) | | --[slave-exec-mode](../replication-and-binary-log-server-system-variables/index#slave_exec_mode), [slave\_exec\_mode](../replication-and-binary-log-server-system-variables/index#slave_exec_mode) | | [Slave\_heartbeat\_period](../replication-and-binary-log-server-status-variables/index#slave_heartbeat_period) | | --[slave-load-tmpdir](../replication-and-binary-log-server-system-variables/index#slave_load_tmpdir), [slave\_load\_tmpdir](../replication-and-binary-log-server-system-variables/index#slave_load_tmpdir) | | --[slave-max-allowed-packet](../replication-and-binary-log-server-system-variables/index#slave_max_allowed_packet), [slave\_max\_allowed\_packet](../replication-and-binary-log-server-system-variables/index#slave_max_allowed_packet) | | --[slave-net-timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout), [slave\_net\_timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout) | | [Slave\_open\_temp\_tables](../replication-and-binary-log-server-status-variables/index#slave_open_temp_tables) | | --[slave-parallel-max-queued](../replication-and-binary-log-server-system-variables/index#slave_parallel_max_queued), [slave\_parallel\_max\_queued](../replication-and-binary-log-server-system-variables/index#slave_parallel_max_queued) | | [slave\_parallel\_mode](../replication-and-binary-log-server-system-variables/index#slave_parallel_mode) | | --[slave-parallel-threads](../replication-and-binary-log-server-system-variables/index#slave_parallel_threads), [slave\_parallel\_threads](../replication-and-binary-log-server-system-variables/index#slave_parallel_threads) | | --[slave-parallel-workers](../replication-and-binary-log-server-system-variables/index#slave_parallel_workers), [slave\_parallel\_workers](../replication-and-binary-log-server-system-variables/index#slave_parallel_workers) | | [Slave\_received\_heartbeats](../replication-and-binary-log-server-status-variables/index#slave_received_heartbeats) | | [Slave\_retried\_transactions](../replication-and-binary-log-server-status-variables/index#slave_retried_transactions) | | [slave\_run\_triggers\_for\_rbr](../replication-and-binary-log-server-system-variables/index#slave_run_triggers_for_rbr), [slave-run-triggers-for-rbr](../replication-and-binary-log-server-system-variables/index#slave_run_triggers_for_rbr) | | [Slave\_running](../replication-and-binary-log-server-status-variables/index#slave_running) | | --[slave-skip-errors](../replication-and-binary-log-server-system-variables/index#slave_skip_errors), [slave\_skip\_errors](../replication-and-binary-log-server-system-variables/index#slave_skip_errors) | | [Slave\_skipped\_errors](../replication-and-binary-log-server-status-variables/index#slave_skipped_errors) | | --[slave-sql-verify-checksum](../replication-and-binary-log-server-system-variables/index#slave_sql_verify_checksum), [slave\_sql\_verify\_checksum](../replication-and-binary-log-server-system-variables/index#slave_sql_verify_checksum) | | --[slave-transaction-retries](../replication-and-binary-log-server-system-variables/index#slave_transaction_retries), [slave\_transaction\_retries](../replication-and-binary-log-server-system-variables/index#slave_transaction_retries) | | --[slave-transaction-retry-errors](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_errors), [slave\_transaction\_retry\_errors](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_errors) | | --[slave-transaction-retry-interval](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_interval), [slave\_transaction\_retry\_interval](../replication-and-binary-log-server-system-variables/index#slave_transaction_retry_interval) | | --[slave-type-conversions](../replication-and-binary-log-server-system-variables/index#slave_type_conversions), [slave\_type\_conversions](../replication-and-binary-log-server-system-variables/index#slave_type_conversions) | | [Slaves\_connected](../replication-and-binary-log-server-status-variables/index#slaves_connected) | | [Slaves\_running](../replication-and-binary-log-server-status-variables/index#slaves_running) | | [Slow\_launch\_threads](../server-status-variables/index#slow_launch_threads) | | --[slow-launch-time](../server-system-variables/index#slow_launch_time), [slow\_launch\_time](../server-system-variables/index#slow_launch_time) | | [Slow\_queries](../server-status-variables/index#slow_queries) | | --[slow-query-log](../server-system-variables/index#slow_query_log), [slow\_query\_log](../server-system-variables/index#slow_query_log) | | --[slow-query-log-file](../server-system-variables/index#slow_query_log_file), [slow\_query\_log\_file](../server-system-variables/index#slow_query_log_file) | | --[slow-start-timeout](../mysqld-options/index#-slow-start-timeout) | | --[socket](../server-system-variables/index#socket), [socket](../server-system-variables/index#socket) | | --[sort-buffer-size](../server-system-variables/index#sort_buffer_size), [sort\_buffer\_size](../server-system-variables/index#sort_buffer_size) | | [Sort\_merge\_passes](../server-status-variables/index#sort_merge_passes) | | [Sort\_priority\_queue\_sorts](../server-status-variables/index#sort_priority_queue_sorts) | | [Sort\_range](../server-status-variables/index#sort_range) | | [Sort\_rows](../server-status-variables/index#sort_rows) | | [Sort\_scan](../server-status-variables/index#sort_scan) | | [Sphinx\_error](../sphinx-status-variables/index#sphinx_error) | | [Sphinx\_time](../sphinx-status-variables/index#sphinx_time) | | [Sphinx\_total](../sphinx-status-variables/index#sphinx_total) | | [Sphinx\_total\_found](../sphinx-status-variables/index#sphinx_total_found) | | [Sphinx\_word\_count](../sphinx-status-variables/index#sphinx_word_count) | | [Sphinx\_words](../sphinx-status-variables/index#sphinx_words) | | [spider\_auto\_increment\_mode](../spider-server-system-variables/index#spider_auto_increment_mode) | | [spider\_bgs\_first\_read](../spider-server-system-variables/index#spider_bgs_first_read) | | [spider\_bgs\_mode](../spider-server-system-variables/index#spider_bgs_mode) | | [spider\_bgs\_second\_read](../spider-server-system-variables/index#spider_bgs_second_read) | | [spider\_bka\_engine](../spider-server-system-variables/index#spider_bka_engine) | | [spider\_bka\_mode](../spider-server-system-variables/index#spider_bka_mode) | | [spider\_block\_size](../spider-server-system-variables/index#spider_block_size) | | [spider\_buffer\_size](../spider-server-system-variables/index#spider_buffer_size) | | [spider\_bulk\_size](../spider-server-system-variables/index#spider_bulk_size) | | [spider\_bulk\_update\_mode](../spider-server-system-variables/index#spider_bulk_update_mod) | | [spider\_bulk\_update\_size](../spider-server-system-variables/index#spider_bulk_update_size) | | [spider\_casual\_read](../spider-server-system-variables/index#spider_casual_read) | | [spider\_conn\_recycle\_mode](../spider-server-system-variables/index#spider_conn_recycle_mode) | | [spider\_conn\_recycle\_strict](../spider-server-system-variables/index#spider_conn_recycle_strict) | | [spider\_conn\_wait\_timeout](../spider-server-system-variables/index#spider_conn_wait_timeout) | | [spider\_connect\_error\_interval](../spider-server-system-variables/index#spider_connect_error_interval) | | [spider\_connect\_mutex](../spider-server-system-variables/index#spider_connect_mutex) | | [spider\_connect\_retry\_count](../spider-server-system-variables/index#spider_connect_retry_count) | | [spider\_connect\_retry\_interval](../spider-server-system-variables/index#spider_connect_retry_interval) | | [spider\_connect\_timeout](../spider-server-system-variables/index#spider_connect_timeout) | | [spider\_crd\_bg\_mode](../spider-server-system-variables/index#spider_crd_bg_mode) | | [spider\_crd\_interval](../spider-server-system-variables/index#spider_crd_interval) | | [spider\_crd\_mode](../spider-server-system-variables/index#spider_crd_mode) | | [spider\_crd\_sync](../spider-server-system-variables/index#spider_crd_sync) | | [spider\_crd\_type](../spider-server-system-variables/index#spider_crd_type) | | [spider\_crd\_weight](../spider-server-system-variables/index#spider_crd_weight) | | [spider\_delete\_all\_rows\_type](../spider-server-system-variables/index#spider_delete_all_rows_type) | | [Spider\_direct\_aggregate](../spider-server-status-variables/index#spider_direct_aggregate) | | [Spider\_direct\_delete](../spider-server-status-variables/index#spider_direct_delete) | | [spider\_direct\_dup\_insert](../spider-server-system-variables/index#spider_direct_dup_insert) | | [spider\_direct\_order\_limit](../spider-server-system-variables/index#spider_direct_order_limit) | | [Spider\_direct\_order\_limit](../spider-server-status-variables/index#spider_direct_order_limit) | | [Spider\_direct\_update](../spider-server-status-variables/index#spider_direct_update) | | [spider\_dry\_access](../spider-server-system-variables/index#spider_dry_access) | | [spider\_error\_read\_mode](../spider-server-system-variables/index#spider_error_read_mode) | | [spider\_error\_write\_mode](../spider-server-system-variables/index#spider_error_write_mode) | | [spider\_first\_read](../spider-server-system-variables/index#spider_first_read) | | [spider\_force\_commit](../spider-server-system-variables/index#spider_force_commit) | | [spider\_general\_log](../spider-server-system-variables/index#spider_general_log) | | [spider\_index\_hint\_pushdown](../spider-server-system-variables/index#spider_index_hint_pushdown) | | [spider\_init\_sql\_alloc\_size](../spider-server-system-variables/index#spider_init_sql_alloc_size) | | [spider\_internal\_limit](../spider-server-system-variables/index#spider_internal_limit) | | [spider\_internal\_offset](../spider-server-system-variables/index#spider_internal_offset) | | [spider\_internal\_optimize](../spider-server-system-variables/index#spider_internal_optimize) | | [spider\_internal\_optimize\_local](../spider-server-system-variables/index#spider_internal_optimize_local) | | [spider\_internal\_sql\_log\_off](../spider-server-system-variables/index#spider_internal_sql_log_off) | | [spider\_internal\_unlock](../spider-server-system-variables/index#spider_internal_unlock) | | [spider\_internal\_xa](../spider-server-system-variables/index#spider_internal_xa) | | [spider\_internal\_xa\_id\_type](../spider-server-system-variables/index#spider_internal_xa_id_type) | | [spider\_internal\_xa\_snapshot](../spider-server-system-variables/index#spider_internal_xa_snapshot) | | [spider\_load\_crd\_at\_startup](../spider-server-system-variables/index#spider_load_crd_at_startup) | | [spider\_load\_sts\_at\_startup](../spider-server-system-variables/index#spider_load_sts_at_startup) | | [spider\_local\_lock\_table](../spider-server-system-variables/index#spider_local_lock_table) | | [spider\_lock\_exchange](../spider-server-system-variables/index#spider_lock_exchange) | | [spider\_log\_result\_error\_with\_sql](../spider-server-system-variables/index#spider_log_result_error_with_sql) | | [spider\_log\_result\_errors](../spider-server-system-variables/index#spider_log_result_errors) | | [spider\_low\_mem\_read](../spider-server-system-variables/index#spider_low_mem_read) | | [spider\_max\_connections](../spider-server-system-variables/index#spider_max_connections) | | [spider\_max\_order](../spider-server-system-variables/index#spider_max_order) | | [Spider\_mon\_table\_cache\_version](../spider-server-status-variables/index#spider_mon_table_cache_version) | | [Spider\_mon\_table\_cache\_version\_req](../spider-server-status-variables/index#spider_mon_table_cache_version_req) | | [spider\_multi\_split\_read](../spider-server-system-variables/index#spider_multi_split_read) | | [spider\_net\_read\_timeout](../spider-server-system-variables/index#spider_net_read_timeout) | | [spider\_net\_write\_timeout](../spider-server-system-variables/index#spider_net_write_timeout) | | [Spider\_parallel\_search](../spider-server-status-variables/index#spider_parallel_search) | | [spider\_ping\_interval\_at\_trx\_start](../spider-server-system-variables/index#spider_ping_interval_at_trx_start) | | [spider\_quick\_mode](../spider-server-system-variables/index#spider_quick_mode) | | [spider\_quick\_page\_byte](../spider-server-system-variables/index#spider_quick_page_byte) | | [spider\_quick\_page\_size](../spider-server-system-variables/index#spider_quick_page_size) | | [spider\_read\_only\_mode](../spider-server-system-variables/index#spider_read_only_mode) | | [spider\_remote\_access\_charset](../spider-server-system-variables/index#spider_remote_access_charse) | | [spider\_remote\_autocommit](../spider-server-system-variables/index#spider_remote_autocommit) | | [spider\_remote\_default\_database](../spider-server-system-variables/index#spider_remote_default_database) | | [spider\_remote\_sql\_log\_off](../spider-server-system-variables/index#spider_remote_sql_log_off) | | [spider\_remote\_time\_zone](../spider-server-system-variables/index#spider_remote_time_zone) | | [spider\_remote\_trx\_isolation](../spider-server-system-variables/index#spider_remote_trx_isolation) | | [spider\_remote\_wait\_timeout](../spider-server-system-variables/index#spider_remote_wait_timeout) | | [spider\_reset\_sql\_alloc](../spider-server-system-variables/index#spider_reset_sql_alloc) | | [spider\_same\_server\_link](../spider-server-system-variables/index#spider_same_server_link) | | [spider\_second\_read](../spider-server-system-variables/index#spider_second_read) | | [spider\_select\_column\_mode](../spider-server-system-variables/index#spider_select_column_mode) | | [spider\_selupd\_lock\_mode](../spider-server-system-variables/index#spider_selupd_lock_mode) | | [spider\_semi\_split\_read](../spider-server-system-variables/index#spider_semi_split_read) | | [spider\_semi\_split\_read\_limit](../spider-server-system-variables/index#spider_semi_split_read_limit) | | [spider\_semi\_table\_lock](../spider-server-system-variables/index#spider_semi_table_loc) | | [spider\_semi\_table\_lock\_connection](../spider-server-system-variables/index#spider_semi_table_lock_connection) | | [spider\_semi\_trx](../spider-server-system-variables/index#spider_semi_trx) | | [spider\_semi\_trx\_isolation](../spider-server-system-variables/index#spider_semi_trx_isolation) | | [spider\_skip\_default\_condition](../spider-server-system-variables/index#spider_skip_default_condition) | | [spider\_skip\_parallel\_search](../spider-server-system-variables/index#spider_skip_parallel_search) | | [spider\_slave\_trx\_isolation](../spider-server-system-variables/index#spider_slave_trx_isolation) | | [spider\_split\_read](../spider-server-system-variables/index#spider_split_read) | | [spider\_store\_last\_crd](../spider-server-system-variables/index#spider_store_last_crd) | | [spider\_store\_last\_sts](../spider-server-system-variables/index#spider_store_last_sts) | | [spider\_strict\_group\_by](../spider-server-system-variables/index#spider_strict_group_by) | | [spider\_sts\_bg\_mode](../spider-server-system-variables/index#spider_sts_bg_mode) | | [spider\_sts\_interval](../spider-server-system-variables/index#spider_sts_interval) | | [spider\_sts\_mode](../spider-server-system-variables/index#spider_sts_mode) | | [spider\_sts\_sync](../spider-server-system-variables/index#spider_sts_sync) | | [spider\_support\_xa](../spider-server-system-variables/index#spider_support_xa) | | [spider\_sync\_autocommit](../spider-server-system-variables/index#spider_sync_autocommit) | | [spider\_sync\_sql\_mode](../spider-server-system-variables/index#spider_sync_sql_mode) | | [spider\_sync\_time\_zone](../spider-server-system-variables/index#spider_sync_time_zone) | | [spider\_sync\_trx\_isolation](../spider-server-system-variables/index#spider_sync_trx_isolation) | | [spider\_table\_crd\_thread\_count](../spider-server-system-variables/index#spider_table_crd_thread_count) | | [spider\_table\_init\_error\_interval](../spider-server-system-variables/index#spider_table_init_error_interval) | | [spider\_table\_sts\_thread\_count](../spider-server-system-variables/index#spider_table_sts_thread_count) | | [spider\_udf\_ct\_bulk\_insert\_interval](../spider-server-system-variables/index#spider_udf_ct_bulk_insert_interval) | | [spider\_udf\_ct\_bulk\_insert\_rows](../spider-server-system-variables/index#spider_udf_ct_bulk_insert_rows) | | [spider\_udf\_ds\_bulk\_insert\_rows](../spider-server-system-variables/index#spider_udf_ds_bulk_insert_rows) | | [spider\_udf\_ds\_table\_loop\_mode](../spider-server-system-variables/index#spider_udf_ds_table_loop_mode) | | [spider\_udf\_ds\_use\_real\_table](../spider-server-system-variables/index#spider_udf_ds_use_real_table) | | [spider\_udf\_table\_lock\_mutex\_count](../spider-server-system-variables/index#spider_udf_table_lock_mutex_count) | | [spider\_udf\_table\_mon\_mutex\_count](../spider-server-system-variables/index#spider_udf_table_mon_mutex_count) | | [spider\_use\_all\_conns\_snapshot](../spider-server-system-variables/index#spider_use_all_conns_snapshot) | | [spider\_use\_cond\_other\_than\_pk\_for\_update](../spider-server-system-variables/index#spider_use_cond_other_than_pk_for_update) | | [spider\_use\_consistent\_snapshot](../spider-server-system-variables/index#spider_use_consistent_snapshot) | | [spider\_use\_default\_database](../spider-server-system-variables/index#spider_use_default_database) | | [spider\_use\_flash\_logs](../spider-server-system-variables/index#spider_use_flash_logs) | | [spider\_use\_handler](../spider-server-system-variables/index#spider_use_handler) | | [spider\_use\_pushdown\_udf](../spider-server-system-variables/index#spider_use_pushdown_udf) | | [spider\_use\_table\_charset](../spider-server-system-variables/index#spider_use_table_charset) | | [spider\_version](../spider-server-system-variables/index#spider_version) | | [spider\_wait\_timeout](../spider-server-system-variables/index#spider_wait_timeout) | | [spider\_xa\_register\_mode](../spider-server-system-variables/index#spider_xa_register_mode) | | --[sporadic-binlog-dump-fail](../mysqld-options/index#-sporadic-binlog-dump-fail) | | [sql\_auto\_is\_null](../server-system-variables/index#sql_auto_is_null) | | [sql\_big\_selects](../server-system-variables/index#sql_big_selects) | | [sql\_big\_tables](../server-system-variables/index#sql_big_tables) | | [sql\_buffer\_result](../server-system-variables/index#sql_buffer_result) | | --[sql-bin-update-same](../mysqld-options/index#-sql-bin-update-same) | | --[sql-error-log-filename](../sql-error-log-plugin/index#sql_error_log_filename), [sql\_error\_log\_filename](../sql-error-log-plugin/index#sql_error_log_filename) | | --[sql-error-log-rate](../sql-error-log-plugin/index#sql_error_log_rate), [sql\_error\_log\_rate](../sql-error-log-plugin/index#sql_error_log_rate) | | --[sql-error-log-rotate](../sql-error-log-plugin/index#sql_error_log_rotate), [sql\_error\_log\_rotate](../sql-error-log-plugin/index#sql_error_log_rotate) | | --[sql-error-log-rotations](../sql-error-log-plugin/index#sql_error_log_rotations), [sql\_error\_log\_rotations](../sql-error-log-plugin/index#sql_error_log_rotations) | | --[sql-error-log-size-limit](../sql-error-log-plugin/index#sql_error_log_size_limit), [sql\_error\_log\_size\_limit](../sql-error-log-plugin/index#sql_error_log_size_limit) | | --[sql-if-exists](../server-system-variables/index#sql_if_exists), [sql\_if\_exists](../server-system-variables/index#sql_if_exists) | | [sql\_log\_bin](../replication-and-binary-log-server-system-variables/index#sql_log_bin) | | [sql\_log\_off](../server-system-variables/index#sql_log_off) | | [sql\_log\_update](../server-system-variables/index#sql_log_update) | | [sql\_low\_priority\_updates](../server-system-variables/index#sql_low_priority_updates) | | [sql\_max\_join\_size](../server-system-variables/index#sql_max_join_size) | | --[sql-mode](../server-system-variables/index#sql_mode), [sql\_mode](../server-system-variables/index#sql_mode) | | [sql\_notes](../server-system-variables/index#sql_notes) | | [sql\_quote\_show\_create](../server-system-variables/index#sql_quote_show_create) | | --[sql-safe-updates](../server-system-variables/index#sql_safe_updates), [sql\_safe\_updates](../server-system-variables/index#sql_safe_updates) | | [sql\_select\_limit](../server-system-variables/index#sql_select_limit) | | [sql\_slave\_skip\_counter](../replication-and-binary-log-server-system-variables/index#sql_slave_skip_counter) | | [sql\_warnings](../server-system-variables/index#sql_warnings) | | --[ssl](../mysqld-options/index#-ssl) | | [Ssl\_accept\_renegotiates](../ssl-status-variables/index#ssl_accept_renegotiates) | | [Ssl\_accepts](../ssl-status-variables/index#ssl_accepts) | | --[ssl-ca](../ssl-server-system-variables/index#ssl-ca), [ssl\_ca](../ssl-server-system-variables/index#ssl_ca) | | [Ssl\_callback\_cache\_hits](../ssl-status-variables/index#ssl_callback_cache_hits) | | --[ssl-capath](../ssl-server-system-variables/index#ssl_capath), [ssl\_capath](../ssl-server-system-variables/index#ssl_capath) | | --[ssl-cert](../ssl-server-system-variables/index#ssl_cert), [ssl\_cert](../ssl-server-system-variables/index#ssl_cert) | | --[ssl-cipher](../ssl-server-system-variables/index#ssl_cipher), [ssl\_cipher](../ssl-server-system-variables/index#ssl_cipher) | | [Ssl\_cipher](../ssl-status-variables/index#ssl_cipher) | | [Ssl\_cipher\_list](../ssl-status-variables/index#ssl_cipher_list) | | [Ssl\_client\_connects](../ssl-status-variables/index#ssl_client_connects) | | [Ssl\_connect\_renegotiates](../ssl-status-variables/index#ssl_connect_renegotiates) | | --[ssl-crl](../ssl-server-system-variables/index#ssl_crl), [ssl\_crl](../ssl-server-system-variables/index#ssl_crl) | | --[ssl-crlpath](../ssl-server-system-variables/index#ssl_crlpath), [ssl\_crlpath](../ssl-server-system-variables/index#ssl_crlpath) | | [Ssl\_ctx\_verify\_depth](../ssl-status-variables/index#ssl_ctx_verify_depth) | | [Ssl\_ctx\_verify\_mode](../ssl-status-variables/index#ssl_ctx_verify_mode) | | [Ssl\_default\_timeout](../ssl-status-variables/index#ssl_default_timeout) | | [Ssl\_finished\_accepts](../ssl-status-variables/index#ssl_finished_accepts) | | [Ssl\_finished\_connects](../ssl-status-variables/index#ssl_finished_connects) | | --[ssl-key](../ssl-server-system-variables/index#ssl_key), [ssl\_key](../ssl-server-system-variables/index#ssl_key) | | [Ssl\_server\_not\_after](../ssl-status-variables/index#ssl_server_not_after) | | [Ssl\_server\_not\_before](../ssl-status-variables/index#ssl_server_not_before) | | [Ssl\_session\_cache\_hits](../ssl-status-variables/index#ssl_session_cache_hits) | | [Ssl\_session\_cache\_misses](../ssl-status-variables/index#ssl_session_cache_misses) | | [Ssl\_session\_cache\_mode](../ssl-status-variables/index#ssl_session_cache_mode) | | [Ssl\_session\_cache\_overflows](../ssl-status-variables/index#ssl_session_cache_overflows) | | [Ssl\_session\_cache\_size](../ssl-status-variables/index#ssl_session_cache_size) | | [Ssl\_session\_cache\_timeouts](../ssl-status-variables/index#ssl_session_cache_timeouts) | | [Ssl\_sessions\_reused](../ssl-status-variables/index#ssl_sessions_reused) | | [Ssl\_used\_session\_cache\_entries](../ssl-status-variables/index#ssl_used_session_cache_entries) | | [Ssl\_verify\_depth](../ssl-status-variables/index#ssl_verify_depth) | | [Ssl\_verify\_mode](../ssl-status-variables/index#ssl_verify_mode) | | --[standard-compliant-cte](../server-system-variables/index#standard_compliant_cte), [standard\_compliant\_cte](../server-system-variables/index#standard_compliant_cte) | | --[stack-trace](../mysqld-options/index#-stack-trace) | | --[standalone](../mysqld-options/index#-standalone) | | [storage\_engine](../server-system-variables/index#storage_engine) | | --[stored-program-cache](../server-system-variables/index#stored_program_cache), [stored\_program\_cache](../server-system-variables/index#stored_program_cache) | | --[strict-password-validation](../server-system-variables/index#strict_password_validation), [strict\_password\_validation](../server-system-variables/index#strict_password_validation) | | [Subquery\_cache\_hit](../server-status-variables/index#subquery_cache_hit) | | [Subquery\_cache\_miss](../server-status-variables/index#subquery_cache_miss) | | -s, --[symbolic-links](../mysqld-options/index#-symbolic-links) | | --[sync-binlog](../replication-and-binary-log-server-system-variables/index#sync_binlog), [sync\_binlog](../replication-and-binary-log-server-system-variables/index#sync_binlog) | | --[sync-frm](../server-system-variables/index#sync_frm), [sync\_frm](../server-system-variables/index#sync_frm) | | --[sync-master-info](../replication-and-binary-log-server-system-variables/index#sync_master_info), [sync\_master\_info](../replication-and-binary-log-server-system-variables/index#sync_master_info) | | --[sync-relay-log](../replication-and-binary-log-server-system-variables/index#sync_relay_log), [sync\_relay\_log](../replication-and-binary-log-server-system-variables/index#sync_relay_log) | | --[sync-relay-log-info](../replication-and-binary-log-server-system-variables/index#sync_relay_log_info), [sync\_relay\_log\_info](../replication-and-binary-log-server-system-variables/index#sync_relay_log_info) | | --[sync-sys](../mysqld-options/index#-sync-sys) | | [Syncs](../server-status-variables/index#syncs) | | --[sysdate-is-now](../mysqld-options/index#-sysdate-is-now) | | -T, --[exit-info](../mysqld-options-full-list/index#-exit-info) | | --[system\_time\_zone](../server-system-variables/index#system_time_zone) | | --[system-versioning-alter-history](../system-versioned-tables/index#system_versioning_alter_history), [system\_versioning\_alter\_history](../system-versioned-tables/index#system_versioning_alter_history) | | [system\_versioning\_asof](../system-versioned-tables/index#system_versioning_asof) | | --[system-versioning-innodb-algorithm-simple](../system-versioned-tables/index#system_versioning_innodb_algorithm_simple), [system\_versioning\_innodb\_algorithm\_simple](../system-versioned-tables/index#system_versioning_innodb_algorithm_simple) | | --[table-cache](../mysqld-options/index#-table-cache) | | --[table-definition-cache](../server-system-variables/index#table_definition_cache), [table\_definition\_cache](../server-system-variables/index#table_definition_cache) | | --[table-lock-wait-timeout](../server-system-variables/index#table_lock_wait_timeout), [table\_lock\_wait\_timeout](../server-system-variables/index#table_lock_wait_timeout) | | [Table\_locks\_immediate](../server-status-variables/index#table_locks_immediate) | | [Table\_locks\_waited](../server-status-variables/index#table_locks_waited) | | --[table-open-cache](../server-system-variables/index#table_open_cache), [table\_open\_cache](../server-system-variables/index#table_open_cache) | | [Table\_open\_cache\_active\_instances](../server-status-variables/index#table_open_cache_active_instances) | | [Table\_open\_cache\_hits](../server-status-variables/index#table_open_cache_hits) | | --[table-open-cache-instances](../server-system-variables/index#table_open_cache_instances), [table\_open\_cache\_instances](../server-system-variables/index#table_open_cache_instances) | | [Table\_open\_cache\_misses](../server-status-variables/index#table_open_cache_misses) | | [Table\_open\_cache\_overflows](../server-status-variables/index#table_open_cache_overflows) | | [table\_type](../server-system-variables/index#table_type) | | --[tc-heuristic-recover](../mysqld-options/index#-tc-heuristic-recover) | | [Tc\_log\_max\_pages\_used](../server-status-variables/index#tc_log_max_pages_used) | | [Tc\_log\_page\_size](../server-status-variables/index#tc_log_page_size) | | [Tc\_log\_page\_waits](../server-status-variables/index#tc_log_page_waits) | | --[tcp-keepalive-interval](../server-system-variables/index#tcp_keepalive_interval), [tcp\_keepalive\_interval](../server-system-variables/index#tcp_keepalive_interval) | | --[tcp-keepalive-probes](../server-system-variables/index#tcp_keepalive_probes), [tcp\_keepalive\_probes](../server-system-variables/index#tcp_keepalive_probes) | | --[tcp-keepalive-interval](../server-system-variables/index#tcp_keepalive_time), [tcp\_keepalive\_time](../server-system-variables/index#tcp_keepalive_time) | | --[tcp-nodelay](../server-system-variables/index#tcp_nodelay), [tcp\_nodelay](../server-system-variables/index#tcp_nodelay) | | --[temp-pool](../mysqld-options/index#-temp-pool) | | --[test-expect-abort](../mysqld-options/index#-test-expect-abort) | | --[test-ignore-wrong-options](../mysqld-options/index#-test-ignore-wrong-options) | | --thread-alarm | | --[thread-cache-size](../server-system-variables/index#thread_cache_size), [thread\_cache\_size](../server-system-variables/index#thread_cache_size) | | --[thread-concurrency](../server-system-variables/index#thread_concurrency), [thread\_concurrency](../server-system-variables/index#thread_concurrency) | | --[thread-handling](../thread-pool-system-and-status-variables/index#thread_handling), [thread\_handling](../thread-pool-system-and-status-variables/index#thread_handling) | | --[thread-pool-dedicated-listener](../thread-pool-system-and-status-variables/index#thread_pool_dedicated_listener), [thread\_pool\_dedicated\_listener](../thread-pool-system-and-status-variables/index#thread_pool_dedicated_listener) | | --[thread-pool-exact-stats](../thread-pool-system-and-status-variables/index#thread_pool_exact_stats), [thread\_pool\_exact\_stats](../thread-pool-system-and-status-variables/index#thread_pool_exact_stats) | | --[thread-pool-idle-timeout](../thread-pool-system-and-status-variables/index#thread_pool_idle_timeout), [thread\_pool\_idle\_timeout](../thread-pool-system-and-status-variables/index#thread_pool_idle_timeout) | | --[thread-pool-max-threads](../thread-pool-system-and-status-variables/index#thread_pool_max_threads), [thread\_pool\_max\_threads](../thread-pool-system-and-status-variables/index#thread_pool_max_threads) | | --[thread-pool-min-threads](../thread-pool-system-and-status-variables/index#thread_pool_min_threads), [thread\_pool\_min\_threads](../thread-pool-system-and-status-variables/index#thread_pool_min_threads) | | [thread\_pool\_oversubscribe](../thread-pool-system-and-status-variables/index#thread_pool_oversubscribe) | | --[thread-pool-prio-kickup-timer](../thread-pool-system-and-status-variables/index#thread_pool_prio_kickup_timer), [thread\_pool\_prio\_kickup\_timer](../thread-pool-system-and-status-variables/index#thread_pool_prio_kickup_timer) | | --[thread-pool-priority](../thread-pool-system-and-status-variables/index#thread_pool_priority), [thread\_pool\_priority](../thread-pool-system-and-status-variables/index#thread_pool_priority) | | --[thread-pool-size](../thread-pool-system-and-status-variables/index#thread_pool_size), [thread\_pool\_size](../thread-pool-system-and-status-variables/index#thread_pool_size) | | --[thread-pool-stall-limit](../thread-pool-system-and-status-variables/index#thread_pool_stall_limit), [thread\_pool\_stall\_limit](../thread-pool-system-and-status-variables/index#thread_pool_stall_limit) | | [Threadpool\_idle\_threads](../thread-pool-system-and-status-variables/index#threadpool_idle_threads) | | [Threadpool\_threads](../thread-pool-system-and-status-variables/index#threadpool_threads) | | --[thread-stack](../server-system-variables/index#thread_stack), [thread\_stack](../server-system-variables/index#thread_stack) | | [Threads\_cached](../server-status-variables/index#threads_cached) | | [Threads\_connected](../server-status-variables/index#threads_connected) | | [Threads\_created](../server-status-variables/index#threads_created) | | [Threads\_running](../server-status-variables/index#threads_running) | | --[timed-mutexes](../server-system-variables/index#timed_mutexes), [timed\_mutexes](../server-system-variables/index#timed_mutexes) | | [timestamp](../server-system-variables/index#timestamp) | | --[time-format](../server-system-variables/index#time_format), [time-format](../server-system-variables/index#time_format) | | [time\_zone](../server-system-variables/index#time_zone) | | --[tls-version](../ssltls-system-variables/index#tls_version), [tls\_version](../ssltls-system-variables/index#tls_version) | | --[tmp-disk-table-size](../server-system-variables/index#tmp_disk_table_size), [tmp\_disk\_table\_size](../server-system-variables/index#tmp_disk_table_size) | | --[tmp-memory-table-size](../server-system-variables/index#tmp_memory_table_size), [tmp\_memory\_table\_size](../server-system-variables/index#tmp_memory_table_size) | | --[tmp-table-size](../server-system-variables/index#tmp_table_size), [tmp\_table\_size](../server-system-variables/index#tmp_table_size) | | -t, --[tmpdir](../server-system-variables/index#tmpdir), [tmpdir](../server-system-variables/index#tmpdir) | | [tokudb\_alter\_print\_error](../tokudb-system-and-status-variables/index#tokudb_alter_print_error) | | [tokudb\_analyze\_time](../tokudb-system-and-status-variables/index#tokudb_analyze_time) | | [Tokudb\_basement\_deserialization\_fixed\_key](../tokudb-status-variables/index#tokudb_basement_deserialization_fixed_key) | | [Tokudb\_basement\_deserialization\_variable\_key](../tokudb-status-variables/index#tokudb_basement_deserialization_variable_key) | | [Tokudb\_basements\_decompressed\_for\_write](../tokudb-status-variables/index#tokudb_basements_decompressed_for_write) | | [Tokudb\_basements\_decompressed\_prefetch](../tokudb-status-variables/index#tokudb_basements_decompressed_prefetch) | | [Tokudb\_basements\_decompressed\_prelocked\_range](../tokudb-status-variables/index#tokudb_basements_decompressed_prelocked_range) | | [Tokudb\_basements\_decompressed\_target\_query](../tokudb-status-variables/index#tokudb_basements_decompressed_target_query) | | [Tokudb\_basements\_fetched\_for\_write](../tokudb-status-variables/index#tokudb_basements_fetched_for_write) | | [Tokudb\_basements\_fetched\_for\_write\_bytes](../tokudb-status-variables/index#tokudb_basements_fetched_for_write_bytes) | | [Tokudb\_basements\_fetched\_for\_write\_seconds](../tokudb-status-variables/index#tokudb_basements_fetched_for_write_seconds) | | [Tokudb\_basements\_fetched\_prefetch](../tokudb-status-variables/index#tokudb_basements_fetched_prefetch) | | [Tokudb\_basements\_fetched\_prefetch\_bytes](../tokudb-status-variables/index#tokudb_basements_fetched_prefetch_bytes) | | [Tokudb\_basements\_fetched\_prefetch\_seconds](../tokudb-status-variables/index#tokudb_basements_fetched_prefetch_seconds) | | [Tokudb\_basements\_fetched\_prelocked\_range](../tokudb-status-variables/index#tokudb_basements_fetched_prelocked_range) | | [Tokudb\_basements\_fetched\_prelocked\_range\_bytes](../tokudb-status-variables/index#tokudb_basements_fetched_prelocked_range_bytes) | | [Tokudb\_basements\_fetched\_prelocked\_range\_seconds](../tokudb-status-variables/index#tokudb_basements_fetched_prelocked_range_seconds) | | [Tokudb\_basements\_fetched\_target\_query](../tokudb-status-variables/index#tokudb_basements_fetched_target_query) | | [Tokudb\_basements\_fetched\_target\_query\_bytes](../tokudb-status-variables/index#tokudb_basements_fetched_target_query_bytes) | | [Tokudb\_basements\_fetched\_target\_query\_seconds](../tokudb-status-variables/index#tokudb_basements_fetched_target_query_seconds) | | [Tokudb\_broadcase\_messages\_injected\_at\_root](../tokudb-status-variables/index#tokudb_broadcase_messages_injected_at_root) | | [Tokudb\_buffers\_decompressed\_prefetch](../tokudb-status-variables/index#tokudb_buffers_decompressed_prefetch) | | [Tokudb\_buffers\_decompressed\_for\_write](../tokudb-status-variables/index#tokudb_buffers_decompressed_for_write) | | [Tokudb\_buffers\_decompressed\_prelocked\_range](../tokudb-status-variables/index#tokudb_buffers_decompressed_prelocked_range) | | [Tokudb\_buffers\_decompressed\_target\_query](../tokudb-status-variables/index#tokudb_buffers_decompressed_target_query) | | [Tokudb\_buffers\_fetched\_for\_write](../tokudb-status-variables/index#tokudb_buffers_fetched_for_write) | | [Tokudb\_buffers\_fetched\_for\_write\_bytes](../tokudb-status-variables/index#tokudb_buffers_fetched_for_write_bytes) | | [Tokudb\_buffers\_fetched\_for\_write\_seconds](../tokudb-status-variables/index#tokudb_buffers_fetched_for_write_seconds) | | [Tokudb\_buffers\_fetched\_prefetch](../tokudb-status-variables/index#tokudb_buffers_fetched_prefetch) | | [Tokudb\_buffers\_fetched\_prefetch\_bytes](../tokudb-status-variables/index#tokudb_buffers_fetched_prefetch_bytes) | | [Tokudb\_buffers\_fetched\_prefetch\_seconds](../tokudb-status-variables/index#tokudb_buffers_fetched_prefetch_seconds) | | [Tokudb\_buffers\_fetched\_prelocked\_range](../tokudb-status-variables/index#tokudb_buffers_fetched_prelocked_range) | | [Tokudb\_buffers\_fetched\_prelocked\_range\_bytes](../tokudb-status-variables/index#tokudb_buffers_fetched_prelocked_range_bytes) | | [Tokudb\_buffers\_fetched\_prelocked\_range\_seconds](../tokudb-status-variables/index#tokudb_buffers_fetched_prelocked_range_seconds) | | [Tokudb\_buffers\_fetched\_target\_query](../tokudb-status-variables/index#tokudb_buffers_fetched_target_query) | | [Tokudb\_buffers\_fetched\_target\_query\_bytes](../tokudb-status-variables/index#tokudb_buffers_fetched_target_query_bytes) | | [Tokudb\_buffers\_fetched\_target\_query\_seconds](../tokudb-status-variables/index#tokudb_buffers_fetched_target_query_seconds) | | [tokudb\_bulk\_fetch](../tokudb-system-and-status-variables/index#tokudb_bulk_fetch) | | [tokudb\_cache\_size](../tokudb-system-and-status-variables/index#tokudb_cache_size) | | [Tokudb\_cachetable\_cleaner\_executions](../tokudb-status-variables/index#tokudb_cachetable_cleaner_executions) | | [Tokudb\_cachetable\_cleaner\_iterations](../tokudb-status-variables/index#tokudb_cachetable_cleaner_iterations) | | [Tokudb\_cachetable\_cleaner\_period](../tokudb-status-variables/index#tokudb_cachetable_cleaner_period) | | [Tokudb\_cachetable\_evictions](../tokudb-status-variables/index#tokudb_cachetable_evictions) | | [Tokudb\_cachetable\_long\_wait\_pressure\_count](../tokudb-status-variables/index#tokudb_cachetable_long_wait_pressure_count) | | [Tokudb\_cachetable\_long\_wait\_pressure\_time](../tokudb-status-variables/index#tokudb_cachetable_long_wait_pressure_time) | | [Tokudb\_cachetable\_miss](../tokudb-status-variables/index#tokudb_cachetable_miss) | | [Tokudb\_cachetable\_miss\_time](../tokudb-status-variables/index#tokudb_cachetable_miss_time) | | [Tokudb\_cachetable\_prefetches](../tokudb-status-variables/index#tokudb_cachetable_prefetches) | | [Tokudb\_cachetable\_size\_cachepressure](../tokudb-status-variables/index#tokudb_cachetable_size_cachepressure) | | [Tokudb\_cachetable\_size\_cloned](../tokudb-status-variables/index#tokudb_cachetable_size_cloned) | | [Tokudb\_cachetable\_size\_current](../tokudb-status-variables/index#tokudb_cachetable_size_current) | | [Tokudb\_cachetable\_size\_leaf](../tokudb-status-variables/index#tokudb_cachetable_size_leaf) | | [Tokudb\_cachetable\_size\_limit](../tokudb-status-variables/index#tokudb_cachetable_size_limit) | | [Tokudb\_cachetable\_size\_nonleaf](../tokudb-status-variables/index#tokudb_cachetable_size_nonleaf) | | [Tokudb\_cachetable\_size\_rollback](../tokudb-status-variables/index#tokudb_cachetable_size_rollback) | | [Tokudb\_cachetable\_size\_writing](../tokudb-status-variables/index#tokudb_cachetable_size_writing) | | [Tokudb\_cachetable\_wait\_pressure\_count](../tokudb-status-variables/index#tokudb_cachetable_wait_pressure_count) | | [Tokudb\_cachetable\_wait\_pressure\_time](../tokudb-status-variables/index#tokudb_cachetable_wait_pressure_time) | | [tokudb\_check\_jemalloc](../tokudb-system-and-status-variables/index#tokudb_check_jemalloc) | | [Tokudb\_checkpoint\_begin\_time](../tokudb-status-variables/index#tokudb_checkpoint_begin_time) | | [Tokudb\_checkpoint\_duration](../tokudb-status-variables/index#tokudb_checkpoint_duration) | | [Tokudb\_checkpoint\_duration\_last](../tokudb-status-variables/index#tokudb_checkpoint_duration_last) | | [Tokudb\_checkpoint\_failed](../tokudb-status-variables/index#tokudb_checkpoint_failed) | | [Tokudb\_checkpoint\_last\_began](../tokudb-status-variables/index#tokudb_checkpoint_last_began) | | [Tokudb\_checkpoint\_last\_complete\_began](../tokudb-status-variables/index#tokudb_checkpoint_last_complete_began) | | [Tokudb\_checkpoint\_last\_complete\_ended](../tokudb-status-variables/index#tokudb_checkpoint_last_complete_ended) | | [tokudb\_checkpoint\_lock](../tokudb-system-and-status-variables/index#tokudb_checkpoint_lock) | | [Tokudb\_checkpoint\_long\_begin\_count](../tokudb-status-variables/index#tokudb_checkpoint_long_begin_count) | | [Tokudb\_checkpoint\_long\_begin\_time](../tokudb-status-variables/index#tokudb_checkpoint_long_begin_time) | | [tokudb\_checkpoint\_on\_flush\_logs](../tokudb-system-and-status-variables/index#tokudb_checkpoint_on_flush_logs) | | [Tokudb\_checkpoint\_period](../tokudb-status-variables/index#tokudb_checkpoint_period) | | [Tokudb\_checkpoint\_taken](../tokudb-status-variables/index#tokudb_checkpoint_taken) | | [tokudb\_checkpointing\_period](../tokudb-system-and-status-variables/index#tokudb_checkpointing_period) | | [tokudb\_cleaner\_iterations](../tokudb-system-and-status-variables/index#tokudb_cleaner_iterations) | | [tokudb\_cleaner\_period](../tokudb-system-and-status-variables/index#tokudb_cleaner_period) | | [tokudb\_commit\_sync](../tokudb-system-and-status-variables/index#tokudb_commit_sync) | | [tokudb\_create\_index\_online](../tokudb-system-and-status-variables/index#tokudb_create_index_online) | | [Tokudb\_cursor\_skip\_deleted\_leaf\_entry](../tokudb-status-variables/index#tokudb_cursor_skip_deleted_leaf_entry) | | [tokudb\_data\_dir](../tokudb-system-and-status-variables/index#tokudb_data_dir) | | [Tokudb\_db\_closes](../tokudb-status-variables/index#tokudb_db_closes) | | [Tokudb\_db\_open\_current](../tokudb-status-variables/index#tokudb_db_open_current) | | [Tokudb\_db\_open\_max](../tokudb-status-variables/index#tokudb_db_open_max) | | [Tokudb\_db\_opens](../tokudb-status-variables/index#tokudb_db_opens) | | [tokudb\_debug](../tokudb-system-and-status-variables/index#tokudb_debug) | | [Tokudb\_descriptor\_set](../tokudb-status-variables/index#tokudb_descriptor_set) | | [Tokudb\_dictionary\_broadcast\_updates](../tokudb-status-variables/index#tokudb_dictionary_broadcast_updates) | | [Tokudb\_dictionary\_updates](../tokudb-status-variables/index#tokudb_dictionary_updates) | | [tokudb\_directio](../tokudb-system-and-status-variables/index#tokudb_directio) | | [tokudb\_disable\_hot\_alter](../tokudb-system-and-status-variables/index#tokudb_disable_hot_alter) | | [tokudb\_disable\_prefetching](../tokudb-system-and-status-variables/index#tokudb_disable_prefetching) | | [tokudb\_disable\_slow\_alter](../tokudb-system-and-status-variables/index#tokudb_disable_slow_alter) | | [tokudb\_empty\_scan](../tokudb-system-and-status-variables/index#tokudb_empty_scan) | | [Tokudb\_filesystem\_fsync\_num](../tokudb-status-variables/index#tokudb_filesystem_fsync_num) | | [Tokudb\_filesystem\_fsync\_time](../tokudb-status-variables/index#tokudb_filesystem_fsync_time) | | [Tokudb\_filesystem\_long\_fsync\_num](../tokudb-status-variables/index#tokudb_filesystem_long_fsync_num) | | [Tokudb\_filesystem\_long\_fsync\_time](../tokudb-status-variables/index#tokudb_filesystem_long_fsync_time) | | [Tokudb\_filesystem\_threads\_blocked\_by\_full\_disk](../tokudb-status-variables/index#tokudb_filesystem_threads_blocked_by_full_disk) | | [tokudb\_fs\_reserve\_percent](../tokudb-system-and-status-variables/index#tokudb_fs_reserve_percent) | | [tokudb\_fsync\_log\_period](../tokudb-system-and-status-variables/index#tokudb_fsync_log_period) | | [tokudb\_hide\_default\_row\_format](../tokudb-system-and-status-variables/index#tokudb_hide_default_row_format) | | [tokudb\_killed\_time](../tokudb-system-and-status-variables/index#tokudb_killed_time) | | [tokudb\_last\_lock\_timeout](../tokudb-system-and-status-variables/index#tokudb_last_lock_timeout) | | [Tokudb\_leaf\_compression\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_leaf_compression_to_memory_seconds) | | [Tokudb\_leaf\_decompression\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_leaf_decompression_to_memory_seconds) | | [Tokudb\_leaf\_deserialization\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_leaf_deserialization_to_memory_seconds) | | [Tokudb\_leaf\_node\_compression\_ratio](../tokudb-status-variables/index#tokudb_leaf_node_compression_ratio) | | [Tokudb\_leaf\_node\_full\_evictions](../tokudb-status-variables/index#tokudb_leaf_node_full_evictions) | | [Tokudb\_leaf\_node\_full\_evictions\_bytes](../tokudb-status-variables/index#tokudb_leaf_node_full_evictions_bytes) | | [Tokudb\_leaf\_node\_partial\_evictions](../tokudb-status-variables/index#tokudb_leaf_node_partial_evictions) | | [Tokudb\_leaf\_node\_partial\_evictions\_bytes](../tokudb-status-variables/index#tokudb_leaf_node_partial_evictions_bytes) | | [Tokudb\_leaf\_nodes\_created](../tokudb-status-variables/index#tokudb_leaf_nodes_created) | | [Tokudb\_leaf\_nodes\_destroyed](../tokudb-status-variables/index#tokudb_leaf_nodes_destroyed) | | [Tokudb\_leaf\_nodes\_flushed\_checkpoint](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_checkpoint) | | [Tokudb\_leaf\_nodes\_flushed\_checkpoint\_bytes](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_checkpoint_bytes) | | [Tokudb\_leaf\_nodes\_flushed\_checkpoint\_seconds](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_checkpoint_seconds) | | [Tokudb\_leaf\_nodes\_flushed\_checkpoint\_uncompressed\_bytes](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_checkpoint_uncompressed_bytes) | | [Tokudb\_leaf\_nodes\_flushed\_not\_checkpoint](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_not_checkpoint) | | [Tokudb\_leaf\_nodes\_flushed\_not\_checkpoint\_bytes](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_not_checkpoint_bytes) | | [Tokudb\_leaf\_nodes\_flushed\_not\_checkpoint\_secondss](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_not_checkpoint_seconds) | | [Tokudb\_leaf\_nodes\_flushed\_not\_checkpoint\_uncompressed\_bytes](../tokudb-status-variables/index#tokudb_leaf_nodes_flushed_not_checkpoint_uncompressed_bytes) | | [Tokudb\_leaf\_serialization\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_leaf_serialization_to_memory_seconds) | | [tokudb\_load\_save\_space](../tokudb-system-and-status-variables/index#tokudb_load_save_space) | | [tokudb\_loader\_memory\_size](../tokudb-system-and-status-variables/index#tokudb_loader_memory_size) | | [Tokudb\_loader\_num\_created](../tokudb-status-variables/index#tokudb_loader_num_created) | | [Tokudb\_loader\_num\_current](../tokudb-status-variables/index#tokudb_loader_num_current) | | [Tokudb\_loader\_num\_max](../tokudb-status-variables/index#tokudb_loader_num_max) | | [tokudb\_lock\_timeout](../tokudb-system-and-status-variables/index#tokudb_lock_timeout) | | [tokudb\_lock\_timeout\_debug](../tokudb-system-and-status-variables/index#tokudb_lock_timeout_debug) | | [Tokudb\_locktree\_escalation\_num](../tokudb-status-variables/index#tokudb_locktree_escalation_num) | | [Tokudb\_locktree\_escalation\_seconds](../tokudb-status-variables/index#tokudb_locktree_escalation_seconds) | | [Tokudb\_locktree\_latest\_post\_escalation\_memory\_size](../tokudb-status-variables/index#tokudb_locktree_latest_post_escalation_memory_size) | | [Tokudb\_locktree\_long\_wait\_count](../tokudb-status-variables/index#tokudb_locktree_long_wait_count) | | [Tokudb\_locktree\_long\_wait\_escalation\_count](../tokudb-status-variables/index#tokudb_locktree_long_wait_escalation_count) | | [Tokudb\_locktree\_long\_wait\_escalation\_time](../tokudb-status-variables/index#tokudb_locktree_long_wait_escalation_time) | | [Tokudb\_locktree\_long\_wait\_time](../tokudb-status-variables/index#tokudb_locktree_long_wait_time) | | [Tokudb\_locktree\_memory\_size](../tokudb-status-variables/index#tokudb_locktree_memory_size) | | [Tokudb\_locktree\_memory\_size\_limit](../tokudb-status-variables/index#tokudb_locktree_memory_size_limit) | | [Tokudb\_locktree\_open\_current](../tokudb-status-variables/index#tokudb_locktree_open_current) | | [Tokudb\_locktree\_pending\_lock\_requests](../tokudb-status-variables/index#tokudb_locktree_pending_lock_requests) | | [Tokudb\_locktree\_sto\_eligible\_num](../tokudb-status-variables/index#tokudb_locktree_sto_eligible_num) | | [Tokudb\_locktree\_sto\_ended\_num](../tokudb-status-variables/index#tokudb_locktree_sto_ended_num) | | [Tokudb\_locktree\_sto\_ended\_seconds](../tokudb-status-variables/index#tokudb_locktree_sto_ended_seconds) | | [Tokudb\_locktree\_timeout\_count](../tokudb-status-variables/index#tokudb_locktree_timeout_count) | | [Tokudb\_locktree\_wait\_count](../tokudb-status-variables/index#tokudb_locktree_wait_count) | | [Tokudb\_locktree\_wait\_escalation\_count](../tokudb-status-variables/index#tokudb_locktree_wait_escalation_count) | | [Tokudb\_locktree\_wait\_escalation\_time](../tokudb-status-variables/index#tokudb_locktree_wait_escalation_time) | | [Tokudb\_locktree\_wait\_time](../tokudb-status-variables/index#tokudb_locktree_wait_time) | | [tokudb\_log\_dir](../tokudb-system-and-status-variables/index#tokudb_log_dir) | | [Tokudb\_logger\_wait\_long](../tokudb-status-variables/index#tokudb_logger_wait_long) | | [Tokudb\_logger\_writes](../tokudb-status-variables/index#tokudb_logger_writes) | | [Tokudb\_logger\_writes\_bytes](../tokudb-status-variables/index#tokudb_logger_writes_bytes) | | [Tokudb\_logger\_writes\_seconds](../tokudb-status-variables/index#tokudb_logger_writes_seconds) | | [Tokudb\_logger\_writes\_uncompressed\_bytes](../tokudb-status-variables/index#tokudb_logger_writes_uncompressed_bytes) | | [tokudb\_max\_lock\_memory](../tokudb-system-and-status-variables/index#tokudb_max_lock_memory) | | [Tokudb\_mem\_estimated\_maximum\_memory\_footprint](../tokudb-status-variables/index#tokudb_mem_estimated_maximum_memory_footprint) | | [Tokudb\_messages\_flushed\_from\_h1\_to\_leaves\_bytes](../tokudb-status-variables/index#tokudb_messages_flushed_from_h1_to_leaves_bytes) | | [Tokudb\_messages\_ignored\_by\_leaf\_due\_to\_msn](../tokudb-status-variables/index#tokudb_messages_ignored_by_leaf_due_to_msn) | | [Tokudb\_messages\_in\_trees\_estimate\_bytes](../tokudb-status-variables/index#tokudb_messages_in_trees_estimate_bytes) | | [Tokudb\_messages\_injected\_at\_root](../tokudb-status-variables/index#tokudb_messages_injected_at_root) | | [Tokudb\_messages\_injected\_at\_root\_bytes](../tokudb-status-variables/index#tokudb_messages_injected_at_root_bytes) | | [Tokudb\_nonleaf\_compression\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_compression_to_memory_seconds) | | [Tokudb\_nonleaf\_decompression\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_decompression_to_memory_seconds) | | [Tokudb\_nonleaf\_deserialization\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_deserialization_to_memory_seconds) | | [Tokudb\_nonleaf\_node\_compression\_ratio](../tokudb-status-variables/index#tokudb_nonleaf_node_compression_ratio) | | [Tokudb\_nonleaf\_node\_full\_evictions](../tokudb-status-variables/index#tokudb_nonleaf_node_full_evictions) | | [Tokudb\_nonleaf\_node\_full\_evictions\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_node_full_evictions_bytes) | | [Tokudb\_nonleaf\_node\_partial\_evictions](../tokudb-status-variables/index#tokudb_nonleaf_node_partial_evictions) | | [Tokudb\_nonleaf\_node\_partial\_evictions\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_node_partial_evictions_bytes) | | [Tokudb\_nonleaf\_nodes\_created](../tokudb-status-variables/index#tokudb_nonleaf_nodes_created) | | [Tokudb\_nonleaf\_nodes\_destroyed](../tokudb-status-variables/index#tokudb_nonleaf_nodes_destroyed) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_checkpoint](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_checkpoint) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_checkpoint\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_checkpoint_bytes) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_checkpoint\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_checkpoint_seconds) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_checkpoint\_uncompressed\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_checkpoint_uncompressed_bytes) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_not\_checkpoint](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_not_checkpoint) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_not\_checkpoint\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_not_checkpoint_bytes) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_not\_checkpoint\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_not_checkpoint_seconds) | | [Tokudb\_nonleaf\_nodes\_flushed\_to\_disk\_not\_checkpoint\_uncompressed\_bytes](../tokudb-status-variables/index#tokudb_nonleaf_nodes_flushed_to_disk_not_checkpoint_uncompressed_bytes) | | [Tokudb\_nonleaf\_serialization\_to\_memory\_seconds](../tokudb-status-variables/index#tokudb_nonleaf_serialization_to_memory_seconds) | | [tokudb\_optimize\_index\_fraction](../tokudb-system-and-status-variables/index#tokudb_optimize_index_fraction) | | [tokudb\_optimize\_index\_name](../tokudb-system-and-status-variables/index#tokudb_optimize_index_name) | | [tokudb\_optimize\_throttle](../tokudb-system-and-status-variables/index#tokudb_optimize_throttle) | | [Tokudb\_overall\_node\_compression\_ratio](../tokudb-status-variables/index#tokudb_overall_node_compression_ratio) | | [Tokudb\_pivots\_fetched\_for\_query](../tokudb-status-variables/index#tokudb_pivots_fetched_for_query) | | [Tokudb\_pivots\_fetched\_for\_query\_bytes](../tokudb-status-variables/index#tokudb_pivots_fetched_for_query_bytes) | | [Tokudb\_pivots\_fetched\_for\_query\_seconds](../tokudb-status-variables/index#tokudb_pivots_fetched_for_query_seconds) | | [Tokudb\_pivots\_fetched\_for\_prefetch](../tokudb-status-variables/index#tokudb_pivots_fetched_for_prefetch) | | [Tokudb\_pivots\_fetched\_for\_prefetch\_bytes](../tokudb-status-variables/index#tokudb_pivots_fetched_for_prefetch_bytes) | | [Tokudb\_pivots\_fetched\_for\_prefetch\_seconds](../tokudb-status-variables/index#tokudb_pivots_fetched_for_prefetch_seconds) | | [Tokudb\_pivots\_fetched\_for\_write](../tokudb-status-variables/index#tokudb_pivots_fetched_for_write) | | [Tokudb\_pivots\_fetched\_for\_write\_bytes](../tokudb-status-variables/index#tokudb_pivots_fetched_for_write_bytes) | | [Tokudb\_pivots\_fetched\_for\_write\_seconds](../tokudb-status-variables/index#tokudb_pivots_fetched_for_write_seconds) | | [tokudb\_pk\_insert\_mode](../tokudb-system-and-status-variables/index#tokudb_pk_insert_mode) | | [tokudb\_prelock\_empty](../tokudb-system-and-status-variables/index#tokudb_prelock_empty) | | [Tokudb\_promotion\_h1\_roots\_injected\_into](../tokudb-status-variables/index#tokudb_promotion_h1_roots_injected_into) | | [Tokudb\_promotion\_injections\_at\_depth\_0](../tokudb-status-variables/index#tokudb_promotion_injections_at_depth_0) | | [Tokudb\_promotion\_injections\_at\_depth\_1](../tokudb-status-variables/index#tokudb_promotion_injections_at_depth_1) | | [Tokudb\_promotion\_injections\_at\_depth\_2](../tokudb-status-variables/index#tokudb_promotion_injections_at_depth_2) | | [Tokudb\_promotion\_injections\_at\_depth\_3](../tokudb-status-variables/index#tokudb_promotion_injections_at_depth_3) | | [Tokudb\_promotion\_injections\_lower\_than\_depth\_3](../tokudb-status-variables/index#tokudb_promotion_injections_lower_than_depth_3) | | [Tokudb\_promotion\_leaf\_roots\_injected\_into](../tokudb-status-variables/index#tokudb_promotion_leaf_roots_injected_into) | | [Tokudb\_promotion\_roots\_split](../tokudb-status-variables/index#tokudb_promotion_roots_split) | | [Tokudb\_promotion\_stopped\_after\_locking\_child](../tokudb-status-variables/index#tokudb_promotion_stopped_after_locking_child) | | [Tokudb\_promotion\_stopped\_at\_height\_1](../tokudb-status-variables/index#tokudb_promotion_stopped_at_height_1) | | [Tokudb\_promotion\_stopped\_child\_locked\_or\_not\_in\_memory](../tokudb-status-variables/index#tokudb_promotion_stopped_child_locked_or_not_in_memory) | | [Tokudb\_promotion\_stopped\_child\_not\_fully\_in\_memory](../tokudb-status-variables/index#tokudb_promotion_stopped_child_not_fully_in_memory) | | [Tokudb\_promotion\_stopped\_nonempty\_buffer](../tokudb-status-variables/index#tokudb_promotion_stopped_nonempty_buffer) | | [tokudb\_read\_block\_size](../tokudb-system-and-status-variables/index#tokudb_read_block_size) | | [tokudb\_read\_buf\_size](../tokudb-system-and-status-variables/index#tokudb_read_buf_size) | | [tokudb\_read\_status\_frequency](../tokudb-system-and-status-variables/index#tokudb_read_status_frequency) | | [tokudb\_row\_format](../tokudb-system-and-status-variables/index#tokudb_row_format) | | [tokudb\_rpl\_check\_readonly](../tokudb-system-and-status-variables/index#tokudb_rpl_check_readonly) | | [tokudb\_rpl\_lookup\_rows](../tokudb-system-and-status-variables/index#tokudb_rpl_lookup_rows) | | [tokudb\_rpl\_lookup\_rows\_delay](../tokudb-system-and-status-variables/index#tokudb_rpl_lookup_rows_delay) | | [tokudb\_rpl\_unique\_checks](../tokudb-system-and-status-variables/index#tokudb_rpl_unique_checks) | | [tokudb\_rpl\_unique\_checks\_delay](../tokudb-system-and-status-variables/index#tokudb_rpl_unique_checks_delay) | | [tokudb\_support\_xa](../tokudb-system-and-status-variables/index#tokudb_support_xa) | | [tokudb\_tmp\_dir](../tokudb-system-and-status-variables/index#tokudb_tmp_dir) | | [Tokudb\_txn\_aborts](../tokudb-status-variables/index#tokudb_txn_aborts) | | [Tokudb\_txn\_begin](../tokudb-status-variables/index#tokudb_txn_begin) | | [Tokudb\_txn\_begin\_read\_only](../tokudb-status-variables/index#tokudb_txn_begin_read_only) | | [Tokudb\_txn\_commits](../tokudb-status-variables/index#tokudb_txn_commits) | | [tokudb\_version](../tokudb-system-and-status-variables/index#tokudb_version) | | [tokudb\_write\_status\_frequency](../tokudb-system-and-status-variables/index#tokudb_write_status_frequency) | | --[transaction-alloc-block-size](../server-system-variables/index#transaction_alloc_block_size), [transaction\_alloc\_block\_size](../server-system-variables/index#transaction_alloc_block_size) | | --[transaction-isolation](../server-system-variables/index#tx_isolation) | | --[transaction-prealloc-size](../server-system-variables/index#transaction_prealloc_size), [transaction\_prealloc\_size](../server-system-variables/index#transaction_prealloc_size) | | --[transaction-read-only](../server-system-variables/index#tx_read_only) | | [Transactions\_gtid\_foreign\_engine](../replication-and-binary-log-server-status-variables/index#transactions_gtid_foreign_engine) | | [Transactions\_multi\_engine](../replication-and-binary-log-server-status-variables/index#transactions_multi_engine) | | [tx\_isolation](../server-system-variables/index#tx_isolation) | | [tx\_read\_only](../server-system-variables/index#tx_read_only) | | -u, --[user](../mysqld-options/index#-user) | | [unique\_checks](../server-system-variables/index#unique_checks) | | --[updatable-views-with-limit](../server-system-variables/index#updatable_views_with_limit), [updatable\_views\_with\_limit](../server-system-variables/index#updatable_views_with_limit) | | [Update\_scan](../server-status-variables/index#update_scan) | | [Uptime](../server-status-variables/index#uptime) | | [Uptime\_since\_flush\_status](../server-status-variables/index#uptime_since_flush_status) | | -u, --[user](../mysqld-options/index#-user) | | --[use-stat-tables](../server-system-variables/index#use_stat_tables), [use\_stat\_tables](../server-system-variables/index#use_stat_tables) | | --[userstat](../user-statistics/index#userstat), [userstat](../user-statistics/index#userstat) | | -v, --[verbose](../mysqld-options/index#-verbose) | | -V, --[version](../server-system-variables/index#version), [version](../server-system-variables/index#version) | | [version\_comment](../server-system-variables/index#version_comment) | | [version\_compile\_machine](../server-system-variables/index#version_compile_machine) | | [version\_compile\_os](../server-system-variables/index#version_compile_os) | | [version\_malloc\_library](../server-system-variables/index#version_malloc_library) | | [version\_source\_revision](../server-system-variables/index#version_source_revision) | | [version\_ssl\_library](../ssl-system-variables/index#version_ssl_library) | | -W, --[log-warnings](../server-system-variables/index#log_warnings), [log\_warnings](../server-system-variables/index#log_warnings) | | --[wait-timeout](../server-system-variables/index#wait_timeout), [wait\_timeout](../server-system-variables/index#wait_timeout) | | [warning\_count](../server-system-variables/index#warning_count) | | [wsrep](../mariadb-galera-cluster-status-variables/index#wsrep) | | [wsrep\_applier\_thread\_count](../mariadb-galera-cluster-status-variables/index#wsrep_applier_thread_count) | | [wsrep\_apply\_oooe](../mariadb-galera-cluster-status-variables/index#wsrep_apply_oooe) | | [wsrep\_apply\_oool](../mariadb-galera-cluster-status-variables/index#wsrep_apply_oool) | | [wsrep\_auto\_increment\_control](../galera-cluster-system-variables/index#wsrep_auto_increment_control) | | [wsrep\_causal\_reads](../galera-cluster-system-variables/index#wsrep_causal_reads) | | [wsrep\_cert\_deps\_distance](../mariadb-galera-cluster-status-variables/index#wsrep_cert_deps_distance) | | [wsrep\_certification\_rules](../galera-cluster-system-variables/index#wsrep_certification_rules) | | [wsrep\_certify\_nonPK](../galera-cluster-system-variables/index#wsrep_certify_nonpk) | | [wsrep\_cluster\_address](../galera-cluster-system-variables/index#wsrep_cluster_address) | | [wsrep\_cluster\_capabilities](../mariadb-galera-cluster-status-variables/index#wsrep_cluster_capabilities) | | [wsrep\_cluster\_conf\_id](../mariadb-galera-cluster-status-variables/index#wsrep_cluster_conf_id) | | [wsrep\_cluster\_name](../galera-cluster-system-variables/index#wsrep_cluster_name) | | [wsrep\_cluster\_size](../mariadb-galera-cluster-status-variables/index#wsrep_cluster_size) | | [wsrep\_cluster\_state\_uuid](../mariadb-galera-cluster-status-variables/index#wsrep_cluster_state_uuid) | | [wsrep\_cluster\_status](../mariadb-galera-cluster-status-variables/index#wsrep_cluster_status) | | [wsrep\_connected](../mariadb-galera-cluster-status-variables/index#wsrep_connected) | | [wsrep\_convert\_LOCK\_to\_trx](../galera-cluster-system-variables/index#wsrep_convert_lock_to_trx) | | [wsrep\_data\_home\_dir](../galera-cluster-system-variables/index#wsrep_data_home_dir) | | [wsrep\_dbug\_option](../galera-cluster-system-variables/index#wsrep_dbug_option) | | [wsrep\_debug](../galera-cluster-system-variables/index#wsrep_debug) | | [wsrep\_desync](../galera-cluster-system-variables/index#wsrep_desync) | | [wsrep\_dirty\_reads](../galera-cluster-system-variables/index#wsrep_dirty_reads) | | [wsrep\_drupal\_282555\_workaround](../galera-cluster-system-variables/index#wsrep_drupal_282555_workaround) | | [wsrep\_flow\_control\_paused](../mariadb-galera-cluster-status-variables/index#wsrep_flow_control_paused) | | [wsrep\_flow\_control\_recv](../mariadb-galera-cluster-status-variables/index#wsrep_flow_control_recv) | | [wsrep\_flow\_control\_sent](../mariadb-galera-cluster-status-variables/index#wsrep_flow_control_sent) | | [wsrep\_gtid\_domain\_id](../galera-cluster-system-variables/index#wsrep_gtid_domain_id) | | [wsrep\_gtid\_mode](../galera-cluster-system-variables/index#wsrep_gtid_mode) | | [wsrep\_gtid\_seq\_no](../galera-cluster-system-variables/index#wsrep_gtid_seq_no) | | [wsrep\_forced\_binlog\_format](../galera-cluster-system-variables/index#wsrep_forced_binlog_format) | | [wsrep\_ignore\_apply\_errors](../galera-cluster-system-variables/index#wsrep_ignore_apply_errors) | | [wsrep\_last\_committed](../mariadb-galera-cluster-status-variables/index#wsrep_last_committed) | | [wsrep\_load\_data\_splitting](../galera-cluster-system-variables/index#wsrep_load_data_splitting) | | [wsrep\_local\_bf\_aborts](../mariadb-galera-cluster-status-variables/index#wsrep_local_bf_aborts) | | [wsrep\_local\_cert\_failures](../mariadb-galera-cluster-status-variables/index#wsrep_local_cert_failures) | | [wsrep\_local\_commits](../mariadb-galera-cluster-status-variables/index#wsrep_local_commits) | | [wsrep\_local\_index](../mariadb-galera-cluster-status-variables/index#wsrep_local_index) | | [wsrep\_local\_recv\_queue](../mariadb-galera-cluster-status-variables/index#wsrep_local_recv_queue) | | [wsrep\_local\_recv\_queue\_avg](../mariadb-galera-cluster-status-variables/index#wsrep_local_recv_queue_avg) | | [wsrep\_local\_replays](../mariadb-galera-cluster-status-variables/index#wsrep_local_replays) | | [wsrep\_local\_send\_queue](../mariadb-galera-cluster-status-variables/index#wsrep_local_send_queue) | | [wsrep\_local\_send\_queue\_avg](../mariadb-galera-cluster-status-variables/index#wsrep_local_send_queue_avg) | | [wsrep\_local\_state](../mariadb-galera-cluster-status-variables/index#wsrep_local_state) | | [wsrep\_local\_state\_comment](../mariadb-galera-cluster-status-variables/index#wsrep_local_state_comment) | | [wsrep\_local\_state\_uuid](../mariadb-galera-cluster-status-variables/index#wsrep_local_state_uuid) | | [wsrep\_log\_conflicts](../galera-cluster-system-variables/index#wsrep_log_conflicts) | | [wsrep\_max\_ws\_rows](../galera-cluster-system-variables/index#wsrep_max_ws_rows) | | [wsrep\_max\_ws\_size](../galera-cluster-system-variables/index#wsrep_max_ws_size) | | [wsrep\_mode](../galera-cluster-system-variables/index#wsrep_mode) | | [wsrep\_mysql\_replication\_bundle](../galera-cluster-system-variables/index#wsrep_mysql_replication_bundle) | | --[wsrep-new-cluster](../mysqld-options-full-list/index#-wsrep-new-cluster) | | [wsrep\_node\_address](../galera-cluster-system-variables/index#wsrep_node_address) | | [wsrep\_node\_incoming\_address](../galera-cluster-system-variables/index#wsrep_node_incoming_address) | | [wsrep\_node\_name](../galera-cluster-system-variables/index#wsrep_node_name) | | [wsrep\_notify\_cmd](../galera-cluster-system-variables/index#wsrep_notify_cmd) | | [wsrep\_on](../galera-cluster-system-variables/index#wsrep_on) | | [wsrep\_OSU\_method](../galera-cluster-system-variables/index#wsrep_osu_method) | | [wsrep\_protocol\_version](../mariadb-galera-cluster-status-variables/index#wsrep_protocol_version) | | [wsrep\_provider\_name](../mariadb-galera-cluster-status-variables/index#wsrep_provider_name) | | [wsrep\_patch\_version](../galera-cluster-system-variables/index#wsrep_patch_version) | | [wsrep\_provider](../galera-cluster-system-variables/index#wsrep_provider) | | [wsrep\_provider\_options](../galera-cluster-system-variables/index#wsrep_provider_options) | | [wsrep\_provider\_vendor](../mariadb-galera-cluster-status-variables/index#wsrep_provider_vendor) | | [wsrep\_provider\_version](../mariadb-galera-cluster-status-variables/index#wsrep_provider_version) | | [wsrep\_ready](../mariadb-galera-cluster-status-variables/index#wsrep_ready) | | [wsrep\_received](../mariadb-galera-cluster-status-variables/index#wsrep_received) | | [wsrep\_received\_bytes](../mariadb-galera-cluster-status-variables/index#wsrep_received_bytes) | | [wsrep\_recover](../galera-cluster-system-variables/index#wsrep_recover) | | [wsrep\_reject\_queries](../galera-cluster-system-variables/index#wsrep_reject_queries) | | [wsrep\_replicate\_myisam](../galera-cluster-system-variables/index#wsrep_replicate_myisam) | | [wsrep\_replicated](../mariadb-galera-cluster-status-variables/index#wsrep_replicated) | | [wsrep\_replicated\_bytes](../mariadb-galera-cluster-status-variables/index#wsrep_replicated_bytes) | | [wsrep\_retry\_autocommit](../galera-cluster-system-variables/index#wsrep_retry_autocommit) | | [wsrep\_rollbacker\_thread\_count](../mariadb-galera-cluster-status-variables/index#wsrep_rollbacker_thread_count) | | [wsrep\_slave\_FK\_checks](../galera-cluster-system-variables/index#wsrep_slave_fk_checks) | | [wsrep\_slave\_threads](../galera-cluster-system-variables/index#wsrep_slave_threads) | | [wsrep\_slave\_UK\_checks](../galera-cluster-system-variables/index#wsrep_slave_uk_checks) | | [wsrep\_sr\_store](../galera-cluster-system-variables/index#wsrep_sr_store_auth) | | [wsrep\_sst\_auth](../galera-cluster-system-variables/index#wsrep_sst_auth) | | [wsrep\_sst\_donor](../galera-cluster-system-variables/index#wsrep_sst_donor) | | [wsrep\_sst\_donor\_rejects\_queries](../galera-cluster-system-variables/index#wsrep_sst_donor_rejects_queries) | | [wsrep\_sst\_method](../galera-cluster-system-variables/index#wsrep_sst_method) | | [wsrep\_sst\_receive\_address](../galera-cluster-system-variables/index#wsrep_sst_receive_address) | | [wsrep\_start\_position](../galera-cluster-system-variables/index#wsrep_start_position) | | [wsrep\_strict\_ddl](../galera-cluster-system-variables/index#wsrep_strict_ddl) | | [wsrep\_sync\_wait](../galera-cluster-system-variables/index#wsrep_sync_wait) | | [wsrep-trx-fragment-size](../galera-cluster-system-variables/index#wsrep_trx_fragment_size) | | [wsrep-trx-fragment-unit](../galera-cluster-system-variables/index#wsrep_trx_fragment_unit) | | [wsrep\_thread\_count](../galera-cluster-system-variables/index#wsrep_thread_count) | See Also -------- * [System Variables Added in MariaDB 10.5](../system-variables-added-in-mariadb-105/index) * [Status Variables Added in MariaDB 10.5](../status-variables-added-in-mariadb-105/index) * [System Variables Added in MariaDB 10.4](../system-variables-added-in-mariadb-104/index) * [Status Variables Added in MariaDB 10.4](../status-variables-added-in-mariadb-104/index) * [System Variables Added in MariaDB 10.3](../system-variables-added-in-mariadb-103/index) * [Status Variables Added in MariaDB 10.3](../status-variables-added-in-mariadb-103/index) * [System Variables Added in MariaDB 10.2](../system-variables-added-in-mariadb-102/index) * [Status Variables Added in MariaDB 10.2](../status-variables-added-in-mariadb-102/index) * [System Variables Added in MariaDB 10.1](../system-variables-added-in-mariadb-101/index) * [Status Variables Added in MariaDB 10.1](../status-variables-added-in-mariadb-101/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Aria Encryption Keys Aria Encryption Keys ==================== As with other storage engines that support data-at-rest encryption, Aria relies on an [Encryption Key Management](../key-management-and-encryption-plugins/index) plugin to handle its encryption keys. Where the support is available, Aria can use [multiple keys](../encryption-key-management/index#using-multiple-encryption-keys). Encryption Keys --------------- MariaDB keeps track of each encryption key internally using a 32-bit integer, which serves as the key identifier. Unlike [InnoDB](../innodb-encryption/index), Aria does not support the `[ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id)` table option (for more information, see [MDEV-18049](https://jira.mariadb.org/browse/MDEV-18049)), which allows the user to specify the encryption key to use. Instead, Aria defaults to specific encryption keys provided by the Encryption Key Management plugin. * When working with user-created tables, Aria encrypts them to disk using the ID 1 key. * When working with internal temporary tables written to disk, Aria encrypts them to disk using the ID 2 key, unless there is no ID 2 key, then it falls back on the ID 1 key. Key Rotation ------------ Some [key management and encryption plugins](../encryption-key-management/index) allow you to automatically rotate and version your encryption keys. If a plugin support key rotation, and if it rotates the encryption keys, then InnoDB's [background encryption threads](../innodb-background-encryption-threads/index) can re-encrypt InnoDB pages that use the old key version with the new key version. However, Aria does **not** have a similar mechanism, which means that the tables remain encrypted with the older key version. For more information, see [MDEV-18971](https://jira.mariadb.org/browse/MDEV-18971). In order for key rotation to work, both the backend key management service (KMS) and the corresponding [key management and encryption plugin](../encryption-key-management/index) have to support key rotation. See [Encryption Key Management: Support for Key Rotation in Encryption Plugins](../encryption-key-management/index#support-for-key-rotation-in-encryption-plugins) to determine which plugins currently support key rotation. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ATAN ATAN ==== Syntax ------ ``` ATAN(X) ``` Description ----------- Returns the arc tangent of X, that is, the value whose tangent is X. Examples -------- ``` SELECT ATAN(2); +--------------------+ | ATAN(2) | +--------------------+ | 1.1071487177940904 | +--------------------+ SELECT ATAN(-2); +---------------------+ | ATAN(-2) | +---------------------+ | -1.1071487177940904 | +---------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb TEXT TEXT ==== Syntax ------ ``` TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name] ``` Description ----------- A `TEXT` column with a maximum length of `65,535` (`216 - 1`) characters. The effective maximum length is less if the value contains multi-byte characters. Each `TEXT` value is stored using a two-byte length prefix that indicates the number of bytes in the value. If you need a bigger storage, consider using [MEDIUMTEXT](../mediumtext/index) instead. An optional length `M` can be given for this type. If this is done, MariaDB creates the column as the smallest `TEXT` type large enough to hold values `M` characters long. Before [MariaDB 10.2](../what-is-mariadb-102/index), all MariaDB [collations](../character-sets/index) were of type PADSPACE, meaning that TEXT (as well as [VARCHAR](../varchar/index) and [CHAR](../char/index) values) are compared without regard for trailing spaces. This does not apply to the [LIKE](../like/index) pattern-matching operator, which takes into account trailing spaces. Before [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/), `BLOB` and `TEXT` columns could not be assigned a [DEFAULT](../create-table/index#default) value. This restriction was lifted in [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/). Examples -------- Trailing spaces: ``` CREATE TABLE strtest (d TEXT(10)); INSERT INTO strtest VALUES('Maria '); SELECT d='Maria',d='Maria ' FROM strtest; +-----------+--------------+ | d='Maria' | d='Maria ' | +-----------+--------------+ | 1 | 1 | +-----------+--------------+ SELECT d LIKE 'Maria',d LIKE 'Maria ' FROM strtest; +----------------+-------------------+ | d LIKE 'Maria' | d LIKE 'Maria ' | +----------------+-------------------+ | 0 | 1 | +----------------+-------------------+ ``` Indexing -------- `TEXT` columns can only be indexed over a specified length. This means that they cannot be used as the [primary key](../getting-started-with-indexes/index#primary-key) of a table norm until [MariaDB 10.4](../what-is-mariadb-104/index), can a [unique index](../getting-started-with-indexes/index#unique-index) be created on them. **MariaDB starting with [10.4](../what-is-mariadb-104/index)**Starting with [MariaDB 10.4](../what-is-mariadb-104/index), a unique index can be created on a `TEXT` column. Internally, this uses hash indexing to quickly check the values and if a hash collision is found, the actual stored values are compared in order to retain the uniqueness. Difference between [VARCHAR](../varchar/index) and TEXT ------------------------------------------------------- * [VARCHAR](../varchar/index) columns can be fully indexed. `TEXT` columns can only be indexed over a specified length. * Using TEXT or [BLOB](../blob/index) in a [SELECT](../select/index) query that uses temporary tables for storing intermediate results will force the temporary table to be disk based (using the [Aria storage engine](../aria-storage-engine/index) instead of the [memory storage engine](../memory-storage-engine/index), which is a bit slower. This is not that bad as the [Aria storage engine](../aria-storage-engine/index) caches the rows in memory. To get the benefit of this, one should ensure that the [aria\_pagecache\_buffer\_size](../aria-system-variables/index#aria_pagecache_buffer_size) variable is big enough to hold most of the row and index data for temporary tables. ### For Storage Engine Developers * Internally the full length of the [VARCHAR](../varchar/index) column is allocated inside each TABLE objects record[] structure. As there are three such buffers, each open table will allocate 3 times max-length-to-store-varchar bytes of memory. * `TEXT` and `BLOB` columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes length. The `TEXT` data is only stored once. This means that internally `TEXT` uses less memory for each open table but instead has the additional overhead that each `TEXT` object needs to be allocated and freed for each row access (with some caching in between). See Also -------- * [BLOB and TEXT Data Types](../blob-and-text-data-types/index) * [MEDIUMTEXT](../mediumtext/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Aria FAQ Aria FAQ ======== This FAQ provides information on the [Aria](../aria/index) storage engine. The ***Aria*** storage engine was previously known as ***Maria***, (see, the [Aria Name](../the-aria-name/index)). In current releases of [MariaDB](../mariadb/index), you can refer to the engine as Maria or Aria. As this will change in future releases, please update references in your scripts and automation to use the correct name. What is Aria? ------------- Aria is a storage engine for MySQL® and MariaDB. It was originally developed with the goal of becoming the default transactional **and** non-transactional storage engine for MariaDB and MySQL. It has been in development since 2007 and was first announced on Monty's [blog](http://monty-says.blogspot.com/2008/01/maria-engine-is-released.html). The same core MySQL engineers who developed the MySQL server and the [MyISAM](../myisam/index), [MERGE](../merge/index), and [MEMORY](../memory-storage-engine/index) storage engines are also working on Aria. Why is the engine called Aria? ------------------------------ Originally, the storage engine was called **Maria**, after Monty's younger daughter. Monty named MySQL after his first child, **My** and his second child **Max** gave his name to MaxDB and the MySQL-Max distributions. In practice, having both *MariaDB* the database server and *Maria* the storage engine with such similar names proved confusing. To mitigate this, the decision was made to change the name. A Rename Maria contest was held during the first half of 2010 and names were submitted from around the world. Monty picked the name ***Aria*** from a short list of finalist. Chris Tooley, who suggested it, received the prize of a Linux-powered [System 76 Meerkat NetTop](http://www.system76.com/product_info.php?cPath=27&products_id=91) from Monty Program. For more information, see the [Aria Name](../the-aria-name/index). What's the goal for the current version? ---------------------------------------- The current version of Aria is 1.5. The goal of this release is to develop a crash-safe alternative to MyISAM. That is, when MariaDB restarts after a crash, Aria recovers all tables to the state as of the start of a statement or at the start of the last `LOCK TABLES` statement. The current goal is to keep the code stable and fix all bugs. What's the goal for the next version? ------------------------------------- The next version of Aria is 2.0. The goal for this release is to develop a fully transactional storage engine with at least all the major features of InnoDB. Currently, Aria 2.0 is on hold as its developers are focusing on improving MariaDB. However, they are interested in working with interested customers and partners to add more features to Aria and eventually release 2.0. These are some of the goals for Aria 2.0: * ACID compliant * Commit/Rollback * Concurrent updates/deletes * Row locking * Group commit (Already in [MariaDB 5.2](../what-is-mariadb-52/index)) * Faster lookup in index pages (Page directory) Beginning in Aria 2.5, the plan is to focus on improving performance. What is the ultimate goal of Aria? ---------------------------------- Long term, we have the following goals for Aria: * To create a new, ACID and Multi-Version Concurrency Control (MVCC), transactional storage engine that can function as both the default non-transactional and transactional storage engine for MariaDB and MySQL®. * To be a MyISAM replacement. This is possible because Aria can also be run in non-transactional mode, supports the same row formats as MyISAM, and supports or will support all major features of MyISAM. * To be the default non-transactional engine in MariaDB (instead of MyISAM). What are the design goals in Aria? ---------------------------------- * Multi-Version Concurrency Control (MVCC) and ACID storage engine. * Optionally non-transactional tables that should be 'as fast and as compact' as MyISAM tables. * Be able to use Aria for internal temporary tables in MariaDB (instead of MyISAM). * All indexes should have equal speed (clustered index is not on our current road map for Aria. If you need clustered index, you should use XtraDB). * Allow 'any' length transactions to work (Having long running transactions will cause more log space to be used). * Allow log shipping; that is, you can do incremental backups of Aria tables just by copying the Aria logs. * Allow copying of Aria tables between different Aria servers (under some well-defined constraints). * Better blob handling (than is currently offered in MyISAM, at a minimum). * No memory copying or extra memory used for blobs on insert/update. * Blobs allocated in big sequential blocks - Less fragmentation over time. * Blobs are stored so that Aria can easily be extended to have access to any part of a blob with a single fetch in the future. * Efficient storage on disk (that is, low row data overhead, low page data overhead and little lost space on pages). Note: There is still some more work to succeed with this goal. The disk layout is fine, but we need more in-memory caches to ensure that we get a higher fill factor on the pages. * Small footprint, to make MariaDB + Aria suitable for desktop and embedded applications. * Flexible memory allocation and scalable algorithms to utilize large amounts of memory efficiently, when it is available. Where can I find documentation and help about Aria? --------------------------------------------------- Documentation is available at [Aria](../aria/index) and related topics. The project is maintained on [GitHub](https://github.com/MariaDB/server). If you want to know what happens or be part of developing Aria, you can subscribe to the [maria-developers](http://launchpad.net/~maria-developers), [maria-docs](http://launchpad.net/~maria-docs), or [maria-discuss](http://launchpad.net/~maria-discuss) groups on Launchpad. To report and check bugs in Aria, see [Reporting Bugs](../reporting-bugs/index). You can usually find some of the Maria developers on our Zulip instance at <https://mariadb.zulipchat.com> or on the [IRC](../irc/index) channel #maria at <https://libera.chat/>. Who develops Aria? ------------------ The Core Team who develop Aria are: **Technical lead** * Michael "Monty" Widenius - Creator of MySQL and MyISAM **Core Developers (in alphabetical order)** * Guilhem Bichot - Replication expert, on line backup for MyISAM, etc. * Kristian Nielsen - MySQL build tools, NDB, MySQL server * Oleksandr Byelkin - Query cache, sub-queries, views. * Sergei Golubchik - Server Architect, Full text search, keys for MyISAM-Merge, Plugin architecture, etc. All except Guilhem Bichot are working for [MariaDB Corporation Ab](http://mariadb.com). What is the release policy/schedule of Aria? -------------------------------------------- Aria follows the same [release criteria](../release-criteria/index) as for [MariaDB](../mariadb/index). Some clarifications, unique for the Aria storage engine: * Aria index and data file formats should be backwards and forwards compatible to ensure easy upgrades and downgrades. * The log file format should also be compatible, but we don't make any guarantees yet. In some cases when upgrading, you must remove the old `aria_log.%` and `maria_log.%` files before restarting MariaDB. (So far, this has only occurred in the upgrade from [MariaDB 5.1](../what-is-mariadb-51/index) and [MariaDB 5.2](../what-is-mariadb-52/index)). ### Extended commitment for Beta 1.5 * Aria is now feature complete according to specification. How does Aria 1.5 Compare to MyISAM? ------------------------------------ Aria 1.0 was basically a crash-safe non-transactional version of MyISAM. Aria 1.5 added more concurrency (multiple inserter) and some optimizations. Aria supports all aspects of MyISAM, except as noted below. This includes external and internal check/repair/compressing of rows, different row formats, different index compress formats, `[aria\_chk](../aria_chk/index)` etc. After a normal shutdown you can copy Aria files between servers. Advantages of Aria compared to MyISAM ------------------------------------- * Data and indexes are crash safe. * On a crash, changes will be rolled back to state of the start of a statement or a last `LOCK TABLES` statement. * Aria can replay almost everything from the log. (Including `CREATE`, `DROP`, `RENAME`, `TRUNCATE` tables). Therefore, you make a backup of Aria by just copying the log. The things that can't be replayed (yet) are: + Batch `INSERT` into an empty table (This includes `LOAD DATA INFILE`, `SELECT... INSERT` and `INSERT` (many rows)). + `ALTER TABLE`. Note that `.frm` tables are NOT recreated! * `LOAD INDEX` can skip index blocks for unwanted indexes. * Supports all MyISAM `ROW` formats and new `PAGE` format where data is stored in pages. (default size is 8K). * Multiple concurrent inserters into the same table. * When using `PAGE` format (default) row data is cached by page cache. * Aria has unit tests of most parts. * Supports both crash-safe (soon to be transactional) and not transactional tables. (Non-transactional tables are not logged and rows uses less space): `CREATE TABLE foo (...) TRANSACTIONAL=0|1 ENGINE=Aria`. * `PAGE` is the only crash-safe/transactional row format. * `PAGE` format should give a notable speed improvement on systems which have bad data caching. (For example Windows). * From [MariaDB 10.5](../what-is-mariadb-105/index), max key length is 2000 bytes, compared to 1000 bytes in MyISAM. Differences between Aria and MyISAM ----------------------------------- * Aria uses BIG (1G by default) log files. * Aria has a log control file (`aria_log_control`) and log files (`aria_log.%`). The log files can be automatically purged when not needed or purged on demand (after backup). * Aria uses 8K pages by default (MyISAM uses 1K). This makes Aria a bit faster when using keys of fixed size, but slower when using variable-length packed keys (until we add a directory to index pages). Disadvantages of Aria compared to MyISAM ---------------------------------------- * Aria doesn't support `INSERT DELAYED`. * Aria does not support multiple key caches. * Storage of very small rows (< 25 bytes) are not efficient for `PAGE` format. * `MERGE` tables don't support Aria (should be very easy to add later). * Aria data pages in block format have an overhead of 10 bytes/page and 5 bytes/row. Transaction and multiple concurrent-writer support will use an extra overhead of 7 bytes for new rows, 14 bytes for deleted rows and 0 bytes for old compacted rows. * No external locking (MyISAM has external locking, but this is a rarely used feature). * Aria has one page size for both index and data (defined when Aria is used the first time). MyISAM supports different page sizes per index. * Small overhead (15 bytes) per index page. * Aria doesn't support MySQL internal RAID (disabled in MyISAM too, it's a deprecated feature). * Minimum data file size for PAGE format is 16K (with 8K pages). * Aria doesn't support indexes on virtual fields. Differences between [MariaDB 5.1](../what-is-mariadb-51/index) release and the normal MySQL-5.1 release? -------------------------------------------------------------------------------------------------------- See: * [Aria storage engine](../aria-storage-engine/index) * [MariaDB versus MySQL](../mariadb-versus-mysql/index) Why do you use the `TRANSACTIONAL` keyword now when Aria is not yet transactional? ---------------------------------------------------------------------------------- In the current development phase Aria tables created with `TRANSACTIONAL=1` are crash safe and atomic but not transactional because changes in Aria tables can't be rolled back with the `ROLLBACK` command. As we planned to make Aria tables fully transactional, we decided it was better to use the `TRANSACTIONAL` keyword from the start so so that applications don't need to be changed later. What are the known problems with the MySQL-5.1-Maria release? ------------------------------------------------------------- * See `KNOWN_BUGS.txt` for open/design bugs. * See jira.mariadb.org for newly reported bugs. Please report anything you can't find here! * If there is a bug in the Aria recovery code or in the code that generates the logs, or if the logs become corrupted, then mysqld may fail to start because Aria can't execute the logs at start up. * Query cache and concurrent insert using page row format have a bug, please disable query cache while using page row format and [MDEV-6817](https://jira.mariadb.org/browse/MDEV-6817) isn't complete If Aria doesn't start or you have an unrecoverable table (shouldn't happen): * Remove the `aria_log.%` files from the data directory. * Restart `mysqld` and run `[CHECK TABLE](../check-table/index)`, `[REPAIR TABLE](../repair-table/index)` or `[mysqlcheck](../mysqlcheck/index)` on your Aria tables. Alternatively, * Remove logs and run `[aria\_chk](../aria_chk/index)` on your `*.MAI` files. What is going to change in later Aria main releases? ---------------------------------------------------- The `LOCK TABLES` statement will not start a crash-safe segment. You should use `[BEGIN](begin)` and `[COMMIT](../commit/index)` instead. To make things future safe, you could do this: ``` BEGIN; LOCK TABLES .... UNLOCK TABLES; COMMIT; ``` And later you can just remove the `LOCK TABLES` and `UNLOCK TABLES` statements. How can I create a MyISAM-like (non-transactional) table in Aria? ----------------------------------------------------------------- Example: ``` CREATE TABLE t1 (a int) ROW_FORMAT=FIXED TRANSACTIONAL=0 PAGE_CHECKSUM=0; CREATE TABLE t2 (a int) ROW_FORMAT=DYNAMIC TRANSACTIONAL=0 PAGE_CHECKSUM=0; SHOW CREATE TABLE t1; SHOW CREATE TABLE t2; ``` Note that the rows are not cached in the page cache for `FIXED` or `DYNAMIC` format. If you want to have the data cached (something MyISAM doesn't support) you should use `ROW_FORMAT=PAGE`: ``` CREATE TABLE t3 (a int) ROW_FORMAT=PAGE TRANSACTIONAL=0 PAGE_CHECKSUM=0; SHOW CREATE TABLE t3; ``` You can use `PAGE_CHECKSUM=1` also for non-transactional tables; This puts a page checksums on all index pages. It also puts a checksum on data pages if you use `ROW_FORMAT=PAGE`. You may still have a speed difference (may be slightly positive or negative) between MyISAM and Aria because of different page sizes. You can change the page size for MariaDB with `--aria-block-size=\`#, where `\`# is 1024, 2048, 4096, 8192, 16384 or 32768. Note that if you change the page size you have to dump all your old tables into text (with `[mysqldump](../mysqldump/index)`) and remove the old Aria log and files: ``` # rm datadir/aria_log* ``` What are the advantages/disadvantages of the new `PAGE` format compared to the old MyISAM-like row formats (`DYNAMIC` and `FIXED`) ---------------------------------------------------------------------------------------------------------------------------------- The MyISAM-like `DYNAMIC` and `FIXED` format are extremely simple and have very little space overhead, so it's hard to beat them for when it comes to simple scanning of unmodified data. The `DYNAMIC` format does however get notably worse over time if you update the row a lot in a manner that increases the size of the row. The advantages of the `PAGE` format (compared to `DYNAMIC` or `FIXED`) for non-transactional tables are: * It's cached by the Page Cache, which gives better random performance (as it uses less system calls). * Does not fragment as easily easily as the `DYNAMIC` format during `UPDATE` statements. The maximum number of fragments are very low. * Code can easily be extended to only read the accessed columns (for example to skip reading blobs). * Faster updates (compared to `DYNAMIC`). The disadvantages are: * Slight storage overhead (should only be notable for very small row sizes) * Slower full table scan time. * When using `row_format=PAGE`, (the default), Aria first writes the row, then the keys, at which point the check for duplicate keys happens. This makes `PAGE` format slower than `DYNAMIC` (or MyISAM) if there is a lot of duplicated keys because of the overhead of writing and removing the row. If this is a problem, you can use `row_format=DYNAMIC` to get same behavior as MyISAM. What's the proper way to copy a Aria table from one place to another? --------------------------------------------------------------------- An Aria table consists of 3 files: ``` XXX.frm : The definition for the table, used by MySQL. XXX.MYI : Aria internal information about the structure of the data and index and data for all indexes. XXX.MAD : The data. ``` It's safe to copy all the Aria files to another directory or MariaDB instance if any of the following holds: * If you shutdown the MariaDB Server properly with `[mysqladmin shutdown](../mysqladmin/index)`, so that there is nothing for Aria to recover when it starts. or * If you have run a `[FLUSH TABLES](../flush/index)` statement and not accessed the table using SQL from that time until the tables have been copied. In addition, you must adhere the following rule for transactional tables: You can't copy the table to a location within the same MariaDB server if the new table has existed before and the new table is still active in the Aria recovery log (that is, Aria may need to access the old data during recovery). If you are unsure whether the old name existed, run `[aria\_chk --zerofill](../aria_chk/index)` on the table before you use it. After copying a transactional table and before you use the table, we recommend that you run the command: ``` $ aria_chk --zerofill table_name ``` This will overwrite all references to the logs (LSN), all transactional references (TRN) and all unused space with 0. It also marks the table as 'movable'. An additional benefit of zerofill is that the Aria files will compress better. No real data is ever removed as part of zerofill. Aria will automatically notice if you have copied a table from another system and do 'zerofill' for the first access of the table if it was not marked as 'movable'. The reason for using `[aria\_chk --zerofill](../aria_chk/index)` is that you avoid a delay in the MariaDB server for the first access of the table. Note that this automatic detection doesn't work if you copy tables within the same MariaDB server! When is it safe to remove old log files? ---------------------------------------- If you want to remove the Aria log files (`aria_log.%`) with `rm` or delete, then you must first shut down MariaDB cleanly (for example, with `[mysqladmin shutdown](../mysqladmin/index)`) before deleting the old files. The same rules apply when upgrading MariaDB; When upgrading, first take down MariaDB in a clean way and then upgrade. This will allow you to remove the old log files if there are incompatible problems between releases. Don't remove the `aria_log_control` file! This is not a log file, but a file that contains information about the Aria setup (current transaction id, unique id, next log file number etc.). If you do, Aria will generate a new `aria_log_control` file at startup and will regard all old Aria files as files moved from another system. This means that they have to be 'zerofilled' before they can be used. This will happen automatically at next access of the Aria files, which can take some time if the files are big. If this happens, you will see things like this in your mysqld.err file: ``` [Note] Zerofilling moved table: '.\database\xxxx' ``` As part of zerofilling no vital data is removed. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb REPLACE REPLACE ======= Syntax ------ ``` REPLACE [LOW_PRIORITY | DELAYED] [INTO] tbl_name [PARTITION (partition_list)] [(col,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),... [RETURNING select_expr [, select_expr ...]] ``` Or: ``` REPLACE [LOW_PRIORITY | DELAYED] [INTO] tbl_name [PARTITION (partition_list)] SET col={expr | DEFAULT}, ... [RETURNING select_expr [, select_expr ...]] ``` Or: ``` REPLACE [LOW_PRIORITY | DELAYED] [INTO] tbl_name [PARTITION (partition_list)] [(col,...)] SELECT ... [RETURNING select_expr [, select_expr ...]] ``` Description ----------- `REPLACE` works exactly like `[INSERT](../insert/index)`, except that if an old row in the table has the same value as a new row for a `PRIMARY KEY` or a `UNIQUE` index, the old row is deleted before the new row is inserted. If the table has more than one `UNIQUE` keys, it is possible that the new row conflicts with more than one row. In this case, all conflicting rows will be deleted. The table name can be specified in the form `db_name`.`tbl_name` or, if a default database is selected, in the form `tbl_name` (see [Identifier Qualifiers](../identifier-qualifiers/index)). This allows to use `[REPLACE ... SELECT](../insert-select/index)` to copy rows between different databases. **MariaDB starting with [10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/)**The RETURNING clause was introduced in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/) Basically it works like this: ``` BEGIN; SELECT 1 FROM t1 WHERE key=# FOR UPDATE; IF found-row DELETE FROM t1 WHERE key=# ; ENDIF INSERT INTO t1 VALUES (...); END; ``` The above can be replaced with: ``` REPLACE INTO t1 VALUES (...) ``` `REPLACE` is a MariaDB/MySQL extension to the SQL standard. It either inserts, or deletes and inserts. For other MariaDB/MySQL extensions to standard SQL --- that also handle duplicate values --- see [IGNORE](../ignore/index) and [INSERT ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index). Note that unless the table has a `PRIMARY KEY` or `UNIQUE` index, using a `REPLACE` statement makes no sense. It becomes equivalent to `INSERT`, because there is no index to be used to determine whether a new row duplicates another. Values for all columns are taken from the values sSee [Partition Pruning and Selection](../partition-pruning-and-selection/index) for details.pecified in the `REPLACE` statement. Any missing columns are set to their default values, just as happens for `INSERT`. You cannot refer to values from the current row and use them in the new row. If you use an assignment such as `'SET col = col + 1'`, the reference to the column name on the right hand side is treated as `DEFAULT(col)`, so the assignment is equivalent to `'SET col = DEFAULT(col) + 1'`. To use `REPLACE`, you must have both the `INSERT` and `DELETE` [privileges](../grant/index) for the table. There are some gotchas you should be aware of, before using `REPLACE`: * If there is an `[AUTO\_INCREMENT](../auto_increment/index)` field, a new value will be generated. * If there are foreign keys, `ON DELETE` action will be activated by `REPLACE`. * [Triggers](../triggers/index) on `DELETE` and `INSERT` will be activated by `REPLACE`. To avoid some of these behaviors, you can use `INSERT ... ON DUPLICATE KEY UPDATE`. This statement activates INSERT and DELETE triggers. See [Trigger Overview](../trigger-overview/index) for details. ### PARTITION See [Partition Pruning and Selection](../partition-pruning-and-selection/index) for details. ### REPLACE RETURNING `REPLACE ... RETURNING` returns a resultset of the replaced rows. This returns the listed columns for all the rows that are replaced, or alternatively, the specified SELECT expression. Any SQL expressions which can be calculated can be used in the select expression for the RETURNING clause, including virtual columns and aliases, expressions which use various operators such as bitwise, logical and arithmetic operators, string functions, date-time functions, numeric functions, control flow functions, secondary functions and stored functions. Along with this, statements which have subqueries and prepared statements can also be used. #### Examples Simple REPLACE statement ``` REPLACE INTO t2 VALUES (1,'Leopard'),(2,'Dog') RETURNING id2, id2+id2 as Total ,id2|id2, id2&&id2; +-----+-------+---------+----------+ | id2 | Total | id2|id2 | id2&&id2 | +-----+-------+---------+----------+ | 1 | 2 | 1 | 1 | | 2 | 4 | 2 | 1 | +-----+-------+---------+----------+ ``` Using stored functions in RETURNING ``` DELIMITER | CREATE FUNCTION f(arg INT) RETURNS INT BEGIN RETURN (SELECT arg+arg); END| DELIMITER ; PREPARE stmt FROM "REPLACE INTO t2 SET id2=3, animal2='Fox' RETURNING f2(id2), UPPER(animal2)"; EXECUTE stmt; +---------+----------------+ | f2(id2) | UPPER(animal2) | +---------+----------------+ | 6 | FOX | +---------+----------------+ ``` Subqueries in the statement ``` REPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE id2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id; +--------+ | new_id | +--------+ | 1 | | 1 | | 1 | | 1 | +--------+ ``` Subqueries in the RETURNING clause that return more than one row or column cannot be used.. Aggregate functions cannot be used in the RETURNING clause. Since aggregate functions work on a set of values and if the purpose is to get the row count, ROW\_COUNT() with SELECT can be used, or it can be used in REPLACE...SEL== Description `REPLACE ... RETURNING` returns a resultset of the replaced rows. This returns the listed columns for all the rows that are replaced, or alternatively, the specified SELECT expression. Any SQL expressions which can be calculated can be used in the select expression for the RETURNING clause, including virtual columns and aliases, expressions which use various operators such as bitwise, logical and arithmetic operators, string functions, date-time functions, numeric functions, control flow functions, secondary functions and stored functions. Along with this, statements which have subqueries and prepared statements can also be used. Examples -------- Simple REPLACE statement ``` REPLACE INTO t2 VALUES (1,'Leopard'),(2,'Dog') RETURNING id2, id2+id2 as Total ,id2|id2, id2&&id2; +-----+-------+---------+----------+ | id2 | Total | id2|id2 | id2&&id2 | +-----+-------+---------+----------+ | 1 | 2 | 1 | 1 | | 2 | 4 | 2 | 1 | +-----+-------+---------+----------+ ``` Using stored functions in RETURNING ``` DELIMITER | CREATE FUNCTION f(arg INT) RETURNS INT BEGIN RETURN (SELECT arg+arg); END| DELIMITER ; PREPARE stmt FROM "REPLACE INTO t2 SET id2=3, animal2='Fox' RETURNING f2(id2), UPPER(animal2)"; EXECUTE stmt; +---------+----------------+ | f2(id2) | UPPER(animal2) | +---------+----------------+ | 6 | FOX | +---------+----------------+ ``` Subqueries in the statement ``` REPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE id2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id; +--------+ | new_id | +--------+ | 1 | | 1 | | 1 | | 1 | +--------+ ``` Subqueries in the RETURNING clause that return more than one row or column cannot be used.. Aggregate functions cannot be used in the RETURNING clause. Since aggregate functions work on a set of values and if the purpose is to get the row count, ROW\_COUNT() with SELECT can be used, or it can be used in REPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the same as the REPLACE table. ECT...RETURNING if the table in the RETURNING clause is not the same as the REPLACE table. See Also -------- * [INSERT](../insert/index) * [HIGH\_PRIORITY and LOW\_PRIORITY clauses](../high_priority-and-low_priority-clauses/index) * [INSERT DELAYED](../insert-delayed/index) for details on the `DELAYED` clause Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.innodb_table_stats mysql.innodb\_table\_stats ========================== The `mysql.innodb_table_stats` table stores data related to [InnoDB Persistent Statistics](../innodb-persistent-statistics/index), and contains one row per table. This table, along with the related [mysql.innodb\_index\_stats](../mysqlinnodb_index_stats/index) table, can be manually updated in order to force or test differing query optimization plans. After updating, `FLUSH TABLE innodb_table_stats` is required to load the changes. `mysql.innodb_table_stats` is not replicated, although any [ANALYZE TABLE](../analyze-table/index) statements on the table will be by default.. It contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `database_name` | `varchar(64)` | NO | PRI | `NULL` | Database name. | | `table_name` | `varchar(64)` | NO | PRI | `NULL` | Table, partition or subpartition name. | | `last_update` | `timestamp` | NO | | `current_timestamp()` | Time that this row was last updated. | | `n_rows` | `bigint(20) unsigned` | NO | | `NULL` | Number of rows in the table. | | `clustered_index_size` | `bigint(20) unsigned` | NO | | `NULL` | Size, in pages, of the primary index. | | `sum_of_other_index_sizes` | `bigint(20) unsigned` | NO | | `NULL` | Size, in pages, of non-primary indexes. | Example ------- ``` SELECT * FROM mysql.innodb_table_stats\G *************************** 1. row *************************** database_name: mysql table_name: gtid_slave_pos last_update: 2017-08-19 20:38:34 n_rows: 0 clustered_index_size: 1 sum_of_other_index_sizes: 0 *************************** 2. row *************************** database_name: test table_name: ft last_update: 2017-09-15 12:58:39 n_rows: 0 clustered_index_size: 1 sum_of_other_index_sizes: 2 ... ``` See Also -------- * [InnoDB Persistent Statistics](../innodb-persistent-statistics/index) * [mysql.innodb\_index\_stats](../mysqlinnodb_index_stats/index) * [ANALYZE TABLE](../analyze-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Restoring Individual Tables and Partitions with Mariabackup Restoring Individual Tables and Partitions with Mariabackup =========================================================== When using Mariabackup, you don't necessarily need to restore every table and/or partition that was backed up. Even if you're starting from a [full backup](../full-backup-and-restore-with-mariabackup/index), it is certainly possible to restore only certain tables and/or partitions from the backup, as long as the table or partition involved is in an [InnoDB file-per-table tablespace](../innodb-file-per-table-tablespaces/index). This page documents how to restore individual tables and partitions. Preparing the Backup -------------------- Before you can restore from a backup, you first need to **prepare** it to make the data files consistent. You can do so with the `[--prepare](../mariabackup-options/index#-prepare)` command option. The ability to restore individual tables and partitions relies on [InnoDB's transportable tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces). For MariaDB to import tablespaces like these, [InnoDB](../xtradb-and-innodb/index) looks for a file with a `.cfg` extension. For Mariabackup to create these files, you also need to add the `[--export](../mariabackup-options/index#-export)` option during the prepare step. For example, you might execute the following command: ``` $ mariabackup --prepare --export \ --target-dir=/var/mariadb/backup/ \ --user=mariabackup --password=mypassword ``` If this operation completes without error, then the backup is ready to be restored. **MariaDB until [10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/)**Before [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), Mariabackup did not support the `[--export](../mariabackup-options/index#-export)` option. See [MDEV-13466](https://jira.mariadb.org/browse/MDEV-13466) about that. In earlier versions of MariaDB, this means that Mariabackup could not create `.cfg` files for [InnoDB file-per-table tablespaces](../innodb-file-per-table-tablespaces/index) during the `--prepare` stage. You can still [import file-per-table tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces) without the `.cfg` files in many cases, so it may still be possible in those versions to [restore partial backups](../partial-backup-and-restore-with-mariabackup/index) or to [restore individual tables and partitions](index) with just the `.ibd` files. If you have a [full backup](../full-backup-and-restore-with-mariabackup/index) and you need to create `.cfg` files for [InnoDB file-per-table tablespaces](../innodb-file-per-table-tablespaces/index), then you can do so by preparing the backup as usual without the `--export` option, and then restoring the backup, and then starting the server. At that point, you can use the server's built-in features to [copy the transportable tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces). Restoring the Backup -------------------- The restore process for restoring individual tables and/or partitions is quite different than the process for [full backups](../full-backup-and-restore-with-mariabackup/index). Rather than using the `[--copy-back](../mariabackup-options/index#-copy-back)` or the `[--move-back](../mariabackup-options/index#-move-back)`, each individual [InnoDB file-per-table tablespace](../innodb-file-per-table-tablespaces/index) file will have to be manually imported into the target server. The process that is used to restore the backup will depend on whether partitioning is involved. ### Restoring Individual Non-Partitioned Tables To restore individual non-partitioned tables from a backup, find the `.ibd` and `.cfg` files for the table in the backup, and then import them using the [Importing Transportable Tablespaces for Non-partitioned Tables](../innodb-file-per-table-tablespaces/index#importing-transportable-tablespaces-for-non-partitioned-tables) process. ### Restoring Individual Partitions and Partitioned Tables To restore individual partitions or partitioned tables from a backup, find the `.ibd` and `.cfg` files for the partition(s) in the backup, and then import them using the [Importing Transportable Tablespaces for Partitioned Tables](../innodb-file-per-table-tablespaces/index#importing-transportable-tablespaces-for-partitioned-tables) process. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ORD ORD === Syntax ------ ``` ORD(str) ``` Description ----------- If the leftmost character of the string `str` is a multi-byte character, returns the code for that character, calculated from the numeric values of its constituent bytes using this formula: ``` (1st byte code) + (2nd byte code x 256) + (3rd byte code x 256 x 256) ... ``` If the leftmost character is not a multi-byte character, ORD() returns the same value as the [ASCII()](../ascii/index) function. Examples -------- ``` SELECT ORD('2'); +----------+ | ORD('2') | +----------+ | 50 | +----------+ ``` See Also -------- * [ASCII()](../ascii/index) - Return ASCII value of first character * [CHAR()](../char-function/index) - Create a character from an integer value Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CHANGE MASTER TO CHANGE MASTER TO ================ The terms *master* and *slave* have historically been used in replication, but the terms terms *primary* and *replica* are now preferred. The old terms are used still used in parts of the documentation, and in MariaDB commands, although [MariaDB 10.5](../what-is-mariadb-105/index) has begun the process of renaming. The documentation process is ongoing. See [MDEV-18777](https://jira.mariadb.org/browse/MDEV-18777) to follow progress on this effort. Syntax ------ ``` CHANGE MASTER ['connection_name'] TO master_def [, master_def] ... [FOR CHANNEL 'channel_name'] master_def: MASTER_BIND = 'interface_name' | MASTER_HOST = 'host_name' | MASTER_USER = 'user_name' | MASTER_PASSWORD = 'password' | MASTER_PORT = port_num | MASTER_CONNECT_RETRY = interval | MASTER_HEARTBEAT_PERIOD = interval | MASTER_LOG_FILE = 'master_log_name' | MASTER_LOG_POS = master_log_pos | RELAY_LOG_FILE = 'relay_log_name' | RELAY_LOG_POS = relay_log_pos | MASTER_DELAY = interval | MASTER_SSL = {0|1} | MASTER_SSL_CA = 'ca_file_name' | MASTER_SSL_CAPATH = 'ca_directory_name' | MASTER_SSL_CERT = 'cert_file_name' | MASTER_SSL_CRL = 'crl_file_name' | MASTER_SSL_CRLPATH = 'crl_directory_name' | MASTER_SSL_KEY = 'key_file_name' | MASTER_SSL_CIPHER = 'cipher_list' | MASTER_SSL_VERIFY_SERVER_CERT = {0|1} | MASTER_USE_GTID = {current_pos|slave_pos|no} | IGNORE_SERVER_IDS = (server_id_list) | DO_DOMAIN_IDS = ([N,..]) | IGNORE_DOMAIN_IDS = ([N,..]) ``` Description ----------- The `CHANGE MASTER` statement sets the options that a [replica](../replication/index) uses to connect to and replicate from a [primary](../replication/index). **MariaDB starting with [10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/)**The `FOR CHANNEL` keyword was added for MySQL compatibility. This is identical to using the channel\_name directly after `CHANGE MASTER`. Multi-Source Replication ------------------------ If you are using [multi-source replication](../multi-source-replication/index), then you need to specify a connection name when you execute `CHANGE MASTER`. There are two ways to do this: * Setting the [default\_master\_connection](../replication-and-binary-log-server-system-variables/index#default_master_connection) system variable prior to executing `CHANGE MASTER`. * Setting the `connection_name` parameter when executing `CHANGE MASTER`. ### `default_master_connection` ``` SET default_master_connection = 'gandalf'; STOP SLAVE; CHANGE MASTER TO MASTER_PASSWORD='new3cret'; START SLAVE; ``` ### `connection_name` ``` STOP SLAVE 'gandalf'; CHANGE MASTER 'gandalf' TO MASTER_PASSWORD='new3cret'; START SLAVE 'gandalf'; ``` Options ------- ### Connection Options #### `MASTER_USER` The `MASTER_USER` option for `CHANGE MASTER` defines the user account that the [replica](../replication/index) will use to connect to the [primary](../replication/index). This user account will need the [REPLICATION SLAVE](../grant/index#replication-slave) privilege (or, from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/), the [REPLICATION REPLICA](../grant/index#replication-replica) on the primary. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_USER='repl', MASTER_PASSWORD='new3cret'; START SLAVE; ``` The maximum length of the `MASTER_USER` string is 96 characters until [MariaDB 10.5](../what-is-mariadb-105/index), and 128 characters from [MariaDB 10.6](../what-is-mariadb-106/index). #### `MASTER_PASSWORD` The `MASTER_USER` option for `CHANGE MASTER` defines the password that the [replica](../replication/index) will use to connect to the [primary](../replication/index) as the user account defined by the [MASTER\_USER](#master_user) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_PASSWORD='new3cret'; START SLAVE; ``` The maximum length of the `MASTER_PASSWORD` string is 32 characters. #### `MASTER_HOST` The `MASTER_HOST` option for `CHANGE MASTER` defines the hostname or IP address of the [primary](../replication/index). If you set the value of the `MASTER_HOST` option to the empty string, then that is not the same as not setting the option's value at all. If you set the value of the `MASTER_HOST` option to the empty string, then the `CHANGE MASTER` command will fail with an error. In [MariaDB 5.3](../what-is-mariadb-53/index) and before, if you set the value of the `MASTER_HOST` option to the empty string, then the `CHANGE MASTER` command would succeed, but the subsequent [START SLAVE](../start-slave/index) command would fail. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_HOST='dbserver1.example.com', MASTER_USER='repl', MASTER_PASSWORD='new3cret', MASTER_USE_GTID=slave_pos; START SLAVE; ``` If you set the value of the `MASTER_HOST` option in a `CHANGE MASTER` command, then the replica assumes that the primary is different from before, even if you set the value of this option to the same value it had previously. In this scenario, the replica will consider the old values for the primary's [binary log](../binary-log/index) file name and position to be invalid for the new primary. As a side effect, if you do not explicitly set the values of the [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options in the statement, then the statement will be implicitly appended with `MASTER_LOG_FILE=''` and `MASTER_LOG_POS=4`. However, if you enable [GTID](../gtid/index) mode for replication by setting the [MASTER\_USE\_GTID](#master_use_gtid) option to some value other than `no` in the statement, then these values will effectively be ignored anyway. Replicas cannot connect to primaries using Unix socket files or Windows named pipes. The replica must connect to the primary using TCP/IP. The maximum length of the `MASTER_HOST` string is 60 characters until [MariaDB 10.5](../what-is-mariadb-105/index), and 255 characters from [MariaDB 10.6](../what-is-mariadb-106/index). #### `MASTER_PORT` The `MASTER_PORT` option for `CHANGE MASTER` defines the TCP/IP port of the [primary](../replication/index). For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_HOST='dbserver1.example.com', MASTER_PORT=3307, MASTER_USER='repl', MASTER_PASSWORD='new3cret', MASTER_USE_GTID=slave_pos; START SLAVE; ``` If you set the value of the `MASTER_PORT` option in a `CHANGE MASTER` command, then the replica assumes that the primary is different from before, even if you set the value of this option to the same value it had previously. In this scenario, the replica will consider the old values for the primary's [binary log](../binary-log/index) file name and position to be invalid for the new primary. As a side effect, if you do not explicitly set the values of the [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options in the statement, then the statement will be implicitly appended with `MASTER_LOG_FILE=''` and `MASTER_LOG_POS=4`. However, if you enable [GTID](../gtid/index) mode for replication by setting the [MASTER\_USE\_GTID](#master_use_gtid) option to some value other than `no` in the statement, then these values will effectively be ignored anyway. Replicas cannot connect to primaries using Unix socket files or Windows named pipes. The replica must connect to the primary using TCP/IP. #### `MASTER_CONNECT_RETRY` The `MASTER_CONNECT_RETRY` option for `CHANGE MASTER` defines how many seconds that the replica will wait between connection retries. The default is `60`. ``` STOP SLAVE; CHANGE MASTER TO MASTER_CONNECT_RETRY=20; START SLAVE; ``` The number of connection attempts is limited by the [master\_retry\_count](../mysqld-options/index#-master-retry-count) option. It can be set either on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... master_retry_count=4294967295 ``` #### `MASTER_BIND` The `MASTER_BIND` option for `CHANGE MASTER` is only supported by MySQL 5.6.2 and later and by MySQL NDB Cluster 7.3.1 and later. This option is not supported by MariaDB. See [MDEV-19248](https://jira.mariadb.org/browse/MDEV-19248) for more information. The `MASTER_BIND` option for `CHANGE MASTER` can be used on replicas that have multiple network interfaces to choose which network interface the replica will use to connect to the primary. #### `MASTER_HEARTBEAT_PERIOD` The `MASTER_HEARTBEAT_PERIOD` option for `CHANGE MASTER` can be used to set the interval in seconds between replication heartbeats. Whenever the primary's [binary log](../binary-log/index) is updated with an event, the waiting period for the next heartbeat is reset. This option's *interval* argument has the following characteristics: * It is a decimal value with a range of `0` to `4294967` seconds. * It has a resolution of hundredths of a second. * Its smallest valid non-zero value is `0.001`. * Its default value is the value of the [slave\_net\_timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout) system variable divided by 2. * If it's set to `0`, then heartbeats are disabled. Heartbeats are sent by the primary only if there are no unsent events in the binary log file for a period longer than the interval. If the [RESET SLAVE](../reset-slave-connection_name/index) statement is executed, then the heartbeat interval is reset to the default. If the [slave\_net\_timeout](../replication-and-binary-log-server-system-variables/index#slave_net_timeout) system variable is set to a value that is lower than the current heartbeat interval, then a warning will be issued. ### TLS Options The TLS options are used for providing information about [TLS](../data-in-transit-encryption/index). The options can be set even on replicas that are compiled without TLS support. The TLS options are saved to either the default `master.info` file or the file that is configured by the [master\_info\_file](../mysqld-options/index#-master-info-file) option, but these TLS options are ignored unless the replica supports TLS. See [Replication with Secure Connections](../replication-with-secure-connections/index) for more information. #### `MASTER_SSL` The `MASTER_SSL` option for `CHANGE MASTER` tells the replica whether to force [TLS](../data-in-transit-encryption/index) for the connection. The valid values are `0` or `1`. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL=1; START SLAVE; ``` #### `MASTER_SSL_CA` The `MASTER_SSL_CA` option for `CHANGE MASTER` defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the [MASTER\_SSL](#master_ssl) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1; START SLAVE; ``` See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. The maximum length of `MASTER_SSL_CA` string is 511 characters. #### `MASTER_SSL_CAPATH` The `MASTER_SSL_CAPATH` option for `CHANGE MASTER` defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the [openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html) command. This option implies the [MASTER\_SSL](#master_ssl) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CAPATH='/etc/my.cnf.d/certificates/ca/', MASTER_SSL_VERIFY_SERVER_CERT=1; START SLAVE; ``` See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. The maximum length of `MASTER_SSL_CA_PATH` string is 511 characters. #### `MASTER_SSL_CERT` The `MASTER_SSL_CERT` option for `CHANGE MASTER` defines a path to the X509 certificate file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the [MASTER\_SSL](#master_ssl) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1; START SLAVE; ``` The maximum length of `MASTER_SSL_CERT` string is 511 characters. #### `MASTER_SSL_CRL` The `MASTER_SSL_CRL` option for `CHANGE MASTER` defines a path to a PEM file that should contain one or more revoked X509 certificates to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option is only supported if the server was built with OpenSSL. If the server was built with yaSSL, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1, MASTER_SSL_CRL='/etc/my.cnf.d/certificates/crl.pem'; START SLAVE; ``` See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. The maximum length of `MASTER_SSL_CRL` string is 511 characters. #### `MASTER_SSL_CRLPATH` The `MASTER_SSL_CRLPATH` option for `CHANGE MASTER` defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this variable needs to be run through the [openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html) command. This option is only supported if the server was built with OpenSSL. If the server was built with yaSSL, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1, MASTER_SSL_CRLPATH='/etc/my.cnf.d/certificates/crl/'; START SLAVE; ``` See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. The maximum length of `MASTER_SSL_CRL_PATH` string is 511 characters. #### `MASTER_SSL_KEY` The `MASTER_SSL_KEY` option for `CHANGE MASTER` defines a path to a private key file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the [MASTER\_SSL](#master_ssl) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1; START SLAVE; ``` The maximum length of `MASTER_SSL_KEY` string is 511 characters. #### `MASTER_SSL_CIPHER` The `MASTER_SSL_CIPHER` option for `CHANGE MASTER` defines the list of permitted ciphers or cipher suites to use for [TLS](../data-in-transit-encryption/index). Besides cipher names, if MariaDB was compiled with OpenSSL, this option could be set to "SSLv3" or "TLSv1.2" to allow all SSLv3 or all TLSv1.2 ciphers. Note that the TLSv1.3 ciphers cannot be excluded when using OpenSSL, even by using this option. See [Using TLSv1.3](../using-tlsv13/index) for details. This option implies the [MASTER\_SSL](#master_ssl) option. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1, MASTER_SSL_CIPHER='TLSv1.2'; START SLAVE; ``` The maximum length of `MASTER_SSL_CIPHER` string is 511 characters. #### `MASTER_SSL_VERIFY_SERVER_CERT` The `MASTER_SSL_VERIFY_SERVER_CERT` option for `CHANGE MASTER` enables [server certificate verification](../secure-connections-overview/index#server-certificate-verification). This option is disabled by default. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_SSL_CERT='/etc/my.cnf.d/certificates/server-cert.pem', MASTER_SSL_KEY='/etc/my.cnf.d/certificates/server-key.pem', MASTER_SSL_CA='/etc/my.cnf.d/certificates/ca.pem', MASTER_SSL_VERIFY_SERVER_CERT=1; START SLAVE; ``` See [Secure Connections Overview: Server Certificate Verification](../secure-connections-overview/index#server-certificate-verification) for more information. ### Binary Log Options These options are related to the [binary log](../binary-log/index) position on the primary. #### `MASTER_LOG_FILE` The `MASTER_LOG_FILE` option for `CHANGE MASTER` can be used along with `MASTER_LOG_POS` to specify the coordinates at which the [replica's I/O thread](../replication-threads/index#slave-io-thread) should begin reading from the primary's [binary logs](../binary-log/index) the next time the thread starts. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_LOG_FILE='master2-bin.001', MASTER_LOG_POS=4; START SLAVE; ``` The [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options cannot be specified if the [RELAY\_LOG\_FILE](#relay_log_file) and [RELAY\_LOG\_POS](#relay_log_pos) options were also specified. The [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options are effectively ignored if you enable [GTID](../gtid/index) mode for replication by setting the [MASTER\_USE\_GTID](#master_use_gtid) option to some value other than `no` in the statement. #### `MASTER_LOG_POS` The `MASTER_LOG_POS` option for `CHANGE MASTER` can be used along with `MASTER_LOG_FILE` to specify the coordinates at which the [replica's I/O thread](../replication-threads/index#slave-io-thread) should begin reading from the primary's [binary logs](../binary-log/index) the next time the thread starts. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_LOG_FILE='master2-bin.001', MASTER_LOG_POS=4; START SLAVE; ``` The [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options cannot be specified if the [RELAY\_LOG\_FILE](#relay_log_file) and [RELAY\_LOG\_POS](#relay_log_pos) options were also specified. The [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options are effectively ignored if you enable [GTID](../gtid/index) mode for replication by setting the [MASTER\_USE\_GTID](#master_use_gtid) option to some value other than `no` in the statement. ### Relay Log Options These options are related to the [relay log](../relay-log/index) position on the replica. #### `RELAY_LOG_FILE` The `RELAY_LOG_FILE` option for `CHANGE MASTER` can be used along with the [RELAY\_LOG\_POS](#relay_log_pos) option to specify the coordinates at which the [replica's SQL thread](../replication-threads/index#slave-sql-thread) should begin reading from the [relay log](../relay-log/index) the next time the thread starts. The `CHANGE MASTER` statement usually deletes all [relay log](../relay-log/index) files. However, if the `RELAY_LOG_FILE` and/or `RELAY_LOG_POS` options are specified, then existing [relay log](../relay-log/index) files are kept. When you want to change the [relay log](../relay-log/index) position, you only need to stop the [replica's SQL thread](../replication-threads/index#slave-sql-thread). The [replica's I/O thread](../replication-threads/index#slave-io-thread) can continue running. The [STOP SLAVE](../stop-slave/index) and [START SLAVE](../start-slave/index) statements support the `SQL_THREAD` option for this scenario. For example: ``` STOP SLAVE SQL_THREAD; CHANGE MASTER TO RELAY_LOG_FILE='slave-relay-bin.006', RELAY_LOG_POS=4025; START SLAVE SQL_THREAD; ``` When the value of this option is changed, the metadata about the [replica's SQL thread's](../replication-threads/index#slave-sql-thread) position in the [relay logs](../relay-log/index) will also be changed in the `relay-log.info` file or the file that is configured by the [relay\_log\_info\_file](../replication-and-binary-log-system-variables/index#relay_log_info_file) system variable. The [RELAY\_LOG\_FILE](#relay_log_file) and [RELAY\_LOG\_POS](#relay_log_pos) options cannot be specified if the [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options were also specified. #### `RELAY_LOG_POS` The `RELAY_LOG_POS` option for `CHANGE MASTER` can be used along with the [RELAY\_LOG\_FILE](#relay_log_file) option to specify the coordinates at which the [replica's SQL thread](../replication-threads/index#slave-sql-thread) should begin reading from the [relay log](../relay-log/index) the next time the thread starts. The `CHANGE MASTER` statement usually deletes all [relay log](../relay-log/index) files. However, if the `RELAY_LOG_FILE` and/or `RELAY_LOG_POS` options are specified, then existing [relay log](../relay-log/index) files are kept. When you want to change the [relay log](../relay-log/index) position, you only need to stop the [replica's SQL thread](../replication-threads/index#slave-sql-thread). The [replica's I/O thread](../replication-threads/index#slave-io-thread) can continue running. The [STOP SLAVE](../stop-slave/index) and [START SLAVE](../start-slave/index) statements support the `SQL_THREAD` option for this scenario. For example: ``` STOP SLAVE SQL_THREAD; CHANGE MASTER TO RELAY_LOG_FILE='slave-relay-bin.006', RELAY_LOG_POS=4025; START SLAVE SQL_THREAD; ``` When the value of this option is changed, the metadata about the [replica's SQL thread's](../replication-threads/index#slave-sql-thread) position in the [relay logs](../relay-log/index) will also be changed in the `relay-log.info` file or the file that is configured by the [relay\_log\_info\_file](../replication-and-binary-log-system-variables/index#relay_log_info_file) system variable. The [RELAY\_LOG\_FILE](#relay_log_file) and [RELAY\_LOG\_POS](#relay_log_pos) options cannot be specified if the [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options were also specified. ### GTID Options #### `MASTER_USE_GTID` The `MASTER_USE_GTID` option for `CHANGE MASTER` can be used to configure the replica to use the [global transaction ID (GTID)](../global-transaction-id/index) when connecting to a primary. The possible values are: * `current_pos` - Replicate in [GTID](../gtid/index) mode and use [gtid\_current\_pos](../gtid/index#gtid_current_pos) as the position to start downloading transactions from the primary. * `slave_pos` - Replicate in [GTID](../gtid/index) mode and use [gtid\_slave\_pos](../gtid/index#gtid_slave_pos) as the position to start downloading transactions from the primary. From [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/), `replica_pos` is an alias for `slave_pos`. * `no` - Don't replicate in [GTID](../gtid/index) mode. For example: ``` STOP SLAVE; CHANGE MASTER TO MASTER_USE_GTID = current_pos; START SLAVE; ``` Or: ``` STOP SLAVE; SET GLOBAL gtid_slave_pos='0-1-153'; CHANGE MASTER TO MASTER_USE_GTID = slave_pos; START SLAVE; ``` ### Replication Filter Options Also see [Replication filters](../replication-filters/index). #### `IGNORE_SERVER_IDS` The `IGNORE_SERVER_IDS` option for `CHANGE MASTER` can be used to configure a [replica](../replication/index) to ignore [binary log](binary_log) events that originated from certain servers. Filtered [binary log](binary_log) events will not get logged to the replica’s [relay log](../relay-log/index), and they will not be applied by the replica. The option's value can be specified by providing a comma-separated list of [server\_id](../replication-and-binary-log-system-variables/index#server_id) values. For example: ``` STOP SLAVE; CHANGE MASTER TO IGNORE_SERVER_IDS = (3,5); START SLAVE; ``` If you would like to clear a previously set list, then you can set the value to an empty list. For example: ``` STOP SLAVE; CHANGE MASTER TO IGNORE_SERVER_IDS = (); START SLAVE; ``` #### `DO_DOMAIN_IDS` The `DO_DOMAIN_IDS` option for `CHANGE MASTER` can be used to configure a [replica](../replication/index) to only apply [binary log](binary_log) events if the transaction's [GTID](../global-transaction-id/index) is in a specific [gtid\_domain\_id](../gtid/index#gtid_domain_id) value. Filtered [binary log](binary_log) events will not get logged to the replica’s [relay log](../relay-log/index), and they will not be applied by the replica. The option's value can be specified by providing a comma-separated list of [gtid\_domain\_id](../gtid/index#gtid_domain_id) values. Duplicate values are automatically ignored. For example: ``` STOP SLAVE; CHANGE MASTER TO DO_DOMAIN_IDS = (1,2); START SLAVE; ``` If you would like to clear a previously set list, then you can set the value to an empty list. For example: ``` STOP SLAVE; CHANGE MASTER TO DO_DOMAIN_IDS = (); START SLAVE; ``` The [DO\_DOMAIN\_IDS](#do_domain_ids) option and the [IGNORE\_DOMAIN\_IDS](#ignore_domain_ids) option cannot both be set to non-empty values at the same time. If you want to set the [DO\_DOMAIN\_IDS](#do_domain_ids) option, and the [IGNORE\_DOMAIN\_IDS](#ignore_domain_ids) option was previously set, then you need to clear the value of the [IGNORE\_DOMAIN\_IDS](#ignore_domain_ids) option. For example: ``` STOP SLAVE; CHANGE MASTER TO IGNORE_DOMAIN_IDS = (), DO_DOMAIN_IDS = (1,2); START SLAVE; ``` The `DO_DOMAIN_IDS` option can only be specified if the replica is replicating in [GTID](../gtid/index) mode. Therefore, the [MASTER\_USE\_GTID](#master_use_gtid) option must also be set to some value other than `no` in order to use this option. #### `IGNORE_DOMAIN_IDS` The `IGNORE_DOMAIN_IDS` option for `CHANGE MASTER` can be used to configure a [replica](../replication/index) to ignore [binary log](binary_log) events if the transaction's [GTID](../global-transaction-id/index) is in a specific [gtid\_domain\_id](../gtid/index#gtid_domain_id) value. Filtered [binary log](binary_log) events will not get logged to the replica’s [relay log](../relay-log/index), and they will not be applied by the replica. The option's value can be specified by providing a comma-separated list of [gtid\_domain\_id](../gtid/index#gtid_domain_id) values. Duplicate values are automatically ignored. For example: ``` STOP SLAVE; CHANGE MASTER TO IGNORE_DOMAIN_IDS = (1,2); START SLAVE; ``` If you would like to clear a previously set list, then you can set the value to an empty list. For example: ``` STOP SLAVE; CHANGE MASTER TO IGNORE_DOMAIN_IDS = (); START SLAVE; ``` The [DO\_DOMAIN\_IDS](#do_domain_ids) option and the [IGNORE\_DOMAIN\_IDS](#ignore_domain_ids) option cannot both be set to non-empty values at the same time. If you want to set the [IGNORE\_DOMAIN\_IDS](#ignore_domain_ids) option, and the [DO\_DOMAIN\_IDS](#do_domain_ids) option was previously set, then you need to clear the value of the [DO\_DOMAIN\_IDS](#do_domain_ids) option. For example: ``` STOP SLAVE; CHANGE MASTER TO DO_DOMAIN_IDS = (), IGNORE_DOMAIN_IDS = (1,2); START SLAVE; ``` The `IGNORE_DOMAIN_IDS` option can only be specified if the replica is replicating in [GTID](../gtid/index) mode. Therefore, the [MASTER\_USE\_GTID](#master_use_gtid) option must also be set to some value other than `no` in order to use this option. ### Delayed Replication Options #### `MASTER_DELAY` **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**The `MASTER_DELAY` option for `CHANGE MASTER` was first added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) to enable [delayed replication](../delayed-replication/index). The `MASTER_DELAY` option for `CHANGE MASTER` can be used to enable [delayed replication](../delayed-replication/index). This option specifies the time in seconds (at least) that a replica should lag behind the primary up to a maximum value of 2147483647, or about 68 years. Before executing an event, the replica will first wait, if necessary, until the given time has passed since the event was created on the primary. The result is that the replica will reflect the state of the primary some time back in the past. The default is zero, no delay. ``` STOP SLAVE; CHANGE MASTER TO MASTER_DELAY=3600; START SLAVE; ``` Changing Option Values ---------------------- If you don't specify a given option when executing the `CHANGE MASTER` statement, then the option keeps its old value in most cases. Most of the time, there is no need to specify the options that do not need to change. For example, if the password for the user account that the replica uses to connect to its primary has changed, but no other options need to change, then you can just change the [MASTER\_PASSWORD](#master_password) option by executing the following commands: ``` STOP SLAVE; CHANGE MASTER TO MASTER_PASSWORD='new3cret'; START SLAVE; ``` There are some cases where options are implicitly reset, such as when the [MASTER\_HOST](#master_host) and [MASTER\_PORT](#master_port) options are changed. Option Persistence ------------------ The values of the [MASTER\_LOG\_FILE](#master_log_file) and [MASTER\_LOG\_POS](#master_log_pos) options (i.e. the [binary log](../binary-log/index) position on the primary) and most other options are written to either the default `master.info` file or the file that is configured by the [master\_info\_file](../mysqld-options/index#-master-info-file) option. The [replica's I/O thread](../replication-threads/index#slave-io-thread) keeps this [binary log](../binary-log/index) position updated as it downloads events only when [MASTER\_USE\_GTID](#master_use_gtid) option is set to `NO`. Otherwise the file is not updated on a per event basis. The [master\_info\_file](../mysqld-options/index#-master-info-file) option can be set either on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... master_info_file=/mariadb/myserver1-master.info ``` The values of the [RELAY\_LOG\_FILE](#relay_log_file) and [RELAY\_LOG\_POS](#relay_log_pos) options (i.e. the [relay log](../relay-log/index) position) are written to either the default `relay-log.info` file or the file that is configured by the [relay\_log\_info\_file](../replication-and-binary-log-system-variables/index#relay_log_info_file) system variable. The [replica's SQL thread](../replication-threads/index#slave-sql-thread) keeps this [relay log](../relay-log/index) position updated as it applies events. The [relay\_log\_info\_file](../replication-and-binary-log-system-variables/index#relay_log_info_file) system variable can be set either on the command-line or in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... relay_log_info_file=/mariadb/myserver1-relay-log.info ``` GTID Persistence ---------------- If the replica is replicating [binary log](../binary-log/index) events that contain [GTIDs](../gtid/index), then the [replica's SQL thread](../replication-threads/index#slave-sql-thread) will write every GTID that it applies to the [mysql.gtid\_slave\_pos](../mysqlgtid_slave_pos-table/index) table. This GTID can be inspected and modified through the [gtid\_slave\_pos](../gtid/index#gtid_slave_pos) system variable. If the replica has the [log\_slave\_updates](../replication-and-binary-log-system-variables/index#log_slave_updates) system variable enabled and if the replica has the [binary log](../binary-log/index) enabled, then every write by the [replica's SQL thread](../replication-threads/index#slave-sql-thread) will also go into the replica's [binary log](../binary-log/index). This means that [GTIDs](../gtid/index) of replicated transactions would be reflected in the value of the [gtid\_binlog\_pos](../gtid/index#gtid_binlog_pos) system variable. Creating a Replica from a Backup -------------------------------- The `CHANGE MASTER` statement is useful for setting up a replica when you have a backup of the primary and you also have the [binary log](../binary-log/index) position or [GTID](../gtid/index) position corresponding to the backup. After restoring the backup on the replica, you could execute something like this to use the [binary log](../binary-log/index) position: ``` CHANGE MASTER TO MASTER_LOG_FILE='master2-bin.001', MASTER_LOG_POS=4; START SLAVE; ``` Or you could execute something like this to use the [GTID](../gtid/index) position: ``` SET GLOBAL gtid_slave_pos='0-1-153'; CHANGE MASTER TO MASTER_USE_GTID=slave_pos; START SLAVE; ``` See [Setting up a Replication Slave with Mariabackup](../setting-up-a-replication-slave-with-mariabackup/index) for more information on how to do this with [Mariabackup](../mariabackup/index). Example ------- The following example changes the primary and primary's binary log coordinates. This is used when you want to set up the replica to replicate the primary: ``` CHANGE MASTER TO MASTER_HOST='master2.mycompany.com', MASTER_USER='replication', MASTER_PASSWORD='bigs3cret', MASTER_PORT=3306, MASTER_LOG_FILE='master2-bin.001', MASTER_LOG_POS=4, MASTER_CONNECT_RETRY=10; START SLAVE; ``` See Also -------- * [Setting up replication](../setting-up-replication/index) * [START SLAVE](../start-slave/index) * [Multi-source replication](../multi-source-replication/index) * [RESET SLAVE](../reset-slave-connection_name/index). Removes a connection created with `CHANGE MASTER TO`. * [Global Transaction ID](../global-transaction-id/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Installing MinIO for Usage With mysql-test-run Installing MinIO for Usage With mysql-test-run ============================================== When testing the S3 storage engine with the s3 test suite, [mysql-test-run](../mysqltest/index) needs access to Amazon S3 compatible storage. The easiest way to achieve this is to install [MinIO](https://min.io), an open source S3 compatible storage. Here is a shell script that you can use to install MinIO with the right credentials for [mysql-test-run](../mysqltest/index). This should work on most Linux systems as the binaries are statically linked. You can alternatively download MinIO binaries directly from [here](https://min.io/download). ``` # Where to install the MinIO binaries and where to store the data install=/my/local/minio data=/tmp/shared # Get the MinIO binaries. You can skip this test if you already have MinIO installed. mkdir -p $install wget https://dl.min.io/server/minio/release/linux-amd64/minio -O $install/minio wget https://dl.min.io/client/mc/release/linux-amd64/mc -O $install/mc chmod a+x $install/minio $install/mc # Setup MinIO for usage with mysql-test-run MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=minioadmin $install/minio server $data 2>&1 & $install/mc config host add local http://127.0.0.1:9000 minio minioadmin $install/mc mb --ignore-existing local/storage-engine ``` Now you can run the S3 test suite: ``` cd "mysql-source-dir"/mysql-test ./mysql-test-run --suite=s3 ``` If there is an issue while running the test suite, you can see the files created by MinIO with: ``` $install/mc ls -r local/storage-engine ``` or ``` ls $data/storage-engine ``` If you want to use MinIO with different credentials or you want to run the test against another S3 storage you ave to update the update the following files: ``` mysql-test/suite/s3/my.cnf mysql-test/suite/s3/slave.cnf ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb COMMIT COMMIT ====== The `COMMIT` statement ends a transaction, saving any changes to the data so that they become visible to subsequent transactions. Also, [unlocks metadata](../metadata-locking/index) changed by current transaction. If [autocommit](../server-system-variables/index#autocommit) is set to 1, an implicit commit is performed after each statement. Otherwise, all transactions which don't end with an explicit `COMMIT` are implicitly rollbacked and the changes are lost. The `[ROLLBACK](../rollback/index)` statement can be used to do this explicitly. The required syntax for the `COMMIT` statement is as follows: ``` COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE] ``` `COMMIT` is the more important transaction terminator, as well as the more interesting one. The basic form of the `COMMIT` statement is simply the keyword `COMMIT` (the keyword `WORK` is simply noise and can be omitted without changing the effect). The optional `AND CHAIN` clause is a convenience for initiating a new transaction as soon as the old transaction terminates. If `AND CHAIN` is specified, then there is effectively nothing between the old and new transactions, although they remain separate. The characteristics of the new transaction will be the same as the characteristics of the old one — that is, the new transaction will have the same access mode, isolation level and diagnostics area size (we'll discuss all of these shortly) as the transaction just terminated. `RELEASE` tells the server to disconnect the client immediately after the current transaction. There are `NO RELEASE` and `AND NO CHAIN` options. By default, commits do not `RELEASE` or `CHAIN`, but it's possible to change this default behavior with the [completion\_type](../server-system-variables/index#completion_type) server system variable. In this case, the `AND NO CHAIN` and `NO RELEASE` options override the server default. See Also -------- * [autocommit](../server-system-variables/index#autocommit) - server system variable that determines whether statements are automatically committed. * [completion\_type](../server-system-variables/index#completion_type) - server system variable that determines whether COMMIT's are standard, COMMIT AND CHAIN or COMMIT RELEASE. * [SQL statements that cause an implicit commit](../sql-statements-that-cause-an-implicit-commit/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema ROCKSDB_LOCKS Table Information Schema ROCKSDB\_LOCKS Table ======================================= The [Information Schema](../information_schema/index) `ROCKSDB_LOCKS` table is included as part of the [MyRocks](../myrocks/index) storage engine. The `PROCESS` [privilege](../grant/index) is required to view the table. It contains the following columns: | Column | Description | | --- | --- | | `COLUMN_FAMILY_ID` | | | `TRANSACTION_ID` | | | `KEY` | | | `MODE` | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LN LN == Syntax ------ ``` LN(X) ``` Description ----------- Returns the natural logarithm of X; that is, the base-e logarithm of X. If X is less than or equal to 0, or `NULL`, then NULL is returned. The inverse of this function is `[EXP()](../exp/index)`. Examples -------- ``` SELECT LN(2); +-------------------+ | LN(2) | +-------------------+ | 0.693147180559945 | +-------------------+ SELECT LN(-2); +--------+ | LN(-2) | +--------+ | NULL | +--------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Database Design Phase 6: Maintenance Database Design Phase 6: Maintenance ===================================== This article follows on from [Database Design Phase 5: Operation](https://mariadb.com/database-design-phase-5-operation). The database maintenance phase incorporates general maintenance, such as maintaining the indexes, optimizing the tables, adding and removing users, and changing passwords, as well as backups and restoration of backups in case of a failure. New requirements also start to be requested, and this may result in new fields, or new tables, being created. As the new system and organization changes, the existing database becomes less and less sufficient to meet the organization's needs. For example, the media organization may be amalgamated with media bodies from other countries, requiring integration of many data sources, or the volumes and staff may expand (or reduce) dramatically. Eventually, there comes a time, whether it's 10 months after completion or 10 years, when the database system needs to be replaced. The maintenance of the existing database begins to drain more and more resources, and the effort to create a new design is matched by the current maintenance effort. As this point, the database is coming to the end of its life, and a new project begins life in the Analysis phase. The following are the steps in the maintenance phase: 1. Maintain the indexes 2. Maintain the tables 3. Maintain the users 4. Change passwords 5. Backup 6. Restore backups 7. Change the design to meet new requirements Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb FLUSH QUERY CACHE FLUSH QUERY CACHE ================= Description ----------- You can defragment [the query cache](../the-query-cache/index) to better utilize its memory with the `FLUSH QUERY CACHE` statement. The statement does not remove any queries from the cache. The [RESET QUERY CACHE](../reset/index) statement removes all query results from the query cache. The [FLUSH TABLES](../flush/index) statement also does this. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SELECT SELECT ====== Syntax ------ ``` SELECT [ALL | DISTINCT | DISTINCTROW] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] select_expr [, select_expr ...] [ FROM table_references [WHERE where_condition] [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]] [HAVING where_condition] [ORDER BY {col_name | expr | position} [ASC | DESC], ...] [LIMIT {[offset,] row_count | row_count OFFSET offset [ROWS EXAMINED rows_limit] } | [OFFSET start { ROW | ROWS }] [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }] ] procedure|[PROCEDURE procedure_name(argument_list)] [INTO OUTFILE 'file_name' [CHARACTER SET charset_name] [export_options] | INTO DUMPFILE 'file_name' | INTO var_name [, var_name] ] [FOR UPDATE lock_option | LOCK IN SHARE MODE lock_option] export_options: [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STARTING BY 'string'] [TERMINATED BY 'string'] ] lock_option: [WAIT n | NOWAIT | SKIP LOCKED] ``` Description ----------- `SELECT` is used to retrieve rows selected from one or more tables, and can include [UNION](../union/index) statements and [subqueries](../subqueries/index). * Each *select\_expr* expression indicates a column or data that you want to retrieve. You must have at least one select expression. See [Select Expressions](#select-expressions) below. * The `FROM` clause indicates the table or tables from which to retrieve rows. Use either a single table name or a `JOIN` expression. See [JOIN](../join/index) for details. If no table is involved, [FROM DUAL](../dual/index) can be specified. * Each table can also be specified as `db_name`.`tabl_name`. Each column can also be specified as `tbl_name`.`col_name` or even `db_name`.`tbl_name`.`col_name`. This allows one to write queries which involve multiple databases. See [Identifier Qualifiers](../identifier-qualifiers/index) for syntax details. * The `WHERE` clause, if given, indicates the condition or conditions that rows must satisfy to be selected. `where_condition` is an expression that evaluates to true for each row to be selected. The statement selects all rows if there is no WHERE clause. + In the `WHERE` clause, you can use any of the functions and operators that MariaDB supports, except for aggregate (summary) functions. See [Functions and Operators](../functions-and-operators/index) and [Functions and Modifiers for use with GROUP BY](../functions-and-modifiers-for-use-with-group-by/index) (aggregate). * Use the [ORDER BY](../order-by/index) clause to order the results. * Use the [LIMIT](../limit/index) clause allows you to restrict the results to only a certain number of rows, optionally with an offset. * Use the [GROUP BY](../group-by/index) and `HAVING` clauses to group rows together when they have columns or computed values in common. SELECT can also be used to retrieve rows computed without reference to any table. ### Select Expressions A `SELECT` statement must contain one or more select expressions, separated by commas. Each select expression can be one of the following: * The name of a column. * Any expression using [functions and operators](../functions-and-operators/index). * `*` to select all columns from all tables in the `FROM` clause. * `tbl_name.*` to select all columns from just the table *tbl\_name*. When specifying a column, you can either use just the column name or qualify the column name with the name of the table using `tbl_name.col_name`. The qualified form is useful if you are joining multiple tables in the `FROM` clause. If you do not qualify the column names when selecting from multiple tables, MariaDB will try to find the column in each table. It is an error if that column name exists in multiple tables. You can quote column names using backticks. If you are qualifying column names with table names, quote each part separately as ``tbl_name`.`col_name``. If you use any [grouping functions](../functions-and-modifiers-for-use-with-group-by/index) in any of the select expressions, all rows in your results will be implicitly grouped, as if you had used `GROUP BY NULL`. ### DISTINCT A query may produce some identical rows. By default, all rows are retrieved, even when their values are the same. To explicitly specify that you want to retrieve identical rows, use the `ALL` option. If you want duplicates to be removed from the resultset, use the `DISTINCT` option. `DISTINCTROW` is a synonym for `DISTINCT`. See also [COUNT DISTINCT](../count-distinct/index) and [SELECT UNIQUE in Oracle mode](../sql_modeoracle-from-mariadb-103/index#simple-syntax-compatibility). ### INTO The `INTO` clause is used to specify that the query results should be written to a file or variable. * [SELECT INTO OUTFILE](../select-into-outfile/index) - formatting and writing the result to an external file. * [SELECT INTO DUMPFILE](../select-into-dumpfile/index) - binary-safe writing of the unformatted results to an external file. * [SELECT INTO Variable](../select-into-variable/index) - selecting and setting variables. The reverse of `SELECT INTO OUTFILE` is [LOAD DATA](../load-data-into-tables-or-index/index). ### LIMIT Restricts the number of returned rows. See [LIMIT](../limit/index) and [LIMIT ROWS EXAMINED](../limit-rows-examined/index) for details. ### LOCK IN SHARE MODE/FOR UPDATE See [LOCK IN SHARE MODE](../lock-in-share-mode/index) and [FOR UPDATE](../for-update/index) for details on the respective locking clauses. ### OFFSET ... FETCH **MariaDB starting with [10.6](../what-is-mariadb-106/index)**See [SELECT ... OFFSET ... FETCH](../select-offset-fetch/index). ### ORDER BY Order a resultset. See [ORDER BY](../order-by/index) for details. ### PARTITION Specifies to the optimizer which partitions are relevant for the query. Other partitions will not be read. See [Partition Pruning and Selection](../partition-pruning-and-selection/index) for details. ### PROCEDURE Passes the whole result set to a C Procedure. See [PROCEDURE](../procedure/index) and [PROCEDURE ANALYSE](../procedure-analyse/index) (the only built-in procedure not requiring the server to be recompiled). ### SKIP LOCKED **MariaDB starting with [10.6](../what-is-mariadb-106/index)**The SKIP LOCKED clause was introduced in [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/). This causes those rows that couldn't be locked ([LOCK IN SHARE MODE](../lock-in-share-mode/index) or [FOR UPDATE](../for-update/index)) to be excluded from the result set. An explicit `NOWAIT` is implied here. This is only implemented on [InnoDB](../innodb/index) tables and ignored otherwise. ### SQL\_CALC\_FOUND\_ROWS When `SQL_CALC_FOUND_ROWS` is used, then MariaDB will calculate how many rows would have been in the result, if there would be no [LIMIT](../limit/index) clause. The result can be found by calling the function [FOUND\_ROWS()](../found_rows/index) in your next sql statement. ### max\_statement\_time clause By using [max\_statement\_time](../server-system-variables/index#max_statement_time) in conjunction with [SET STATEMENT](../set-statement/index), it is possible to limit the execution time of individual queries. For example: ``` SET STATEMENT max_statement_time=100 FOR SELECT field1 FROM table_name ORDER BY field1; ``` ### WAIT/NOWAIT Set the lock wait timeout. See [WAIT and NOWAIT](../wait-and-nowait/index). Examples -------- ``` SELECT f1,f2 FROM t1 WHERE (f3<=10) AND (f4='y'); ``` See [Getting Data from MariaDB](../getting-data-from-mariadb/index) (Beginner tutorial), or the various sub-articles, for more examples. See Also -------- * [Getting Data from MariaDB](../getting-data-from-mariadb/index) (Beginner tutorial) * [Joins and Subqueries](../joins-subqueries/index) * [LIMIT](../limit/index) * [ORDER BY](../order-by/index) * [GROUP BY](../group-by/index) * [Common Table Expressions](../common-table-expressions/index) * [SELECT WITH ROLLUP](../select-with-rollup/index) * [SELECT INTO OUTFILE](../select-into-outfile/index) * [SELECT INTO DUMPFILE](../select-into-dumpfile/index) * [FOR UPDATE](../for-update/index) * [LOCK IN SHARE MODE](../lock-in-share-mode/index) * [Optimizer Hints](../optimizer-hints/index) * [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#simple-syntax-compatibility) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb RAND RAND ==== Syntax ------ ``` RAND(), RAND(N) ``` Description ----------- Returns a random `[DOUBLE](../double/index)` precision floating point value v in the range 0 <= v < 1.0. If a constant integer argument N is specified, it is used as the seed value, which produces a repeatable sequence of column values. In the example below, note that the sequences of values produced by RAND(3) is the same both places where it occurs. In a WHERE clause, RAND() is evaluated each time the WHERE is executed. Statements using the RAND() function are not [safe for statement-based replication](../unsafe-statements-for-replication/index). Practical uses -------------- The expression to get a random integer from a given range is the following: ``` FLOOR(min_value + RAND() * (max_value - min_value +1)) ``` RAND() is often used to read random rows from a table, as follows: ``` SELECT * FROM my_table ORDER BY RAND() LIMIT 10; ``` Note, however, that this technique should never be used on a large table as it will be extremely slow. MariaDB will read all rows in the table, generate a random value for each of them, order them, and finally will apply the LIMIT clause. Examples -------- ``` CREATE TABLE t (i INT); INSERT INTO t VALUES(1),(2),(3); SELECT i, RAND() FROM t; +------+-------------------+ | i | RAND() | +------+-------------------+ | 1 | 0.255651095188829 | | 2 | 0.833920199269355 | | 3 | 0.40264774151393 | +------+-------------------+ SELECT i, RAND(3) FROM t; +------+-------------------+ | i | RAND(3) | +------+-------------------+ | 1 | 0.90576975597606 | | 2 | 0.373079058130345 | | 3 | 0.148086053457191 | +------+-------------------+ SELECT i, RAND() FROM t; +------+-------------------+ | i | RAND() | +------+-------------------+ | 1 | 0.511478140495232 | | 2 | 0.349447508668012 | | 3 | 0.212803152588013 | +------+-------------------+ ``` Using the same seed, the same sequence will be returned: ``` SELECT i, RAND(3) FROM t; +------+-------------------+ | i | RAND(3) | +------+-------------------+ | 1 | 0.90576975597606 | | 2 | 0.373079058130345 | | 3 | 0.148086053457191 | +------+-------------------+ ``` Generating a random number from 5 to 15: ``` SELECT FLOOR(5 + (RAND() * 11)); ``` See Also -------- * [Techniques for Efficiently Finding a Random Row](../techniques-for-efficiently-finding-a-random-row/index) * [rand\_seed1 and rand\_seed2 system variables](../server-system-variables/index#rand_seed1) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb InnoDB Data Dictionary Troubleshooting InnoDB Data Dictionary Troubleshooting ====================================== Can't Open File --------------- If InnoDB returns something like the following error: ``` ERROR 1016: Can't open file: 'x.ibd'. (errno: 1) ``` it may be that an orphan `.frm` file exists. Something like the following may also appear in the [error log](../error-log/index): ``` InnoDB: Cannot find table test/x from the internal data dictionary InnoDB: of InnoDB though the .frm file for the table exists. Maybe you InnoDB: have deleted and recreated InnoDB data files but have forgotten InnoDB: to delete the corresponding .frm files of InnoDB tables? ``` If this is the case, as the text describes, delete the orphan `.frm` file on the filesystem. Removing Orphan Intermediate Tables ----------------------------------- An orphan intermediate table may prevent you from dropping the tablespace even if it is otherwise empty, and generally takes up unnecessary space. It may come about if MariaDB exits in the middle of an [ALTER TABLE ... ALGORITHM=INPLACE](../alter-table/index#algorithm) operation. They will be listed in the [INFORMATION\_SCHEMA.INNODB\_SYS\_TABLES](../information-schema-innodb_sys_tables-table/index) table, and always start with an `#sql-ib` prefix. The accompanying `.frm` file also begins with `#sql-`, but has a different name. To identify orphan tables, run: ``` SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE '%#sql%'; ``` When [innodb\_file\_per\_table](../xtradbinnodb-server-system-variables/index#innodb_file_per_table) is set, the `#sql-*.ibd` file will also be visible in the database directory. To remove an orphan intermediate table: * Rename the `#sql-*.frm` file (in the database directory) to match the base name of the orphan intermediate table, for example: ``` mv #sql-36ab_2.frm #sql-ib87-856498050.frm ``` * Drop the table, for example: ``` DROP TABLE `#mysql50##sql-ib87-856498050`; ``` See Also -------- * [InnoDB Troubleshooting Overview](../innodb-troubleshooting-overview/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Using MariaDB Replication with MariaDB Galera Cluster Using MariaDB Replication with MariaDB Galera Cluster ====================================================== | Title | Description | | --- | --- | | [Using MariaDB Replication with MariaDB Galera Cluster](../using-mariadb-replication-with-mariadb-galera-cluster-using-mariadb-replica/index) | Information on using MariaDB replication with MariaDB Galera Cluster. | | [Using MariaDB GTIDs with MariaDB Galera Cluster](../using-mariadb-gtids-with-mariadb-galera-cluster/index) | Information on using MariaDB's GTIDs with MariaDB Galera Cluster. | | [Configuring MariaDB Replication between MariaDB Galera Cluster and MariaDB Server](../using-mariadb-replication-with-mariadb-galera-cluster-configuring-mariadb-r/index) | Information on configuring replication between MariaDB Galera Cluster and MariaDB Server. | | [Configuring MariaDB Replication between Two MariaDB Galera Clusters](../configuring-mariadb-replication-between-two-mariadb-galera-clusters/index) | Information on configuring replication between two MariaDB Galera Clusters. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW ENGINE INNODB STATUS SHOW ENGINE INNODB STATUS ========================= `SHOW ENGINE INNODB STATUS` is a specific form of the [SHOW ENGINE](../show-engine/index) statement that displays the [InnoDB Monitor](../innodb-monitors/index) output, which is extensive InnoDB information which can be useful in diagnosing problems. The following sections are displayed * **Status:** Shows the timestamp, monitor name and the number of seconds, or the elapsed time between the current time and the time the InnoDB Monitor output was last displayed. The per-second averages are based upon this time. * **BACKGROUND THREAD:** srv\_master\_thread lines show work performed by the main background thread. * **SEMAPHORES:** Threads waiting for a semaphore and stats on how the number of times threads have needed a spin or a wait on a mutex or rw-lock semaphore. If this number of threads is large, there may be I/O or contention issues. Reducing the size of the [innodb\_thread\_concurrency](../xtradbinnodb-server-system-variables/index#innodb_thread_concurrency) system variable may help if contention is related to thread scheduling. `Spin rounds per wait` shows the number of spinlock rounds per OS wait for a mutex. * **LATEST FOREIGN KEY ERROR:** Only shown if there has been a foreign key constraint error, it displays the failed statement and information about the constraint and the related tables. * **LATEST DETECTED DEADLOCK:** Only shown if there has been a deadlock, it displays the transactions involved in the deadlock and the statements being executed, held and required locked and the transaction rolled back to. * **TRANSACTIONS:** The output of this section can help identify lock contention, as well as reasons for the deadlocks. * **FILE I/O:** InnoDB thread information as well as pending I/O operations and I/O performance statistics. * **INSERT BUFFER AND ADAPTIVE HASH INDEX:** InnoDB insert buffer (old name for the [change buffer](../innodb-change-buffering/index)) and adaptive hash index status information, including the number of each type of operation performed, and adaptive hash index performance. * **LOG:** InnoDB log information, including current log sequence number, how far the log has been flushed to disk, the position at which InnoDB last took a checkpoint, pending writes and write performance statistics. * **BUFFER POOL AND MEMORY:** Information on buffer pool pages read and written, which allows you to see the number of data file I/O operations performed by your queries. See [InnoDB Buffer Pool](../innodb-buffer-pool/index) for more. Similar information is also available from the [INFORMATION\_SCHEMA.INNODB\_BUFFER\_POOL\_STATS](../information-schema-innodb_buffer_pool_stats-table/index) table. * **ROW OPERATIONS:**Information about the main thread, including the number and performance rate for each type of row operation. If the [innodb\_status\_output\_locks](../xtradbinnodb-server-system-variables/index#innodb_status_output_locks) system variable is set to `1`, extended lock information will be displayed. Example output: ``` ===================================== 2019-09-06 12:44:13 0x7f93cc236700 INNODB MONITOR OUTPUT ===================================== Per second averages calculated from the last 4 seconds ----------------- BACKGROUND THREAD ----------------- srv_master_thread loops: 2 srv_active, 0 srv_shutdown, 83698 srv_idle srv_master_thread log flush and writes: 83682 ---------- SEMAPHORES ---------- OS WAIT ARRAY INFO: reservation count 15 OS WAIT ARRAY INFO: signal count 8 RW-shared spins 0, rounds 20, OS waits 7 RW-excl spins 0, rounds 0, OS waits 0 RW-sx spins 0, rounds 0, OS waits 0 Spin rounds per wait: 20.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx ------------ TRANSACTIONS ------------ Trx id counter 236 Purge done for trx's n:o < 236 undo n:o < 0 state: running History list length 22 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION 421747401994584, not started 0 lock struct(s), heap size 1136, 0 row lock(s) ---TRANSACTION 421747401990328, not started 0 lock struct(s), heap size 1136, 0 row lock(s) -------- FILE I/O -------- I/O thread 0 state: waiting for completed aio requests (insert buffer thread) I/O thread 1 state: waiting for completed aio requests (log thread) I/O thread 2 state: waiting for completed aio requests (read thread) I/O thread 3 state: waiting for completed aio requests (read thread) I/O thread 4 state: waiting for completed aio requests (read thread) I/O thread 5 state: waiting for completed aio requests (read thread) I/O thread 6 state: waiting for completed aio requests (write thread) I/O thread 7 state: waiting for completed aio requests (write thread) I/O thread 8 state: waiting for completed aio requests (write thread) I/O thread 9 state: waiting for completed aio requests (write thread) Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] , ibuf aio reads:, log i/o's:, sync i/o's: Pending flushes (fsync) log: 0; buffer pool: 0 286 OS file reads, 171 OS file writes, 22 OS fsyncs 0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s ------------------------------------- INSERT BUFFER AND ADAPTIVE HASH INDEX ------------------------------------- Ibuf: size 1, free list len 0, seg size 2, 0 merges merged operations: insert 0, delete mark 0, delete 0 discarded operations: insert 0, delete mark 0, delete 0 Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) Hash table size 34679, node heap has 0 buffer(s) 0.00 hash searches/s, 0.00 non-hash searches/s --- LOG --- Log sequence number 445926 Log flushed up to 445926 Pages flushed up to 445926 Last checkpoint at 445917 0 pending log flushes, 0 pending chkp writes 18 log i/o's done, 0.00 log i/o's/second ---------------------- BUFFER POOL AND MEMORY ---------------------- Total large memory allocated 167772160 Dictionary memory allocated 50768 Buffer pool size 8012 Free buffers 7611 Database pages 401 Old database pages 0 Modified db pages 0 Percent of dirty pages(LRU & free pages): 0.000 Max dirty pages percent: 75.000 Pending reads 0 Pending writes: LRU 0, flush list 0, single page 0 Pages made young 0, not young 0 0.00 youngs/s, 0.00 non-youngs/s Pages read 264, created 137, written 156 0.00 reads/s, 0.00 creates/s, 0.00 writes/s No buffer pool page gets since the last printout Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s LRU len: 401, unzip_LRU len: 0 I/O sum[0]:cur[0], unzip sum[0]:cur[0] -------------- ROW OPERATIONS -------------- 0 queries inside InnoDB, 0 queries in queue 0 read views open inside InnoDB Process ID=4267, Main thread ID=140272021272320, state: sleeping Number of rows inserted 1, updated 0, deleted 0, read 1 0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s Number of system rows inserted 0, updated 0, deleted 0, read 0 0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s ---------------------------- END OF INNODB MONITOR OUTPUT ============================ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT DOS and FIX Table Types CONNECT DOS and FIX Table Types =============================== Overview -------- Tables of type DOS and FIX are based on text files (see [CONNECT Table Types - Data Files](../connect-table-types-data-files/index)). Within a record, column fields are positioned at a fixed offset from the beginning of the record. Except sometimes for the last field, column fields are also of fixed length. If the last field has varying length, the type of the table is DOS. For instance, having the file *dept.dat* formatted like: ``` 0318 KINGSTON 70012 SALES Bank/Insurance 0021 ARMONK 87777 CHQ Corporate headquarter 0319 HARRISON 40567 SALES Federal Administration 2452 POUGHKEEPSIE 31416 DEVELOPMENT Research & development ``` You can define a table based on it with: ``` create table department ( number char(4) not null, location char(15) not null flag=5, director char(5) not null flag=20, function char(12) not null flag=26, name char(22) not null flag=38) engine=CONNECT table_type=DOS file_name='dept.dat'; ``` Here the flag column option represents the offset of this column inside the records. If the offset of a column is not specified, it defaults to the end of the previous column and defaults to 0 for the first one. The *`lrecl`* parameter that represents the maximum size of a record is calculated by default as the end of the rightmost column and can be unspecified except when some trailing information exists after the rightmost column. **Note:** A special case is files having an encoding such as UTF-8 (for instance specifying `charset=UTF8`) in which some characters may be represented with several bytes. Unlike the type size that MariaDB interprets as a number of characters, the `lrecl` value is the record size in bytes and the flag value represents the offset of the field in the record in bytes. If the flag and/or the `lrecl` value are not specified, they will be calculated by the number of characters in the fields multiplied by a value that is the maximum size in bytes of a character for the corresponding charset. For UTF-8 this value is 3 which is often far too much as there are very few characters requiring 3 bytes to be represented. When creating a new file, you are on the safe side by only doubling the maximum number of characters of a field to calculate the offset of the next field. Of course, for already existing files, the offset must be specified according to what it is in it. Although the field representation is always text in the table file, you can freely choose the corresponding column type, characters, date, integer or floating point according to its contents. Sometimes, as in the *number* column of the above *department* table, you have the choice of the type, numeric or characters. This will modify how the column is internally handled — in characters `0021` is different from `21` but not in numeric — as well as how it is displayed. If the last field has fixed length, the table should be referred as having the type `FIX`. For instance, to create a table on the file *boys.txt*: ``` John Boston 25/01/1986 02/06/2010 Henry Boston 07/06/1987 01/04/2008 George San Jose 10/08/1981 02/06/2010 Sam Chicago 22/11/1979 10/10/2007 James Dallas 13/05/1992 14/12/2009 Bill Boston 11/09/1986 10/02/2008 ``` You can for instance use the command: ``` create table boys ( name char(12) not null, city char(12) not null, birth date not null date_format='DD/MM/YYYY', hired date not null date_format='DD/MM/YYYY' flag=36) engine=CONNECT table_type=FIX file_name='boys.txt' lrecl=48; ``` Here some *flag* options were not specified because the fields have no intermediate space between them except for the last column. The offsets are calculated by default adding the field length to the *offset* of the preceding field. However, for formatted date columns, the offset in the file depends on the format and cannot be calculated by default. For fixed files, the *lrecl* option is the physical length of the record including the line ending character(s). It is calculated by adding to the end of the last field 2 bytes under Windows (CRLF) or 1 byte under UNIX. If the file is imported from another operating system, the `ENDING` option will have to be specified with the proper value. For this table, the last offset and the record length must be specified anyway because the date columns have field length coming from their format that is not known by CONNECT. Do not forget to add the line ending length to the total length of the fields. This table is displayed as: | name | city | birth | hired | | --- | --- | --- | --- | | John | Boston | 1986-01-25 | 2010-06-02 | | Henry | Boston | 1987-06-07 | 2008-04-01 | | George | San Jose | 1981-08-10 | 2010-06-02 | | Sam | Chicago | 1979-11-22 | 2007-10-10 | | James | Dallas | 1992-05-13 | 2009-12-14 | | Bill | Boston | 1986-09-11 | 2008-02-10 | Whenever possible, the fixed format should be preferred to the varying one because it is much faster to deal with fixed tables than with variable tables. Sure enough, instead of being read or written record by record, FIX tables are processed by blocks of `BLOCK_SIZE` records, resulting in far less input/output operations to execute. The block size defaults to 100 if not specified in the Create Table statement. **Note 1:** It is not mandatory to declare in the table all the fields existing in the source file. However, if some fields are ignored, the *flag* option of the following field and/or the *lrecl* option will have to be specified. **Note 2:** Some files have an EOF marker (CTRL+Z 1A) that can prevent the table to be recognized as fixed because the file length is not a multiple of the fixed record size. To indicate this, use in the option list the create option EOF. For instance, if after creating the FIX table *xtab* on the file *foo.dat* that you know have fixed record size, you get, when you try to use it, a message such as: ``` File foo.dat is not fixed length, len=302587 lrecl=141 ``` After checking that the LRECL default or specified specification is correct, you can indicate to ignore that extra EOF character by: ``` alter table xtab option_list='eof=1'; ``` Of course, you can specify this option directly in the Create statement. All this applies to some other table types, in particular to BIN tables. **Note 3:** The width of the fields is the length specified in the column declaration. For instance for a column declared as: ``` number int(3) not null, ``` The field width in the file is 3 characters. This is the value used to calculate the offset of the next field if it is not specified. If this length is not specified, it defaults to the MySQL default type length. Specifying the Field Format --------------------------- Some files have specific format for their numeric fields. For instance, the decimal point is absent and/or the field should be filled with leading zeros. To deal with such files, as well in reading as in writing, the format can be specified in the `CREATE TABLE` column definition. The syntax of the field format specification is: ``` Field_format='[Z][N][d]' ``` The optional parts of the format are: | | | | --- | --- | | **Z** | The field has leading zeros | | **N** | No decimal point exist in the file | | ***d*** | The number of decimals, defaults to the column precision | Example ------- Let us see how it works in the following example. We define a table based on the file xfmt.txt having eight fields of 12 characters: ``` create table xfmt ( col1 double(12,3) not null, col2 double(12,3) not null field_format='4', col3 double(12,2) not null field_format='N3', col4 double(12,3) not null field_format='Z', col5 double(12,3) not null field_format='Z3', col6 double(12,5) not null field_format='ZN5', col7 int(12) not null field_format='N3', col8 smallint(12) not null field_format='N3') engine=CONNECT table_type=FIX file_name='xfmt.txt'; insert into xfmt values(4567.056,4567.056,4567.056,4567.056,-23456.8, 3.14159,4567,4567); select * from xfmt; ``` The first row is displayed as: | COL1 | COL2 | COL3 | COL4 | COL5 | COL6 | COL7 | COL8 | | --- | --- | --- | --- | --- | --- | --- | --- | | 4567.056 | 4567.056 | 4567.06 | 4567.056 | -23456.800 | 3.14159 | 4567 | 4567 | The number of decimals displayed for all float columns is the column precision, the second argument of the column type option. Of course, integer columns have no decimals, although their formats specify some. More interesting is the file layout. To see it let us define another table based on the same file but whose columns are all characters: ``` create table cfmt ( col1 char(12) not null, col2 char(12) not null, col3 char(12) not null, col4 char(12) not null, col5 char(12) not null, col6 char(12) not null, col7 char(12) not null, col8 char(12) not null) engine=CONNECT table_type=FIX file_name='xfmt.txt'; select * from cfmt; ``` The (transposed) display of the select command shows the file text layout for each field. Below a third column was added in this document to comment this result. | Column | Row 1 | Comment (all numeric fields are written right justified) | | --- | --- | --- | | **COL1** | `4567.056` | No format, the value was entered as is. | | **COL2** | `4567.0560` | The format ‘4’ forces to write 4 decimals. | | **COL3** | `4567060` | N3 → No decimal point. The last 3 digits are decimals. However, the second decimal was rounded because of the column precision. | | **COL4** | `00004567.056` | Z → Leading zeros, 3 decimals (the column precision) | | **COL5** | `-0023456.800` | Z3 → (Minus sign) leading zeros, 3 decimals. | | **COL6** | `000000314159` | ZN5 → Leading zeros, no decimal point, 5 decimals. | | **COL7** | `4567000` | N3 → No decimal point. The last 3 digits are decimals. | | **COL8** | `4567000` | Same. Any decimals would be ignored. | **Note:** For columns internally using double precision floating-point numbers, MariaDB limits the decimal precision of any calculation to the column precision. The declared column precision should be at least the number of decimals of the format to avoid a loss of decimals as it happened for `col3` of the above example. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Using StorageManager With IAM Role Using StorageManager With IAM Role ================================== AWS IAM Role Configuration -------------------------- We have added a new feature in Columnstore 5.5.2 that allows you to use AWS IAM roles in order to connect to S3 buckets without explicitly entering credentials into the **storagemanager.cnf** config file. You will need to modify the IAM role of your Amazon EC2 instance to allow for this. Please follow the AWS [documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) before beginning this process. It is important to note that you must update the AWS S3 endpoint based on your chosen region otherwise you might face delays in propagation as discussed [here](https://forums.aws.amazon.com/thread.jspa?messageID=552808) and [here](https://forums.aws.amazon.com/thread.jspa?messageID=801522). For a complete list of AWS service endpoints, please visit the AWS [reference guide](https://docs.aws.amazon.com/general/latest/gr/rande.html). ### Sample configuration Edit your **Storage Manager** configuration file located at */etc/columnstore/storagemanager.cnf* in order to look similar to the example below (replacing those in the [S3] section with your own custom variables): ``` [ObjectStorage] service = S3 object_size = 5M metadata_path = /var/lib/columnstore/storagemanager/metadata journal_path = /var/lib/columnstore/storagemanager/journal max_concurrent_downloads = 21 max_concurrent_uploads = 21 common_prefix_depth = 3 [S3] ec2_iam_mode=enabled bucket = my_mcs_bucket region = us-west-2 endpoint = s3.us-west-2.amazonaws.com [LocalStorage] path = /var/lib/columnstore/storagemanager/fake-cloud fake_latency = n max_latency = 50000 [Cache] cache_size = 2g path = /var/lib/columnstore/storagemanager/cache ``` ***Note**: This is an AWS only feature. For other deployment methods, see the example [here](../sample-storagemanagercnf/index).* Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Index Hints: How to Force Query Plans Index Hints: How to Force Query Plans ===================================== The optimizer is largely cost-based and will try to choose the optimal plan for any query. However in some cases it does not have enough information to choose a perfect plan and in these cases you may have to provide hints to force the optimizer to use another plan. You can examine the query plan for a [SELECT](../select/index) by writing [EXPLAIN](../explain/index) before the statement. [SHOW EXPLAIN](../show-explain/index) shows the output of a running query. In some cases, its output can be closer to reality than `EXPLAIN`. For the following queries, we will use the world database for the examples. Setting up the World Example Database ------------------------------------- Download it from <ftp://ftp.askmonty.org/public/world.sql.gz> Install it with: ``` mysqladmin create world zcat world.sql.gz | ../client/mysql world ``` or ``` mysqladmin create world gunzip world.sql.gz ../client/mysql world < world.sql ``` Forcing Join Order ------------------ You can force the join order by using [STRAIGHT\_JOIN](../join/index) either in the [SELECT](../select/index) or [JOIN](../join/index) part. The simplest way to force the join order is to put the tables in the correct order in the `FROM` clause and use `SELECT STRAIGHT_JOIN` like so: ``` SELECT STRAIGHT_JOIN SUM(City.Population) FROM Country,City WHERE City.CountryCode=Country.Code AND Country.HeadOfState="Volodymyr Zelenskyy"; ``` If you only want to force the join order for a few tables, use `STRAIGHT_JOIN` in the `FROM` clause. When this is done, only tables connected with `STRAIGHT_JOIN` will have their order forced. For example: ``` SELECT SUM(City.Population) FROM Country STRAIGHT_JOIN City WHERE City.CountryCode=Country.Code AND Country.HeadOfState="Volodymyr Zelenskyy"; ``` In both of the above cases `Country` will be scanned first and for each matching country (one in this case) all rows in `City` will be checked for a match. As there is only one matching country this will be faster than the original query. The output of [EXPLAIN](../explain/index) for the above cases is: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | Country | ALL | PRIMARY | NULL | NULL | NULL | 239 | Using where | | 1 | SIMPLE | City | ALL | NULL | NULL | NULL | NULL | 4079 | Using where; Using join buffer (flat, BNL join) | This is one of the few cases where `ALL` is ok, as the scan of the `Country` table will only find one matching row. Forcing Usage of a Specific Index for the WHERE Clause ------------------------------------------------------ In some cases the optimizer may choose a non-optimal index or it may choose to not use an index at all, even if some index could theoretically be used. In these cases you have the option to either tell the optimizer to only use a limited set of indexes, ignore one or more indexes, or force the usage of some particular index. ### USE INDEX: Use a Limited Set of Indexes You can limit which indexes are considered with the [USE INDEX](../use-index/index) option. ``` USE INDEX [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list]) ``` The default is '`FOR JOIN`', which means that the hint only affects how the `WHERE` clause is optimized. `USE INDEX` is used after the table name in the `FROM` clause. Example: ``` CREATE INDEX Name ON City (Name); CREATE INDEX CountryCode ON City (Countrycode); EXPLAIN SELECT Name FROM City USE INDEX (CountryCode) WHERE name="Helsingborg" AND countrycode="SWE"; ``` This produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | ref | CountryCode | CountryCode | 3 | const | 14 | Using where | If we had not used [USE INDEX](../use-index/index), the `Name` index would have been in `possible keys`. ### IGNORE INDEX: Don't Use a Particular Index You can tell the optimizer to not consider some particular index with the [IGNORE INDEX](../ignore-index/index) option. ``` IGNORE INDEX [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list]) ``` This is used after the table name in the `FROM` clause: ``` CREATE INDEX Name ON City (Name); CREATE INDEX CountryCode ON City (Countrycode); EXPLAIN SELECT Name FROM City IGNORE INDEX (Name) WHERE name="Helsingborg" AND countrycode="SWE"; ``` This produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | ref | CountryCode | CountryCode | 3 | const | 14 | Using where | The benefit of using `IGNORE_INDEX` instead of `USE_INDEX` is that it will not disable a new index which you may add later. Also see [Ignored Indexes](../ignored-indexes/index) for an option to specify in the index definition that indexes should be ignored. ### FORCE INDEX: Forcing an Index [Forcing an index](../force-index/index) to be used is mostly useful when the optimizer decides to do a table scan even if you know that using an index would be better. (The optimizer could decide to do a table scan even if there is an available index when it believes that most or all rows will match and it can avoid the overhead of using the index). ``` CREATE INDEX Name ON City (Name); EXPLAIN SELECT Name,CountryCode FROM City FORCE INDEX (Name) WHERE name>="A" and CountryCode >="A"; ``` This produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | range | Name | Name | 35 | NULL | 4079 | Using where | `FORCE_INDEX` works by only considering the given indexes (like with `USE_INDEX`) but in addition it tells the optimizer to regard a table scan as something very expensive. However if none of the 'forced' indexes can be used, then a table scan will be used anyway. ### Index Prefixes When using index hints (USE, FORCE or [IGNORE INDEX](../ignore-index/index)), the index name value can also be an unambiguous prefix of an index name. Forcing an Index to be Used for ORDER BY or GROUP BY ---------------------------------------------------- The optimizer will try to use indexes to resolve [ORDER BY](../order-by/index) and [GROUP BY](../group-by/index). You can use [USE INDEX](../use-index/index), [IGNORE INDEX](../ignore-index/index) and [FORCE INDEX](../force-index/index) as in the `WHERE` clause above to ensure that some specific index used: ``` USE INDEX [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list]) ``` This is used after the table name in the `FROM` clause. Example: ``` CREATE INDEX Name ON City (Name); EXPLAIN SELECT Name,Count(*) FROM City FORCE INDEX FOR GROUP BY (Name) WHERE population >= 10000000 GROUP BY Name; ``` This produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | index | NULL | Name | 35 | NULL | 4079 | Using where | Without the [FORCE INDEX](../force-index/index) option we would have '`Using where; Using temporary; Using filesort`' in the 'Extra' column, which means that the optimizer would created a temporary table and sort it. ### Help the Optimizer Optimize GROUP BY and ORDER BY The optimizer uses several strategies to optimize [GROUP BY](../group-by/index) and [ORDER BY](../order-by/index): * Resolve with an index: + Scan the table in index order and output data as we go. (This only works if the [ORDER BY](../order-by/index) / [GROUP BY](../group-by/index) can be resolved by an index after constant propagation is done). * Filesort: + Scan the table to be sorted and collect the sort keys in a temporary file. + Sort the keys + reference to row (with filesort) + Scan the table in sorted order * Use a temporary table for [ORDER BY](../order-by/index): + Create a temporary (in memory) table for the 'to-be-sorted' data. (If this gets bigger than `max_heap_table_size` or contains blobs then an [Aria](../aria/index) or [MyISAM](../myisam/index) disk based table will be used) + Sort the keys + reference to row (with filesort) + Scan the table in sorted order A temporary table will always be used if the fields which will be sorted are not from the first table in the [JOIN](../join/index) order. * Use a temporary table for [GROUP BY](../group-by/index): + Create a temporary table to hold the [GROUP BY](../group-by/index) result with an index that matches the [GROUP BY](../group-by/index) fields. + Produce a result row + If a row with the [GROUP BY](../group-by/index) key exists in the temporary table, add the new result row to it. If not, create a new row. + Before sending the results to the user, sort the rows with filesort to get the results in the [GROUP BY](../group-by/index) order. ### Forcing/Disallowing TemporaryTables to be Used for GROUP BY: Using an in-memory table (as described above) is usually the fastest option for [GROUP BY](../group-by/index) if the result set is small. It is not optimal if the result set is very big. You can tell the optimizer this by using `SELECT SQL_SMALL_RESULT` or `SELECT SQL_BIG_RESULT`. For example: ``` EXPLAIN SELECT SQL_SMALL_RESULT Name,Count(*) AS Cities FROM City GROUP BY Name HAVING Cities > 2; ``` produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | ALL | NULL | NULL | NULL | NULL | 4079 | Using temporary; Using filesort | while: ``` EXPLAIN SELECT SQL_BIG_RESULT Name,Count(*) AS Cities FROM City GROUP BY Name HAVING Cities > 2; ``` produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | ALL | NULL | NULL | NULL | NULL | 4079 | Using filesort | The difference is that with `SQL_SMALL_RESULT` a temporary table is used. Forcing Usage of Temporary Tables --------------------------------- In some cases you may want to force the use of a temporary table for the result to free up the table/row locks for the used tables as quickly as possible. You can do this with the `SQL_BUFFER_RESULT` option: ``` CREATE INDEX Name ON City (Name); EXPLAIN SELECT SQL_BUFFER_RESULT Name,Count(*) AS Cities FROM City GROUP BY Name HAVING Cities > 2; ``` This produces: | id | select\_type | table | type | possible\_keys | key | key\_len | ref | rows | Extra | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 1 | SIMPLE | City | index | NULL | Name | 35 | NULL | 4079 | Using index; Using temporary | Without `SQL_BUFFER_RESULT`, the above query would not use a temporary table for the result set. Optimizer Switch ---------------- In [MariaDB 5.3](../what-is-mariadb-53/index) we added an [optimizer switch](../server-system-variables/index#optimizer_switch) which allows you to specify which algorithms will be considered when optimizing a query. See the [optimizer](../optimizer/index) section for more information about the different algorithms which are used. See Also -------- * [FORCE INDEX](../force-index/index) * [USE INDEX](../use-index/index) * [IGNORE INDEX](../ignore-index/index) * [GROUP BY](../group-by/index) * [Ignored Indexes](../ignored-indexes/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb FOR UPDATE FOR UPDATE ========== InnoDB supports row-level locking. Selected rows can be locked using [LOCK IN SHARE MODE](../lock-in-share-mode/index) or FOR UPDATE. In both cases, a lock is acquired on the rows read by the query, and it will be released when the current transaction is committed. The `FOR UPDATE` clause of [SELECT](../select/index) applies only when [autocommit](../server-system-variables/index#autocommit) is set to 0 or the `SELECT` is enclosed in a transaction. A lock is acquired on the rows, and other transactions are prevented from writing the rows, acquire locks, and from reading them (unless their isolation level is `[READ UNCOMMITTED](../set-transaction-isolation-level/index#read-uncommitted)`). If `autocommit` is set to 1, the [LOCK IN SHARE MODE](../lock-in-share-mode/index) and `FOR UPDATE` clauses have no effect. If the isolation level is set to [SERIALIZABLE](../set-transaction-isolation-level/index#serializable), all plain `SELECT` statements are converted to `SELECT ... LOCK IN SHARE MODE`. Example ------- ``` SELECT * FROM trans WHERE period=2001 FOR UPDATE; ``` See Also -------- * [SELECT](../select/index) * [LOCK IN SHARE MODE](../lock-in-share-mode/index) * [InnoDB Lock Modes](../innodb-lock-modes/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MPointFromWKB MPointFromWKB ============= Syntax ------ ``` MPointFromWKB(wkb[,srid]) MultiPointFromWKB(wkb[,srid]) ``` Description ----------- Constructs a [MULTIPOINT](../multipoint/index) value using its [WKB](../well-known-binary-wkb-format/index) representation and [SRID](../srid/index). `MPointFromWKB()` and `MultiPointFromWKB()` are synonyms. Examples -------- ``` SET @g = ST_AsBinary(MPointFromText('MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9, 4 9, 1 5 )')); SELECT ST_AsText(MPointFromWKB(@g)); +-----------------------------------------------------+ | ST_AsText(MPointFromWKB(@g)) | +-----------------------------------------------------+ | MULTIPOINT(1 1,2 2,5 3,7 2,9 3,8 4,6 6,6 9,4 9,1 5) | +-----------------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW USER_STATISTICS SHOW USER\_STATISTICS ===================== Syntax ------ ``` SHOW USER_STATISTICS ``` Description ----------- The `SHOW USER_STATISTICS` statement is part of the [User Statistics](../user-statistics/index) feature. It was removed as a separate statement in [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/), but effectively replaced by the generic [SHOW information\_schema\_table](../information-schema-plugins-show-and-flush-statements/index) statement. The [information\_schema.USER\_STATISTICS](../information-schema-user_statistics-table/index) table holds statistics about user activity. You can use this table to find out such things as which user is causing the most load and which users are being abusive. You can also use this table to measure how close to capacity the server may be. The [userstat](../server-system-variables/index#userstat) system variable must be set to 1 to activate this feature. See the [User Statistics](../user-statistics/index) and [information\_schema.USER\_STATISTICS](../information-schema-user_statistics-table/index) table for more information. Example ------- ``` SHOW USER_STATISTICS\G *************************** 1. row *************************** User: root Total_connections: 1 Concurrent_connections: 0 Connected_time: 3297 Busy_time: 0.14113400000000006 Cpu_time: 0.017637000000000003 Bytes_received: 969 Bytes_sent: 22355 Binlog_bytes_written: 0 Rows_read: 10 Rows_sent: 67 Rows_deleted: 0 Rows_inserted: 0 Rows_updated: 0 Select_commands: 7 Update_commands: 0 Other_commands: 0 Commit_transactions: 1 Rollback_transactions: 0 Denied_connections: 0 Lost_connections: 0 Access_denied: 0 Empty_queries: 7 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW CREATE PACKAGE BODY SHOW CREATE PACKAGE BODY ======================== **MariaDB starting with [10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/)**Oracle-style packages were introduced in [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/). Syntax ------ ``` SHOW CREATE PACKAGE BODY [ db_name . ] package_name ``` Description ----------- The `SHOW CREATE PACKAGE BODY` statement can be used when [Oracle SQL\_MODE](../sql_modeoracle-from-mariadb-103/index) is set. Shows the `CREATE` statement that creates the given package body (i.e. the implementation). Examples -------- ``` SHOW CREATE PACKAGE BODY employee_tools\G *************************** 1. row *************************** Package body: employee_tools sql_mode: PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER Create Package Body: CREATE DEFINER="root"@"localhost" PACKAGE BODY "employee_tools" AS stdRaiseAmount DECIMAL(10,2):=500; PROCEDURE log (eid INT, ecmnt TEXT) AS BEGIN INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt); END; PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS eid INT; BEGIN INSERT INTO employee (name, salary) VALUES (ename, esalary); eid:= last_insert_id(); log(eid, 'hire ' || ename); END; FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS nSalary DECIMAL(10,2); BEGIN SELECT salary INTO nSalary FROM employee WHERE id=eid; log(eid, 'getSalary id=' || eid || ' salary=' || nSalary); RETURN nSalary; END; PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS BEGIN UPDATE employee SET salary=salary+amount WHERE id=eid; log(eid, 'raiseSalary id=' || eid || ' amount=' || amount); END; PROCEDURE raiseSalaryStd(eid INT) AS BEGIN raiseSalary(eid, stdRaiseAmount); log(eid, 'raiseSalaryStd id=' || eid); END; BEGIN log(0, 'Session ' || connection_id() || ' ' || current_user || ' started'); END character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci ``` See Also -------- * [CREATE PACKAGE](../create-package/index) * [SHOW CREATE PACKAGE](../show-create-package/index) * [DROP PACKAGE](../drop-package/index) * [CREATE PACKAGE BODY](../create-package-body/index) * [DROP PACKAGE BODY](../drop-package-body/index) * [Oracle SQL\_MODE](../sql_modeoracle-from-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Differences in MariaDB in Debian (and Ubuntu) Differences in MariaDB in Debian (and Ubuntu) ============================================= The `[.deb](../installing-mariadb-deb-files/index)` packages provided by MariaDB Foundation's and MariaDB Corporation's repositories are not identical to the official `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. The packages provided by MariaDB Foundation's and MariaDB Corporation's repositories are generated using the Debian packaging in MariaDB's official [source code](../getting-the-mariadb-source-code/index). The Debian packaging scripts are specifically in the `debian/` directory. The packages provided by Debian's and Ubuntu's default repositories are generated using the Debian packaging in Debian's mirror of MariaDB's source code, which contains some custom changes. The source tree can be found here: * <https://anonscm.debian.org/cgit/pkg-mysql/mariadb-10.1.git/tree/debian> As a consequence, MariaDB behaves a bit differently if it is installed from Debian's and Ubuntu's default repositories. Option File Locations --------------------- * The [option file](../configuring-mariadb-with-option-files/index) located at `/etc/mysql/my.cnf` is handled by the `[update-alternatives](http://manpages.ubuntu.com/manpages/trusty/en/man8/update-alternatives.8.html)` mechanism when the `mysql-common` package is installed. It is a symbolic link that references either `mysql.cnf` or `mariadb.cnf` depending on whether MySQL or MariaDB is installed. Most of the MariaDB [option files](../configuring-mariadb-with-option-files/index) are therefore actually located in `/etc/mysql/mariadb.d/`. System Variables ---------------- | Variable | MariaDB in Debian | Standard MariaDB | Notes | | --- | --- | --- | --- | | [character\_set\_server](../server-system-variables/index#character_set_server) | utf8mb4 | latin1 | Debian sets a default character set that can support emojis etc. | | [collation\_server](../server-system-variables/index#collation_server) | utf8mb4\_general\_ci | latin1\_swedish\_ci | | Options ------- | Option | MariaDB in Debian | Standard MariaDB | Notes | | --- | --- | --- | --- | | `[plugin-load-add](../mysqld-options/index#-plugin-load-add)` | `auth_socket.so` | - | Before [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/), MariaDB did not enable the `[unix\_socket](../authentication-plugin-unix-socket/index)` authentication plugin by default.This is default in Debian, allowing passwordless login. | TLS --- * MariaDB binaries from `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories are linked with a different TLS library than MariaDB binaries from `[.deb](../installing-mariadb-deb-files/index)` packages provided by MariaDB Foundation's and MariaDB Corporation's repositories. * MariaDB Server binaries: + In [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/) and later, MariaDB Server is statically linked with the bundled [wolfSSL](https://www.wolfssl.com/products/wolfssl/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. + In [MariaDB 10.4.5](https://mariadb.com/kb/en/mariadb-1045-release-notes/) and before, MariaDB Server is statically linked with the bundled [yaSSL](https://www.wolfssl.com/products/yassl/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. + In contrast, MariaDB Server is dynamically linked with the system's [OpenSSL](https://www.openssl.org/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by MariaDB Foundation and MariaDB Corporation. * MariaDB [client and utility](../clients-utilities/index) binaries: + In [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/) and later, MariaDB's [clients and utilities](../clients-utilities/index) and [MariaDB Connector/C](../mariadb-connector-c/index) are dynamically linked with the system's [GnuTLS](https://www.gnutls.org/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. [libmysqlclient](https://dev.mysql.com/doc/refman/5.5/en/c-api.html) is still statically linked with the bundled [wolfSSL](https://www.wolfssl.com/products/wolfssl/) libraries. + In [MariaDB 10.2](../what-is-mariadb-102/index) and later, MariaDB's [clients and utilities](../clients-utilities/index) and [MariaDB Connector/C](../mariadb-connector-c/index) are dynamically linked with the system's [GnuTLS](https://www.gnutls.org/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. [libmysqlclient](https://dev.mysql.com/doc/refman/5.5/en/c-api.html) is still statically linked with the bundled [yaSSL](https://www.wolfssl.com/products/yassl/) libraries. + In [MariaDB 10.1](../what-is-mariadb-101/index) and earlier, MariaDB's [clients and utilities](../clients-utilities/index) and [libmysqlclient](https://dev.mysql.com/doc/refman/5.5/en/c-api.html) are statically linked with the bundled [yaSSL](https://www.wolfssl.com/products/yassl/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's and Ubuntu's default repositories. + In contrast, MariaDB's [clients and utilities](../clients-utilities/index), [libmysqlclient](https://dev.mysql.com/doc/refman/5.5/en/c-api.html), and [MariaDB Connector/C](../mariadb-connector-c/index) are dynamically linked with the system's [OpenSSL](https://www.openssl.org/) libraries in `[.deb](../installing-mariadb-deb-files/index)` packages provided by MariaDB Foundation's and MariaDB Corporation's repositories. * See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. Authentication -------------- * The `[unix\_socket](../authentication-plugin-unix-socket/index)` authentication plugin is installed by default in **new installations** that use the `[.deb](../installing-mariadb-deb-files/index)` packages provided by Debian's default repositories in Debian 9 and later and Ubuntu's default repositories in Ubuntu 15.10 and later. * The `root@localhost` created by `[mysql\_install\_db](../mysql_install_db/index)` will also be created to authenticate via the `[unix\_socket](../authentication-plugin-unix-socket/index)` authentication plugin in these builds. See Also -------- * [Moving from MySQL to MariaDB in Debian 9](../moving-from-mysql-to-mariadb-in-debian-9/index) More Information ---------------- For details, check out the Debian and Ubuntu official repositories: * <https://packages.debian.org/search?keywords=mariadb-server&searchon=names&suite=all&section=all> * <http://packages.ubuntu.com/search?keywords=mariadb-server&searchon=names&suite=all&section=all> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LONG and LONG VARCHAR LONG and LONG VARCHAR ===================== `LONG` and `LONG VARCHAR` are synonyms for [MEDIUMTEXT](../mediumtext/index). ``` CREATE TABLE t1 (a LONG, b LONG VARCHAR); DESC t1; +-------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+------------+------+-----+---------+-------+ | a | mediumtext | YES | | NULL | | | b | mediumtext | YES | | NULL | | +-------+------------+------+-----+---------+-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW WSREP_MEMBERSHIP SHOW WSREP\_MEMBERSHIP ====================== `SHOW WSREP_MEMBERSHIP` is part of the `[WSREP\_INFO](../wsrep_info-plugin/index)` plugin. Syntax ------ ``` SHOW WSREP_MEMBERSHIP ``` Description ----------- The `SHOW WSREP_MEMBERSHIP` statement returns [Galera](../galera/index) node cluster membership information. It returns the same information as found in the `[information\_schema.WSREP\_MEMBERSHIP](../information-schema-wsrep_membership-table/index)` table. Only users with the `[SUPER](../grant/index)` privilege can access this information. Examples -------- ``` SHOW WSREP_MEMBERSHIP; +-------+--------------------------------------+----------+-----------------+ | Index | Uuid | Name | Address | +-------+--------------------------------------+----------+-----------------+ | 0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 | | 1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 | | 2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 | +-------+--------------------------------------+----------+-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ALTER USER ALTER USER ========== **MariaDB starting with [10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/)**The ALTER USER statement was introduced in [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/). Syntax ------ ``` ALTER USER [IF EXISTS] user_specification [,user_specification] ... [REQUIRE {NONE | tls_option [[AND] tls_option] ...}] [WITH resource_option [resource_option] ...] [lock_option] [password_option] user_specification: username [authentication_option] authentication_option: IDENTIFIED BY 'password' | IDENTIFIED BY PASSWORD 'password_hash' | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule] ... authentication_rule: authentication_plugin | authentication_plugin {USING|AS} 'authentication_string' | authentication_plugin {USING|AS} PASSWORD('password') tls_option SSL | X509 | CIPHER 'cipher' | ISSUER 'issuer' | SUBJECT 'subject' resource_option MAX_QUERIES_PER_HOUR count | MAX_UPDATES_PER_HOUR count | MAX_CONNECTIONS_PER_HOUR count | MAX_USER_CONNECTIONS count | MAX_STATEMENT_TIME time password_option: PASSWORD EXPIRE | PASSWORD EXPIRE DEFAULT | PASSWORD EXPIRE NEVER | PASSWORD EXPIRE INTERVAL N DAY lock_option: ACCOUNT LOCK | ACCOUNT UNLOCK } ``` Description ----------- The `ALTER USER` statement modifies existing MariaDB accounts. To use it, you must have the global [CREATE USER](../grant/index#global-privileges) privilege or the [UPDATE](../grant/index#table-privileges) privilege for the [mysql](../the-mysql-database-tables/index) database. The global [SUPER](../grant/index#global-privileges) privilege is also required if the [read\_only](../server-system-variables/index#read_only) system variable is enabled. If any of the specified user accounts do not yet exist, an error results. If an error occurs, `ALTER USER` will still modify the accounts that do not result in an error. Only one error is produced for all users which have not been modified. IF EXISTS --------- When the `IF EXISTS` clause is used, MariaDB will return a warning instead of an error for each specified user that does not exist. Account Names ------------- For `ALTER USER` statements, account names are specified as the `username` argument in the same way as they are for [CREATE USER](../create-user/index) statements. See [account names](../create-user/index#account-names) from the `CREATE USER` page for details on how account names are specified. [CURRENT\_USER](../current_user/index) or `CURRENT_USER()` can also be used to alter the account logged into the current session. For example, to change the current user's password to `mariadb`: ``` ALTER USER CURRENT_USER() IDENTIFIED BY 'mariadb'; ``` Authentication Options ---------------------- **MariaDB starting with [10.4](../what-is-mariadb-104/index)**From [MariaDB 10.4](../what-is-mariadb-104/index), it is possible to use more than one authentication plugin for each user account. For example, this can be useful to slowly migrate users to the more secure ed25519 authentication plugin over time, while allowing the old mysql\_native\_password authentication plugin as an alternative for the transitional period. See [Authentication from MariaDB 10.4](../authentication-from-mariadb-104/index) for more. When running `ALTER USER`, not specifying an authentication option in the IDENTIFIED VIA clause will remove that authentication method. (However this was not the case before [MariaDB 10.4.13](https://mariadb.com/kb/en/mariadb-10413-release-notes/), see [MDEV-21928](https://jira.mariadb.org/browse/MDEV-21928)) For example, a user is created with the ability to authenticate via both a password and unix\_socket: ``` CREATE USER 'bob'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('pwd') OR unix_socket; SHOW CREATE USER 'bob'@'localhost'\G *************************** 1. row *************************** CREATE USER for bob@localhost: CREATE USER `bob`@`localhost` IDENTIFIED VIA mysql_native_password USING '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD' OR unix_socket ``` If the user's password is updated, but unix\_socket authentication is not specified in the `IDENTIFIED VIA` clause, unix\_socket authentication will no longer be permitted. ``` ALTER USER 'bob'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('pwd2'); SHOW CREATE USER 'bob'@'localhost'\G *************************** 1. row *************************** CREATE USER for bob@localhost: CREATE USER `bob`@`localhost` IDENTIFIED BY PASSWORD '*38366FDA01695B6A5A9DD4E428D9FB8F7EB75512' ``` ### IDENTIFIED BY 'password' The optional `IDENTIFIED BY` clause can be used to provide an account with a password. The password should be specified in plain text. It will be hashed by the [PASSWORD](../password/index) function prior to being stored to the [mysql.user](../mysqluser-table/index) table. For example, if our password is `mariadb`, then we can set the account's password with: ``` ALTER USER foo2@test IDENTIFIED BY 'mariadb'; ``` If you do not specify a password with the `IDENTIFIED BY` clause, the user will be able to connect without a password. A blank password is not a wildcard to match any password. The user must connect without providing a password if no password is set. The only [authentication plugins](../authentication-plugins/index) that this clause supports are [mysql\_native\_password](../authentication-plugin-mysql_native_password/index) and [mysql\_old\_password](../authentication-plugin-mysql_old_password/index). ### IDENTIFIED BY PASSWORD 'password\_hash' The optional `IDENTIFIED BY PASSWORD` clause can be used to provide an account with a password that has already been hashed. The password should be specified as a hash that was provided by the [PASSWORD](../password/index)#function. It will be stored to the [mysql.user](../mysqluser-table/index) table as-is. For example, if our password is `mariadb`, then we can find the hash with: ``` SELECT PASSWORD('mariadb'); +-------------------------------------------+ | PASSWORD('mariadb') | +-------------------------------------------+ | *54958E764CE10E50764C2EECBB71D01F08549980 | +-------------------------------------------+ ``` And then we can set an account's password with the hash: ``` ALTER USER foo2@test IDENTIFIED BY PASSWORD '*54958E764CE10E50764C2EECBB71D01F08549980'; ``` If you do not specify a password with the `IDENTIFIED BY` clause, the user will be able to connect without a password. A blank password is not a wildcard to match any password. The user must connect without providing a password if no password is set. The only [authentication plugins](../authentication-plugins/index) that this clause supports are [mysql\_native\_password](../authentication-plugin-mysql_native_password/index) and [mysql\_old\_password](../authentication-plugin-mysql_old_password/index). ### IDENTIFIED {VIA|WITH} authentication\_plugin The optional `IDENTIFIED VIA authentication_plugin` allows you to specify that the account should be authenticated by a specific [authentication plugin](../authentication-plugins/index). The plugin name must be an active authentication plugin as per [SHOW PLUGINS](../show-plugins/index). If it doesn't show up in that output, then you will need to install it with [INSTALL PLUGIN](../install-plugin/index) or [INSTALL SONAME](../install-soname/index). For example, this could be used with the [PAM authentication plugin](../authentication-plugin-pam/index): ``` ALTER USER foo2@test IDENTIFIED VIA pam; ``` Some authentication plugins allow additional arguments to be specified after a `USING` or `AS` keyword. For example, the [PAM authentication plugin](../authentication-plugin-pam/index) accepts a [service name](../authentication-plugin-pam/index#configuring-the-pam-service): ``` ALTER USER foo2@test IDENTIFIED VIA pam USING 'mariadb'; ``` The exact meaning of the additional argument would depend on the specific authentication plugin. In [MariaDB 10.4](../what-is-mariadb-104/index) and later, the `USING` or `AS` keyword can also be used to provide a plain-text password to a plugin if it's provided as an argument to the [PASSWORD()](../password/index) function. This is only valid for [authentication plugins](../authentication-plugins/index) that have implemented a hook for the [PASSWORD()](../password/index) function. For example, the [ed25519](../authentication-plugin-ed25519/index) authentication plugin supports this: ``` ALTER USER safe@'%' IDENTIFIED VIA ed25519 USING PASSWORD('secret'); ``` TLS Options ----------- By default, MariaDB transmits data between the server and clients without encrypting it. This is generally acceptable when the server and client run on the same host or in networks where security is guaranteed through other means. However, in cases where the server and client exist on separate networks or they are in a high-risk network, the lack of encryption does introduce security concerns as a malicious actor could potentially eavesdrop on the traffic as it is sent over the network between them. To mitigate this concern, MariaDB allows you to encrypt data in transit between the server and clients using the Transport Layer Security (TLS) protocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly speaking the SSL protocol is a predecessor to TLS and, that version of the protocol is now considered insecure. The documentation still uses the term SSL often and for compatibility reasons TLS-related server system and status variables still use the prefix ssl\_, but internally, MariaDB only supports its secure successors. See [Secure Connections Overview](../secure-connections-overview/index) for more information about how to determine whether your MariaDB server has TLS support. You can set certain TLS-related restrictions for specific user accounts. For instance, you might use this with user accounts that require access to sensitive data while sending it across networks that you do not control. These restrictions can be enabled for a user account with the [CREATE USER](../create-user/index), [ALTER USER](index), or [GRANT](../grant/index) statements. The following options are available: | Option | Description | | --- | --- | | `REQUIRE NONE` | TLS is not required for this account, but can still be used. | | `REQUIRE SSL` | The account must use TLS, but no valid X509 certificate is required. This option cannot be combined with other TLS options. | | `REQUIRE X509` | The account must use TLS and must have a valid X509 certificate. This option implies `REQUIRE SSL`. This option cannot be combined with other TLS options. | | `REQUIRE ISSUER 'issuer'` | The account must use TLS and must have a valid X509 certificate. Also, the Certificate Authority must be the one specified via the string `issuer`. This option implies `REQUIRE X509`. This option can be combined with the `SUBJECT`, and `CIPHER` options in any order. | | `REQUIRE SUBJECT 'subject'` | The account must use TLS and must have a valid X509 certificate. Also, the certificate's Subject must be the one specified via the string `subject`. This option implies `REQUIRE X509`. This option can be combined with the `ISSUER`, and `CIPHER` options in any order. | | `REQUIRE CIPHER 'cipher'` | The account must use TLS, but no valid X509 certificate is required. Also, the encryption used for the connection must use a specific cipher method specified in the string `cipher`. This option implies `REQUIRE SSL`. This option can be combined with the `ISSUER`, and `SUBJECT` options in any order. | The `REQUIRE` keyword must be used only once for all specified options, and the `AND` keyword can be used to separate individual options, but it is not required. For example, you can alter a user account to require these TLS options with the following: ``` ALTER USER 'alice'@'%' REQUIRE SUBJECT '/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland' AND ISSUER '/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter Parker/[email protected]' AND CIPHER 'SHA-DES-CBC3-EDH-RSA'; ``` If any of these options are set for a specific user account, then any client who tries to connect with that user account will have to be configured to connect with TLS. See [Securing Connections for Client and Server](../securing-connections-for-client-and-server/index) for information on how to enable TLS on the client and server. Resource Limit Options ---------------------- **MariaDB starting with [10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/)**[MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) introduced a number of resource limit options. It is possible to set per-account limits for certain server resources. The following table shows the values that can be set per account: | Limit Type | Description | | --- | --- | | `MAX_QUERIES_PER_HOUR` | Number of statements that the account can issue per hour (including updates) | | `MAX_UPDATES_PER_HOUR` | Number of updates (not queries) that the account can issue per hour | | `MAX_CONNECTIONS_PER_HOUR` | Number of connections that the account can start per hour | | `MAX_USER_CONNECTIONS` | Number of simultaneous connections that can be accepted from the same account; if it is 0, `max_connections` will be used instead; if `max_connections` is 0, there is no limit for this account's simultaneous connections. | | `MAX_STATEMENT_TIME` | Timeout, in seconds, for statements executed by the user. See also [Aborting Statements that Exceed a Certain Time to Execute](../aborting-statements/index). | If any of these limits are set to `0`, then there is no limit for that resource for that user. Here is an example showing how to set an account's resource limits: ``` ALTER USER 'someone'@'localhost' WITH MAX_USER_CONNECTIONS 10 MAX_QUERIES_PER_HOUR 200; ``` The resources are tracked per account, which means `'user'@'server'`; not per user name or per connection. The count can be reset for all users using [FLUSH USER\_RESOURCES](../flush/index), [FLUSH PRIVILEGES](../flush/index) or [mysqladmin reload](../mysqladmin/index). Per account resource limits are stored in the [user](../mysqluser-table/index) table, in the [mysql](../the-mysql-database-tables/index) database. Columns used for resources limits are named `max_questions`, `max_updates`, `max_connections` (for `MAX_CONNECTIONS_PER_HOUR`), and `max_user_connections` (for `MAX_USER_CONNECTIONS`). Password Expiry --------------- **MariaDB starting with [10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)**Besides automatic password expiry, as determined by [default\_password\_lifetime](../server-system-variables/index#default_password_lifetime), password expiry times can be set on an individual user basis, overriding the global setting, for example: ``` ALTER USER 'monty'@'localhost' PASSWORD EXPIRE INTERVAL 120 DAY; ALTER USER 'monty'@'localhost' PASSWORD EXPIRE NEVER; ALTER USER 'monty'@'localhost' PASSWORD EXPIRE DEFAULT; ``` See [User Password Expiry](../user-password-expiry/index) for more details. Account Locking --------------- **MariaDB starting with [10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)**Account locking permits privileged administrators to lock/unlock user accounts. No new client connections will be permitted if an account is locked (existing connections are not affected). For example: ``` ALTER USER 'marijn'@'localhost' ACCOUNT LOCK; ``` See [Account Locking](../account-locking/index) for more details. From [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/) and [MariaDB 10.5.8](https://mariadb.com/kb/en/mariadb-1058-release-notes/), the *lock\_option* and *password\_option* clauses can occur in either order. See Also -------- * [Authentication from MariaDB 10.4](../authentication-from-mariadb-104/index) * [GRANT](../grant/index) * [CREATE USER](../create-user/index) * [DROP USER](../drop-user/index) * [SET PASSWORD](../set-password/index) * [SHOW CREATE USER](../show-create-user/index) * [mysql.user table](../mysqluser-table/index) * [Password Validation Plugins](../password-validation-plugins/index) - permits the setting of basic criteria for passwords * [Authentication Plugins](../authentication-plugins/index) - allow various authentication methods to be used, and new ones to be developed. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ROLLBACK ROLLBACK ======== The `ROLLBACK` statement rolls back (ends) a transaction, destroying any changes to SQL-data so that they never become visible to subsequent transactions. The required syntax for the `ROLLBACK` statement is as follows. ``` ROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] [ TO [ SAVEPOINT ] {<savepoint name> | <simple target specification>} ] ``` The `ROLLBACK` statement will either end a transaction, destroying all data changes that happened during any of the transaction, or it will just destroy any data changes that happened since you established a savepoint. The basic form of the `ROLLBACK` statement is just the keyword `ROLLBACK` (the keyword `WORK` is simply noise and can be omitted without changing the effect). The optional `AND CHAIN` clause is a convenience for initiating a new transaction as soon as the old transaction terminates. If `AND CHAIN` is specified, then there is effectively nothing between the old and new transactions, although they remain separate. The characteristics of the new transaction will be the same as the characteristics of the old one — that is, the new transaction will have the same access mode, isolation level and diagnostics area size (we'll discuss all of these shortly) as the transaction just terminated. The `AND NO CHAIN` option just tells your DBMS to end the transaction — that is, these four SQL statements are equivalent: ``` ROLLBACK; ROLLBACK WORK; ROLLBACK AND NO CHAIN; ROLLBACK WORK AND NO CHAIN; ``` All of them end a transaction without saving any transaction characteristics. The only other options, the equivalent statements: ``` ROLLBACK AND CHAIN; ROLLBACK WORK AND CHAIN; ``` both tell your DBMS to end a transaction, but to save that transaction's characteristics for the next transaction. `ROLLBACK` is much simpler than `COMMIT`: it may involve no more than a few deletions (of Cursors, locks, prepared SQL statements and log-file entries). It's usually assumed that `ROLLBACK` can't fail, although such a thing is conceivable (for example, an encompassing transaction might reject an attempt to `ROLLBACK` because it's lining up for a `COMMIT`). `ROLLBACK` cancels all effects of a transaction. It does not cancel effects on objects outside the DBMS's control (for example the values in host program variables or the settings made by some SQL/CLI function calls). But in general, it is a convenient statement for those situations when you say "oops, this isn't working" or when you simply don't care whether your temporary work becomes permanent or not. Here is a moot question. If all you've been doing is `SELECT`s, so that there have been no data changes, should you end the transaction with `ROLLBACK` or `COMMIT`? It shouldn't really matter because both `ROLLBACK` and `COMMIT` do the same transaction-terminating job. However, the popular conception is that `ROLLBACK` implies failure, so after a successful series of `SELECT` statements the convention is to end the transaction with `COMMIT` rather than `ROLLBACK`. MariaDB (and most other DBMSs) supports rollback of SQL-data change statements, but not of SQL-Schema statements. This means that if you use any of `CREATE`, `ALTER`, `DROP`, `GRANT`, `REVOKE`, you are implicitly committing at execution time. ``` INSERT INTO Table_2 VALUES(5); DROP TABLE Table_3 CASCADE; ROLLBACK; ``` The result will be that both the `INSERT` and the `DROP` will go through as separate transactions so the `ROLLBACK` will have no effect. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb User-Defined Functions Calling Sequences User-Defined Functions Calling Sequences ======================================== The functions described in [Creating User-defined Functions](../creating-user-defined-functions/index) are expanded on this page. They are declared as follows: Simple Functions ---------------- ### x() If x() returns an integer, it is declared as follows: ``` long long x(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); ``` If x() returns a string (DECIMAL functions also return string values), it is declared as follows: ``` char *x(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error); ``` If x() returns a real, it is declared as follows: ``` double x(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); ``` ### x\_init() ``` my_bool x_init(UDF_INIT *initid, UDF_ARGS *args, char *message); ``` ### x\_deinit() ``` void x_deinit(UDF_INIT *initid); ``` ### Description *initid* is a parameter passed to all three functions that points to a *UDF\_INIT* structure, used for communicating information between the functions. Its structure members are: * my\_bool maybe\_null + *maybe\_null* should be set to *1* if x\_init can return a NULL value, Defaults to *1* if any arguments are declared *maybe\_null*. * unsigned int decimals + Number of decimals after the decimal point. The default, if an explicit number of decimals is passed in the arguments to the main function, is the maximum number of decimals, so if *9.5*, *9.55* and *9.555* are passed to the function, the default would be three (based on *9.555*, the maximum). If there are no explicit number of decimals, the default is set to 31, or one more than the maximum for the DOUBLE, FLOAT and DECIMAL types. This default can be changed in the function to suit the actual calculation. * unsigned int max\_length + Maximum length of the result. For integers, the default is 21. For strings, the length of the longest argument. For reals, the default is 13 plus the number of decimals indicated by *initid->decimals*. The length includes any signs or decimal points. Can also be set to 65KB or 16MB in order to return a BLOB. The memory remains unallocated, but this is used to decide on the data type to use if the data needs to be temporarily stored. * char \*ptr + A pointer for use as required by the function. Commonly, *initid->ptr* is used to communicate allocated memory, with *x\_init()* allocating the memory and assigning it to this pointer, *x()* using it, and *x\_deinit()* de-allocating it. * my\_bool const\_item + Should be set to *1* in *x\_init()* if *x()* always returns the same value, otherwise *0*. Aggregate Functions ------------------- ### x\_clear() *x\_clear()* is a required function for aggregate functions, and is declared as follows: ``` void x_clear(UDF_INIT *initid, char *is_null, char *error); ``` It is called when the summary results need to be reset, that is at the beginning of each new group. but also to reset the values when there were no matching rows. *is\_null* is set to point to CHAR(0) before calling x\_clear(). In the case of an error, you can store the value to which the error argument points (a single-byte variable, not a string string buffer) in the variable. ### x\_reset() *x\_reset()* is declared as follows: ``` void x_reset(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); ``` It is called on finding the first row in a new group. Should reset the summary variables, and then use *UDF\_ARGS* as the first value in the group's internal summary value. The function is not required if the UDF interface uses *x\_clear()*. ### x\_add() *x\_add()* is declared as follows: ``` void x_add(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error); ``` It is called for all rows belonging to the same group, and should be used to add the value in *UDF\_ARGS* to the internal summary variable. ### x\_remove() *x\_remove()* was added in [MariaDB 10.4](../what-is-mariadb-104/index) and is declared as follows (same as *x\_add()*): ``` void x_remove(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); ``` It adds more efficient support of aggregate UDFs as [window functions](../window-functions/index). *x\_remove()* should "subtract" the row (reverse *x\_add()*). In [MariaDB 10.4](../what-is-mariadb-104/index) aggregate UDFs will work as WINDOW functions without *x\_remove()* but it will not be so efficient. If *x\_remove()* supported (defined) detected automatically. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema METADATA_LOCK_INFO Table Information Schema METADATA\_LOCK\_INFO Table ============================================= The [Information Schema](../information_schema/index) `METADATA_LOCK_INFO` table is created by the [metadata\_lock\_info](../metadata_lock_info/index) plugin. It shows active [metadata locks](../metadata-locking/index) and user locks (the locks acquired with [GET\_LOCK](../get_lock/index)). It has the following columns: | Column | Description | | --- | --- | | `THREAD_ID` | | | `LOCK_MODE` | One of `MDL_INTENTION_EXCLUSIVE`, `MDL_SHARED`, `MDL_SHARED_HIGH_PRIO`, `MDL_SHARED_READ`, `MDL_SHARED_READ_ONLY`, `MDL_SHARED_WRITE`, `MDL_SHARED_NO_WRITE`, `MDL_SHARED_NO_READ_WRITE`, `MDL_SHARED_UPGRADABLE` or `MDL_EXCLUSIVE`. | | `LOCK_DURATION` | One of `MDL_STATEMENT`, `MDL_TRANSACTION` or `MDL_EXPLICIT` | | `LOCK_TYPE` | One of `Global read lock`, `Schema metadata lock`, `Table metadata lock`, `Stored function metadata lock`, `Stored procedure metadata lock`, `Trigger metadata lock`, `Event metadata lock`, `Commit lock` or `User lock`. | | `TABLE_SCHEMA` | | | `TABLE_NAME` | | #### "LOCK\_MODE" Descriptions The `LOCK_MODE` column can have the following values: | Value | Description | | --- | --- | | `MDL_INTENTION_EXCLUSIVE` | An intention exclusive metadata lock (IX). Used only for scoped locks. Owner of this type of lock can acquire upgradable exclusive locks on individual objects. Compatible with other IX locks, but is incompatible with scoped S and X locks. IX lock is taken in SCHEMA namespace when we intend to modify object metadata. Object may refer table, stored procedure, trigger, view/etc. | | `MDL_SHARED` | A shared metadata lock (S). To be used in cases when we are interested in object metadata only and there is no intention to access object data (e.g. for stored routines or during preparing prepared statements). We also mis-use this type of lock for open HANDLERs, since lock acquired by this statement has to be compatible with lock acquired by LOCK TABLES ... WRITE statement, i.e. SNRW (We can't get by by acquiring S lock at HANDLER ... OPEN time and upgrading it to SR lock for HANDLER ... READ as it doesn't solve problem with need to abort DML statements which wait on table level lock while having open HANDLER in the same connection). To avoid deadlock which may occur when SNRW lock is being upgraded to X lock for table on which there is an active S lock which is owned by thread which waits in its turn for table-level lock owned by thread performing upgrade we have to use thr\_abort\_locks\_for\_thread() facility in such situation. This problem does not arise for locks on stored routines as we don't use SNRW locks for them. It also does not arise when S locks are used during PREPARE calls as table-level locks are not acquired in this case. This lock is taken for global read lock, when caching a stored procedure in memory for the duration of the transaction and for tables used by prepared statements. | | `MDL_SHARED_HIGH_PRIO` | A high priority shared metadata lock. Used for cases when there is no intention to access object data (i.e. data in the table). "High priority" means that, unlike other shared locks, it is granted ignoring pending requests for exclusive locks. Intended for use in cases when we only need to access metadata and not data, e.g. when filling an INFORMATION\_SCHEMA table. Since SH lock is compatible with SNRW lock, the connection that holds SH lock lock should not try to acquire any kind of table-level or row-level lock, as this can lead to a deadlock. Moreover, after acquiring SH lock, the connection should not wait for any other resource, as it might cause starvation for X locks and a potential deadlock during upgrade of SNW or SNRW to X lock (e.g. if the upgrading connection holds the resource that is being waited for). | | `MDL_SHARED_READ` | A shared metadata lock (SR) for cases when there is an intention to read data from table. A connection holding this kind of lock can read table metadata and read table data (after acquiring appropriate table and row-level locks). This means that one can only acquire TL\_READ, TL\_READ\_NO\_INSERT, and similar table-level locks on table if one holds SR MDL lock on it. To be used for tables in SELECTs, subqueries, and LOCK TABLE ... READ statements. | | `MDL_SHARED_WRITE` | A shared metadata lock (SW) for cases when there is an intention to modify (and not just read) data in the table. A connection holding SW lock can read table metadata and modify or read table data (after acquiring appropriate table and row-level locks). To be used for tables to be modified by INSERT, UPDATE, DELETE statements, but not LOCK TABLE ... WRITE or DDL). Also taken by SELECT ... FOR UPDATE. | | `MDL_SHARED_UPGRADABLE` | An upgradable shared metadata lock for cases when there is an intention to modify (and not just read) data in the table. Can be upgraded to MDL\_SHARED\_NO\_WRITE and MDL\_EXCLUSIVE. A connection holding SU lock can read table metadata and modify or read table data (after acquiring appropriate table and row-level locks). To be used for the first phase of ALTER TABLE. | | `MDL_SHARED_READ_ONLY` | A shared metadata lock for cases when we need to read data from table and block all concurrent modifications to it (for both data and metadata). Used by LOCK TABLES READ statement. | | `MDL_SHARED_NO_WRITE` | An upgradable shared metadata lock which blocks all attempts to update table data, allowing reads. A connection holding this kind of lock can read table metadata and read table data. Can be upgraded to X metadata lock. Note, that since this type of lock is not compatible with SNRW or SW lock types, acquiring appropriate engine-level locks for reading (TL\_READ\* for MyISAM, shared row locks in InnoDB) should be contention-free. To be used for the first phase of ALTER TABLE, when copying data between tables, to allow concurrent SELECTs from the table, but not UPDATEs. | | `MDL_SHARED_NO_READ_WRITE` | An upgradable shared metadata lock which allows other connections to access table metadata, but not data. It blocks all attempts to read or update table data, while allowing INFORMATION\_SCHEMA and SHOW queries. A connection holding this kind of lock can read table metadata modify and read table data. Can be upgraded to X metadata lock. To be used for LOCK TABLES WRITE statement. Not compatible with any other lock type except S and SH. | | `MDL_EXCLUSIVE` | An exclusive metadata lock (X). A connection holding this lock can modify both table's metadata and data. No other type of metadata lock can be granted while this lock is held. To be used for CREATE/DROP/RENAME TABLE statements and for execution of certain phases of other DDL statements. | Examples -------- User lock: ``` SELECT GET_LOCK('abc',1000); +----------------------+ | GET_LOCK('abc',1000) | +----------------------+ | 1 | +----------------------+ SELECT * FROM information_schema.METADATA_LOCK_INFO; +-----------+--------------------------+---------------+-----------+--------------+------------+ | THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA | TABLE_NAME | +-----------+--------------------------+---------------+-----------+--------------+------------+ | 61 | MDL_SHARED_NO_READ_WRITE | MDL_EXPLICIT | User lock | abc | | +-----------+--------------------------+---------------+-----------+--------------+------------+ ``` Table metadata lock: ``` START TRANSACTION; INSERT INTO t VALUES (1,2); SELECT * FROM information_schema.METADATA_LOCK_INFO \G *************************** 1. row *************************** THREAD_ID: 4 LOCK_MODE: MDL_SHARED_WRITE LOCK_DURATION: MDL_TRANSACTION LOCK_TYPE: Table metadata lock TABLE_SCHEMA: test TABLE_NAME: t ``` ``` SELECT * FROM information_schema.METADATA_LOCK_INFO; +-----------+--------------------------+---------------+----------------------+-----------------+-------------+ | THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA | TABLE_NAME | +-----------+--------------------------+---------------+----------------------+-----------------+-------------+ | 31 | MDL_INTENTION_EXCLUSIVE | MDL_EXPLICIT | Global read lock | | | | 31 | MDL_INTENTION_EXCLUSIVE | MDL_EXPLICIT | Commit lock | | | | 31 | MDL_INTENTION_EXCLUSIVE | MDL_EXPLICIT | Schema metadata lock | dbname | | | 31 | MDL_SHARED_NO_READ_WRITE | MDL_EXPLICIT | Table metadata lock | dbname | exotics | +-----------+--------------------------+---------------+----------------------+-----------------+-------------+ ``` See Also -------- * [metadata locks](../metadata-locking/index) * [Performance Schema metadata\_locks table](../performance-schema-metadata_locks-table/index) * [GET\_LOCK](../get_lock/index)). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb About SphinxSE About SphinxSE ============== The Sphinx storage engine (SphinxSE) is a storage engine that talks to searchd (the Sphinx daemon) to enable text searching. Sphinx and SphinxSE is used as a faster and more customizable alternative to MariaDB's [built-in full-text search](../full-text-indexes/index). Sphinx does not depend on MariaDB, and can run independently, but SphinxSE provides a convenient interface to the underlying Sphinx daemon. Versions of SphinxSE in MariaDB ------------------------------- | SphinxSE Version | Introduced | Maturity | | --- | --- | --- | | [SphinxSE 2.2.6](http://sphinxsearch.com/docs/current.html) | [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/) | Stable | | [SphinxSE 2.1.9](http://sphinxsearch.com/docs/2.1.9/) | [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/) | Stable | | SphinxSE 2.0.4 | [MariaDB 5.5](../what-is-mariadb-55/index) | | | SphinxSE 0.99 | [MariaDB 5.2](../what-is-mariadb-52/index) and [MariaDB 5.3](../what-is-mariadb-53/index) | | Enabling SphinxSE in MariaDB ---------------------------- The Sphinx storage engine is included in the source, binaries, and packages of MariaDB. SphinxSE is built as a dynamically loadable .so plugin. To use it, you need to perform a one-time install: ``` INSTALL SONAME 'ha_sphinx'; ``` **MariaDB until [10.0](../what-is-mariadb-100/index)**In Debian/Ubuntu packages SphinxSE is statically compiled into the MariaDB server, there is no need to use the `INSTALL SONAME` statement. Once installed, SphinxSE will show up in the list of installed storage engines: ``` SHOW ENGINES; +------------+---------+--------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+--------------------------------------------+--------------+------+------------+ ... | SPHINX | YES | Sphinx storage engine 0.9.9 | NO | NO | NO | ... +------------+---------+--------------------------------------------+--------------+------+------------+ ``` This is a one-time step and will not need to be performed again. **Note:** SphinxSE is just the storage engine part of Sphinx. You will have to [install Sphinx](../installing-sphinx/index) itself in order to make use of SphinxSE in MariaDB. Despite the name, SphinxSE does not actually store any data itself. It is actually a built-in client which allows MariaDB to talk to Sphinx, run search queries, and obtain search results. All indexing and searching happen outside MariaDB. Some SphinxSE applications include: * easier porting of MariaDB/MySQL FTS applications to Sphinx * allowing Sphinx use with programming languages for which native APIs are not available yet * optimizations when additional Sphinx result set processing on the MariaDB side is required (eg. JOINs with original document tables, additional MariaDB-side filtering, and etc...) Using SphinxSE -------------- ### Basic Usage To search via SphinxSE, you would need to create a special `ENGINE=SPHINX` "search table", and then `SELECT` from it with full text query put into the `WHERE` clause for query column. Here is an example create statement and search query: ``` CREATE TABLE t1 ( id BIGINT UNSIGNED NOT NULL, weight INTEGER NOT NULL, query VARCHAR(3072) NOT NULL, group_id INTEGER, INDEX(query) ) ENGINE=SPHINX CONNECTION="sphinx://127.0.0.1:9312/test1"; SELECT * FROM t1 WHERE query='test it;mode=any'; ``` The first three columns of the search table must have a type of `BIGINT` for the 1st column (document id), `INTEGER` or `BIGINT` for the 2nd column (match weight), and `VARCHAR` or `TEXT` for the 3rd column (your query), respectively. This mapping is fixed; you cannot omit any of these three required columns, or move them around, or change types. Also, the query column must be indexed; all the others must be kept unindexed. Column names are ignored so you can use arbitrary ones. Additional columns must be either `INTEGER`, `TIMESTAMP`, `BIGINT`, `VARCHAR`, or `FLOAT`. They will be bound to the attributes provided in the Sphinx result set by name, so their names must match the attribute names specified in `sphinx.conf`. If there's no such attribute name in the Sphinx search results, the additional columns will have `NULL` values. Special "virtual" attribute names can also be bound to SphinxSE columns. `_sph_` needs to be used instead of `@` for that. For instance, to obtain the values of '`@groupby`', '`@count`', or '`@distinct`' virtual attributes, use '`_sph_groupby`', '`_sph_count`' or '`_sph_distinct`' column names, respectively. The `CONNECTION` string parameter is used to specify the default `searchd` host, port, and indexes for queries issued using this table. If no connection string is specified in `CREATE TABLE`, index name '`*`' (ie. search all indexes) and '`127.0.0.1:9312`' are assumed. The connection string syntax is as follows: ``` CONNECTION="sphinx://HOST:PORT/INDEXNAME" ``` You can change the default connection string later like so: ``` ALTER TABLE t1 CONNECTION="sphinx://NEWHOST:NEWPORT/NEWINDEXNAME"; ``` You can also override all these parameters per-query. **Note:** To use Linux sockets you can modify the searchd section of the Sphinx configuration file, setting the listen parameter to a socket file. Instruct SphinxSE about the socket using CONNECTION="unix:*unix/domain/socket[:index]".* ### Search Options As seen in the example above, both query text and search options should be put into the '`WHERE`' clause of the search query column (i.e. the 3rd column); the options are separated by semicolons ('`;`') and separate names from values using an equals sign ('`=`'). Any number of options can be specified. Available options are: * query - query text; * mode - matching mode. Must be one of "all", "any", "phrase", "boolean", or "extended". Default is "all"; * sort - match sorting mode. Must be one of "relevance", "attr\_desc", "attr\_asc", "time\_segments", or "extended". In all modes besides "relevance" attribute name (or sorting clause for "extended") is also required after a colon: ``` ... WHERE query='test;sort=attr_asc:group_id'; ... WHERE query='test;sort=extended:@weight desc, group_id asc'; ``` * offset - offset into result set, default is 0; * limit - amount of matches to retrieve from result set, default is 20; * index - names of the indexes to search: ``` ... WHERE query='test;index=test1;'; ... WHERE query='test;index=test1,test2,test3;'; ``` * minid, maxid - min and max document ID to match; * weights - comma-separated list of weights to be assigned to Sphinx full-text fields: ``` ... WHERE query='test;weights=1,2,3;'; ``` * filter, !filter - comma-separated attribute name and a set of values to match: ``` # only include groups 1, 5 and 19 ... WHERE query='test;filter=group_id,1,5,19;'; # exclude groups 3 and 11 ... WHERE query='test;!filter=group_id,3,11;'; ``` * range, !range - comma-separated attribute name, min and max value to match: ``` # include groups from 3 to 7, inclusive ... WHERE query='test;range=group_id,3,7;'; # exclude groups from 5 to 25 ... WHERE query='test;!range=group_id,5,25;'; ``` * maxmatches - per-query max matches value: ``` ... WHERE query='test;maxmatches=2000;'; ``` * groupby - group-by function and attribute: ``` ... WHERE query='test;groupby=day:published_ts;'; ... WHERE query='test;groupby=attr:group_id;'; ``` * groupsort - group-by sorting clause: ``` ... WHERE query='test;groupsort=@count desc;'; ``` * indexweights - comma-separated list of index names and weights to use when searching through several indexes: ``` ... WHERE query='test;indexweights=idx_exact,2,idx_stemmed,1;'; ``` * comment - a string to mark this query in query log (mapping to $comment parameter in Query() API call): ``` ... WHERE query='test;comment=marker001;'; ``` * select - a string with expressions to compute (mapping to SetSelect() API call): ``` ... WHERE query='test;select=2*a+3*b as myexpr;'; ``` **Note:** It is much more efficient to allow Sphinx to perform sorting, filtering, and slicing of the result set than to raise max matches count and use '`WHERE`', '`ORDER BY`', and '`LIMIT`' clauses on the MariaDB side. This is for two reasons: 1. Sphinx does a number of optimizations and performs better than MariaDB/MySQL on these tasks. 2. Less data would need to be packed by `searchd`, and transferred and unpacked by SphinxSE. ### SHOW ENGINE SPHINX STATUS Starting with version 0.9.9-rc1, additional query info besides the result set can be retrieved with the '`SHOW ENGINE SPHINX STATUS`' statement: ``` SHOW ENGINE SPHINX STATUS; +--------+-------+-------------------------------------------------+ | Type | Name | Status | +--------+-------+-------------------------------------------------+ | SPHINX | stats | total: 25, total found: 25, time: 126, words: 2 | | SPHINX | words | sphinx:591:1256 soft:11076:15945 | +--------+-------+-------------------------------------------------+ ``` This information can also be accessed through status variables. Note that this method does not require super-user privileges. ``` SHOW STATUS LIKE 'sphinx_%'; +--------------------+----------------------------------+ | Variable_name | Value | +--------------------+----------------------------------+ | sphinx_total | 25 | | sphinx_total_found | 25 | | sphinx_time | 126 | | sphinx_word_count | 2 | | sphinx_words | sphinx:591:1256 soft:11076:15945 | +--------------------+----------------------------------+ ``` ### JOINs with SphinxSE You can perform `JOIN`s on a SphinxSE search table and tables using other engines. Here's an example with "documents" from example.sql: ``` SELECT content, date_added FROM test.documents docs JOIN t1 ON (docs.id=t1.id) WHERE query="one document;mode=any"; +-------------------------------------+---------------------+ | content | docdate | +-------------------------------------+---------------------+ | this is my test document number two | 2006-06-17 14:04:28 | | this is my test document number one | 2006-06-17 14:04:28 | +-------------------------------------+---------------------+ SHOW ENGINE SPHINX STATUS; +--------+-------+---------------------------------------------+ | Type | Name | Status | +--------+-------+---------------------------------------------+ | SPHINX | stats | total: 2, total found: 2, time: 0, words: 2 | | SPHINX | words | one:1:2 document:2:2 | +--------+-------+---------------------------------------------+ ``` Building snippets (excerpts) via MariaDB ---------------------------------------- Starting with version 0.9.9-rc2, SphinxSE also includes a UDF function that lets you create snippets through MariaDB. The functionality is fully similar to the [BuildExcerprts](http://sphinxsearch.com/docs/current.html#api-func-buildexcerpts) API call but is accessible through MariaDB+SphinxSE. **MariaDB until [5.5](../what-is-mariadb-55/index)**The binary that provides the UDF is named sphinx.so and is automatically built and installed to the proper location along with SphinxSE itself. Register the UDF using the following statement: ``` CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'sphinx.so'; ``` **MariaDB until [10.0](../what-is-mariadb-100/index)**The UDF is packed together with the storage engine, in the same binary named ha\_sphinx.so. Register the UDF using the following statement: ``` CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'ha_sphinx.so'; ``` The function name must be '`sphinx_snippets`', you can not use an arbitrary name. Function arguments are as follows: ``` Prototype: function sphinx_snippets ( document, index, words, [options] ); ``` Document and words arguments can be either strings or table columns. Options must be specified like this: <code>'value' AS option\_name</code>. For a list of supported options, refer to the [BuildExcerprts()](http://sphinxsearch.com/docs/current.html#api-func-buildexcerpts) API call. The only UDF-specific additional option is named 'sphinx' and lets you specify searchd location (host and port). Usage examples: ``` SELECT sphinx_snippets('hello world doc', 'main', 'world', 'sphinx://192.168.1.1/' AS sphinx, true AS exact_phrase, '[b]' AS before_match, '[/b]' AS after_match) FROM documents; SELECT title, sphinx_snippets(text, 'index', 'mysql php') AS text FROM sphinx, documents WHERE query='mysql php' AND sphinx.id=documents.id; ``` More Information ---------------- More information on Sphinx and SphinxSE is available on the [Sphinx website](http://sphinxsearch.com/docs/current.html). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb 10.0.34 Release Upgrade Tests 10.0.34 Release Upgrade Tests ============================= ### Tested revision d01dbe66a8bf9cb6031f95159c49100f9299a768 ### Test date 2018-02-01 07:13:41 ### Summary All tests passed ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | undo-recovery | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo-recovery | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo-recovery | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | recovery | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | recovery | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | recovery | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.0.34 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | downgrade | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | downgrade | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | downgrade | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.33 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | | crash-downgrade | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | | downgrade | 16 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | | downgrade | 4 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | | downgrade | 8 | 10.0.34 (inbuilt) | | - | - | => | 10.0.14 (inbuilt) | | - | - | - | OK | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb List of Plugins List of Plugins =============== MariaDB Plugin Maturity ----------------------- The following table lists the various plugins included in MariaDB ordered by their maturity. Note that maturity will differ across MariaDB versions - see below for an easy way to get a complete list of plugins and their maturity in your version of MariaDB: | Plugin | Version | Maturity | From | | --- | --- | --- | --- | | [Archive](../archive/index) | 3.0 | Stable | | | [Aria](../aria-formerly-known-as-maria/index) | 1.5 | Stable | | | [Audit Plugin](../about-the-mariadb-audit-plugin/index) | 1.4 | Stable | | | [aws\_key\_management](../aws-key-management-encryption-plugin/index) | 1.0 | Stable | [MariaDB 10.2.6](https://mariadb.com/kb/en/mariadb-1026-release-notes/) | | [binlog](../binary-log/index) | 1.0 | Stable | | | [Blackhole](../blackhole/index) | 1.0 | Stable | | | [Connect](../connect/index) | 1.7 | Stable | [MariaDB 10.4.12](https://mariadb.com/kb/en/mariadb-10412-release-notes/), [MariaDB 10.3.22](https://mariadb.com/kb/en/mariadb-10322-release-notes/), [MariaDB 10.2.31](https://mariadb.com/kb/en/mariadb-10231-release-notes/) | | [CLIENT\_STATISTICS](../user-statistics/index) | 2.0 | Stable | | | [cracklib\_password\_check](../cracklib_password_check/index) | 1.0 | Stable | | | [CSV](../csv/index) | 1.0 | Stable | | | [DISKS](../disks-plugin/index) | 1.1 | Stable | [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/), [MariaDB 10.3.17](https://mariadb.com/kb/en/mariadb-10317-release-notes/), [MariaDB 10.2.26](https://mariadb.com/kb/en/mariadb-10226-release-notes/) | | [ed25519](../ed25519-authentication-plugin/index) | 1.1 | Stable | [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/) | | [FederatedX](../federatedx-storage-engine/index)[[1](#_note-0)] | 2.1 | Stable | | | [Feedback](../feedback-plugin/index) | 1.1 | Stable | | | [file\_key\_management](../file-key-management-encryption-plugin/index) | 1.0 | Stable | | [gssapi](../gssapi-authentication-plugin/index) | 1.0 | Stable | | | [INDEX\_STATISTICS](../user-statistics/index) | 2.0 | Stable | | | [INET6](../inet6/index) | 1.0 | Stable | [MariaDB 10.5.12](https://mariadb.com/kb/en/mariadb-10512-release-notes/) | | [InnoDB](../xtradb-and-innodb/index) | 5.710.\* | Stable | [MariaDB 10.2](../what-is-mariadb-102/index) | | [LOCALES](../locales-plugin/index) | 1.0 | Stable | | | [Memory](../memory-storage-engine/index) | 1.0 | Stable | | | [METADATA\_LOCK\_INFO](../metadata_lock_info/index) | 0.1 | Stable | | | [MRG\_MyISAM](../merge/index) | 1.0 | Stable | | | [Mroonga](../mroonga/index) | 7.7 | Stable | [MariaDB 10.2.11](https://mariadb.com/kb/en/mariadb-10211-release-notes/) | | [MyISAM](../myisam-storage-engine/index) | 1.0 | Stable | | | [MyRocks](../myrocks/index) | 1.0 | Stable | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/), [MariaDB 10.2.16](https://mariadb.com/kb/en/mariadb-10216-release-notes/) | | [mysql\_json](../mysql_json/index) | 0.1 | Stable | [MariaDB 10.5.17](https://mariadb.com/kb/en/mariadb-10517-release-notes/) | | [mysql\_native\_password](../authentication-plugin-mysql_native_password/index) | 1.0 | Stable | | | [mysql\_old\_password](../authentication-plugin-mysql_old_password/index) | 1.0 | Stable | | | [named\_pipe](../named_pipe-authentication-plugin/index) | 1.0 | Stable | | | [pam](../pam-authentication-plugin/index) | 1.0 | Stable | | | partition | 1.0 | Stable | | | [Performance\_Schema](../performance-schema/index) | 0.1 | Stable | | | [QUERY\_CACHE\_INFO](../query_cache_info-plugin/index) | 1.1 | Stable | | | [query\_response\_time](../query_response_time-plugin/index) | 1.0 | Stable | | | [S3](../s3-storage-engine/index) | 1.0 | Stable | [MariaDB 10.5.12](https://mariadb.com/kb/en/mariadb-10512-release-notes/) | | [semisync](../semisynchronous-replication/index) | 1.0 | Stable | | | [Sequence](../sequence/index) | 1.0 | Stable | | | [SERVER\_AUDIT](../mariadb-audit-plugin/index) | 1.4 | Stable | | | [simple\_password\_check](../simple_password_check/index) | 1.0 | Stable | | | [Spider](../spider/index) | 3.3 | Stable | <= [MariaDB 10.4](../what-is-mariadb-104/index), [MariaDB 10.5.7](https://mariadb.com/kb/en/mariadb-1057-release-notes/) | | [SQL\_ERROR\_LOG](../sql_error_log-plugin/index) | 1.0 | Stable | | | [TABLE\_STATISTICS](../user-statistics/index) | 2.0 | Stable | | | [USER\_STATISTICS](../user-statistics/index) | 2.0 | Stable | | | [user\_variables](../user-variables-plugin/index) | 1.0 | Stable | [MariaDB 10.3.13](https://mariadb.com/kb/en/mariadb-10313-release-notes/) | | [TokuDB](../tokudb/index) | 4.0 | Stable | | | [unix\_socket](../unix_socket-authentication-plugin/index) | 1.0 | Stable | | | [UUID](../uuid-data-type/index) | 1.0 | Stable | [MariaDB 10.9.1](https://mariadb.com/kb/en/mariadb-1091-release-notes/) | | [wsrep](../galera/index) | 1.0 | Stable | | | [WSREP\_INFO](../wsrep_info-plugin/index) | 1.0 | Stable | | | Plugin | Version | Maturity | From | | [Federated](../federated-storage-engine/index)[[2](#_note-1)] | 1.0 | Gamma | | | [OQGraph](../oqgraph-storage-engine/index) | 3.0 | Gamma | | | [password\_reuse\_check](../password_reuse_check-plugin/index) | 1.0 | Gamma | [MariaDB 10.7.4](https://mariadb.com/kb/en/mariadb-1074-release-notes/) | | [Sphinx](../sphinx-storage-engine/index) | 2.0 | Gamma | | | Plugin | Version | Maturity | From | | [Columnstore](../mariadb-columnstore/index) | 1.0 | Beta | [MariaDB 10.5.4](https://mariadb.com/kb/en/mariadb-1054-release-notes/) | | [handlersocket](../handlersocket/index) | 1.0 | Beta | | | Plugin | Version | Maturity | From | | [Cassandra](../cassandra/index) | 0.1 | Experimental | | | [debug\_key\_management](../encryption-plugins/index) | 1.0 | Experimental | | | [example\_key\_management](../encryption-plugins/index) | 1.0 | Experimental | | Execute the following on your MariaDB server to get a complete list of plugins and their maturity for your version of MariaDB: ``` SELECT plugin_name, plugin_version, plugin_maturity FROM information_schema.plugins ORDER BY plugin_name; ``` See Also -------- * [Plugin Overview](../plugin-overview/index) * [INSTALL PLUGIN](../install-plugin/index) * [INFORMATION\_SCHEMA.PLUGINS Table](../plugins-table-information-schema/index) * [mysql\_plugin](../mysql_plugin/index) * [SHOW PLUGINS](../show-plugins/index) * [INSTALL SONAME](../install-soname/index) * [UNINSTALL PLUGIN](../uninstall-plugin/index) * [UNINSTALL SONAME](../uninstall-soname/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Troubleshooting InnoDB Troubleshooting ======================= Guidelines when troubleshooting problems with InnoDB. | Title | Description | | --- | --- | | [InnoDB Troubleshooting Overview](../innodb-troubleshooting-overview/index) | Overview of InnoDB errors experienced and steps to take. | | [InnoDB Data Dictionary Troubleshooting](../innodb-data-dictionary-troubleshooting/index) | Troubleshooting the InnoDB Data Dictionary. | | [InnoDB Recovery Modes](../innodb-recovery-modes/index) | Modes for recovering from emergency situations in InnoDB. | | [Troubleshooting Row Size Too Large Errors with InnoDB](../troubleshooting-row-size-too-large-errors-with-innodb/index) | Fixing "Row size too large (> 8126). Changing some columns to TEXT or BLOB may help." | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Tips on Converting to Galera Tips on Converting to Galera ============================ These topics will be discussed in more detail below. Dear Schema Designer: * InnoDB only, always have PK. Dear Developer: * Check for errors, even after COMMIT. * Moderate sized transactions. * Don't make assumptions about AUTO\_INCREMENT values. * Handling of "critical reads" is quite different (arguably better). * Read/Write split is not necessary, but is still advised in case the underlying structure changes in the future. Dear DBA: * Building the machines is quite different. (Not covered here) * ALTERs are handled differently. * TRIGGERs and EVENTs may need checking. * Tricks in replication (eg, BLACKHOLE) may not work. * Several variables need to be set differently. Galera is available in many places ---------------------------------- Galera's High Availability replication is available via: * [MariaDB 10.1](../what-is-mariadb-101/index) and later * Percona XtraDB Cluster * Codership's Galera Cluster for MySQL Overview of cross-colo writing ------------------------------ (This overview is valid even for same-datacenter nodes, but the issues of latency vanish.) Cross-colo latency is an 'different' than with traditional replication, but not necessarily better or worse with Galera. The latency happens at a very different time for Galera. In 'traditional' replication, these steps occur: * Client talks to Master. If Client and Master are in different colos, this has a latency hit. * Each SQL to Master is another latency hit, including(?) the COMMIT (unless using autocommit). * Replication to Slave(s) is asynchronous, so this does not impact the client writing to the Master. * Since replication is asynchronous, a Client (same or subsequent) cannot be guaranteed to see that data on the Slave. This is a "critical read". The async Replication delay forces apps to take some evasive action. In Galera-based replication: * Client talks to any Master -- possibly with cross-colo latency. Or you could arrange to have Galera nodes co-located with clients to avoid this latency. * At COMMIT time (or end of statement, in case of autocommit=1), galera makes one roundtrip to other nodes. * The COMMIT usually succeeds, but could fail if some other node is messing with the same rows. (Galera retries on autocommit failures.) * Failure of the COMMIT is reported to the Client, who should simply replay the SQL statements from the BEGIN. * Later, the whole transaction will be applied (with possibility of conflict) on the other nodes. * Critical Read -- details below For an N-statement transaction: In a typical 'traditional' replication setup: * 0 or N (N+2?) latency hits, depending on whether the Client is co-located with the Master. * Replication latencies and delays lead to issues with "Critical Reads". In Galera: * 0 latency hits (assuming Client is 'near' some node) * 1 latency hit for the COMMIT. * 0 (usually) for Critical Read (details below) Bottom line: Depending on where your Clients are, and whether you clump statements into BEGIN...COMMIT transacitons, Galera may be faster or slower than traditional replication in a WAN topology. AUTO\_INCREMENT --------------- By using wsrep\_auto\_increment\_control = ON, the values of auto\_increment\_increment and auto\_increment\_offset will be automatically adjusted as nodes come/go. If you are building a Galera cluster by starting with one node as a Slave to an existing non-Galera system, and if you have multi-row INSERTs that depend on AUTO\_INCREMENTs, the read this Percona blog Bottom line: There may be gaps in AUTO\_INCREMENT values. Consecutive rows, even on one connection, will not have consecutive ids. Beware of Proxies that try to implement a "read/write split". In some situations, a reference to LAST\_INSERT\_ID() will be sent to a "Slave". InnoDB only ----------- For effective replication of data, you must use only InnoDB. This eliminates * FULLTEXT index (until 5.6) * SPATIAL index * MyISAM's PK as second column You can use MyISAM and MEMORY for data that does not need to be replicated. Also, you should use "START TRANSACTION READONLY" wherever appropriate. Check after COMMIT ------------------ Check for errors after issuing COMMIT. A "deadlock" can occur due to writes on other node(s). Possible exception (could be useful for legacy code without such checks): Treat the system as single-Master, plus Slaves. By writing only to one node, COMMIT should always succeed(?) What about autocommit = 1? wsrep\_retry\_autocommit tells Galera to retry if a single statement that is autocommited N times. So, there is still a chance (very slim) of getting a deadlock on such a statement. The default setting of "1" retry is probably good. Always have PRIMARY KEY ----------------------- "Row Based Replication" will be used; this requires a PK on every table. A non-replicated table (eg, MyISAM) does not have to have a PK. Transaction "size" ------------------ (This section assumes you have Galera nodes in multiple colos.) Because of some of the issues discussed, it is wise to group your write statements into moderate sized BEGIN...COMMIT transactions. There is one latency hit per COMMIT or autocommit. So, combining statements will decrease those hits. On the other hand, it is unwise (for other reasons) to make huge transactions, such as inserting/modifying millions of rows in a single transaction. To deal with failure on COMMIT, design your code so you can redo the SQL statements in the transaction without messing up other data. For example, move "normalization" statements out of the main transaction; there is arguably no compelling reason to roll them back if the main code rolls back. In any case, doing what is "right" for the business logic overrides other considerations. Galera's tx\_isolation is between Serializable and Repeatable Read. tx\_isolation variable is ignored. Set wsrep\_log\_conflicts to get errors put in the regular MySQL mysqld.err. XA transactions cannot be supported. (Galera is already doing a form of XA in order to do its thing.) Critical reads -------------- Here is a 'simple' (but not 'free') way to assure that a read-after-write, even from a different connection, will see the updated data. SET SESSION wsrep\_sync\_wait = 1; SELECT ... SET SESSION wsrep\_sync\_wait = 0; For non-SELECTs, use a different bit set for the first select. (TBD: Would 0xffff always work?) (Before Galera 3.6, it was wsrep\_causal\_reads = ON.) Doc for wsrep\_sync\_wait This setting stalls the SELECT until all current updates have been applied to the node. That is sufficient to guarantee that a previous write will be visible. The time cost is usually zero. However, a large UPDATE could lead to a delay. Because of RBR and parallel application, delays are likely to be less than on traditional replication. Zaitsev's blog It may be more practical (for a web app) to simply set wsrep\_sync\_wait right after connecting. MyISAM and MEMORY ----------------- As said above, use InnoDB only. However, here is more info on the MyISAM (and hence FULLTEXT, SPATIAL, etc) issues. MyISAM and MEMORY tables are not replicated. Having MyISAM not replicated can be a big benefit -- You can "CREATE TEMPORARY TABLE ... ENGINE=MyISAM" and have it exist on only one node. RBR assures that any data transferred from that temp table into a 'real' table can still be replicated. Replicating GRANTs ------------------ GRANTs and related operations act on the MyISAM tables in the database `mysql`. The GRANT statements will(?) be replicated, but the underlying tables will not. ALTERs ------ Many DDL changes on Galera can be achieved without downtime, even if they take a long time. [RSU vs TOI](https://galeracluster.com/documentation-webpages/documentation/schema-upgrades.html): * Rolling Schema Upgrade (RSU): manually execute the DDL on each node in the cluster. The node will desync while executing the DDL. * Total Order Isolation (TOI): Galera automatically replicates the DDL to each node in the cluster, and it synchronizes each node so that the statement is executed at same time (in the replication sequence) on all nodes. Caution: Since there is no way to synchronize the clients with the DDL, you must make sure that the clients are happy with either the old or the new schema. Otherwise, you will probably need to take down the entire cluster while simultaneously switching over both the schema and the client code. Fast DDL operations can usually be executed in TOI mode: * DDL operations that support the `NOCOPY` and `INSTANT` algorithms are usually very fast. * DDL operations that support the `INPLACE` algorithm may be fast or slow, depending on whether the table needs to be rebuilt. * DDL operations that only support the `COPY` algorithm are usually very slow. For a list of which operations support which algorithms, see [InnoDB Online DDL](../innodb-online-ddl/index). If you need to use RSU mode, then do the following separately for each node: ``` SET SESSION wsrep_OSU_method='RSU'; ALTER TABLE tab <alter options here>; SET SESSION wsrep_OSU_method='TOI'; ``` [More discussion of RSU procedures](http://www.severalnines.com/blog/online-schema-upgrade-mysql-galera-cluster-using-rsu-method) Single "Master" Configuration ----------------------------- You can 'simulate' Master + Slaves by having clients write only to one node. * No need to check for errors after COMMIT. * Lose the latency benefits. DBA tricks ---------- * Remove node from cluster; back it up; put it back in. Syncup is automatic. * Remove node from cluster; use it for testing, etc; put it back in. Syncup is automatic. * Rolling hardware/software upgrade: Remove; upgrade; put back in. Repeat. Variables that may need to be different --------------------------------------- * [auto\_increment\_increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) - If you are writing to multiple nodes, and you use AUTO\_INCREMENT, then auto\_increment\_increment will automatically be equal the current number of nodes. * [binlog-do](../mysqld-options/index#-binlog-do-db)/[ignore-db](../mysqld-options/index#-binlog-ignore-db) - Do not use. * [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) - ROW is required for Galera. * [innodb\_autoinc\_lock\_mode](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) - 2 * [innodb\_doublewrite](../xtradbinnodb-server-system-variables/index#innodb_doublewrite) - ON: When an IST occurs, want there to be no torn pages? (With FusionIO or other drives that guarantee atomicity, OFF is better.) * [innodb\_flush\_log\_at\_trx\_commit](../xtradbinnodb-server-system-variables/index#innodb_doublewrite) - 2 or 0. IST or SST will recover from loss if you have 1. * [query\_cache\_size](../server-system-variables/index#query_cache_size) - 0 * [query\_cache\_type](../server-system-variables/index#query_cache_type) - 0: The Query cache cannot be used in a Galera context. * [wsrep\_auto\_increment\_control](../galera-cluster-system-variables/index#wsrep_auto_increment_control) - Normally want ON * [wsrep\_on](../galera-cluster-system-variables/index#wsrep_on) - ON * [wsrep\_provider\_options](../galera-cluster-system-variables/index#wsrep_provider_options) - Various settings may need tuning if you are using a WAN. * [wsrep\_slave\_threads](../galera-cluster-system-variables/index#wsrep_slave_threads) - use for parallel replication * [wsrep\_sync\_wait](../galera-cluster-system-variables/index#wsrep_sync_wait) (previously wsrep\_causal\_reads) - used transiently to dealing with "critical reads". Miscellany ---------- Until recently, FOREIGN KEYs were buggy. LOAD DATA is auto-chunked. That is, it is passed to other nodes piecemeal, not all at once. [MariaDB's known issues with Galera](../mariadb-galera-cluster-known-limitations/index) DROP USER may not replicate? A slight difference in ROLLBACK for conflict: InnoDB rolls back smaller transaction; Galera rolls back last. [Slide Deck for Galera](http://www.slideshare.net/skysql/mariadb-galera-cluster-simple-transparent-highly-available) SET GLOBAL wsrep\_debug = 1; leads to a lot of debug info in the error log. Large UPDATEs / DELETEs should be broken up. This admonition is valid for all databases, but there are additional issues in Galera. WAN: May need to increase (from the defaults) wsrep\_provider\_options = evs... MySQL/Perona 5.6 or MariaDB 10 is recommended when going to Galera. [Cluster limitations](../mariadb-galera-cluster-known-limitations/index) [Slide show](https://www.percona.com/files/presentations/percona-live/nyc-2012/PLNY12-galera-cluster-best-practices.pdf) GTIDs ----- See [Using MariaDB GTIDs with MariaDB Galera Cluster](../using-mariadb-gtids-with-mariadb-galera-cluster/index). How many nodes to have in a cluster ----------------------------------- If all the servers are in the same 'vulnerability zone' -- eg, rack or data center -- Have an odd number (at least 3) of nodes. When spanning colos, you need 3 (or more) data centers in order to be 'always' up, even during a colo failure. With only 2 data centers, Galera can automatically recover from one colo outage, but not the other. (You pick which.) If you use 3 or 4 colos, these number of nodes per colo are safe: * 3 nodes: 1+1+1 (1 node in each of 3 colos) * 4 nodes: 1+1+1+1 (4 nodes won't work in 3 colos) * 5 nodes: 2+2+1, 2+1+1+1 (5 nodes spread 'evenly' across the colos) * 6 nodes: 2+2+2, 2+2+1+1 * 7 nodes: 3+2+2, 3+3+1, 2+2+2+1, 3+2+1+1 There may be a way to "weight" the nodes differently; that would allow a few more configurations. With "weighting", give each colo the same weight; then subdivide the weight within each colo evenly. Four nodes in 3 colos: (1/6+1/6) + 1/3 + 1/3 That way, any single colo failure cannot lead to "split brain". Postlog ------- Posted 2013; VARIABLES: 2015; Refreshed Feb. 2016 See also -------- Rick James graciously allowed us to use this article in the Knowledge Base. [Rick James' site](http://mysql.rjweb.org/) has other useful tips, how-tos, optimizations, and debugging tips. Original source: <http://mysql.rjweb.org/doc.php/galera> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb TO_DAYS TO\_DAYS ======== Syntax ------ ``` TO_DAYS(date) ``` Description ----------- Given a date `date`, returns the number of days since the start of the current calendar (0000-00-00). The function is not designed for use with dates before the advent of the Gregorian calendar in October 1582. Results will not be reliable since it doesn't account for the lost days when the calendar changed from the Julian calendar. This is the converse of the [FROM\_DAYS()](../from_days/index) function. Examples -------- ``` SELECT TO_DAYS('2007-10-07'); +-----------------------+ | TO_DAYS('2007-10-07') | +-----------------------+ | 733321 | +-----------------------+ SELECT TO_DAYS('0000-01-01'); +-----------------------+ | TO_DAYS('0000-01-01') | +-----------------------+ | 1 | +-----------------------+ SELECT TO_DAYS(950501); +-----------------+ | TO_DAYS(950501) | +-----------------+ | 728779 | +-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WEEKOFYEAR WEEKOFYEAR ========== Syntax ------ ``` WEEKOFYEAR(date) ``` Description ----------- Returns the calendar week of the date as a number in the range from 1 to 53. `WEEKOFYEAR()` is a compatibility function that is equivalent to `[WEEK(date,3)](../week/index)`. Examples -------- ``` SELECT WEEKOFYEAR('2008-02-20'); +--------------------------+ | WEEKOFYEAR('2008-02-20') | +--------------------------+ | 8 | +--------------------------+ ``` ``` CREATE TABLE t1 (d DATETIME); INSERT INTO t1 VALUES ("2007-01-30 21:31:07"), ("1983-10-15 06:42:51"), ("2011-04-21 12:34:56"), ("2011-10-30 06:31:41"), ("2011-01-30 14:03:25"), ("2004-10-07 11:19:34"); ``` ``` select * from t1; +---------------------+ | d | +---------------------+ | 2007-01-30 21:31:07 | | 1983-10-15 06:42:51 | | 2011-04-21 12:34:56 | | 2011-10-30 06:31:41 | | 2011-01-30 14:03:25 | | 2004-10-07 11:19:34 | +---------------------+ ``` ``` SELECT d, WEEKOFYEAR(d), WEEK(d,3) from t1; +---------------------+---------------+-----------+ | d | WEEKOFYEAR(d) | WEEK(d,3) | +---------------------+---------------+-----------+ | 2007-01-30 21:31:07 | 5 | 5 | | 1983-10-15 06:42:51 | 41 | 41 | | 2011-04-21 12:34:56 | 16 | 16 | | 2011-10-30 06:31:41 | 43 | 43 | | 2011-01-30 14:03:25 | 4 | 4 | | 2004-10-07 11:19:34 | 41 | 41 | +---------------------+---------------+-----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MPointFromText MPointFromText ============== Syntax ------ ``` MPointFromText(wkt[,srid]) MultiPointFromText(wkt[,srid]) ``` Description ----------- Constructs a [MULTIPOINT](../multipoint/index) value using its [WKT](../wkt-definition/index) representation and [SRID](../srid/index). `MPointFromText()` and `MultiPointFromText()` are synonyms. Examples -------- ``` CREATE TABLE gis_multi_point (g MULTIPOINT); SHOW FIELDS FROM gis_multi_point; INSERT INTO gis_multi_point VALUES (MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb <=> <=> === Syntax ------ ``` <=> ``` Description ----------- NULL-safe equal operator. It performs an equality comparison like the [= operator](../equal/index), but returns 1 rather than NULL if both operands are NULL, and 0 rather than NULL if one operand is NULL. `a <=> b` is equivalent to `a = b OR (a IS NULL AND b IS NULL)`. When used in row comparisons these two queries return the same results: ``` SELECT (t1.a, t1.b) <=> (t2.x, t2.y) FROM t1 INNER JOIN t2; SELECT (t1.a <=> t2.x) AND (t1.b <=> t2.y) FROM t1 INNER JOIN t2; ``` See also [NULL Values in MariaDB](../null-values-in-mariadb/index). Examples -------- ``` SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL; +---------+---------------+------------+ | 1 <=> 1 | NULL <=> NULL | 1 <=> NULL | +---------+---------------+------------+ | 1 | 1 | 0 | +---------+---------------+------------+ SELECT 1 = 1, NULL = NULL, 1 = NULL; +-------+-------------+----------+ | 1 = 1 | NULL = NULL | 1 = NULL | +-------+-------------+----------+ | 1 | NULL | NULL | +-------+-------------+----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb 10.3.9 Release Upgrade Tests 10.3.9 Release Upgrade Tests ============================ ### Tested revision ca26f91bcaa21933147974c823852a2e1c2e2bd7 ### Test date 2018-08-30 07:09:44 ### Summary Known bug [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094). A few upgrades from MySQL and old MariaDB fail because the old versions hang on shutdown. ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | recovery | 16 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 16 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 4 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 4 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 8 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 8 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 16 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 16 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 4 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 4 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 8 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 8 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 16 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 4 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 32 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 64 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 8 | 10.3.9 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 16 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 4 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 32 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 64 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 8 | 10.3.9 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 16 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 4 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 32 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 64 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 8 | 10.3.9 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 16 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 4 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 32 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 64 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 8 | 10.3.9 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.3.8 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.3.8 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.3.8 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.3.8 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.9 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.9 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.9 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.9 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.3.9 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb DECODE_HISTOGRAM DECODE\_HISTOGRAM ================= Syntax ------ ``` DECODE_HISTOGRAM(hist_type,histogram) ``` Description ----------- Returns a string of comma separated numeric values corresponding to a probability distribution represented by the histogram of type `hist_type` (`SINGLE_PREC_HB` or `DOUBLE_PREC_HB`). The `hist_type` and `histogram` would be commonly used from the [mysql.column\_stats table](../mysqlcolumn_stats-table/index). See [Histogram Based Statistics](../histogram-based-statistics/index) for details. Examples -------- ``` CREATE TABLE origin ( i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, v INT UNSIGNED NOT NULL ); INSERT INTO origin(v) VALUES (1),(2),(3),(4),(5),(10),(20), (30),(40),(50),(60),(70),(80), (90),(100),(200),(400),(800); SET histogram_size=10,histogram_type=SINGLE_PREC_HB; ANALYZE TABLE origin PERSISTENT FOR ALL; +-------------+---------+----------+-----------------------------------------+ | Table | Op | Msg_type | Msg_text | +-------------+---------+----------+-----------------------------------------+ | test.origin | analyze | status | Engine-independent statistics collected | | test.origin | analyze | status | OK | +-------------+---------+----------+-----------------------------------------+ SELECT db_name,table_name,column_name,hist_type, hex(histogram),decode_histogram(hist_type,histogram) FROM mysql.column_stats WHERE db_name='test' and table_name='origin'; +---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+ | db_name | table_name | column_name | hist_type | hex(histogram) | decode_histogram(hist_type,histogram) | +---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+ | test | origin | i | SINGLE_PREC_HB | 0F2D3C5A7887A5C3D2F0 | 0.059,0.118,0.059,0.118,0.118,0.059,0.118,0.118,0.059,0.118,0.059 | | test | origin | v | SINGLE_PREC_HB | 000001060C0F161C1F7F | 0.000,0.000,0.004,0.020,0.024,0.012,0.027,0.024,0.012,0.376,0.502 | +---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+ SET histogram_size=20,histogram_type=DOUBLE_PREC_HB; ANALYZE TABLE origin PERSISTENT FOR ALL; +-------------+---------+----------+-----------------------------------------+ | Table | Op | Msg_type | Msg_text | +-------------+---------+----------+-----------------------------------------+ | test.origin | analyze | status | Engine-independent statistics collected | | test.origin | analyze | status | OK | +-------------+---------+----------+-----------------------------------------+ SELECT db_name,table_name,column_name, hist_type,hex(histogram),decode_histogram(hist_type,histogram) FROM mysql.column_stats WHERE db_name='test' and table_name='origin'; +---------+------------+-------------+----------------+------------------------------------------+-----------------------------------------------------------------------------------------+ | db_name | table_name | column_name | hist_type | hex(histogram) | decode_histogram(hist_type,histogram) | +---------+------------+-------------+----------------+------------------------------------------+-----------------------------------------------------------------------------------------+ | test | origin | i | DOUBLE_PREC_HB | 0F0F2D2D3C3C5A5A78788787A5A5C3C3D2D2F0F0 | 0.05882,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.05882 | | test | origin | v | DOUBLE_PREC_HB | 5200F600480116067E0CB30F1B16831CB81FD67F | 0.00125,0.00250,0.00125,0.01877,0.02502,0.01253,0.02502,0.02502,0.01253,0.37546,0.50063 | ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore SQL Structure and Commands ColumnStore SQL Structure and Commands ======================================= SQL syntax supported by MariaDB ColumnStore | Title | Description | | --- | --- | | [ColumnStore Naming Conventions](../columnstore-naming-conventions/index) | Maximum lengths and naming conventions | | [ColumnStore Data Types](../columnstore-data-types/index) | Data types supported by ColumnStore | | [ColumnStore Distributed Aggregate Functions](../columnstore-distributed-aggregate-functions/index) | MariaDB ColumnStore supports the following aggregate functions, these can b... | | [ColumnStore Distributed Functions](../columnstore-distributed-functions/index) | Functions supported by ColumnStore | | [ColumnStore Non-Distributed Post-Processed Functions](../columnstore-non-distributed-post-processed-functions/index) | Functions where data is returned by ColumnStore first, then executed by MariaDB | | [ColumnStore Information Functions](../columnstore-information-functions/index) | Functions MariaDB ColumnStore Information Functions are selectable pseudo ... | | [ColumnStore Conditions](../columnstore-conditions/index) | Conditions are combinations of expressions and operators that return TRUE, FALSE or NULL | | [ColumnStore Data Definition Statements](../columnstore-data-definition-statements/index) | SQL statements for defining data, such as ALTER, CREATE, DROP, RENAME etc | | [ColumnStore Data Manipulation Statements](../columnstore-data-manipulation-statements/index) | Statements for querying and manipulating data, such as SELECT, UPDATE, DELETE etc | | [ColumnStore Window Functions](../columnstore-window-functions/index) | Introduction MariaDB ColumnStore provides support for window functions bro... | | [ColumnStore Operating Mode](../columnstore-operating-mode/index) | ColumnStore can support full MariaDB query syntax through an operating mode | | [ColumnStore Decimal Math and Scale](../columnstore-decimal-math-and-scale/index) | ColumnStore can support varied internal precision on decimal calculations | | [ColumnStore Compression Mode](../columnstore-compression-mode/index) | ColumnStore has the ability to compress data | | [ColumnStore Partition Management](../columnstore-partition-management/index) | Partition Management SQL Commands to view, drop, disable, and enable partitions | | [ColumnStore Information Schema Tables](../columnstore-information-schema-tables/index) | ColumnStore-related Information Schema tables | | [ColumnStore User Defined Functions](../columnstore-user-defined-functions/index) | ColumnStore User Defined Functions (UDF) overview and how-to. | | [ColumnStore User Defined Aggregate and Window Functions](../columnstore-user-defined-aggregate-and-window-functions/index) | Introduction Starting with MariaDB ColumnStore 1.1, the ability to create ... | | [ColumnStore Commit](../5568/index) | Make changes to a table permanent | | [ColumnStore Drop Procedure](../5571/index) | Deletes a stored procedure from ColumnStore | | [ColumnStore Rename Table](../5573/index) | Renames one or more ColumnStore tables | | [ColumnStore Rollback](../5574/index) | Undoes transactions that have not been permanently saved with the COMMIT statement | | [ColumnStore Utility Functions](../columnstore-utility-functions/index) | MariaDB ColumnStore Utility Functions are a set of simple functions that re... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SET SET === Syntax ------ ``` SET variable_assignment [, variable_assignment] ... variable_assignment: user_var_name = expr | [GLOBAL | SESSION] system_var_name = expr | [@@global. | @@session. | @@]system_var_name = expr ``` One can also set a user variable in any expression with this syntax: ``` user_var_name:= expr ``` Description ----------- The `SET` statement assigns values to different types of variables that affect the operation of the server or your client. Older versions of MySQL employed `SET OPTION`, but this syntax was deprecated in favor of `SET` without `OPTION`, and was removed in [MariaDB 10.0](../what-is-mariadb-100/index). Changing a system variable by using the SET statement does not make the change permanently. To do so, the change must be made in a [configuration file](../mysqld-configuration-files-and-groups/index). For setting variables on a per-query basis, see [SET STATEMENT](../set-statement/index). See [SHOW VARIABLES](../show-variables/index) for documentation on viewing server system variables. See [Server System Variables](../server-system-variables/index) for a list of all the system variables. ### GLOBAL / SESSION When setting a system variable, the scope can be specified as either GLOBAL or SESSION. A global variable change affects all new sessions. It does not affect any currently open sessions, including the one that made the change. A session variable change affects the current session only. If the variable has a session value, not specifying either GLOBAL or SESSION will be the same as specifying SESSION. If the variable only has a global value, not specifying GLOBAL or SESSION will apply to the change to the global value. ### DEFAULT Setting a global variable to DEFAULT will restore it to the server default, and setting a session variable to DEFAULT will restore it to the current global value. Examples -------- * [innodb\_sync\_spin\_loops](../innodb-system-variables/index#innodb_sync_spin_loops) is a global variable. * [skip\_parallel\_replication](../replication-and-binary-log-server-system-variables/index#skip_parallel_replication) is a session variable. * [max\_error\_count](../server-system-variables/index#max_error_count) is both global and session. ``` SELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME IN ('max_error_count', 'skip_parallel_replication', 'innodb_sync_spin_loops'); +---------------------------+---------------+--------------+ | VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE | +---------------------------+---------------+--------------+ | MAX_ERROR_COUNT | 64 | 64 | | SKIP_PARALLEL_REPLICATION | OFF | NULL | | INNODB_SYNC_SPIN_LOOPS | NULL | 30 | +---------------------------+---------------+--------------+ ``` Setting the session values: ``` SET max_error_count=128;Query OK, 0 rows affected (0.000 sec) SET skip_parallel_replication=ON;Query OK, 0 rows affected (0.000 sec) SET innodb_sync_spin_loops=60; ERROR 1229 (HY000): Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL SELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME IN ('max_error_count', 'skip_parallel_replication', 'innodb_sync_spin_loops'); +---------------------------+---------------+--------------+ | VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE | +---------------------------+---------------+--------------+ | MAX_ERROR_COUNT | 128 | 64 | | SKIP_PARALLEL_REPLICATION | ON | NULL | | INNODB_SYNC_SPIN_LOOPS | NULL | 30 | +---------------------------+---------------+--------------+ ``` Setting the global values: ``` SET GLOBAL max_error_count=256; SET GLOBAL skip_parallel_replication=ON; ERROR 1228 (HY000): Variable 'skip_parallel_replication' is a SESSION variable and can't be used with SET GLOBAL SET GLOBAL innodb_sync_spin_loops=120; SELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME IN ('max_error_count', 'skip_parallel_replication', 'innodb_sync_spin_loops'); +---------------------------+---------------+--------------+ | VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE | +---------------------------+---------------+--------------+ | MAX_ERROR_COUNT | 128 | 256 | | SKIP_PARALLEL_REPLICATION | ON | NULL | | INNODB_SYNC_SPIN_LOOPS | NULL | 120 | +---------------------------+---------------+--------------+ ``` [SHOW VARIABLES](../show-variables/index) will by default return the session value unless the variable is global only. ``` SHOW VARIABLES LIKE 'max_error_count'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_error_count | 128 | +-----------------+-------+ SHOW VARIABLES LIKE 'skip_parallel_replication'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | skip_parallel_replication | ON | +---------------------------+-------+ SHOW VARIABLES LIKE 'innodb_sync_spin_loops'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | innodb_sync_spin_loops | 120 | +------------------------+-------+ ``` Using the inplace syntax: ``` SELECT (@a:=1); +---------+ | (@a:=1) | +---------+ | 1 | +---------+ SELECT @a; +------+ | @a | +------+ | 1 | +------+ ``` See Also -------- * [Using last\_value() to return data of used rows](../last_value/index) * [SET STATEMENT](../set-statement/index) * [SET Variable](../set-variable/index) * [SET Data Type](../set-data-type/index) * [DECLARE Variable](../declare-variable/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Upgrading MariaDB ColumnStore from 1.0.4 to 1.0.5 Upgrading MariaDB ColumnStore from 1.0.4 to 1.0.5 ================================================= MariaDB ColumnStore software upgrade 1.0.4 to 1.0.5 --------------------------------------------------- Note: Columnstore.xml modifications you manually made are not automatically carried forward on an upgrade. These modifications will need to be incorporated back into .XML once the upgrade has occurred. The previous configuration file will be saved as /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave. If you have specified a root database password (which is good practice), then you must configure a .my.cnf file with user credentials for the upgrade process to use. Create a .my.cnf file in the user home directory with 600 file permissions with the following content (updating PASSWORD as appropriate): ``` [mysqladmin] user = root password = PASSWORD ``` This file can be removed after the upgrade is complete. ### Choosing the type of upgrade #### Root User Installs #### Upgrading MariaDB ColumnStore using RPMs Upgrade MariaDB ColumnStore as user root on the server designated as PM1: **Download the package mariadb-columnstore-1.0.5-1-centos#.x86\_64.rpm.tar.gz to the PM1 server where you are installing MariaDB ColumnStore.** Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate a set of RPMs that will reside in the /root/ directory. `tar -zxf mariadb-columnstore-1.0.5-1-centos#.x86_64.rpm.tar.gz` * Upgrade the RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` rpm -e --nodeps $(rpm -qa | grep '^mariadb-columnstore') rpm -ivh mariadb-columnstore-*1.0.5*rpm ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` For RPM Upgrade, the previous configuration file will be saved as: /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /usr/local directory -mariadb-columnstore-1.0.5-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: `mcsadmin shutdownsystem y` * Run pre-uninstall script `/usr/local/mariadb/columnstore/bin/pre-uninstall` * Unpack the tarball, in the /usr/local/ directory. `tar -zxvf -mariadb-columnstore-1.0.5-1.x86_64.bin.tar.gz` * Run post-install scripts `/usr/local/mariadb/columnstore/bin/post-install` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave `/usr/local/mariadb/columnstore/bin/postConfigure -u` ### Upgrading MariaDB ColumnStore using the DEB package A DEB upgrade would be done on a system that supports DEBs like Debian or Ubuntu systems. Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /root directory ``` mariadb-columnstore-1.0.5-1.amd64.deb.tar.gz ``` (DEB 64-BIT) to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate DEBs. ``` tar -zxf mariadb-columnstore-1.0.5-1.amd64.deb.tar.gz ``` * Remove, purge and install all MariaDB ColumnStore debs ``` cd /root/ dpkg -r mariadb-columnstore*deb dpkg -P mariadb-columnstore*deb ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` /usr/local/mariadb/columnstore/bin/postConfigure -u ``` #### Non-Root User Installs ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /home/'non-root-user" directory mariadb-columnstore-1.0.5-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: `mcsadmin shutdownsystem y` * Run pre-uninstall script `$HOME/mariadb/columnstore/bin/pre-uninstall -i /home/guest/mariadb/columnstore` * Unpack the tarball, which will generate the $HOME/ directory. `tar -zxvf -mariadb-columnstore-1.0.5-1.x86_64.bin.tar.gz` * Run post-install scripts 1. $HOME/mariadb/columnstore/bin/post-install -i /home/guest/mariadb/columnstore * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave `$HOME/mariadb/columnstore/bin/postConfigure -u -i /home/guest/mariadb/columnstore` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.help_keyword Table mysql.help\_keyword Table ========================= `mysql.help_keyword` is one of the four tables used by the [HELP command](../help-command/index). It is populated when the server is installed by the `fill_help_table.sql` script. The other help tables are [help\_relation](../mysqlhelp_relation-table/index), [help\_category](../mysqlhelp_category-table/index) and [help\_topic](../mysqlhelp_topic-table/index). **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. The `mysql.help_keyword` table contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `help_keyword_id` | `int(10) unsigned` | NO | PRI | `NULL` | | | `name` | `char(64)` | NO | UNI | `NULL` | | Example ------- ``` SELECT * FROM help_keyword; +-----------------+-------------------------------+ | help_keyword_id | name | +-----------------+-------------------------------+ | 0 | JOIN | | 1 | HOST | | 2 | REPEAT | | 3 | SERIALIZABLE | | 4 | REPLACE | | 5 | AT | | 6 | SCHEDULE | | 7 | RETURNS | | 8 | STARTS | | 9 | MASTER_SSL_CA | | 10 | NCHAR | | 11 | COLUMNS | | 12 | COMPLETION | ... ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb AsWKB AsWKB ===== A synonym for [ST\_AsBinary()](../st_asbinary/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MultiPointFromWKB MultiPointFromWKB ================= A synonym for [MPointFromWKB](../mpointfromwkb/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Buildbot ========= Pages about buildbot. As an example, you can see what's happening with 10.1 [here](http://buildbot.askmonty.org/buildbot/waterfall?branch=10.1). | Title | Description | | --- | --- | | [Buildbot Setup](../buildbot-setup/index) | Pages about buildbot setup | | [About Buildbot](../about-buildbot/index) | Overview, where to find the running builds, setting up a buildbot etc. | | [Branch Protection Using Buildbot](../branch-protection-using-buildbot/index) | MariaDB uses branch protection. ensuring pushes to the repo can't be made w... | | [Buildbot Database Schema](../buildbot-buildbot-database-schema/index) | This page describes the database schema used by Buildbot to save results fr... | | [Buildbot Development](../buildbot-buildbot-development/index) | Developing on the Buildbot code Buildbot has all of the right ideas for sol... | | [Buildbot runvm](../runvm/index) | One type of build we do in BuildBot is to build and test MariaDB binary pac... | | [Buildbot ToDo](../buildbot-todo/index) | Buildbot development ToDo list. | | [Package Testing with Buildbot and KVM](../package-testing-with-buildbot-and-kvm/index) | Buildbot testing of binary MariaDB packages This part of the Buildbot setu... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb PERCENTILE_CONT PERCENTILE\_CONT ================ **MariaDB starting with [10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/)**The PERCENTILE\_CONT() [window function](../window-functions/index) was first introduced with in [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/). Syntax ------ Description ----------- `PERCENTILE_CONT()` (standing for continuous percentile) is a [window function](../window-functions/index) which returns a value which corresponds to the given fraction in the sort order. If required, it will interpolate between adjacent input items. Essentially, the following process is followed to find the value to return: * Get the number of rows in the partition, denoted by N * RN = p\*(N-1), where p denotes the argument to the PERCENTILE\_CONT function * calculate the FRN(floor row number) and CRN(column row number for the group( FRN= floor(RN) and CRN = ceil(RN)) * look up rows FRN and CRN * If (CRN = FRN = RN) then the result is (value of expression from row at RN) * Otherwise the result is * (CRN - RN) \* (value of expression for row at FRN) + * (RN - FRN) \* (value of expression for row at CRN) The [MEDIAN function](../median/index) is a specific case of `PERCENTILE_CONT`, equivalent to `PERCENTILE_CONT(0.5)`. Examples -------- ``` CREATE TABLE book_rating (name CHAR(30), star_rating TINYINT); INSERT INTO book_rating VALUES ('Lord of the Ladybirds', 5); INSERT INTO book_rating VALUES ('Lord of the Ladybirds', 3); INSERT INTO book_rating VALUES ('Lady of the Flies', 1); INSERT INTO book_rating VALUES ('Lady of the Flies', 2); INSERT INTO book_rating VALUES ('Lady of the Flies', 5); SELECT name, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY star_rating) OVER (PARTITION BY name) AS pc FROM book_rating; +-----------------------+--------------+ | name | pc | +-----------------------+--------------+ | Lord of the Ladybirds | 4.0000000000 | | Lord of the Ladybirds | 4.0000000000 | | Lady of the Flies | 2.0000000000 | | Lady of the Flies | 2.0000000000 | | Lady of the Flies | 2.0000000000 | +-----------------------+--------------+ SELECT name, PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY star_rating) OVER (PARTITION BY name) AS pc FROM book_rating; +-----------------------+--------------+ | name | pc | +-----------------------+--------------+ | Lord of the Ladybirds | 5.0000000000 | | Lord of the Ladybirds | 5.0000000000 | | Lady of the Flies | 5.0000000000 | | Lady of the Flies | 5.0000000000 | | Lady of the Flies | 5.0000000000 | +-----------------------+--------------+ SELECT name, PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY star_rating) OVER (PARTITION BY name) AS pc FROM book_rating; +-----------------------+--------------+ | name | pc | +-----------------------+--------------+ | Lord of the Ladybirds | 3.0000000000 | | Lord of the Ladybirds | 3.0000000000 | | Lady of the Flies | 1.0000000000 | | Lady of the Flies | 1.0000000000 | | Lady of the Flies | 1.0000000000 | +-----------------------+--------------+ SELECT name, PERCENTILE_CONT(0.6) WITHIN GROUP (ORDER BY star_rating) OVER (PARTITION BY name) AS pc FROM book_rating; +-----------------------+--------------+ | name | pc | +-----------------------+--------------+ | Lord of the Ladybirds | 4.2000000000 | | Lord of the Ladybirds | 4.2000000000 | | Lady of the Flies | 2.6000000000 | | Lady of the Flies | 2.6000000000 | | Lady of the Flies | 2.6000000000 | +-----------------------+--------------+ ``` See Also -------- * [MEDIAN()](../median/index) - a special case of `PERCENTILE_CONT` equivalent to `PERCENTILE_CONT(0.5)` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mroonga_highlight_html mroonga\_highlight\_html ======================== Syntax ------ ``` mroonga_highlight_html(text[[, query AS query]]) mroonga_highlight_html(text[[, keyword1, ..., keywordN]]) ``` Description ----------- `mroonga_highlight_html` is a [user-defined function](../user-defined-functions/index) (UDF) included with the [Mroonga storage engine](../mroonga/index). It highlights the specified keywords in the target text. See [Creating Mroonga User-Defined Functions](../creating-mroonga-user-defined-functions/index) for details on creating this UDF if required. The optional parameter can either be one or more *keywords*, or a Groonga *query*. The function highlights the specified keywords in the target text by surrounding each keyword with `<span class="keyword">...</span>`, and escaping special HTML characters such as `<` and `>`. Returns highlighted HTML. Examples -------- ``` SELECT mroonga_highlight_html('<p>MariaDB includes the Mroonga storage engine</p>.') AS highlighted_html; +-----------------------------------------------------------------+ | highlighted_html | +-----------------------------------------------------------------+ | &lt;p&gt;MariaDB includes the Mroonga storage engine&lt;/p&gt;. | +-----------------------------------------------------------------+ ``` Highlighting the words `MariaDB` and `Mroonga` in a given text: ``` SELECT mroonga_highlight_html('MariaDB includes the Mroonga storage engine.', 'MariaDB', 'Mroonga') AS highlighted_html; +--------------------------------------------------------------------------------------------------------+ | highlighted_html | +--------------------------------------------------------------------------------------------------------+ | <span class="keyword">MariaDB</span> includes the <span class="keyword">Mroonga</span> storage engine. | +--------------------------------------------------------------------------------------------------------+ ``` The same outcome, formulated as a Groonga query: ``` SELECT mroonga_highlight_html('MariaDB includes the Mroonga storage engine.', 'MariaDB OR Mroonga' AS query) AS highlighted_text; +--------------------------------------------------------------------------------------------------------+ | highlighted_text | +--------------------------------------------------------------------------------------------------------+ | <span class="keyword">MariaDB</span> includes the <span class="keyword">Mroonga</span> storage engine. | +--------------------------------------------------------------------------------------------------------+ ``` See Also -------- * [Creating Mroonga User-Defined Functions](../creating-mroonga-user-defined-functions/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.server mysql.server ============ The `[mysql.server](index)` startup script is in MariaDB distributions on Linux and Unix. It is a wrapper that works as a standard [sysVinit](../sysvinit/index) script. However, it can be used independently of [sysVinit](../sysvinit/index) as a regular `sh` script. The script starts the `[mysqld](../mysqld-options/index)` server process by first changing its current working directory to the MariaDB install directory and then starting `[mysqld\_safe](../mysqld_safe/index)`. The script requires the standard [sysVinit](../sysvinit/index) arguments, such as `start`, `stop`, `restart`, and `status`. For example: ``` mysql.server start mysql.server restart mysql.server stop mysql.server status ``` It can be used on systems such as Linux, Solaris, and Mac OS X. The `mysql.server` script starts `[mysqld](../mysqld-options/index)` by first changing to the MariaDB install directory and then calling `[mysqld\_safe](https://mariadb.com/mysqld_safe)`. Using mysql.server ------------------ The command to use `mysql.server` and the general syntax is: ``` mysql.server [ start | stop | restart | status ] <options> <mysqld_options> ``` ### Options If an unknown option is provided to `mysqld_safe` on the command-line, then it is passed to `mysqld_safe`. `mysql.server` supports the following options: | Option | Description | | --- | --- | | `--basedir=path` | The path to the MariaDB installation directory. | | `--datadir=path` | The path to the MariaDB data directory. | | `--pid-file=file_name` | The path name of the file in which the server should write its process ID. If not provided, the default, `host_name.pid` is used. | | `--service-startup-timeout=file_name` | How long in seconds to wait for confirmation of server startup. If the server does not start within this time, *mysql.server* exits with an error. The default value is 900. A value of 0 means not to wait at all for startup. Negative values mean to wait forever (no timeout). | | `--use-mysqld_safe` | Use [mysqld\_safe](../mysqld_safe/index) to start the server. This is the default. | | `--use-manager` | Use Instance Manager to start the server. | | `--user=user_name` | The login user name to use for running `mysqld`. | ### Option Files In addition to reading options from the command-line, `mysql.server` can also read options from [option files](../configuring-mariadb-with-option-files/index). The following options relate to how MariaDB command-line tools handles option files. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | #### Option Groups `mysql.server` reads options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysql.server]` | Options read by `mysql.server`, which includes both MariaDB Server and MySQL Server. | `mysql.server` also reads options from the following server [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysqld]` | Options read by `mysqld`, which includes both MariaDB Server and MySQL Server. | | `[server]` | Options read by MariaDB Server. | | `[mysqld-X.Y]` | Options read by a specific version of `mysqld`, which includes both MariaDB Server and MySQL Server. For example, `[mysqld-5.5]`. | | `[mariadb]` | Options read by MariaDB Server. | | `[mariadb-X.Y]` | Options read by a specific version of MariaDB Server. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[galera]` | Options read by a galera-capable MariaDB Server. Available on systems compiled with Galera support. | ### Customizing mysql.server If you have installed MariaDB to a non-standard location, then you may need to edit the `mysql.server` script to get it to work right. If you do not want to edit the `mysql.server` script itself, then `mysql.server` also sources a few other `sh` scripts. These files can be used to set any variables that might be needed to make the script work in your specific environment. The files are: * /etc/default/mysql * /etc/sysconfig/mysql * /etc/conf.d/mysql Installed Locations ------------------- `mysql.server` can be found in the `support-files` directory under your MariaDB installation directory or in a MariaDB source distribution. ### Installed SysVinit Locations On systems that use [sysVinit](../sysvinit/index), `mysql.server` may also be installed in other locations and with other names. If you installed MariaDB on Linux using [RPMs](../rpm/index), then the `mysql.server` script will be installed into the `/etc/init.d` directory with the name `mysql`. You need not install it manually. #### Manually Installing with SysVinit If you install MariaDB from [source](../compiling-mariadb-from-source/index) or from a [binary tarball](../installing-mariadb-binary-tarballs/index) that does not install `[mysql.server](index)` automatically, and if you are on a system that uses [sysVinit](../sysvinit/index), then you can manually install `mysql.server` with [sysVinit](../sysvinit/index). This is usually done by copying it to `/etc/init.d/` and then creating specially named symlinks in the appropriate `/etc/rcX.d/` directories (where 'X' is a number between 0 and 6). In the examples below we will follow the historical convention of renaming the `mysql.server` script to '`mysql`' when we copy it to `/etc/init.d/`. The first step for most Linux distributions is to copy the `mysql.server` script to `/etc/init.d/` and make it executable: ``` cd /path/to/your/mariadb-version/support-files/ cp mysql.server /etc/init.d/mysql chmod +x /etc/init.d/mysql ``` Now all that is needed is to create the specially-named symlinks. On both RPM and Debian-based Linux distributions there are tools which do this for you. Consult your distribution's documentation if neither of these work for you and follow their instructions for generating the symlinks or creating them manually. On RPM-based distributions (like Fedora and CentOS), you use `chkconfig`: ``` chkconfig --add mysql chkconfig --level 345 mysql on ``` On Debian-based distributions you use `update-rc.d`: ``` update-rc.d mysql defaults ``` On FreeBSD, the location for startup scripts is `/usr/local/etc/rc.d/` and when you copy the `mysql.server` script there you should rename it so that it matches the `*.sh` pattern, like so: ``` cd /path/to/your/mariadb/support-files/ cp mysql.server /usr/local/etc/rc.d/mysql.server.sh ``` As stated above, consult your distribution's documentation for more information on starting services like MariaDB at system startup. See [mysqld startup options](../mysqld-startup-options/index) for information on configuration options for `mysqld`. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Aria Status Variables Aria Status Variables ===================== This page documents status variables related to the [Aria storage engine](../aria/index). See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with [SHOW STATUS](../show-status/index). See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `Aria_pagecache_blocks_not_flushed` * **Description:** The number of dirty blocks in the Aria page cache. The global value can be flushed by `[FLUSH STATUS](../flush/index)`. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_blocks_unused` * **Description:** Free blocks in the Aria page cache. The global value can be flushed by `[FLUSH STATUS](../flush/index)`. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_blocks_used` * **Description:** Blocks used in the Aria page cache. The global value can be flushed by `[FLUSH STATUS](../flush/index)`. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_read_requests` * **Description:** The number of requests to read something from the Aria page cache. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_reads` * **Description:** The number of Aria page cache read requests that caused a block to be read from the disk. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_write_requests` * **Description:** The number of requests to write a block to the Aria page cache. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_pagecache_writes` * **Description:** The number of blocks written to disk from the Aria page cache. * **Scope:** Global * **Data Type:** `numeric` --- #### `Aria_transaction_log_syncs` * **Description:** The number of Aria log fsyncs. * **Scope:** Global * **Data Type:** `numeric` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Date and Time Units Date and Time Units =================== The `INTERVAL` keyword can be used to add or subtract a time interval of time to a `[DATETIME](../datetime/index)`, `[DATE](../date/index)` or `[TIME](../time/index)` value. The syntax is: ``` INTERVAL time_quantity time_unit ``` For example, the `SECOND` unit is used below by the `[DATE\_ADD()](../date_add/index)` function: ``` SELECT '2008-12-31 23:59:59' + INTERVAL 1 SECOND; +-------------------------------------------+ | '2008-12-31 23:59:59' + INTERVAL 1 SECOND | +-------------------------------------------+ | 2009-01-01 00:00:00 | +-------------------------------------------+ ``` The following units are valid: | Unit | Description | | --- | --- | | `MICROSECOND` | Microseconds | | `SECOND` | Seconds | | `MINUTE` | Minutes | | `HOUR` | Hours | | `DAY` | Days | | `WEEK` | Weeks | | `MONTH` | Months | | `QUARTER` | Quarters | | `YEAR` | Years | | `SECOND_MICROSECOND` | Seconds.Microseconds | | `MINUTE_MICROSECOND` | Minutes.Seconds.Microseconds | | `MINUTE_SECOND` | Minutes.Seconds | | `HOUR_MICROSECOND` | Hours.Minutes.Seconds.Microseconds | | `HOUR_SECOND` | Hours.Minutes.Seconds | | `HOUR_MINUTE` | Hours.Minutes | | `DAY_MICROSECOND` | Days Hours.Minutes.Seconds.Microseconds | | `DAY_SECOND` | Days Hours.Minutes.Seconds | | `DAY_MINUTE` | Days Hours.Minutes | | `DAY_HOUR` | Days Hours | | `YEAR_MONTH` | Years-Months | The time units containing an underscore are composite; that is, they consist of multiple base time units. For base time units, `time_quantity` is an integer number. For composite units, the quantity must be expressed as a string with multiple integer numbers separated by any punctuation character. Example of composite units: ``` INTERVAL '2:2' YEAR_MONTH INTERVAL '1:30:30' HOUR_SECOND INTERVAL '1!30!30' HOUR_SECOND -- same as above ``` Time units can be used in the following contexts: * after a `[+](../addition-operator/index)` or a `[-](../subtraction-operator-/index)` operator; * with the following `DATE` or `TIME` functions: `[ADDDATE()](../adddate/index)`, `[SUBDATE()](../subdate/index)`, `[DATE\_ADD()](../date_add/index)`, `[DATE\_SUB()](../date_sub/index)`, `[TIMESTAMPADD()](../timestampadd/index)`, `[TIMESTAMPDIFF()](../timestampdiff/index)`, `[EXTRACT()](../extract/index)`; * in the `ON SCHEDULE` clause of `[CREATE EVENT](../create-event/index)` and `[ALTER EVENT](../alter-event/index)`. * when defining a [partitioning](../create-table/index#partitions) `BY SYSTEM_TIME` See also -------- * [Date and time literals](../date-and-time-literals/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Partial Backup and Restore with Mariabackup Partial Backup and Restore with Mariabackup =========================================== When using Mariabackup, you have the option of performing partial backups. Partial backups allow you to choose which databases or tables to backup, as long as the table or partition involved is in an [InnoDB file-per-table tablespace](../innodb-file-per-table-tablespaces/index).This page documents how to perform partial backups. Backing up the Database Server ------------------------------ Just like with [full backups](../full-backup-and-restore-with-mariabackup/index), in order to back up the database, you need to run Mariabackup with the `[--backup](../mariabackup-options/index#-backup)` option to tell it to perform a backup and with the `[--target-dir](../mariabackup-options/index#-target-dir)` option to tell it where to place the backup files. The target directory must be empty or not exist. For a partial backup, there are a few other arguments that you can provide as well: * To tell it which databases to backup, you can provide the `[--databases](../mariabackup-options/index#-databases)` option. * To tell it which databases to exclude from the backup, you can provide the `[--databases-exclude](../mariabackup-options/index#-databases-exclude)` option. * To tell it to check a file for the databases to backup, you can provide the `[--databases-file](../mariabackup-options/index#-databases-file)` option. * To tell it which tables to backup, you can use the `[--tables](../mariabackup-options/index#-tables)` option. * To tell it which tables to exclude from the backup, you can provide the `[--tables-exclude](../mariabackup-options/index#-tables-exclude)` option. * To tell it to check a file for specific tables to backup, you can provide the `[--tables-file](../mariabackup-options/index#-tables-file)` option. The non-file partial backup options support regex in the database and table names. For example, to take a backup of any database that starts with the string `app1_` and any table in those databases that start with the string `tab_`, run the following command: ``` $ mariabackup --backup \ --target-dir=/var/mariadb/backup/ \ --databases='app1_*' --tables='tab_*' \ --user=mariabackup --password=mypassword ``` Mariabackup cannot currently backup a subset of partitions from a partitioned table. Backing up a partitioned table is currently an all-or-nothing selection. See [MDEV-17132](https://jira.mariadb.org/browse/MDEV-17132) about that. If you need to backup a subset of partitions, then one possibility is that instead of using Mariabackup, you can [export the file-per-table tablespaces of the partitions](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces). The time the backup takes depends on the size of the databases or tables you're backing up. You can cancel the backup if you need to, as the backup process does not modify the database. Mariabackup writes the backup files the target directory. If the target directory doesn't exist, then it creates it. If the target directory exists and contains files, then it raises an error and aborts. Preparing the Backup -------------------- Just like with [full backups](../full-backup-and-restore-with-mariabackup/index), the data files that Mariabackup creates in the target directory are not point-in-time consistent, given that the data files are copied at different times during the backup operation. If you try to restore from these files, InnoDB notices the inconsistencies and crashes to protect you from corruption. In fact, for partial backups, the backup is not even a completely functional MariaDB data directory, so InnoDB would raise more errors than it would for full backups. This point will also be very important to keep in mind during the restore process. Before you can restore from a backup, you first need to **prepare** it to make the data files consistent. You can do so with the `[--prepare](../mariabackup-options/index#-prepare)` command option. Partial backups rely on [InnoDB's transportable tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces). For MariaDB to import tablespaces like these, [InnoDB](../xtradb-and-innodb/index) looks for a file with a `.cfg` extension. For Mariabackup to create these files, you also need to add the `[--export](../mariabackup-options/index#-export)` option during the prepare step. For example, you might execute the following command: ``` $ mariabackup --prepare --export \ --target-dir=/var/mariadb/backup/ ``` If this operation completes without error, then the backup is ready to be restored. **MariaDB until [10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/)**In [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/) and before, Mariabackup did not support the `[--export](../mariabackup-options/index#-export)` option. See [MDEV-13466](https://jira.mariadb.org/browse/MDEV-13466) about that. In these versions of MariaDB, this means that Mariabackup could not create `.cfg` files for [InnoDB file-per-table tablespaces](../innodb-file-per-table-tablespaces/index) during the `--prepare` stage. You can still [import file-per-table tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces) without the `.cfg` files in many cases, so it may still be possible in those versions to [restore partial backups](index) or to [restore individual tables and partitions](../restoring-individual-tables-and-partitions-with-mariabackup/index) with just the `.ibd` files. If you have a [full backup](../full-backup-and-restore-with-mariabackup/index) and you need to create `.cfg` files for [InnoDB file-per-table tablespaces](../innodb-file-per-table-tablespaces/index), then you can do so by preparing the backup as usual without the `--export` option, and then restoring the backup, and then starting the server. At that point, you can use the server's built-in features to [copy the transportable tablespaces](../innodb-file-per-table-tablespaces/index#copying-transportable-tablespaces). Restoring the Backup -------------------- The restore process for partial backups is quite different than the process for [full backups](../full-backup-and-restore-with-mariabackup/index). A partial backup is not a completely functional data directory. The data dictionary in the [InnoDB system tablespace](../innodb-system-tablespaces/index) will still contain entries for the databases and tables that were not included in the backup. Rather than using the `[--copy-back](../mariabackup-options/index#-copy-back)` or the `[--move-back](../mariabackup-options/index#-move-back)`, each individual [InnoDB file-per-table tablespace](../innodb-file-per-table-tablespaces/index) file will have to be manually imported into the target server. The process that is used to import the file will depend on whether partitioning is involved. ### Restoring Individual Non-Partitioned Tables To restore individual non-partitioned tables from a backup, find the `.ibd` and `.cfg` files for the table in the backup, and then import them using the [Importing Transportable Tablespaces for Non-partitioned Tables](../innodb-file-per-table-tablespaces/index#importing-transportable-tablespaces-for-non-partitioned-tables) process. ### Restoring Individual Partitions and Partitioned Tables To restore individual partitions or partitioned tables from a backup, find the `.ibd` and `.cfg` files for the partition(s) in the backup, and then import them using the [Importing Transportable Tablespaces for Partitioned Tables](../innodb-file-per-table-tablespaces/index#importing-transportable-tablespaces-for-partitioned-tables) process. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB ColumnStore System Usage MariaDB ColumnStore System Usage ================================ Once the MariaDB ColumnStore system installation has been completed, these are some of the basic commands to access the MariaDB ColumnStore Admin and MySQL Console Non-root user MariaDB ColumnStore Admin console ----------------------------------------------- The MariaDB ColumnStore Admin console that is run from the command line console as root user can be setup to be run for a non-root user, if you choose to do so. This would require a change in the /etc/sudoers file. After this line: ``` # %wheel ALL=(ALL) NOPASSWD: ALL ``` Add, where 'user' is the non-root username: ``` user ALL=(ALL) NOPASSWD: /usr/local/mariadb/columnstore/bin/mcsadmin ``` To run the command, you would need to enter the full path or you can setup the alias's by entering the following command: ``` . /usr/local/mariadb/columnstore/bin/columnstoreAlias ``` Now you can run both console commands for a non-root user account: 'mcsmysql' and 'mcsadmin' NOTE: The same setup can be done for other commands like 'cpimport'. MariaDB ColumnStore aliases --------------------------- To configure the MariaDB ColumnStore Aliases, run the following: ``` . /usr/local/mariadb/columnstore/bin/columnstoreAlias ``` Note: This script will also be added to the /root/.bash\_profile. The following alias will be created after running the Alias: ``` mcsmysql = /usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root ``` mcsmysql: Launches the MariaDB ColumnStore MySQL Console ``` mcsadmin = /usr/local/mariadb/columnstore/bin/mcsadmin ``` mcsadmin: Launches the MariaDB ColumnStore Admin Console mcsadmin -------- The MariaDB ColumnStore Management Console allows you to configure, monitor, and manage the MariaDB ColumnStore system and servers. For more detailed information, see [MariaDB ColumnStore Administrative Console](../mariadb-columnstore-administrative-console/index). These 2 examples will provide a full command list ``` mcsadmin help ``` Or ``` mcsadmin mcsadmin> help ``` To get a verbose help on a specific command, enter: ``` mcsadmin help getsysteminfo ``` NOTE: You can also short-cut commands, both of these do the same command: ``` mcsadmin getsysteminfo mcsadmin getsystemi ``` Check system status ``` mcsadmin getsystemstatus getsystemstatus Tue Jan 12 08:07:02 2012 System mymcs1 System and Module statuses Component Status Last Status Change ------------ ---------------------- ------------------------ System ACTIVE Mon Jan 11 17:54:46 2012 Module pm1 ACTIVE Mon Jan 11 17:54:45 2012 ``` Check system info, which provides process status ``` mcsadmin getsysteminfo ``` ### Shutting down the system When you perform a shutdown, all MariaDB ColumnStore processes are stopped. This command would be used mainly when performing software upgrades. To shutdown the system: * From the MariaDB ColumnStore Console, type shutdownSystem * Press y ``` mcsadmin shutdownSystem y ``` ### Stopping the system Stopping the system stops the application processes. The platform process that supports the Management Console and System Alarms remain active. If you want to stop the system or server and immediately start the processes again (typically if the system or a server hangs), you can restart the system or servers as shown in the section “Restarting the system”. To stop the system: * From the MariaDB ColumnStore Console, type stopSystem * Press y ``` mcsadmin stopSystem y ``` ### Starting the system or modules You can start the system or module application processes with the following commands: To start the system after a stopSystem: * From the MariaDB ColumnStore Console, type startSystem ``` mcsadmin startSystem ``` To start the system after a shutdownSystem: If its a multi-server system and ssh-keys are not configured between the servers, you will be required to provide the user password for the other servers. If ssh-keys are configured, then password parameter isn't required * From the MariaDB ColumnStore Console, type startSystem ``` mcsadmin startSystem 'user-password' ``` ### Restarting the system When you want to stop and immediately start application processes, you can perform a restart. You restart the system or modules application processes with the following commands: To restart the system: * From the MariaDB ColumnStore Console, type restartSystem ``` mcsadmin restartSystem ``` Logging into MariaDB ColumnStore MariaDB console ------------------------------------------------ a Linux prompt: ``` mcsmysql [optional database name] ``` ### MariaDB Root user password When a MariaDB Root user password is configured, do the following to access the MariaDB console: ``` mcsmysql -p'password' [optional database name] ``` Setup this file in the user account where MariaDB ColumnStore was installed, .my.cnf So for root user install, it would be /root/.my.cnf ``` [client] user = root password = 'password' ``` Make sure the permissions are set appropriately: ``` # chmod 0600 /root/.my.cnf ``` <https://dev.mysql.com/doc/refman/5.7/en/password-security-user.html> IMPORTANT - If there is no MariaDB Root user password set, make sure there is no .my.cnf file. This could cause failures in install and upgrades if this file exist when no password is set. Example MariaDB ColumnStore database setup ------------------------------------------ Once logged into mcsmysql: ``` create database mcs; use mcs; create table idbtest(col1 int, col2 int) engine=columnstore; show create table idbtest; insert into idbtest values (1, 2); insert into idbtest values (3, 4); select * from idbtest; ``` Importing data into MariaDB ColumnStore --------------------------------------- While MariaDB ColumnStore supports multiple ways to get data into the database (individual insert, batch insert, load data infile and import), the most efficient manner to load significant amounts of data into MariaDB ColumnStore is through the import utility. * A delimited import file should be created to match the table that you want to import data to similar to the following. In this example, the file will be saved as idbtest.tbl: ``` 100|1001| 200|2002| ``` * Save/place this file in a directory * From that same directory, import the rows: ``` /usr/local/mariadb/columnstore/bin/cpimport mcs idbtest idbtest.tbl ``` #### `Configuring_to_use_UTF-8_Character_sets` Configuring to use UTF-8 Character sets --------------------------------------- MariaDB Columnstore has the ability to support UTF-8 character sets. This profile may be set as a default for the instance or set at the session level. Please refer to the SQL Syntax Guide for the setting UTF-8 profile at the session level. To set UTF-8 profile at the instance level, specify the following in my.cnf and the Columnstore.xml files. my.cnf To configure the MariaDB Locale language, modify the my.cnf file (/usr/local/mariadb/columnstore/mysql): ``` [client] default-character-set=utf8 [mysqld] character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' ``` Columnstore.xml To configure the ColumnStore Locale language, modify the Columnstore.xml files (/usr/local/mariadb/columnstore/etc) ``` <SystemConfig> <SystemLang>en_US.utf8</SystemLang> ``` where value is a valid locale for the operating system. The recommended setting is en\_US.utf8. Alternatively, you can set the value as follows ``` /usr/local/mariadb/columnstore/bin/setConfig SystemConfig SystemLang en_US.utf8 ``` Any tables containing UTF-8 data must have the default character set specified as 'utf8', for example: ``` create table airports ( code char(3), airport varchar(100), city varchar(50), state char(50), country char(100), latitude float, longitude float ) engine=columnstore default character set=utf8; ``` Importing UTF-8 data -------------------- When using the cpimport utility, the input file must be converted to UTF-8 data. The Linux program iconv is one utility to convert it. ``` iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Benchmarking Benchmarking ============ Published Results ----------------- * [Benchmark Results](../benchmark-results/index) Systemtap --------- * Useful scripts: <http://sourceware.org/systemtap/examples/keyword-index.html#DISK> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_CONTAINS ST\_CONTAINS ============ Syntax ------ ``` ST_CONTAINS(g1,g2) ``` Description ----------- Returns `1` or `0` to indicate whether a geometry `g1` completely contains geometry `g2`. ST\_CONTAINS() uses object shapes, while [CONTAINS()](../contains/index), based on the original MySQL implementation, uses object bounding rectangles. ST\_CONTAINS tests the opposite relationship to [ST\_WITHIN()](../st_within/index). Examples -------- ``` SET @g1 = ST_GEOMFROMTEXT('POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))'); SET @g2 = ST_GEOMFROMTEXT('POINT(174 149)'); SELECT ST_CONTAINS(@g1,@g2); +----------------------+ | ST_CONTAINS(@g1,@g2) | +----------------------+ | 1 | +----------------------+ SET @g2 = ST_GEOMFROMTEXT('POINT(175 151)'); SELECT ST_CONTAINS(@g1,@g2); +----------------------+ | ST_CONTAINS(@g1,@g2) | +----------------------+ | 0 | +----------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb || || == Syntax ------ ``` OR, || ``` Description ----------- Logical OR. When both operands are non-NULL, the result is 1 if any operand is non-zero, and 0 otherwise. With a NULL operand, the result is 1 if the other operand is non-zero, and NULL otherwise. If both operands are NULL, the result is NULL. For this operator, [short-circuit evaluation](../operator-precedence/index#short-circuit-evaluation) can be used. Note that, if the `PIPES_AS_CONCAT` [SQL\_MODE](../sql-mode/index) is set, `||` is used as a string concatenation operator. This means that `a || b` is the same as `CONCAT(a,b)`. See `[CONCAT()](../concat/index)` for details. ### Oracle Mode **MariaDB starting with [10.3](../what-is-mariadb-103/index)**In [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#null-handling), `||` ignores [NULL](null). Examples -------- ``` SELECT 1 || 1; +--------+ | 1 || 1 | +--------+ | 1 | +--------+ SELECT 1 || 0; +--------+ | 1 || 0 | +--------+ | 1 | +--------+ SELECT 0 || 0; +--------+ | 0 || 0 | +--------+ | 0 | +--------+ SELECT 0 || NULL; +-----------+ | 0 || NULL | +-----------+ | NULL | +-----------+ SELECT 1 || NULL; +-----------+ | 1 || NULL | +-----------+ | 1 | +-----------+ ``` In [Oracle mode](../sql_modeoracle-from-mariadb-103/index#null-handling), from [MariaDB 10.3](../what-is-mariadb-103/index): ``` SELECT 0 || NULL; +-----------+ | 0 || NULL | +-----------+ | 0 | +-----------+ ``` See Also -------- * [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#null-handling) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb DECLARE CONDITION DECLARE CONDITION ================= Syntax ------ ``` DECLARE condition_name CONDITION FOR condition_value condition_value: SQLSTATE [VALUE] sqlstate_value | mysql_error_code ``` Description ----------- The `DECLARE ... CONDITION` statement defines a named error condition. It specifies a condition that needs specific handling and associates a name with that condition. Later, the name can be used in a [DECLARE ... HANDLER](../declare-handler/index), [SIGNAL](../signal/index) or [RESIGNAL](../resignal/index) statement (as long as the statement is located in the same [BEGIN ... END](../begin-end/index) block). Conditions must be declared after [local variables](../declare-variable/index), but before [CURSORs](../programmatic-and-compound-statements-cursors/index) and [HANDLERs](../declare-handler/index). A condition\_value for `DECLARE ... CONDITION` can be an [SQLSTATE](../sqlstate/index) value (a 5-character string literal) or a MySQL error code (a number). You should not use SQLSTATE value '00000' or MySQL error code 0, because those indicate sucess rather than an error condition. If you try, or if you specify an invalid SQLSTATE value, an error like this is produced: ``` ERROR 1407 (42000): Bad SQLSTATE: '00000' ``` For a list of SQLSTATE values and MariaDB error codes, see [MariaDB Error Codes](../mariadb-error-codes/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT XCOL Table Type CONNECT XCOL Table Type ======================= `XCOL` tables are based on another table or view, like `[PROXY](../connect-table-types-proxy-table-type/index)` tables. This type can be used when the object table has a column that contains a list of values. Suppose we have a *'children'* table that can be displayed as: | name | childlist | | --- | --- | | Sophie | Vivian, Antony | | Lisbeth | Lucy,Charles,Diana | | Corinne | | | Claude | Marc | | Janet | Arthur, Sandra, Peter, John | We can have a different view on these data, where each child will be associated with his/her mother by creating an `XCOL` table by: ``` CREATE TABLE xchild ( mother char(12) NOT NULL, child char(12) DEFAULT NULL flag=2 ) ENGINE=CONNECT table_type=XCOL tabname='chlist' option_list='colname=child'; ``` The `COLNAME` option specifies the name of the column receiving the list items. This will return from: ``` select * from xchild; ``` The requested view: | mother | child | | --- | --- | | Sophia | Vivian | | Sophia | Antony | | Lisbeth | Lucy | | Lisbeth | Charles | | Lisbeth | Diana | | Corinne | NULL | | Claude | Marc | | Janet | Arthur | | Janet | Sandra | | Janet | Peter | | Janet | John | Several things should be noted here: * When the original *children* field is void, what happens depends on the NULL specification of the "multiple" column. If it is nullable, like here, a void string will generate a NULL value. However, if the column is not nullable, no row will be generated at all. * Blanks after the separator are ignored. * No copy of the original data was done. Both tables use the same source data. * Specifying the column definitions in the `CREATE TABLE` statement is optional. The "multiple" column *child* can be used as any other column. For instance: ``` select * from xchild where substr(child,1,1) = 'A'; ``` This will return: | Mother | Child | | --- | --- | | Sophia | Antony | | Janet | Arthur | If a query does not involve the "multiple" column, no row multiplication will be done. For instance: ``` select mother from xchild; ``` This will just return all the mothers: | mother | | --- | | Sophia | | Lisbeth | | Corinne | | Claude | | Janet | The same occurs with other types of select statements, for instance: ``` select count(*) from xchild; -- returns 5 select count(child) from xchild; -- returns 10 select count(mother) from xchild; -- returns 5 ``` Grouping also gives different result: ``` select mother, count(*) from xchild group by mother; ``` Replies: | mother | count(\*) | | --- | --- | | Claude | 1 | | Corinne | 1 | | Janet | 1 | | Lisbeth | 1 | | Sophia | 1 | While the query: ``` select mother, count(child) from xchild group by mother; ``` Gives the more interesting result: | mother | count(child) | | --- | --- | | Claude | 1 | | Corinne | 0 | | Janet | 4 | | Lisbeth | 3 | | Sophia | 2 | Some more options are available for this table type: | Option | Description | | --- | --- | | Sep\_char | The separator character used in the "multiple" column, defaults to the comma. | | Mult | Indicates the max number of multiple items. It is used to internally calculate the max size of the table and defaults to 10. (To be specified in `OPTION_LIST`). | Using Special Columns with XCOL ------------------------------- Special columns can be used in XCOL tables. The mostly useful one is ROWNUM that gives the rank of the value in the list of values. For instance: ``` CREATE TABLE xchild2 ( rank int NOT NULL SPECIAL=ROWID, mother char(12) NOT NULL, child char(12) NOT NULL flag=2 ) ENGINE=CONNECT table_type=XCOL tabname='chlist' option_list='colname=child'; ``` This table will be displayed as: | rank | mother | child | | --- | --- | --- | | 1 | Sophia | Vivian | | 2 | Sophia | Antony | | 1 | Lisbeth | Lucy | | 2 | Lisbeth | Charles | | 3 | Lisbeth | Diana | | 1 | Claude | Marc | | 1 | Janet | Arthur | | 2 | Janet | Sandra | | 3 | Janet | Peter | | 4 | Janet | John | To list only the first child of each mother you can do: ``` SELECT mother, child FROM xchild2 where rank = 1 ; ``` returning: | mother | child | | --- | --- | | Sophia | Vivian | | Lisbeth | Lucy | | Claude | Marc | | Janet | Arthur | However, note the following pitfall: trying to get the names of all mothers having more than 2 children cannot be done by: ``` SELECT mother FROM xchild2 where rank > 2; ``` This is because with no row multiplication being done, the rank value is always 1. The correct way to obtain this result is longer but cannot use the ROWNUM column: ``` SELECT mother FROM xchild2 group by mother having count(child) > 2; ``` XCOL tables based on specified views ------------------------------------ Instead of specifying a source table name via the TABNAME option, it is possible to retrieve data from a “view” whose definition is given in a new option SRCDEF . For instance: ``` create table xsvars engine=connect table_type=XCOL srcdef='show variables like "optimizer_switch"' option_list='Colname=Value'; ``` Then, for instance: ``` select value from xsvars limit 10; ``` This will display something like: | value | | --- | | index\_merge=on | | index\_merge\_union=on | | index\_merge\_sort\_union=on | | index\_merge\_intersection=on | | index\_merge\_sort\_intersection=off | | engine\_condition\_pushdown=off | | index\_condition\_pushdown=on | | derived\_merge=on | | derived\_with\_keys=on | | firstmatch=on | Note: All XCOL tables are read only. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb 10.3.3-beta Release Upgrade Tests 10.3.3-beta Release Upgrade Tests ================================= ### Tested revision 52c40b406d5a68bf774a75dc6fa9ef1c166b22b1 ### Test date 2017-12-24 ### Summary Some tests failed due to the known bug [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103). Crash upgrade from 10.3.2 fails due to an incompatible change (removal of MLOG\_UNDO\* record types), allowed for Alpha=>Beta transition. ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | recovery | 16 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 16 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 4 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 4 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 32 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 32 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 8 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 8 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 16 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 16 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 4 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 4 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 8 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 8 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 16 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 4 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 32 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 64 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 8 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 16 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 4 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 32 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 64 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 8 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 16 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 4 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 32 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 64 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 8 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 16 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 4 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 32 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 64 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 8 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.3.2 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.3.2 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.3.2 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.3.2 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.11 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.11 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.11 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.11 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.3 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.3 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.3 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.3 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 64 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 32 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 16 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 64 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 32 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 32 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 64 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 32 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 64 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.7.20 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 4 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.6.38 (inbuilt) | | - | - | => | 10.3.3 (inbuilt) | | - | - | - | OK | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ROWNUM ROWNUM ====== **MariaDB starting with [10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/)**From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/), the `ROWNUM()` function is supported. Syntax ------ ``` ROWNUM() ``` In [Oracle mode](../sql_modeoracle/index) one can just use `ROWNUM`, without the parentheses. Description ----------- `ROWNUM()` returns the current number of accepted rows in the current context. It main purpose is to emulate the `ROWNUM` [pseudo column in Oracle](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/ROWNUM-Pseudocolumn.html#GUID-2E40EC12-3FCF-4A4F-B5F2-6BC669021726). For MariaDB native applications, we recommend the usage of [LIMIT](../limit/index), as it is easier to use and gives more predictable results than the usage of `ROWNUM()`. The main difference between using `LIMIT` and `ROWNUM()` to limit the rows in the result is that `LIMIT` works on the result set while `ROWNUM` works on the number of accepted rows (before any `ORDER` or `GROUP BY` clauses). The following queries will return the same results: ``` SELECT * from t1 LIMIT 10; SELECT * from t1 WHERE ROWNUM() <= 10; ``` While the following may return different results based on in which orders the rows are found: ``` SELECT * from t1 ORDER BY a LIMIT 10; SELECT * from t1 ORDER BY a WHERE ROWNUM() <= 10; ``` The recommended way to use `ROWNUM` to limit the number of returned rows and get predictable results is to have the query in a subquery and test for `ROWNUM()` in the outer query: ``` SELECT * FROM (select * from t1 ORDER BY a) WHERE ROWNUM() <= 10; ``` `ROWNUM()` can be used in the following contexts: * [SELECT](../select/index) * [INSERT](../insert/index) * [UPDATE](../update/index) * [DELETE](../delete/index) * [LOAD DATA INFILE](../load-data-infile/index) Used in other contexts, `ROWNUM()` will return 0. Examples -------- ``` INSERT INTO t1 VALUES (1,ROWNUM()),(2,ROWNUM()),(3,ROWNUM()); INSERT INTO t1 VALUES (1),(2) returning a, ROWNUM(); UPDATE t1 SET row_num_column=ROWNUM(); DELETE FROM t1 WHERE a < 10 AND ROWNUM() < 2; LOAD DATA INFILE 'filename' into table t1 fields terminated by ',' lines terminated by "\r\n" (a,b) set c=ROWNUM(); ``` Optimizations ------------- In many cases where `ROWNUM()` is used, MariaDB will use the same optimizations it uses with [LIMIT](../limit/index). `LIMIT` optimization is possible when using `ROWNUM` in the following manner: * When one is in a top level `WHERE` clause comparing `ROWNUM()` with a numerical constant using any of the following expressions: + `ROWNUM()` < number + `ROWNUM()` <= number + `ROWNUM()` = 1 `ROWNUM()` can be also be the right argument to the comparison function. In the above cases, `LIMIT` optimization can be done in the following cases: * For the current sub query when the ROWNUM comparison is done on the top level: ``` SELECT * from t1 WHERE ROWNUM() <= 2 AND t1.a > 0 ``` * For an inner sub query, when the upper level has only a `ROWNUM()` comparison in the `WHERE` clause: ``` SELECT * from (select * from t1) as t WHERE ROWNUM() <= 2 ``` Other Changes Related to ROWNUM ------------------------------- When `ROWNUM()` is used anywhere in a query, the optimization to ignore `ORDER BY` in subqueries are disabled. This was done to get the following common Oracle query to work as expected: ``` select * from (select * from t1 order by a desc) as t where rownum() <= 2; ``` By default MariaDB ignores any `ORDER BY` in subqueries both because the SQL standard defines results sets in subqueries to be un-ordered and because of performance reasons (especially when using views in subqueries). See [MDEV-3926](https://jira.mariadb.org/browse/MDEV-3926) "Wrong result with GROUP BY ... WITH ROLLUP" for a discussion of this topic. Other Considerations -------------------- While MariaDB tries to emulate Oracle's usage of `ROWNUM()` as closely as possible, there are cases where the result is different: * When the optimizer finds rows in a different order (because of different storage methods or optimization). This may also happen in Oracle if one adds or deletes an index, in which case the rows may be found in a different order. Note that usage of `ROWNUM()` in functions or [stored procedures](../stored-procedures/index) will use their own context, not the caller's context. See Also -------- * [MDEV-24089](https://jira.mariadb.org/browse/MDEV-24089) support oracle syntax: rownum * [LIMIT clause](../limit/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore User Defined Functions ColumnStore User Defined Functions ================================== Introduction ------------ MariaDB provides extensibility support through user defined functions. For more details on the MariaDB server framework see the [user-defined-functions](../user-defined-functions/index) article. This documentation applies to MariaDB ColumnStore version 1.0.10 and above. MariaDB ColumnStore provides scale out query processing and as such requires a separate distributed implementation of each SQL function. This allows for the function application to happen on each PM server node providing distributed scale out performance. Thus, to fully implement a user defined function for MariaDB ColumnStore requires implementing 2 different API's: * The MariaDB server UDF API: This allows utilization on all storage engines and is the implementation used if applied in the select list. * The ColumnStore distributed UDF API: This enables distributed execution of where clause and group by usage of the function and will be pushed down to PM nodes for execution where possible. MariaDB ColumnStore supports user defined function implementations in C/C++. User defined aggregate and window functions are not supported in ColumnStore 1.0. Developing a user defined function ---------------------------------- The development kit can be found under the [utils/udfsdk](https://github.com/mariadb-corporation/mariadb-columnstore-engine/tree/master/utils/udfsdk) directory of the mariadb-columnstore-engine source tree. To develop a user defined function requires you to set up a development environment and be comfortable with c++ development. To setup a ColumnStore development environment please follow the instructions on dependencies in the [ColumnStore server fork](https://github.com/mariadb-corporation/mariadb-columnstore-server) repository. Three main files will need to be modified in order to add a new UDF: * **udfmysql.cpp** : mariadb server UDF implementation * **udfsdk.h** : class headers. * **udfsdk.cpp** : distributed columnstore UDF implementation. Two reference implementations are provided to provide guidance on creating your own functions: * *MCS\_IsNull* : this illustrates a simple one argument function providing the ability to return a Boolean if the expression parameter is null * *MCS\_Add*: this illustrates a simple 2 argument function to illustrate adding 2 values and return the sum. It is simplest to copy these and adapt to your needs. There are no system dependencies on the included reference implementations so these can be removed to simplify the class files if preferred. ### MariaDB server UDF implementation Three functions are required to be implemented (for more details see [user-defined-functions](../user-defined-functions/index)): * *x\_init* : perform any parameter validation or setup such as memory allocation. * *x* : perform the actual function implementation. * *x\_deinit* : perform any clean up tasks such as deallocating memory where 'x' is the function name. ### ColumnStore distributed UDF implementation The function name and class must be registered in order to be recognized and used by the ColumnStore primitive processor. This is done by adding a line to perform the registration in the *UDFSDK::UDFMap()* function in the file **udfsdk.cpp**: ``` FuncMap UDFSDK::UDFMap() const { FuncMap fm; // first: function name // second: Function pointer // please use lower case for the function name. Because the names might be // case-insensitive in MariaDB depending on the setting. In such case, // the function names passed to the interface is always in lower case. fm["mcs_add"] = new MCS_add(); fm["mcs_isnull"] = new MCS_isnull(); return fm; } ``` For any new user defined functions add a new entry into the FuncMap object mapping the name to the udf class. The UDF class should be defined in file **udfsdk.h** and implemented in file **udfsdk.cpp**. It is easiest to adapt the example classes for new instance but each class must implement the *funcexp::Func* C++ class definition: * *constructor*: any initialization necessary * *destructor*: any de-initialization. * *getOperationType*: this performs parameter validation and returns the result data type. * *get<DATATYPE>Val* : computes and returns the value of the user defined function for each given return datatype. The code changes can be built using make within the directory **utils/udfsdk**, this will create the following libraries in the same directory: * **libudf\_mysql.so.1.0.0** * **libudfsdk.so.1.0.0** containing the compiled code ### Deploying and using a UDF The 2 libraries created above must be deployed to the **/usr/local/mariadb/columnstore/lib** directory (or equivalent lib directory in a non root install) replacing the existing files. Symbolic links in the mariadb server directory point to these but should be validated. Run the following as root from the **utils/udfsdk** directory in the build tree (specifying a password to restartSystem if needed for a multi server cluster): ``` $ cp libudf_mysql.so.1.0.0 libudfsdk.so.1.0.0 /usr/local/mariadb/columnstore/lib/ $ ls -l /usr/local/mariadb/columnstore/mysql/lib/plugin/libudf_mysql.so lrwxrwxrwx. 1 root root 56 Jul 19 09:47 /usr/local/mariadb/columnstore/mysql/lib/plugin/libudf_mysql.so -> /usr/local/mariadb/columnstore/lib/libudf_mysql.so.1.0.0 ``` Repeat this for each ColumnStore UM and PM node in the cluster and then restart ColumnStore to make the libraries available. After restarting the system the UDF must be registered with the MariaDB server to be usable: ``` $ mcsmysql > create function mcs_add returns integer soname 'libudf_mysql.so'; ``` The function *mcs\_add* can then be used. Verify that it can be used both in the select list and where clause for correct installation: ``` MariaDB [test]> create function mcs_add returns integer soname 'libudf_mysql.so'; Query OK, 0 rows affected (0.01 sec) MariaDB [test]> create table t1(i1 int, i2 int) engine=columnstore; Query OK, 0 rows affected (0.58 sec) MariaDB [test]> insert into t1 values (1,1), (2,2); Query OK, 2 rows affected (0.24 sec) Records: 2 Duplicates: 0 Warnings: 0 MariaDB [test]> select i1, i2, mcs_add(i1,i2) sum from t1; +------+------+------+ | i1 | i2 | sum | +------+------+------+ | 1 | 1 | 2 | | 2 | 2 | 4 | +------+------+------+ 2 rows in set (0.05 sec) MariaDB [test]> select i1, i2 from t1 where mcs_add(i1,i2) = 4; +------+------+ | i1 | i2 | +------+------+ | 2 | 2 | +------+------+ 1 row in set (0.02 sec) ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb NumPoints NumPoints ========= A synonym for [ST\_NumPoints](../st_numpoints/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MyISAM System Variables MyISAM System Variables ======================= This page documents system variables related to the [MyISAM](../myisam/index) storage engine. For options, see [MyISAM Options](../mysqld-options/index#myisam-options). See [Server System Variables](../server-system-variables/index) for a complete list of system variables and instructions on setting them. See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `key_buffer_size` * **Description:** Size of the buffer for the index blocks used by MyISAM tables and shared for all threads. See [Optimizing key\_buffer\_size](../optimizing-key_buffer_size/index) for more on selecting the best value. * **Commandline:** `--key-buffer-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `134217728` * **Range:** `8` upwards (upper limit determined by operating system per process limit) --- #### `key_cache_age_threshold` * **Description:** The lower the setting, the more quickly buffers move from the hot key cache sublist to the warm sublist. * **Commandline:** `--key-cache-age-threshold=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `300` * **Range:** `100` to `4294967295` --- #### `key_cache_block_size` * **Description:** [MyISAM](../myisam/index) key cache block size in bytes . * **Commandline:** `--key-cache-block-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1024` * **Range:** `512` to `16384` --- #### `key_cache_division_limit` * **Description:** Percentage to use for the warm key cache buffer list (the remainder is allocated between the hot and cold caches). * **Commandline:** `--key-cache-division-limit=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `100` * **Range:** `1` to `100` --- #### `key_cache_file_hash_size` * **Description:** Number of hash buckets for open and changed files. If you have many MyISAM files open you should increase this for faster flushing of changes. A good value is probably 1/10th of the number of possible open MyISAM files. * **Commandline:** `--key-cache-file-hash-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `512` * **Range:** `128` to `16384` --- #### `key_cache_segments` * **Description:** The number of segments in a key cache. See [Segmented Key Cache](../segmented-key-cache/index). * **Commandline:** `--key-cache-segments=#` * **Scope:** Global * **Dynamic:** Yes * **Type:** numeric * **Default Value:** `0` *(non-segmented)* * **Range:** `0` to `64` --- #### `myisam_block_size` * **Description:** Block size to be used for MyISAM index pages. * **Commandline:** `--myisam-block-size=#` * **Scope:** Global * **Dynamic:** No * **Data Type:** `numeric` * **Default Value:** `1024` --- #### `myisam_data_pointer_size` * **Description:** Size in bytes of the default pointer, used in a [MyISAM](../myisam/index) [CREATE TABLE](../create-table/index) with no MAX\_ROWS option. * **Commandline:** `--myisam-data-pointer-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `6` * **Range:** `2` to `7` --- #### `myisam_max_extra_sort_file_size` * **Description:** Removed in MySQL 5.0.6, was used as a way to force long character keys in large tables to use the key cache method. * **Removed:** MySQL 5.0.6 --- #### `myisam_max_sort_file_size` * **Description:** Maximum size in bytes of the temporary file used while recreating a MyISAM index. If the this size is exceeded, the slower process of using the key cache is done instead. * **Commandline:** `--myisam-max-sort-file-size=#` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value - 32 bit:** `2147483648` * **Default Value - 64 bit:** `9223372036854775807` --- #### `myisam_mmap_size` * **Description:** Maximum memory in bytes that can be used for memory mapping compressed MyISAM files. Too high a value may result in swapping if there are many compressed MyISAM tables. * **Commandline:** `--myisam-mmap-size=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value - 32 bit:** `4294967295` * **Default Value - 64 bit:** `18446744073709547520` * **Range - 32-bit:** `7` to `4294967295` * **Range - 64-bit:** `7` to `18446744073709547520` --- #### `myisam_recover_options` * **Description:** MyISAM recovery mode. Multiple options can be selected, comma-delimited. Using no argument is equivalent to specifying `DEFAULT`, while specifying "" is equivalent to `OFF`. If enabled each time the server opens a MyISAM table, it checks whether it has been marked as crashed, or wasn't closed properly. If so, mysqld will run a check and then attempt to repair the table, writing to the error log beforehand. + **OFF**: No recovery. + **BACKUP**: If the data file is changed while recovering, saves a backup of the .MYD data file. t.MYD will be saved as t.MYD-datetime.BAK. + **BACKUP\_ALL**: Same as `BACKUP` but also backs up the .MYI index file. t.MYI will be saved as t.MYI-datetime.BAK. + **DEFAULT**: Recovers without backing up, forcing, or quick checking. + **FORCE**: Runs the recovery even if it determines that more than one row from the data file will be lost. + **QUICK**: Does not check rows in the table if there are no delete blocks. * **Commandline:** `--myisam-recover-options[=name]` * **Scope:** Global * **Dynamic:** No * **Data Type:** `enumeration` * **Default Value:** + `BACKUP,QUICK` (>= [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)) + `DEFAULT` (<= [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)) + `OFF` * **Valid Values:** `OFF`, `DEFAULT`, `BACKUP`, `BACKUP_ALL`, `FORCE` or `QUICK` --- #### `myisam_repair_threads` * **Description:** If set to more than `1`, the default, MyISAM table indexes each have their own thread during repair and sorting. Increasing from the default will usually result in faster repair, but will use more CPU and memory. * **Commandline:** `--myisam-repair-threads=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `1` * **Range - 32-bit:** `1` to `4294967295` * **Range - 64-bit:** `1` to `18446744073709547520` --- #### `myisam_sort_buffer_size` * **Description:** Size in bytes of the buffer allocated when creating or sorting indexes on a MyISAM table. * **Commandline:** `--myisam-sort-buffer-size=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `134217720` (128MB) * **Range:** `4096` to `18446744073709547520` --- #### `myisam_stats_method` * **Description:** Determines how NULLs are treated for [MyISAM](../myisam/index) index statistics purposes. If set to `nulls_equal`, the default, all NULL index values are treated as a single group. This is usually fine, but if you have large numbers of NULLs the average group size is slanted higher, and the optimizer may miss using the index for ref accesses when it would be useful. If set to `nulls_unequal`, the opposite approach is taken, with each NULL forming its own group of one. Conversely, the average group size is slanted lower, and the optimizer may use the index for ref accesses when not suitable. Setting to `nulls_ignored` ignores NULLs altogether from index group calculations. See also [Index Statistics](../index-statistics/index), [aria\_stats\_method](../aria-server-system-variables/index#aria_stats_method), [innodb\_stats\_method](../xtradbinnodb-server-system-variables/index#innodb_stats_method). * **Commandline:** `--myisam-stats-method=name` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `enumeration` * **Default Value:** `nulls_equal` * **Valid Values:** `nulls_equal`, `nulls_unequal`, `nulls_ignored` --- #### `myisam_use_mmap` * **Description:** If set to `1` (0 is default), memory mapping will be used to reading and writing MyISAM tables. * **Commandline:** `--myisam-use-mmap` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Table Value Constructors Table Value Constructors ======================== **MariaDB starting with [10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/)**Table Value Constructors were introduced in [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) Syntax ------ ``` VALUES ( row_value[, row_value...]), (...)... ``` Description ----------- In Unions, Views, and sub-queries, a Table Value Constructor (TVC) allows you to inject arbitrary values into the result-set. The given values must have the same number of columns as the result-set, otherwise it returns Error 1222. Examples -------- Using TVC's with `[UNION](../union/index)` operations: ``` CREATE TABLE test.t1 (val1 INT, val2 INT); INSERT INTO test.t1 VALUES(5, 8), (3, 4), (1, 2); SELECT * FROM test.t1 UNION VALUES (70, 90), (100, 110); +------+------+ | val1 | val2 | +------+------+ | 5 | 8 | | 3 | 4 | | 1 | 2 | | 70 | 90 | | 100 | 110 | +------+------+ ``` Using TVC's with a `[CREATE VIEW](../create-view/index)` statement: ``` CREATE VIEW v1 AS VALUES (7, 9), (9, 10); SELECT * FROM v1; +---+----+ | 7 | 9 | +---+----+ | 7 | 9 | | 9 | 10 | +---+----+ ``` Using TVC with an `[ORDER BY](../order-by/index)` clause: ``` SELECT * FROM test.t1 UNION VALUES (10, 20), (30, 40), (50, 60), (70, 80) ORDER BY val1 DESC; ``` Using TVC with `[LIMIT](../limit/index)` clause: ``` SELECT * FROM test.t1 UNION VALUES (10, 20), (30, 40), (50, 60), (70, 80) LIMIT 2 OFFSET 4; +------+------+ | val1 | val2 | +------+------+ | 30 | 40 | | 50 | 60 | +------+------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP FUNCTION UDF DROP FUNCTION UDF ================= Syntax ------ ``` DROP FUNCTION [IF EXISTS] function_name ``` Description ----------- This statement drops the [user-defined function](../user-defined-functions/index) (UDF) named `function_name`. To drop a function, you must have the `[DELETE privilege](../grant/index)` for the mysql database. This is because `DROP FUNCTION` removes the row from the [mysql.func](../mysqlfunc-table/index) system table that records the function's name, type and shared library name. For dropping a stored function, see [DROP FUNCTION](../drop-function/index). ### Upgrading a UDF To upgrade the UDF's shared library, first run a [DROP FUNCTION](../drop-function/index) statement, then upgrade the shared library and finally run the CREATE FUNCTION statement. If you upgrade without following this process, you may crash the server. Examples -------- ``` DROP FUNCTION jsoncontains_path; ``` IF EXISTS: ``` DROP FUNCTION jsoncontains_path; ERROR 1305 (42000): FUNCTION test.jsoncontains_path does not exist DROP FUNCTION IF EXISTS jsoncontains_path; Query OK, 0 rows affected, 1 warning (0.00 sec) SHOW WARNINGS; +-------+------+------------------------------------------------+ | Level | Code | Message | +-------+------+------------------------------------------------+ | Note | 1305 | FUNCTION test.jsoncontains_path does not exist | +-------+------+------------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Events Overview Events Overview =============== [Events](stored-programs-and-views-event) are named database objects containing SQL statements that are to be executed at a later stage, either once off, or at regular intervals. They function very similarly to the Windows Task Scheduler or Unix cron jobs. Creating, modifying or deleting events requires the [EVENT privilege](../grant/index#database-privileges). Creating Events --------------- Events are created with the [CREATE EVENT](../create-event/index) statement. ### Example ``` CREATE EVENT test_event ON SCHEDULE EVERY 1 MINUTE DO UPDATE test.t1 SET a = a + 1; ``` Executing Events ---------------- Events are only executed if the event scheduler is running. This is determined by the value of the [event\_scheduler](../server-system-variables/index#event_scheduler) system variable, which needs to be set to `On` for the event scheduler to be running. You can check if the Event scheduler is running with: ``` SHOW PROCESSLIST; +----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+ | Id | User | Host | db | Command | Time | State | Info | Progress | +----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+ | 40 | root | localhost | test | Sleep | 4687 | | NULL | 0.000 | | 41 | root | localhost | test | Query | 0 | init | SHOW PROCESSLIST | 0.000 | | 42 | event_scheduler | localhost | NULL | Daemon | 30 | Waiting for next activation | NULL | 0.000 | +----+-----------------+-----------+------+---------+------+-----------------------------+------------------+----------+ ``` If the event scheduler is not running and `event_scheduler` has been set to `OFF`, use: ``` SET GLOBAL event_scheduler = ON; ``` to activate it. If `event_scheduler` has been set to `Disabled`, you cannot change the value at runtime. Changing the value of the `event_scheduler` variable requires the SUPER privilege. Since [MariaDB 10.0.22](https://mariadb.com/kb/en/mariadb-10022-release-notes/), setting the [event\_scheduler](../server-system-variables/index#event_scheduler) system variable will also try to reload the [mysql.event table](../mysqlevent-table/index) if it was not properly loaded at startup. Viewing Current Events ---------------------- A list of current events can be obtained with the [SHOW EVENTS](../show-events/index) statement. This only shows the event name and interval - the full event details, including the SQL, can be seen by querying the [Information Schema EVENTS table](../information-schema-events-table/index), or with [SHOW CREATE EVENT](../show-create-event/index). If an event is currently being executed, it can be seen by querying the [Information Schema PROCESSLIST table](../information-schema-processlist-table/index), or with the [SHOW PROCESSLIST](../show-processlist/index) statement. ### Example ``` SHOW EVENTS\G; *************************** 1. row *************************** Db: test Name: test_event Definer: root@localhost Time zone: SYSTEM Type: RECURRING Execute at: NULL Interval value: 1 Interval field: MINUTE Starts: 2013-05-20 13:46:56 Ends: NULL Status: ENABLED Originator: 1 character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci ``` ``` SHOW CREATE EVENT test_event\G *************************** 1. row *************************** Event: test_event sql_mode: time_zone: SYSTEM Create Event: CREATE DEFINER=`root`@`localhost` EVENT `test_event` ON SCHEDULE EVERY 1 MINUTE STARTS '2013-05-20 13:46:56' ON COMPLETION NOT PRESERVE ENABLE DO UPDATE test.t1 SET a = a + 1 character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci ``` Altering Events --------------- An event can be changed with the [ALTER EVENT](../alter-event/index) statement. ### Example ``` ALTER EVENT test_event ON SCHEDULE EVERY '2:3' DAY_HOUR; ``` Dropping Events --------------- Events are dropped with the [DROP EVENT](../drop-event/index) statement. Events are also also automatically dropped once they have run for the final time according to their schedule, unless the ON COMPLETION PRESERVE clause has been specified. ### Example ``` DROP EVENT test_event; Query OK, 0 rows affected (0.00 sec) ``` See Also -------- * [CREATE EVENT](../create-event/index) * [SHOW CREATE EVENT](../show-create-event/index) * [ALTER EVENT](../alter-event/index) * [DROP EVENT](../drop-event/index) * [Event Limitations](../event-limitations/index) * [Automating MariaDB Tasks with Events](../automating-mariadb-tasks-with-events/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema memory_summary_global_by_event_name Table Performance Schema memory\_summary\_global\_by\_event\_name Table ================================================================= **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The memory\_summary\_global\_by\_event\_name table was introduced in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). There are five memory summary tables in the Performance Schema that share a number of fields in common. These include: * [memory\_summary\_by\_account\_by\_event\_name](../performance-schema-memory_summary_by_account_by_event_name-table/index) * [memory\_summary\_by\_host\_by\_event\_name](../performance-schema-memory_summary_by_host_by_event_name-table/index) * [memory\_summary\_by\_thread\_by\_event\_name](../performance-schema-memory_summary_by_thread_by_event_name-table/index) * [memory\_summary\_by\_user\_by\_event\_name](../performance-schema-memory_summary_by_user_by_event_name-table/index) * memory\_global\_by\_event\_name The `memory_summary_global_by_event_name` table contains memory usage statistics aggregated by event and event. The table contains the following columns: | Field | Type | Null | Default | Description | | --- | --- | --- | --- | --- | | EVENT\_NAME | varchar(128) | NO | NULL | Event name. | | COUNT\_ALLOC | bigint(20) unsigned | NO | NULL | Total number of allocations to memory. | | COUNT\_FREE | bigint(20) unsigned | NO | NULL | Total number of attempts to free the allocated memory. | | SUM\_NUMBER\_OF\_BYTES\_ALLOC | bigint(20) unsigned | NO | NULL | Total number of bytes allocated. | | SUM\_NUMBER\_OF\_BYTES\_FREE | bigint(20) unsigned | NO | NULL | Total number of bytes freed | | LOW\_COUNT\_USED | bigint(20) | NO | NULL | Lowest number of allocated blocks (lowest value of CURRENT\_COUNT\_USED). | | CURRENT\_COUNT\_USED | bigint(20) | NO | NULL | Currently allocated blocks that have not been freed (COUNT\_ALLOC minus COUNT\_FREE). | | HIGH\_COUNT\_USED | bigint(20) | NO | NULL | Highest number of allocated blocks (highest value of CURRENT\_COUNT\_USED). | | LOW\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Lowest number of bytes used. | | CURRENT\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Current number of bytes used (total allocated minus total freed). | | HIGH\_NUMBER\_OF\_BYTES\_USED | bigint(20) | NO | NULL | Highest number of bytes used. | Example ------- Seeing what memory was most often allocated for: ``` SELECT * FROM memory_summary_global_by_event_name ORDER BY count_alloc DESC LIMIT 1\G *************************** 1. row *************************** EVENT_NAME: memory/sql/QUICK_RANGE_SELECT::alloc COUNT_ALLOC: 147976 COUNT_FREE: 147976 SUM_NUMBER_OF_BYTES_ALLOC: 600190656 SUM_NUMBER_OF_BYTES_FREE: 600190656 LOW_COUNT_USED: 0 CURRENT_COUNT_USED: 0 HIGH_COUNT_USED: 68 LOW_NUMBER_OF_BYTES_USED: 0 CURRENT_NUMBER_OF_BYTES_USED: 0 HIGH_NUMBER_OF_BYTES_USED: 275808 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema ROCKSDB_PERF_CONTEXT Table Information Schema ROCKSDB\_PERF\_CONTEXT Table =============================================== The [Information Schema](../information_schema/index) `ROCKSDB_PERF_CONTEXT` table is included as part of the [MyRocks](../myrocks/index) storage engine and includes per-table/partition counters . The `PROCESS` [privilege](../grant/index) is required to view the table. It contains the following columns: | Column | Description | | --- | --- | | `TABLE_SCHEMA` | | | `TABLE_NAME` | | | `PARTITION_NAME` | | | `STAT_TYPE` | | | `VALUE` | | Note: for multi-table queries, all counter increments are "billed" to the first table in the query: <https://github.com/facebook/mysql-5.6/issues/1018> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb HIGH_PRIORITY and LOW_PRIORITY HIGH\_PRIORITY and LOW\_PRIORITY ================================ The [InnoDB](../innodb/index) storage engine uses row-level locking to ensure data integrity. However some storage engines (such as [MEMORY](../memory-storage-engine/index), [MyISAM](../myisam/index), [Aria](../aria/index) and [MERGE](../merge/index)) lock the whole table to prevent conflicts. These storage engines use two separate queues to remember pending statements; one is for [SELECTs](../select/index) and the other one is for write statements ([INSERT](../insert/index), [DELETE](../delete/index), [UPDATE](../update/index)). By default, the latter has a higher priority. To give write operations a lower priority, the [low\_priority\_updates](../server-system-variables/index#low_priority_updates) server system variable can be set to `ON`. The option is available on both the global and session levels, and it can be set at startup or via the [SET](../set/index) statement. When too many table locks have been set by write statements, some pending SELECTs are executed. The maximum number of write locks that can be acquired before this happens is determined by the [max\_write\_lock\_count](../server-system-variables/index#max_write_lock_count) server system variable, which is dynamic. If write statements have a higher priority (default), the priority of individual write statements ([INSERT](../insert/index), [REPLACE](../replace/index), [UPDATE](../update/index), [DELETE](../delete/index)) can be changed via the `LOW_PRIORITY` attribute, and the priority of a `SELECT` statement can be raised via the `HIGH_PRIORITY` attribute. Also, [LOCK TABLES](../transactions-lock/index) supports a `LOW_PRIORITY` attribute for `WRITE` locks. If read statements have a higher priority, the priority of an `INSERT` can be changed via the `HIGH_PRIORITY` attribute. However, the priority of other write statements cannot be raised individually. The use of `LOW_PRIORITY` or `HIGH_PRIORITY` for an `INSERT` prevents [Concurrent Inserts](../concurrent-inserts/index) from being used. See Also -------- * [INSERT](../insert/index) * [INSERT DELAYED](../insert-delayed/index) * [INSERT SELECT](../insert-select/index) * [Concurrent Inserts](../concurrent-inserts/index) * [INSERT - Default & Duplicate Values](../insert-default-duplicate-values/index) * [INSERT IGNORE](../insert-ignore/index) * [INSERT ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_COMPACT JSON\_COMPACT ============= **MariaDB starting with [10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)**This function was added in [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/). Syntax ------ ``` JSON_COMPACT(json_doc) ``` Description ----------- Removes all unnecessary spaces so the json document is as short as possible. Example ------- ``` SET @j = '{ "A": 1, "B": [2, 3]}'; SELECT JSON_COMPACT(@j), @j; +-------------------+------------------------+ | JSON_COMPACT(@j) | @j | +-------------------+------------------------+ | {"A":1,"B":[2,3]} | { "A": 1, "B": [2, 3]} | +-------------------+------------------------+ ``` See Also -------- * [JSON video tutorial](https://www.youtube.com/watch?v=sLE7jPETp8g) covering JSON\_COMPACT. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb myisam_ftdump myisam\_ftdump ============== myisam\_ftdump is a utility for displaying information about [MyISAM](../myisam/index) [FULLTEXT](../full-text-indexes/index) indexes. It will scan and dump the entire index, and can be a lengthy process. If the server is running, make sure you run a [FLUSH TABLES](../flush/index) statement first. Usage ----- ``` myisam_ftdump <table_name> <index_num> ``` The table\_name can be specified with or without the .MYI index extension. The index number refers to the number of the index when the table was defined, starting at zero. For example, take the following table definition: ``` CREATE TABLE IF NOT EXISTS `employees_example` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(30) NOT NULL, `last_name` varchar(40) NOT NULL, `position` varchar(25) NOT NULL, `home_address` varchar(50) NOT NULL, `home_phone` varchar(12) NOT NULL, `employee_code` varchar(25) NOT NULL, `bio` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `employee_code` (`employee_code`), FULLTEXT (`bio`) ) ENGINE=MyISAM; ``` The fulltext index will be `2`. The primary key is index `0`, and the unique key index `1`. You can use *myisam\_ftdump* to generate a list of index entries in order of frequency of occurrence as follows: ``` myisam_ftdump -c mytexttable 1 | sort -r ``` Options ------- | Option | Description | | --- | --- | | -h, --help | Display help and exit. | | -?, --help | Synonym for -h. | | -c, --count | Calculate per-word stats (counts and global weights). | | -d, --dump | Dump index (incl. data offsets and word weights). | | -l, --length | Report length distribution. | | -s, --stats | Report global stats. | | -v, --verbose | Be verbose. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.index_stats Table mysql.index\_stats Table ======================== The `mysql.index_stats` table is one of three tables storing data used for [Engine-independent table statistics](../engine-independent-table-statistics/index). The others are [mysql.column\_stats](../mysqlcolumn_stats-table/index) and [mysql.table\_stats](../mysqltable_stats-table/index). **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. The `mysql.index_stats` table contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `db_name` | `varchar(64)` | NO | PRI | `NULL` | Database the table is in. | | `table_name` | `varchar(64)` | NO | PRI | `NULL` | Table name | | `index_name` | `varchar(64)` | NO | PRI | `NULL` | Name of the index | | `prefix_arity` | `int(11) unsigned` | NO | PRI | `NULL` | Index prefix length. 1 for the first keypart, 2 for the first two, and so on. InnoDB's extended keys are supported. | | `avg_frequency` | `decimal(12,4)` | YES | | `NULL` | Average number of records one will find for given values of (keypart1, keypart2, ..), provided the values will be found in the table. | It is possible to manually update the table. See [Manual updates to statistics tables](../engine-independent-table-statistics/index#manual-updates-to-statistics-tables) for details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb LOG10 LOG10 ===== Syntax ------ ``` LOG10(X) ``` Description ----------- Returns the base-10 logarithm of X. Examples -------- ``` SELECT LOG10(2); +-------------------+ | LOG10(2) | +-------------------+ | 0.301029995663981 | +-------------------+ SELECT LOG10(100); +------------+ | LOG10(100) | +------------+ | 2 | +------------+ SELECT LOG10(-100); +-------------+ | LOG10(-100) | +-------------+ | NULL | +-------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Diagnostics Area Diagnostics Area ================ The diagnostics area contains information about the error conditions which were produced by an SQL statement, as well as some information about the statement which generated them. Statement Information --------------------- The statement information area contains the following data: * NUMBER is the number of conditions which are present in the diagnostics area. * ROW\_COUNT has the same value as the [ROW\_COUNT()](../row_count/index) function for the statement that produced the conditions. Condition Information --------------------- Each condition has several properties, which are explained here. ### Data Types and Sizes The following table shows the type and size of all the properties: | Property name | Property type | Notes | | --- | --- | --- | | RETURNED\_SQLSTATE | VARCHAR(5) | | | MYSQL\_ERRNO | SMALLINT UNSIGNED | | | MESSAGE\_TEXT | VARCHAR(512) | Before [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/), was VARCHAR(128) | | CLASS\_ORIGIN | VARCHAR(64) | | | SUBCLASS\_ORIGIN | VARCHAR(64) | | | CONSTRAINT\_CATALOG | VARCHAR(64) | | | CONSTRAINT\_SCHEMA | VARCHAR(64) | | | CONSTRAINT\_NAME | VARCHAR(64) | | | CATALOG\_NAME | VARCHAR(64) | | | SCHEMA\_NAME | VARCHAR(64) | | | TABLE\_NAME | VARCHAR(64) | | | COLUMN\_NAME | VARCHAR(64) | | | CURSOR\_NAME | VARCHAR(64) | | These properties can never be set to NULL. If they are empty, the empty string is used. ### Common Condition Properties The most common ones have a value for all built-in errors, and can be read both via SQL and via the API: RETURNED\_SQLSTATE is the SQLSTATE of the condition. It is a five characters code, composed by a class (first two characters) and a subclass (last three characters). For more information about this property, refer to the [SQLSTATE](../sqlstate/index) page. MYSQL\_ERRNO is the error code. Each built-in condition has a unique numeric code. 0 indicates success, but it cannot be explicitly set or read via SQL. For a list of built-in error codes, refer to [MariaDB Error Codes](../mariadb-error-codes/index). The API function to read it is mysql\_errno(). MESSAGE\_TEXT is a descriptive, human-readable message. For built-in errors, parsing this string is the only way to get more information about the error. For example, parsing a message like "Table 'tab1' already exists", a program can find out that the missing table is tab1. The API function to read it is mysql\_error(). For conditions generated by the user via SIGNAL, if MYSQL\_ERRNO and MESSAGE\_TEXT are not specified, their default values depend on the first two SQLSTATE characters: * '00' means 'success'. It can not be set in any way, and can only be read via the API. * For '01' class, default MYSQL\_ERRNO is 1642 and default MESSAGE\_TEXT is 'Unhandled user-defined warning condition'. * For '02' class, default MYSQL\_ERRNO is 1643 and default MESSAGE\_TEXT is 'Unhandled user-defined not found condition'. * For all other cases, including the '45000' value, default MYSQL\_ERRNO is 1644 and default MESSAGE\_TEXT is 'Unhandled user-defined exception condition'. ### Special Condition Properties There are more condition properties, which are never set for built-in errors. They can only be set via SIGNAL and RESIGNAL statements, and can only be read via GET DIAGNOSTICS - not via the API. Such properties are: CLASS\_ORIGIN indicates whether the SQLSTATE uses a standard class or a software-specific class. If it is defined in the SQL standards document ISO 9075-2 (section 24.1, SQLSTATE), this property's value is supposed to be 'ISO 9075', otherwise it is supposed to be 'MySQL'. However, any string is accepted. SUBCLASS\_ORIGIN indicates whether the SQLSTATE uses a standard subclass or a software-specific class. If the SQLSTATE is defined in the SQL standards document ISO 9075-2 (section 24.1, SQLSTATE), this property's value is supposed to be 'ISO 9075', otherwise it is supposed to be 'MySQL'. However, any string is accepted. SCHEMA\_NAME indicates in which schema (database) the error occurred. TABLE\_NAME indicates the name of the table which was accessed by the failed statement. COLUMN\_NAME indicates the name of the column which was accessed by the failed statement. CONSTRAINT\_NAME indicates the name of the constraint that was violated. CONSTRAINT\_SCHEMA indicates in which schema the violated constraint is located. CURSOR\_NAME indicates the name of the cursor which caused the error. The following properties can be used and are defined in the standard SQL, but have no meaning because MariaDB doesn't currently support catalogs: CATALOG\_NAME is used by the standard SQL to indicate in which catalog the error occurred. CONSTRAINT\_CATALOG is used by the standard SQL to indicate in which catalog the violated constraint is located. How the Diagnostics Area is Populated and Cleared ------------------------------------------------- When a statement produces one or more error conditions (errors, warnings, notes) the conditions are inserted into the diagnostics area, and the statement information area is updated with that statement’s information. Usually, this also clears all the old conditions from the diagnostics area, but there is an exception: if the new statement is a correctly parsed RESIGNAL or GET DIAGNOSTICS, the old contents will remain in the diagnostics area. SIGNAL clears the old conditions. When a table-based statement (like INSERT) is executed, the old data in the diagnostics area is cleared even if the statement doesn't produce any condition. However, statements which don't access any table (like SET, or a SELECT with no FROM clause) is executed and produces no warnings, the diagnostics area remains unchanged. The maximum number of conditions that can be in the diagnostics area is `[max\_error\_count](../server-system-variables/index#max_error_count)`. If this value is 0, the diagnostics area is empty. If this variable is changed, the new value takes effect with the next statement (that is, the diagnostics area is not immediately truncated). How to Access the Diagnostics Area ---------------------------------- The following statements explicitly add conditions to the diagnostics area: * [SIGNAL](../signal/index): produces a custom error. * [RESIGNAL](../resignal/index): after an error is produced, generates a modified version of that error. The following statements read contents from the diagnostics area: * [GET DIAGNOSTICS](../get-diagnostics/index) is the only way to read all information * [SHOW WARNINGS](../show-warnings/index) shows a summary of errors, warnings and notes * [SHOW ERRORS](../show-errors/index) shows a summary of errors [DECLARE HANDLER](../declare-handler/index) can be used to handle error conditions within stored programs. [DECLARE CONDITION](../declare-condition/index) can be used to associate an SQLSTATE or an error code to a name. That name can be referenced in DECLARE HANDLER, SIGNAL and RESIGNAL statements. All these statements can also be executed inside a stored routine. However, only SHOW WARNINGS and SHOW ERRORS can be executed as a prepared statement. After an [EXECUTE](../execute-statement/index) statement, the diagnostics area contains information about the prepared statement, if it produces error conditions. See Also -------- * [RESIGNAL](../resignal/index) * [SIGNAL](../signal/index) * [HANDLER](../handler/index) * [GET DIAGNOSTICS](../get-diagnostics/index) * [SHOW WARNINGS](../show-warnings/index) * [SHOW ERRORS](../show-errors/index) * [DECLARE HANDLER](../declare-handler/index) * [MariaDB Error Codes](../mariadb-error-codes/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BACKUP Commands BACKUP Commands ================ Commands used by backup tools | Title | Description | | --- | --- | | [BACKUP STAGE](../backup-stage/index) | Commands to be used by a MariaDB backup tool. | | [BACKUP LOCK](../backup-lock/index) | Blocks a table from DDL statements. | | [Mariabackup and BACKUP STAGE Commands](../mariabackup-and-backup-stage-commands/index) | How Mariabackup could use BACKUP STAGE commands. | | [Storage Snapshots and BACKUP STAGE Commands](../storage-snapshots-and-backup-stage-commands/index) | How storage snapshots could use BACKUP STAGE commands. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Slow Query Log Slow Query Log =============== The slow query log is a record of SQL queries that took a long time to perform. | Title | Description | | --- | --- | | [Slow Query Log Overview](../slow-query-log-overview/index) | A record of SQL queries that took a long time to perform. | | [Slow Query Log Extended Statistics](../slow-query-log-extended-statistics/index) | The slow query log makes extended statistics available. | | [mysqldumpslow](../mysqldumpslow/index) | Display data from the slow query log. | | [EXPLAIN in the Slow Query Log](../explain-in-the-slow-query-log/index) | EXPLAIN output in the slow query log. | | [mysql.slow\_log Table](../mysqlslow_log-table/index) | Contents of the slow query log if written to table. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CURRENT_TIME CURRENT\_TIME ============= Syntax ------ ``` CURRENT_TIME CURRENT_TIME([precision]) ``` Description ----------- `CURRENT_TIME` and `CURRENT_TIME()` are synonyms for `[CURTIME()](../curtime/index)`. See Also -------- * [Microseconds in MariaDB](../microseconds-in-mariadb/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb innochecksum innochecksum ============ innochecksum is a tool for printing checksums for InnoDB files. Usage ----- ``` innochecksum [options] file_name ``` Description ----------- It reads an [InnoDB](../innodb/index) tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages. It was originally developed to speed up verifying the integrity of tablespace files after power outages but can also be used after file copies. Because checksum mismatches will cause InnoDB to deliberately shut down a running server, it can be preferable to use innochecksum rather than waiting for a server in production usage to encounter the damaged pages. Multiple filenames can be specified by a wildcard on non-Windows systems only. innochecksum has worked with compressed pages since [MariaDB 10.0.16](https://mariadb.com/kb/en/mariadb-10016-release-notes/). [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) added options to analyze leaf pages to estimate how fragmented an index is and how much benefit can be gained from defragmentation. innochecksum cannot be used on tablespace files that the server already has open. For such files, you should use [CHECK TABLE](../sql-commands-check-table/index) to check tables within the tablespace. If checksum mismatches are found, you would normally restore the tablespace from backup or start the server and attempt to use [mysqldump](../mysqldump/index) to make a backup of the tables within the tablespace. Options ------- innochecksum supports the following options. For options that refer to page numbers, the numbers are zero-based. | Option | Description | Added | | --- | --- | --- | | -a, --allow-mismatches=# | Maximum checksum mismatch allowed before innochecksum terminates. Defaults to 0, which terminates on the first mismatch. | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | -c, --count | Print a count of the number of pages in the file. | | | -d, --debug | Debug mode; prints checksums for each page, implies `--verbose`. Replaced by `--log` in [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | | -e num, --end-page=# | End at this page number (0-based). | | | -?, --help | Displays help and exits. | | | -I, --info | Synonym for --help. | | | -f, --leaf | Examine leaf index pages. Until [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/), the short code was `-l`, but this was changed to avoid confusion with the `--log` option. | [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) | | -l fn, --log=fn | Log output to the specified filename `fn`. | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | -m num, --merge=# | Leaf page count if merge given number of consecutive pages. | [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/) | | -n, --no-check | Ignore the checksum verification. Until [MariaDB 10.6](../what-is-mariadb-106/index), must be used with the `--write` option. | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | -p num, --page=# | Check only this page number (0-based). | | | -D, --page-type-dump=name | Dump the page type info for each page in a tablespace. | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | -S, --page-type-summary | Display a count of each page type in a tablespace | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) | | -i, --per-page-details | Print out per-page detail information. | | | -u, --skip-corrupt | Skip corrupt pages. | [MariaDB 10.0.16](https://mariadb.com/kb/en/mariadb-10016-release-notes/) | | -s num, --start-page=# | Start at this page number (0-based). | | | -C, --strict-check=name | Specify the strict checksum algorithm. One of: crc32, innodb, none. If not specified, validates against innodb, crc32 and none. See also [innodb\_checksum\_algorithm](../innodb-system-variables/index#innodb_checksum_algorithm). | Added [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) Removed [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) | | -v, --verbose | Verbose mode; print a progress indicator every five seconds. | | | -V, --version | Displays version information and exits. | | | -w, --write=name | Rewrite the checksum algorithm. One of crc32, innodb, none. An exclusive lock is obtained during use. Use in conjunction with the `-no-check` option to rewrite an invalid checksum. | Added [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.26](https://mariadb.com/kb/en/mariadb-10126-release-notes/) Removed [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) | Examples -------- Rewriting a crc32 checksum to replace an invalid checksum: ``` innochecksum --no-check --write crc32 tablename.ibd ``` A count of each page type: ``` innochecksum --page-type-summary data/mysql/gtid_slave_pos.ibd File::data/mysql/gtid_slave_pos.ibd ================PAGE TYPE SUMMARY============== #PAGE_COUNT PAGE_TYPE =============================================== 1 Index page 0 Undo log page 1 Inode page 0 Insert buffer free list page 2 Freshly allocated page 1 Insert buffer bitmap 0 System page 0 Transaction system page 1 File Space Header 0 Extent descriptor page 0 BLOB page 0 Compressed BLOB page 0 Page compressed page 0 Page compressed encrypted page 0 Other type of page =============================================== Additional information: Undo page type: 0 insert, 0 update, 0 other Undo page state: 0 active, 0 cached, 0 to_free, 0 to_purge, 0 prepared, 0 other index_id #pages #leaf_pages #recs_per_page #bytes_per_page 24 1 1 0 0 index_id page_data_bytes_histgram(empty,...,oversized) 24 1 0 0 0 0 0 0 0 0 0 0 0 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LAST_INSERT_ID LAST\_INSERT\_ID ================ Syntax ------ ``` LAST_INSERT_ID(), LAST_INSERT_ID(expr) ``` Description ----------- LAST\_INSERT\_ID() (no arguments) returns the first automatically generated value successfully inserted for an [AUTO\_INCREMENT](../auto_increment/index) column as a result of the most recently executed INSERT statement. The value of LAST\_INSERT\_ID() remains unchanged if no rows are successfully inserted. If one gives an argument to LAST\_INSERT\_ID(), then it will return the value of the expression and the next call to LAST\_INSERT\_ID() will return the same value. The value will also be sent to the client and can be accessed by the [mysql\_insert\_id](../mysql_insert_id/index) function. For example, after inserting a row that generates an AUTO\_INCREMENT value, you can get the value like this: ``` SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 9 | +------------------+ ``` You can also use LAST\_INSERT\_ID() to delete the last inserted row: ``` DELETE FROM product WHERE id = LAST_INSERT_ID(); ``` If no rows were successfully inserted, LAST\_INSERT\_ID() returns 0. The value of LAST\_INSERT\_ID() will be consistent across all versions if all rows in the [INSERT](../insert/index) or [UPDATE](../update/index) statement were successful. The currently executing statement does not affect the value of LAST\_INSERT\_ID(). Suppose that you generate an AUTO\_INCREMENT value with one statement, and then refer to LAST\_INSERT\_ID() in a multiple-row INSERT statement that inserts rows into a table with its own AUTO\_INCREMENT column. The value of LAST\_INSERT\_ID() will remain stable in the second statement; its value for the second and later rows is not affected by the earlier row insertions. (However, if you mix references to LAST\_INSERT\_ID() and LAST\_INSERT\_ID(expr), the effect is undefined.) If the previous statement returned an error, the value of LAST\_INSERT\_ID() is undefined. For transactional tables, if the statement is rolled back due to an error, the value of LAST\_INSERT\_ID() is left undefined. For manual [ROLLBACK](../rollback/index), the value of LAST\_INSERT\_ID() is not restored to that before the transaction; it remains as it was at the point of the ROLLBACK. Within the body of a stored routine (procedure or function) or a trigger, the value of LAST\_INSERT\_ID() changes the same way as for statements executed outside the body of these kinds of objects. The effect of a stored routine or trigger upon the value of LAST\_INSERT\_ID() that is seen by following statements depends on the kind of routine: * If a [stored procedure](../stored-procedures/index) executes statements that change the value of LAST\_INSERT\_ID(), the new value will be seen by statements that follow the procedure call. * For [stored functions](../stored-functions/index) and [triggers](../triggers/index) that change the value, the value is restored when the function or trigger ends, so following statements will not see a changed value. Examples -------- ``` CREATE TABLE t ( id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY, f VARCHAR(1)) ENGINE = InnoDB; INSERT INTO t(f) VALUES('a'); SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 1 | +------------------+ INSERT INTO t(f) VALUES('b'); INSERT INTO t(f) VALUES('c'); SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 3 | +------------------+ INSERT INTO t(f) VALUES('d'),('e'); SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 4 | +------------------+ SELECT * FROM t; +----+------+ | id | f | +----+------+ | 1 | a | | 2 | b | | 3 | c | | 4 | d | | 5 | e | +----+------+ SELECT LAST_INSERT_ID(12); +--------------------+ | LAST_INSERT_ID(12) | +--------------------+ | 12 | +--------------------+ SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 12 | +------------------+ INSERT INTO t(f) VALUES('f'); SELECT LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 6 | +------------------+ SELECT * FROM t; +----+------+ | id | f | +----+------+ | 1 | a | | 2 | b | | 3 | c | | 4 | d | | 5 | e | | 6 | f | +----+------+ SELECT LAST_INSERT_ID(12); +--------------------+ | LAST_INSERT_ID(12) | +--------------------+ | 12 | +--------------------+ INSERT INTO t(f) VALUES('g'); SELECT * FROM t; +----+------+ | id | f | +----+------+ | 1 | a | | 2 | b | | 3 | c | | 4 | d | | 5 | e | | 6 | f | | 7 | g | +----+------+ ``` See Also -------- * [mysql\_insert\_id](../mysql_insert_id/index) * [AUTO\_INCREMENT](../auto_increment/index) * [AUTO\_INCREMENT handling in InnoDB](../auto_increment-handling-in-innodb/index) * [Sequences](../sequences/index) - an alternative to auto\_increment available from [MariaDB 10.3](../what-is-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb TIMESTAMP TIMESTAMP ========= Syntax ------ ``` TIMESTAMP [(<microsecond precision)] ``` Description ----------- A timestamp in the format `YYYY-MM-DD HH:MM:SS.ffffff`. The timestamp field is generally used to define at which moment in time a row was added or updated and by default will automatically be assigned the current datetime when a record is inserted or updated. The automatic properties only apply to the first TIMESTAMP in the record; subsequent TIMESTAMP columns will not be changed. MariaDB includes the [--mysql56-temporal-format](../server-system-variables/index#mysql56_temporal_format) option, on by default, which allows MariaDB to store TIMESTAMPs using the same low-level format MySQL 5.6 uses. For more information, see [Internal Format](#internal-format). Supported Values ---------------- MariaDB stores values that use the `TIMESTAMP` data type as the number of seconds since '1970-01-01 00:00:00' ([UTC](../coordinated-universal-time/index)). This means that the `TIMESTAMP` data type can hold values between '1970-01-01 00:00:01' ([UTC](../coordinated-universal-time/index)) and '2038-01-19 03:14:07' ([UTC](../coordinated-universal-time/index)). MariaDB can also store [microseconds](../microseconds-in-mariadb/index) with a precision between 0 and 6. If no microsecond precision is specified, then 0 is used by default. Automatic Values ---------------- MariaDB has special behavior for the first column that uses the `TIMESTAMP` data type in a specific table. For the first column that uses the `TIMESTAMP` data type in a specific table, MariaDB automatically assigns the following properties to the column: * `DEFAULT CURRENT_TIMESTAMP` * `ON UPDATE CURRENT_TIMESTAMP` This means that if the column is not explicitly assigned a value in an `INSERT` or `UPDATE` query, then MariaDB will automatically initialize the column's value with the current date and time. This automatic initialization for `INSERT` and `UPDATE` queries can also be **explicitly enabled** for a column that uses the `TIMESTAMP` data type by specifying the `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` clauses for the column. In these clauses, any synonym of `[CURRENT\_TIMESTAMP](../now/index)` is accepted, including `CURRENT_TIMESTAMP()`, `NOW()`, `LOCALTIME`, `LOCALTIME()`, `LOCALTIMESTAMP`, and `LOCALTIMESTAMP()`. This automatic initialization for `INSERT` queries can also be **explicitly disabled** for a column that uses the `TIMESTAMP` data type by specifying a constant `DEFAULT` value. For example, `DEFAULT 0`. This automatic initialization for `UPDATE` queries can also be **explicitly disabled** for a column that uses the `TIMESTAMP` data type by specifying a `DEFAULT` clause for the column, but no `ON UPDATE` clause. If a `DEFAULT` clause is explicitly specified for a column that uses the `TIMESTAMP` data type, but an `ON UPDATE` clause is not specified for the column, then the timestamp value will not automatically change when an `UPDATE` statement is executed. MariaDB also has special behavior if `NULL` is assigned to column that uses the `TIMESTAMP` data type. If the column is assigned the `NULL` value in an `INSERT` or `UPDATE` query, then MariaDB will automatically initialize the column's value with the current date and time. For details, see [NULL values in MariaDB](../null-values-in-mariadb/index#auto_increment-timestamp-and-virtual-columns). This automatic initialization for `NULL` values can also be **explicitly disabled** for a column that uses the `TIMESTAMP` data type by specifying the `NULL` attribute for the column. In this case, if the column's value is set to `NULL`, then the column's value will actually be set to `NULL`. Time Zones ---------- If a column uses the `TIMESTAMP` data type, then any inserted values are converted from the session's time zone to [Coordinated Universal Time (UTC)](../coordinated-universal-time/index) when stored, and converted back to the session's time zone when retrieved. MariaDB does not currently store any time zone identifier with the value of the `TIMESTAMP` data type. See [MDEV-10018](https://jira.mariadb.org/browse/MDEV-10018) for more information. MariaDB does not currently support time zone literals that contain time zone identifiers. See [MDEV-11829](https://jira.mariadb.org/browse/MDEV-11829) for more information. Limitations ----------- * Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value '1970-01-01 00:00:00' (UTC) is reserved since the second #0 is used to represent '0000-00-00 00:00:00'. * In [MariaDB 5.5](../what-is-mariadb-55/index) and before there could only be one TIMESTAMP column per table that had CURRENT\_TIMESTAMP defined as its default value. This limit has no longer applied since [MariaDB 10.0](../what-is-mariadb-100/index). SQL\_MODE=MAXDB --------------- If the [SQL\_MODE](../sql-mode/index) is set to `MAXDB`, TIMESTAMP fields will be silently converted to [DATETIME](../datetime/index). Internal Format --------------- In [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/) a new temporal format was introduced from MySQL 5.6 that alters how the `TIME`, `DATETIME` and `TIMESTAMP` columns operate at lower levels. These changes allow these temporal data types to have fractional parts and negative values. You can disable this feature using the `[mysql56\_temporal\_format](../server-system-variables/index#mysql56_temporal_format)` system variable. Tables that include `TIMESTAMP` values that were created on an older version of MariaDB or that were created while the `[mysql56\_temporal\_format](../server-system-variables/index#mysql56_temporal_format)` system variable was disabled continue to store data using the older data type format. In order to update table columns from the older format to the newer format, execute an `[ALTER TABLE... MODIFY COLUMN](../alter-table/index#modify-column)` statement that changes the column to the \*same\* data type. This change may be needed if you want to export the table's tablespace and import it onto a server that has `mysql56_temporal_format=ON` set (see [MDEV-15225](https://jira.mariadb.org/browse/MDEV-15225)). For instance, if you have a `TIMESTAMP` column in your table: ``` SHOW VARIABLES LIKE 'mysql56_temporal_format'; +-------------------------+-------+ | Variable_name | Value | +-------------------------+-------+ | mysql56_temporal_format | ON | +-------------------------+-------+ ALTER TABLE example_table MODIFY ts_col TIMESTAMP; ``` When MariaDB executes the `[ALTER TABLE](../alter-table/index)` statement, it converts the data from the older temporal format to the newer one. In the event that you have several tables and columns using temporal data types that you want to switch over to the new format, make sure the system variable is enabled, then perform a dump and restore using `mysqldump`. The columns using relevant temporal data types are restored using the new temporal format. Starting from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/) columns with old temporal formats are marked with a `/* mariadb-5.3 */` comment in the output of `[SHOW CREATE TABLE](../show-create-table/index)`, `[SHOW COLUMNS](../show-columns/index)`, `[DESCRIBE](../describe/index)` statements, as well as in the `COLUMN_TYPE` column of the `[INFORMATION\_SCHEMA.COLUMNS Table](../information-schema-columns-table/index)`. ``` SHOW CREATE TABLE mariadb5312_timestamp\G *************************** 1. row *************************** Table: mariadb5312_timestamp Create Table: CREATE TABLE `mariadb5312_timestamp` ( `ts0` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ts6` timestamp(6) /* mariadb-5.3 */ NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ``` **Note:** Prior to MySQL 4.1 a different format for the TIMESTAMP datatype was used. This format is unsupported in [MariaDB 5.1](../what-is-mariadb-51/index) and upwards. Examples -------- ``` CREATE TABLE t (id INT, ts TIMESTAMP); DESC t; +-------+-----------+------+-----+-------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+-------------------+-----------------------------+ | id | int(11) | YES | | NULL | | | ts | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | +-------+-----------+------+-----+-------------------+-----------------------------+ INSERT INTO t(id) VALUES (1),(2); SELECT * FROM t; +------+---------------------+ | id | ts | +------+---------------------+ | 1 | 2013-07-22 12:50:05 | | 2 | 2013-07-22 12:50:05 | +------+---------------------+ INSERT INTO t VALUES (3,NULL),(4,'2001-07-22 12:12:12'); SELECT * FROM t; +------+---------------------+ | id | ts | +------+---------------------+ | 1 | 2013-07-22 12:50:05 | | 2 | 2013-07-22 12:50:05 | | 3 | 2013-07-22 12:51:56 | | 4 | 2001-07-22 12:12:12 | +------+---------------------+ ``` Converting to Unix epoch: ``` SELECT ts, UNIX_TIMESTAMP(ts) FROM t; +---------------------+--------------------+ | ts | UNIX_TIMESTAMP(ts) | +---------------------+--------------------+ | 2013-07-22 12:50:05 | 1374490205 | | 2013-07-22 12:50:05 | 1374490205 | | 2013-07-22 12:51:56 | 1374490316 | | 2001-07-22 12:12:12 | 995796732 | +---------------------+--------------------+ ``` Update also changes the timestamp: ``` UPDATE t set id=5 WHERE id=1; SELECT * FROM t; +------+---------------------+ | id | ts | +------+---------------------+ | 5 | 2013-07-22 14:52:33 | | 2 | 2013-07-22 12:50:05 | | 3 | 2013-07-22 12:51:56 | | 4 | 2001-07-22 12:12:12 | +------+---------------------+ ``` Default NULL: ``` CREATE TABLE t2 (id INT, ts TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP); INSERT INTO t(id) VALUES (1),(2); SELECT * FROM t2; INSERT INTO t2(id) VALUES (1),(2); SELECT * FROM t2; +------+------+ | id | ts | +------+------+ | 1 | NULL | | 2 | NULL | +------+------+ UPDATE t2 SET id=3 WHERE id=1; SELECT * FROM t2; +------+---------------------+ | id | ts | +------+---------------------+ | 3 | 2013-07-22 15:32:22 | | 2 | NULL | +------+---------------------+ ``` Only the first timestamp is automatically inserted and updated: ``` CREATE TABLE t3 (id INT, ts1 TIMESTAMP, ts2 TIMESTAMP); INSERT INTO t3(id) VALUES (1),(2); SELECT * FROM t3; +------+---------------------+---------------------+ | id | ts1 | ts2 | +------+---------------------+---------------------+ | 1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 | | 2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 | +------+---------------------+---------------------+ DESC t3; +-------+-----------+------+-----+---------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+---------------------+-----------------------------+ | id | int(11) | YES | | NULL | | | ts1 | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | | ts2 | timestamp | NO | | 0000-00-00 00:00:00 | | +-------+-----------+------+-----+---------------------+-----------------------------+ ``` Explicitly setting a timestamp with the [CURRENT\_TIMESTAMP](../current_timestamp/index) function: ``` INSERT INTO t3(id,ts2) VALUES (3,CURRENT_TIMESTAMP()); SELECT * FROM t3; +------+---------------------+---------------------+ | id | ts1 | ts2 | +------+---------------------+---------------------+ | 1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 | | 2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 | | 3 | 2013-07-22 15:38:52 | 2013-07-22 15:38:52 | +------+---------------------+---------------------+ ``` Specifying the timestamp as NOT NULL: ``` CREATE TABLE t4 (id INT, ts TIMESTAMP NOT NULL); INSERT INTO t4(id) VALUES (1); SELECT SLEEP(1); INSERT INTO t4(id,ts) VALUES (2,NULL); SELECT * FROM t4; ``` See Also -------- * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DAY DAY === Syntax ------ ``` DAY(date) ``` Description ----------- `DAY()` is a synonym for `[DAYOFMONTH()](../dayofmonth/index)`. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DECLARE HANDLER DECLARE HANDLER =============== Syntax ------ ``` DECLARE handler_type HANDLER FOR condition_value [, condition_value] ... statement handler_type: CONTINUE | EXIT | UNDO condition_value: SQLSTATE [VALUE] sqlstate_value | condition_name | SQLWARNING | NOT FOUND | SQLEXCEPTION | mariadb_error_code ``` Description ----------- The `DECLARE ... HANDLER` statement specifies handlers that each may deal with one or more conditions. If one of these conditions occurs, the specified statement is executed. statement can be a simple statement (for example, `SET var_name = value`), or it can be a compound statement written using [BEGIN and END](../begin-end/index). Handlers must be declared after local variables, a `CONDITION` and a [CURSOR](../programmatic-and-compound-statements-cursors/index). For a `CONTINUE` handler, execution of the current program continues after execution of the handler statement. For an EXIT handler, execution terminates for the [BEGIN ... END](../begin-end/index) compound statement in which the handler is declared. (This is true even if the condition occurs in an inner block.) The `UNDO` handler type statement is not supported. If a condition occurs for which no handler has been declared, the default action is `EXIT`. A condition\_value for `DECLARE ... HANDLER` can be any of the following values: * An [SQLSTATE](../sqlstate/index) value (a 5-character string literal) or a MariaDB error code (a number). You should not use `SQLSTATE` value '00000' or MariaDB error code 0, because those indicate sucess rather than an error condition. For a list of `SQLSTATE` values and MariaDB error codes, see [MariaDB Error Codes](../mariadb-error-codes/index). * A condition name previously specified with `DECLARE ... CONDITION`. It must be in the same stored program. See [DECLARE CONDITION](../declare-condition/index). * `SQLWARNING` is shorthand for the class of SQLSTATE values that begin with '01'. * `NOT FOUND` is shorthand for the class of `SQLSTATE` values that begin with '02'. This is relevant only the context of cursors and is used to control what happens when a cursor reaches the end of a data set. If no more rows are available, a No Data condition occurs with `SQLSTATE` value 02000. To detect this condition, you can set up a handler for it (or for a `NOT FOUND` condition). An example is shown in [Cursor Overview](../cursor-overview/index). This condition also occurs for [SELECT ... INTO](../select-into/index) var\_list statements that retrieve no rows. * SQLEXCEPTION is shorthand for the class of SQLSTATE values that do not begin with '00', '01', or '02'. When an error raises, in some cases it could be handled by multiple `HANDLER`s. For example, there may be an handler for 1050 error, a separate handler for the 42S01 SQLSTATE, and another separate handler for the `SQLEXCEPTION` class: in theory all occurrences of `HANDLER` may catch the 1050 error, but MariaDB chooses the `HANDLER` with the highest precedence. Here are the precedence rules: * Handlers which refer to an error code have the highest precedence. * Handlers which refer to a SQLSTATE come next. * Handlers which refer to an error class have the lowest precedence. In some cases, a statement could produce multiple errors. If this happens, in some cases multiple handlers could have the highest precedence. In such cases, the choice of the handler is indeterminate. Note that if an error occurs within a `CONTINUE HANDLER` block, it can be handled by another `HANDLER`. However, a `HANDLER` which is already in the stack (that is, it has been called to handle an error and its execution didn't finish yet) cannot handle new errors—this prevents endless loops. For example, suppose that a stored procedure contains a `CONTINUE HANDLER` for `SQLWARNING` and another `CONTINUE HANDLER` for `NOT FOUND`. At some point, a NOT FOUND error occurs, and the execution enters the `NOT FOUND HANDLER`. But within that handler, a warning occurs, and the execution enters the `SQLWARNING HANDLER`. If another `NOT FOUND` error occurs, it cannot be handled again by the `NOT FOUND HANDLER`, because its execution is not finished. When a `DECLARE HANDLER` block can handle more than one error condition, it may be useful to know which errors occurred. To do so, you can use the [GET DIAGNOSTICS](../get-diagnostics/index) statement. An error that is handled by a `DECLARE HANDLER` construct can be issued again using the [RESIGNAL](../resignal/index) statement. Below is an example using `DECLARE HANDLER`: ``` CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1)); DELIMITER // CREATE PROCEDURE handlerdemo ( ) BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' SET @x2 = 1; SET @x = 1; INSERT INTO test.t VALUES (1); SET @x = 2; INSERT INTO test.t VALUES (1); SET @x = 3; END; // DELIMITER ; CALL handlerdemo( ); SELECT @x; +------+ | @x | +------+ | 3 | +------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LOWER LOWER ===== Syntax ------ ``` LOWER(str) ``` Description ----------- Returns the string `str` with all characters changed to lowercase according to the current character set mapping. The default is latin1 (cp1252 West European). Examples -------- ``` SELECT LOWER('QUADRATICALLY'); +------------------------+ | LOWER('QUADRATICALLY') | +------------------------+ | quadratically | +------------------------+ ``` `LOWER()` (and `[UPPER](../upper/index)()`) are ineffective when applied to binary strings (`[BINARY](../binary/index)`, `[VARBINARY](../varbinary/index)`, `[BLOB](../blob/index)`). To perform lettercase conversion, [CONVERT](../convert/index) the string to a non-binary string: ``` SET @str = BINARY 'North Carolina'; SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1)); +----------------+-----------------------------------+ | LOWER(@str) | LOWER(CONVERT(@str USING latin1)) | +----------------+-----------------------------------+ | North Carolina | north carolina | +----------------+-----------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb R Statistical Programming Using MariaDB as the Background Database R Statistical Programming Using MariaDB as the Background Database ================================================================== Introduction to R ----------------- R is a language and environment for statistical computing and graphics. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …), graphical techniques, machine learning packages and is highly extensible. One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control. The R Environment ----------------- R is an integrated suite of software facilities for data manipulation, calculation, and graphical display. It includes: • an effective data handling and storage facility, • a suite of operators for calculations on arrays, in particular matrices, • a large, coherent, integrated collection of intermediate tools for data analysis, • graphical facilities for data analysis and display either on-screen or on hardcopy, and • a well-developed, simple and effective programming language which includes conditionals, loops, user-defined recursive functions and input and output facilities. Using R with MariaDB -------------------- ### R Installation Some basic notions / tips on how to use R along with MariaDB are the following: A. The recommended R distribution is “Base R”: [CRAN](https://cran.r-project.org/bin/windows/base/) B. The recommended R GUIs are RStudio Desktop, or RStudio Server: [RStudio](https://www.rstudio.com/products/rstudio/) Alternative GUIs would be: * RCode (PGM Solutions): [RCode](https://www.pgm-solutions.com/rcode). “R” and “MariaDB Server” can be installed either in the same server, or in different servers, as an ODBC communication protocol will be used for the exchange of data between the two environments. ### Data Transfer between R and MariaDB #### Package: "odbc" For the transfer of data between MariaDB Server and R Environment, it is recommended R's "odbc" Package: [CRAN odbc](https://cran.r-project.org/web/packages/odbc/index.html) * “odbc" is a new R package available on CRAN (Since 2017-02-05), and maintained by RStudio, which is designed to comply with the DBI specification. * Tutorials on how to use R's "odbc" package can be found here: + Setting up ODBC Drivers: [DB RStudio Drivers](https://db.rstudio.com/drivers/) + "odbc" R Package: [DB RStudio odbc Usage](https://db.rstudio.com/odbc/#usage) The "odbc" package requires to have previously installed the MariaDB or MySQL ODBC connector: * [MariaDB ODBC Connector](https://downloads.mariadb.org/connector-odbc/) * [MySQL ODBC Connector](https://dev.mysql.com/downloads/connector/odbc/5.3.html) For installing the "odbc" package from CRAN, execute in R: ``` install.packages("odbc") ``` #### Package: "RMariaDB" “RMariaDB” R library, is a modern 'MariaDB' client based on 'Rcpp'. For installing RMariaDB package through CRAN, execute the following R statement: ``` install.packages("RMariaDB") ``` And for connecting to MariaDB: ``` library(RMariaDB) con <- dbConnect( drv = RMariaDB::MariaDB(), username = NULL, password = NULL, host = NULL, port = 3306 ) ``` #### Other Packages: "readr", "RODBC" There are other alternatives for data transfer between R and MariaDB: * “readr” R package, for writing / reading CSV files. To be used in MariaDB along with “LOAD DATA INFILE”. * "RODBC" R package: Robust and well-tested (Since 2000-05-24) package which enables data transfer between R and MariaDB by means of an ODBC connector: [CRAN RODBC](https://cran.r-project.org/web/packages/RODBC/index.html) + It is slightly slower than RStudio's new "odbc" package (See benchmarks): [RStudio odbc](https://db.rstudio.com/odbc/) + For bug report to the RODBC package maintainer, use the following R statement: bug.report(package = "RODBC") + A vignette on how to use the RODBC package can be found here: [RODBC CRAN Vignette](https://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf) ### R Programming Resources #### A) Programming Recommended resources for learning how to program in R are the following: * [R Cookbook Second Edition (O’Reilly Media; Paul Teetor; James (JD) Long)](https://rc2e.com/) * [R Graphics Cookbook Second Edition (O’Reilly Media; Winston Chang)](https://r-graphics.org/) * [R for Data Science (O’Reilly Media; Garrett Grolemund, Hadley Wickham)](https://r4ds.had.co.nz/) * [Advanced R Second Edition (CRC R Series; Hadley Wickham)](https://adv-r.hadley.nz/) * [Mastering Spark with R (O'Reilly; Javier Luraschi, Kevin Kuo, Edgar Ruiz)](https://therinspark.com/) * [R Packages (Hadley Wickham; O’Reilly)](https://r-pkgs.org/) #### B) Statistics A recommended book for understanding the underlying statistics in the R packages is: * [Practical Statistics for Data Scientists (O’Reilly Media; Peter Bruce, Andrew Bruce)](http://shop.oreilly.com/product/0636920048992.do) #### C) Cheatsheets: Concept Summary * Rstudio Cheatsheets are a recommended and valuable resource: [RStudio Cheatsheets: Webpage](https://www.rstudio.com/resources/cheatsheets/) * Along with the following Base R reference card: [R Reference Card v2](https://cran.r-project.org/doc/contrib/Baggott-refcard-v2.pdf) #### D) Search Engine & R Package Spotlight * Search Engines: + [RSeek: For searching any R related information (Based on Google).](http://rseek.org/) + [RPackages: Search and stats for CRAN packages.](https://www.rpackages.io/) * Information on new R packages is regularly published in the following websites: + [R-bloggers](https://www.r-bloggers.com/) + [Towards Data Science](https://towardsdatascience.com/) + [MRAN: Package Spotlight](https://mran.microsoft.com/spotlight) #### E) Statistical / Unsupervised Machine Learning, Deep Learning and Artificial Intelligence **H2O.AI** The R Programming language has support for the H2O.ai library ([h2o](https://cran.r-project.org/web/packages/h2o/index.html)), which enables to create in-memory multi-cluster GPU powered machine learning models. For installing H2O.ai through CRAN, execute: ``` install.packages("h2o") ``` * [H2O.ai: Webpage](https://www.h2o.ai/) * [H2O.ai Algorithms: Cheatsheet](https://github.com/h2oai/h2o-tutorials/raw/master/training/h2o_algos/h2o_algos_cheat_sheet_04_25_17.pdf) * [h2o R Package Functions: Cheatsheet](https://github.com/rstudio/cheatsheets/raw/master/h2o.pdf) * [Practical Machine Learning with H2O (O'Reilly Media; Darren Cook)](http://shop.oreilly.com/product/0636920053170.do) * [Machine Learning with R and H2O (Mark Landry): Booklet Online Version](http://docs.h2o.ai/h2o/latest-stable/h2o-docs/booklets/RBooklet.pdf) * [Deep Learning with H2O: Vignette](http://docs.h2o.ai/h2o/latest-stable/h2o-docs/booklets/DeepLearningBooklet.pdf) The following R Statements can be used for importing a MariaDB table to H2O.ai using the R Front End: * **import\_sql\_table**: "This function imports a SQL table to H2OFrame in memory". * **import\_sql\_select**: "This function imports the SQL table that is the result of the specified SQL query to H2OFrame in memory". ``` connection_url <- "jdbc:mariadb://172.16.2.178:3306/ingestSQL?&useSSL=false" username <- "root" password <- "abc123" # Whole Table: table <- "citibike20k" my_citibike_data <- h2o.import_sql_table(connection_url, table, username, password) # SELECT Query: select_query <- "SELECT bikeid FROM citibike20k" my_citibike_data <- h2o.import_sql_select(connection_url, select_query, username, password) ``` NOTE: Be sure to start the h2o.jar in the terminal with your downloaded JDBC driver in the classpath: ``` java -cp <path_to_h2o_jar>:<path_to_jdbc_driver_jar> water.H2OApp ``` **KERAS** [R package keras](https://cran.r-project.org/web/packages/keras/index.html) offers an interface to [Python's 'Keras'](https://keras.io), a high-level neural networks 'API'. 'Keras' was developed with a focus on enabling fast experimentation, supports both convolution based networks and recurrent networks (as well as combinations of the two), and runs seamlessly on both 'CPU' and 'GPU' devices. * [R interface to Keras: Webpage](https://keras.rstudio.com/) * [Deep Learning With R (François Chollet with J. J. Allaire, Manning)](https://www.manning.com/books/deep-learning-with-r) * [Keras Rstudio Cheatsheet](https://github.com/rstudio/cheatsheets/raw/master/keras.pdf) **R LIBRARIES: CARET** A book which introduces core Machine Learning concepts: * [Introduction to Machine Learning with R (O'Reilly; Scott Burger)](http://shop.oreilly.com/product/0636920058885.do) #### F) Text Mining Documentation on how to perform Text Mining in R can be found in the book "Text Mining With R": * [Text Mining With R: A Tidy Approach (O’Reilly Media; Julia Silge and David Robinson): Book Online Version](http://tidytextmining.com/) #### G) Shiny Web Apps & RMarkdown Documents **SHINY WEB APPS** [Shiny](https://cran.r-project.org/web/packages/shiny/index.html) R Package makes it incredibly easy to build interactive web applications with R. Automatic "reactive" binding between inputs and outputs and extensive prebuilt widgets make it possible to build beautiful, responsive, and powerful applications with minimal effort. * [Shiny Written Tutorials](https://shiny.rstudio.com/tutorial/written-tutorial/lesson1/) * [Shiny R Package Cheatsheet](https://github.com/rstudio/cheatsheets/raw/master/shiny.pdf) For deploy Shiny Web Applications using Open Source Alternatives, you can either use: * [RInno: CRAN Webpage (Windows)](https://cran.r-project.org/web/packages/RInno/index.html) * [ShinyProxy: Webpage](https://www.shinyproxy.io/) * [Shiny Server (Open Source Edition): Webpage](https://www.rstudio.com/products/shiny/shiny-server/) **RMARKDOWN DOCUMENTS** * [R Markdown: The Definitive Guide (Book).](https://bookdown.org/yihui/rmarkdown/) * [R Markdown Cheatsheet.](https://github.com/rstudio/cheatsheets/raw/master/rmarkdown-2.0.pdf) #### H) Advanced R Resources Some of the most advanced R resources for fully understanding the internals and nuances of the R Programming Language are the following: * [Chapman & Hall/CRC The R Series: Subject-specific Books](https://www.crcpress.com/Chapman--HallCRC-The-R-Series/book-series/crctherser) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb replace Utility replace Utility =============== Description ----------- The replace utility program changes strings in place in files or on the standard input. Invoke replace in one of the following ways: ``` shell> replace from to [from to] ... -- file_name [file_name] ... shell> replace from to [from to] ... < file_name ``` "`from`" represents a string to look for and "`to`" represents its replacement. There can be one or more pairs of strings. A from-string can contain these special characters: | Character | Description | | --- | --- | | `\^` | Match start of line. | | `\$` | Match end of line. | | `\b` | Match space-character, start of line or end of line. For an end `\b` the next replace starts looking at the end space-character. A `\b` alone in a string matches only a space-character | Use the `--` option to indicate where the string-replacement list ends and the file names begin. Any file named on the command line is modified in place, so you may want to make a copy of the original before converting it. `replace` prints a message indicating which of the input files it actually modifies. If the `--` option is not given, replace reads standard input and writes to standard output. replace uses a finite state machine to match longer strings first. It can be used to swap strings. For example, the following command swaps "a" and "b" in the given files, /file1 *and* file2*:* ``` shell> replace a b b a -- file1 file2 ... ``` The replace program is used by [msql2mysql](../msql2mysql/index). Options ------- `replace` supports the following options. | Option | Description | | --- | --- | | `-?`, `-I` | Display a help message and exit. | | `-#debug_options` | Enable debugging. | | `-s` | Silent mode. Print less information about what the program does. | | `-v` | Verbose mode. Print more information about what the program does. | | `-V` | Display version information and exit. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Audit Plugin - Status Variables MariaDB Audit Plugin - Status Variables ======================================= There are a few status variables related to the [MariaDB Audit Plugin](../server_audit-mariadb-audit-plugin/index), once it has been [installed](../mariadb-audit-plugin-entitymdashentity-installation/index). These variables can be displayed using the [SHOW STATUS](../show-status/index) statement like so: ``` SHOW STATUS LIKE 'server_audit%'; +----------------------------+------------------+ | Variable_name | Value | +----------------------------+------------------+ | Server_audit_active | ON | | Server_audit_current_log | server_audit.log | | Server_audit_last_error | | | Server_audit_writes_failed | 0 | +----------------------------+------------------+ ``` ### Status Variables Below is a list of all status variables related to the Audit Plugin. These cannot be set: These are not to be confused with system variables, which can be set. See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with the [SHOW STATUS](../show-status/index) statement. See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `Server_audit_active` * **Description:** If the auditing is actually working. It gets the ON value when the logging is successfully started. Then it can get the OFF value if the logging was stopped or log records can't be properly stored due to file or syslog errors. * **Data Type:** `boolean` --- #### `Server_audit_current_log` * **Description:** The name of the logfile or the SYSLOG parameters that are in current use. * **Data Type:** `string` --- #### `Server_audit_last_error` * **Description:** If something went wrong with the logging here you can see the message. * **Data Type:** `string` --- #### `Server_audit_writes_failed` * **Description:** The number of log records since last logging-start that weren't properly stored because of errors of any kind. The global value can be flushed by `[FLUSH STATUS](../flush/index)`. * **Data Type:** `numeric` * **Default Value:** `0` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW PLUGINS SONAME SHOW PLUGINS SONAME =================== Syntax ------ ``` SHOW PLUGINS SONAME { library | LIKE 'pattern' | WHERE expr }; ``` Description ----------- `SHOW PLUGINS SONAME` displays information about compiled-in and all server plugins in the `[plugin\_dir](../server-system-variables/index#plugin_dir)` directory, including plugins that haven't been installed. Examples -------- ``` SHOW PLUGINS SONAME 'ha_example.so'; +----------+---------------+----------------+---------------+---------+ | Name | Status | Type | Library | License | +----------+---------------+----------------+---------------+---------+ | EXAMPLE | NOT INSTALLED | STORAGE ENGINE | ha_example.so | GPL | | UNUSABLE | NOT INSTALLED | DAEMON | ha_example.so | GPL | +----------+---------------+----------------+---------------+---------+ ``` There is also a corresponding `[information\_schema](../information_schema/index)` table, called `[ALL\_PLUGINS](../information-schema-all_plugins-table/index)`, which contains more complete information. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB ColumnStore software upgrade 1.1.1 RC to 1.1.2 GA MariaDB ColumnStore software upgrade 1.1.1 RC to 1.1.2 GA ========================================================= MariaDB ColumnStore software upgrade 1.1.1 RC to 1.1.2 GA --------------------------------------------------------- Additional Dependency Packages exist for 1.1.2, so make sure you install those based on the "Preparing for ColumnStore Installation" Guide. Note: Columnstore.xml modifications you manually made are not automatically carried forward on an upgrade. These modifications will need to be incorporated back into .XML once the upgrade has occurred. The previous configuration file will be saved as /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave. If you have specified a root database password (which is good practice), then you must configure a .my.cnf file with user credentials for the upgrade process to use. Create a .my.cnf file in the user home directory with 600 file permissions with the following content (updating PASSWORD as appropriate): ``` [mysqladmin] user = root password = PASSWORD ``` ### Choosing the type of upgrade As noted on the Preparing guide, you can installing MariaDB ColumnStore with the use of soft-links. If you have the softlinks be setup at the Data Directory Levels, like mariadb/columnstore/data and mariadb/columnstore/dataX, then your upgrade will happen without any issues. In the case where you have a softlink at the top directory, like /usr/local/mariadb, you will need to upgrade using the binary package. If you updating using the rpm package and tool, this softlink will be deleted when you perform the upgrade process and the upgrade will fail. #### Root User Installs #### Upgrading MariaDB ColumnStore using RPMs Upgrade MariaDB ColumnStore as user root on the server designated as PM1: **Download the package mariadb-columnstore-1.1.2-1-centos#.x86\_64.rpm.tar.gz to the PM1 server where you are installing MariaDB ColumnStore.** Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate a set of RPMs that will reside in the /root/ directory. ``` # tar -zxf mariadb-columnstore-1.1.2-1-centos#.x86_64.rpm.tar.gz ``` * Upgrade the RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` # rpm -e --nodeps $(rpm -qa | grep '^mariadb-columnstore') # rpm -ivh mariadb-columnstore-*1.1.2*rpm ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml.rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` For RPM Upgrade, the previous configuration file will be saved as: /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /usr/local directory -mariadb-columnstore-1.1.2-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # /usr/local/mariadb/columnstore/bin/pre-uninstall ``` * Unpack the tarball, in the /usr/local/ directory. ``` # tar -zxvf -mariadb-columnstore-1.1.2-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # /usr/local/mariadb/columnstore/bin/post-install ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` ### Upgrading MariaDB ColumnStore using the DEB package A DEB upgrade would be done on a system that supports DEBs like Debian or Ubuntu systems. Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /root directory mariadb-columnstore-1.1.2-1.amd64.deb.tar.gz (DEB 64-BIT) to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate DEBs. ``` # tar -zxf mariadb-columnstore-1.1.2-1.amd64.deb.tar.gz ``` * Remove, purge and install all MariaDB ColumnStore debs ``` # cd /root/ # dpkg -r $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg -P $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg --install mariadb-columnstore-*1.1.2-1*deb ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` #### Non-Root User Installs ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /home/'non-root-user" directory mariadb-columnstore-1.1.2-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # $HOME/mariadb/columnstore/bin/pre-uninstall --installdir= /home/guest/mariadb/columnstore ``` * Unpack the tarball, which will generate the $HOME/ directory. ``` # tar -zxvf -mariadb-columnstore-1.1.2-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # $HOME/mariadb/columnstore/bin/post-install --installdir=/home/guest/mariadb/columnstore ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # $HOME/mariadb/columnstore/bin/postConfigure -u -i /home/guest/mariadb/columnstore ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SPACE SPACE ===== Syntax ------ ``` SPACE(N) ``` Description ----------- Returns a string consisting of *`N`* space characters. If `N` is NULL, returns NULL. Examples -------- ``` SELECT QUOTE(SPACE(6)); +-----------------+ | QUOTE(SPACE(6)) | +-----------------+ | ' ' | +-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql.func Table mysql.func Table ================ The `mysql.func` table stores information about [user-defined functions](../user-defined-functions/index) (UDFs) created with the [CREATE FUNCTION UDF](../create-function-udf/index) statement. **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this table uses the [Aria](../aria/index) storage engine. **MariaDB until [10.3](../what-is-mariadb-103/index)**In [MariaDB 10.3](../what-is-mariadb-103/index) and before, this table uses the [MyISAM](../myisam-storage-engine/index) storage engine. The `mysql.func` table contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | `name` | `char(64)` | NO | PRI | | UDF name | | `ret` | `tinyint(1)` | NO | | 0 | | | `dl` | `char(128)` | NO | | | Shared library name | | `type` | `enum('function','aggregate')` | NO | | `NULL` | Type, either `function` or `aggregate`. Aggregate functions are summary functions such as [SUM()](../sum/index) and [AVG()](../avg/index). | Example ------- ``` SELECT * FROM mysql.func; +------------------------------+-----+--------------+-----------+ | name | ret | dl | type | +------------------------------+-----+--------------+-----------+ | spider_direct_sql | 2 | ha_spider.so | function | | spider_bg_direct_sql | 2 | ha_spider.so | aggregate | | spider_ping_table | 2 | ha_spider.so | function | | spider_copy_tables | 2 | ha_spider.so | function | | spider_flush_table_mon_cache | 2 | ha_spider.so | function | +------------------------------+-----+--------------+-----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Setting Up a LAMP Stack with Docker Compose Setting Up a LAMP Stack with Docker Compose =========================================== Docker Compose is a tool that allows one to declare which Docker containers should run, and which relationships should exist between them. It follows the **infrastructure as code** approach, just like most automation software and Docker itself. For information about installing Docker Compose, see [Install Docker Compose](https://docs.docker.com/compose/install/) in Docker documentation. The `docker-compose.yml` File ----------------------------- When using Docker Compose, the Docker infrastructure must be described in a YAML file called `docker-compose.yml`. Let's see an example: ``` version: "3" services: web: image: "apache:${PHP_VERSION}" restart: 'always' depends_on: - mariadb restart: 'always' ports: - '8080:80' links: - mariadb mariadb: image: "mariadb:${MARIADB_VERSION}" restart: 'always' volumes: - "/var/lib/mysql/data:${MARIADB_DATA_DIR}" - "/var/lib/mysql/logs:${MARIADB_LOG_DIR}" - /var/docker/mariadb/conf:/etc/mysql environment: MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" MYSQL_DATABASE: "${MYSQL_DATABASE}" MYSQL_USER: "${MYSQL_USER}" MYSQL_PASSWORD: "${MYSQL_PASSWORD}" ``` In the first line we declare that we are using version 3 of the Docker compose language. Then we have the list of services, namely the `web` and the `mariadb` services. Let's see the properties of the services: * `port` maps the 8080 container port to the 80 host system port. This is very useful for a development environment, but not in production, because it allows us to connect our browser to the containerized web server. Normally there is no need to connect to MariaDB from the host system. * `links` declares that this container must be able to connect `mariadb`. The hostname is the container name. * `depends_on` declares that `mariadb` needs to start before `web`. This is because we cannot do anything with our application until MariaDB is ready to accept connections. * `restart: always` declares that the containers must restart if they crash. * `volumes` creates volumes for the container if it is set in a service definition, or a volume that can be used by any container if it is set globally, at the same level as `services`. Volumes are directories in the host system that can be accessed by any number of containers. This allows destroying a container without losing data. * `environment` sets environment variables inside the container. This is important because in setting these variables we set the MariaDB root credentials for the container. ### About Volumes It is good practice to create volumes for: * The [data directory](../server-system-variables/index#datadir), so we don't lose data when a container is created or replaced, perhaps to upgrade MariaDB. * The directory where we put all the logs, if it is not the datadir. * The directory containing all configuration files (for development environments), so we can edit those files with the editor installed in the host system. Normally no editor is installed in containers. In production we don't need to do this, because we can copy files from a repository located in the host system to the containers. Note that Docker Compose variables are just placeholders for values. Compose does not support assignment, conditionals or loops. ### Using Variables In the above example you can see several variables, like `${MARIADB_VERSION}`. Before executing the file, Docker Compose will replace this syntax with the `MARIADB_VERSION` variable. Variables allow making Docker Compose files more re-usable: in this case, we can use any MariaDB image version without modifying the Docker Compose file. The most common way to pass variables is to write them into a file. This has the benefit of allowing us to version the variable file along with the Docker Compose file. It uses the same syntax you would use in BASH: ``` PHP_VERSION=8.0 MARIADB_VERSION=10.5 ... ``` For bigger setups, it could make sense to use different environment files for different services. To do so, we need to specify the file to use in the Compose file: ``` services: web: env_file: - web-variables.env ... ``` Docker Compose Commands ----------------------- Docker Compose is operated using `docker-compose`. Here we'll see the most common commands. For more commands and for more information about the commands mentioned here, see the documentation. Docker Compose assumes that the Composer file is located in the current directory and it's called `docker-compose.yml`. To use a different file, the `-f <filename>` parameter must be specified. To pull the necessary images: ``` docker-compose pull ``` Containers described in the Compose file can be created in several ways. To create them only if they do not exist: ``` docker-compose up --no-recreate ``` To create them if they do not exist and recreate them if their image or configuration have changed: ``` docker-compose up ``` To recreate containers in all cases: ``` docker-compose up --force-recreate ``` Normally `docker-compose up` starts the containers. To create them without starting them, add the `--no-start` option. To restart containers without recreating them: ``` docker-compose restart ``` To kill a container by sending it a `SIGKILL`: ``` docker-compose kill <service> ``` To instantly remove a running container: ``` docker-compose rm -f <serice> ``` To tear down all containers created by the current Compose file: ``` docker-compose down ``` Docker Compose Resources and References --------------------------------------- * [Overview of Docker Compose](https://docs.docker.com/compose/) in the Docker documentation. * [Compose file](https://docs.docker.com/compose/compose-file/) in the Docker documentation. * [Docker Compose](https://github.com/docker/compose) on GitHub. Further information about the concepts explained in this page can be found in Docker documentation: * [Environment variables in Compose](https://docs.docker.com/compose/environment-variables/). * [Overview of docker-compose CLI](https://docs.docker.com/compose/reference/overview/). * [Compose command-line reference](https://docs.docker.com/compose/reference/). --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Buildbot Setup for Virtual Machines - Additional Steps Buildbot Setup for Virtual Machines - Additional Steps ======================================================= This section documents some additions that have been made after the initial setup. | Title | Description | | --- | --- | | [Installing the Boost library needed for the OQGraph storage engine](../installing-the-boost-library-needed-for-the-oqgraph-storage-engine/index) | The OQGraph storage engine needs a newer version of Boost that what is avai... | | [Installing VM images for testing .deb upgrade between versions](../installing-vm-images-for-testing-deb-upgrade-between-versions/index) | This step creates virtual machine images used to do an important additional... | | [Install Cassandra on Fulltest VMs](../install-cassandra-on-fulltest-vms/index) | CassandraSE is no longer actively being developed and has been removed in M... | | [Install cmake on build VMs](../install-cmake-on-build-vms/index) | MariaDB 5.5 Requires cmake. Install cmake on all -build VMs (and other Unix... | | [Installing correct libraries for PAM and readline](../installing-correct-libraries-for-pam-and-readline/index) | Some additional/alternative libraries needs to be installed to handle readl... | | [Resizing a Virtual Machine Image](../resizing-a-virtual-machine-image/index) | Some KVM images end up not having enough space on them. In such cases, it i... | | [Update Debian 4 mirrors for Buildbot VMs](../update-debian-4-mirrors-for-buildbot-vms/index) | Debian 4 has become so old that the apt repository has been moved out of th... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb YEAR Data Type YEAR Data Type ============== Syntax ------ ``` YEAR[(4)] ``` Description ----------- A year in two-digit or four-digit format. The default is four-digit format. Note that the two-digit format has been deprecated since [MariaDB 5.5.27](https://mariadb.com/kb/en/mariadb-5527-release-notes/). In four-digit format, the allowable values are 1901 to 2155, and 0000. In two-digit format, the allowable values are 70 to 69, representing years from 1970 to 2069. MariaDB displays YEAR values in YYYY format, but allows you to assign values to YEAR columns using either strings or numbers. Inserting numeric zero has a different result for YEAR(4) and YEAR(2). For YEAR(2), the value `00` reflects the year 2000. For YEAR(4), the value `0000` reflects the year zero. This only applies to numeric zero. String zero always reflects the year 2000. Examples -------- Accepting a string or a number: ``` CREATE TABLE y(y YEAR); INSERT INTO y VALUES (1990),('2012'); SELECT * FROM y; +------+ | y | +------+ | 1990 | | 2012 | +------+ ``` With [strict\_mode](../sql-mode/index#strict-mode) set, the default from [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/): Out of range: ``` INSERT INTO y VALUES (1005),('3080'); ERROR 1264 (22003): Out of range value for column 'y' at row 1 INSERT INTO y VALUES ('2013-12-12'); ERROR 1265 (01000): Data truncated for column 'y' at row 1 SELECT * FROM y; +------+ | y | +------+ | 1990 | | 2012 | +------+ ``` With [strict\_mode](../sql-mode/index#strict-mode) unset, the default until [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/): Out of range: ``` INSERT INTO y VALUES (1005),('3080'); Query OK, 2 rows affected, 2 warnings (0.05 sec) Records: 2 Duplicates: 0 Warnings: 2 SHOW WARNINGS; +---------+------+--------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------+ | Warning | 1264 | Out of range value for column 'y' at row 1 | | Warning | 1264 | Out of range value for column 'y' at row 2 | +---------+------+--------------------------------------------+ SELECT * FROM y; +------+ | y | +------+ | 1990 | | 2012 | | 0000 | | 0000 | +------+ ``` Truncating: ``` INSERT INTO y VALUES ('2013-12-12'); Query OK, 1 row affected, 1 warning (0.05 sec) SHOW WARNINGS; +---------+------+----------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------+ | Warning | 1265 | Data truncated for column 'y' at row 1 | +---------+------+----------------------------------------+ SELECT * FROM y; +------+ | y | +------+ | 1990 | | 2012 | | 0000 | | 0000 | | 2013 | +------+ ``` Difference between YEAR(2) and YEAR(4), and string and numeric zero: ``` CREATE TABLE y2(y YEAR(4), y2 YEAR(2)); Query OK, 0 rows affected, 1 warning (0.40 sec) Note (Code 1287): 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO y2 VALUES(0,0),('0','0'); SELECT YEAR(y),YEAR(y2) FROM y2; +---------+----------+ | YEAR(y) | YEAR(y2) | +---------+----------+ | 0 | 2000 | | 2000 | 2000 | +---------+----------+ ``` See Also -------- * [YEAR() function](../year/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BOUNDARY BOUNDARY ======== A synonym for [ST\_BOUNDARY](../st_boundary/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Authentication Plugin - SHA-256 Authentication Plugin - SHA-256 =============================== MySQL 5.6 added support for the `[sha256\_password](https://dev.mysql.com/doc/refman/5.6/en/sha256-pluggable-authentication.html)` authentication plugin, and MySQL 8.0 also added support for the `[caching\_sha2\_password](https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html)` authentication plugin. The `caching_sha2_password` plugin is now the default authentication plugin in MySQL 8.0.4 and above, based on the value of the `[default\_authentication\_plugin](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin)` system variable. Support in MariaDB Server ------------------------- MariaDB Server does not currently support either the `[sha256\_password](https://dev.mysql.com/doc/refman/5.6/en/sha256-pluggable-authentication.html)` or the `[caching\_sha2\_password](https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html)` authentication plugins. See [MDEV-9804](https://jira.mariadb.org/browse/MDEV-9804) for more information. MariaDB Server does not support either of these authentication plugins. This is mainly because: * To use the protocol, one has to distribute the server's public key to all MariaDB users, which can be cumbersome and impractical. * The server gets the password in clear text which can cause problems if the user is convinced to connect to a malicious server. Client Authentication Plugins ----------------------------- For clients that use the [MariaDB Connector/C](../mariadb-connector-c/index) library, MariaDB provides two client authentication plugins that are compatible with MySQL's SHA-256 authentication plugins: * `sha256_password` * `caching_sha256_password` When connecting with a [client or utility](../clients-utilities/index) to a server as a user account that authenticates with the `sha256_password` or `caching_sha256_password` authentication plugin, you may need to tell the client where to find the relevant client authentication plugin by specifying the `--plugin-dir` option. For example: ``` mysql --plugin-dir=/usr/local/mysql/lib64/mysql/plugin --user=alice ``` For clients that use MariaDB's `libmysqlclient` library instead of [MariaDB Connector/C](../mariadb-connector-c/index), these client authentication plugins are not supported. ### `sha256_password` The `sha256_password` client authentication plugin is compatible with MySQL's `[sha256\_password](https://dev.mysql.com/doc/refman/5.6/en/sha256-pluggable-authentication.html)` authentication plugin, which was added in MySQL 5.6. ### `caching_sha256_password` The `caching_sha256_password` client authentication plugin is compatible with MySQL's `[caching\_sha2\_password](https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html)` authentication plugin, which was added in MySQL 8.0. The `caching_sha2_password` plugin is now the default authentication plugin in MySQL 8.0.4 and above, based on the value of the `[default\_authentication\_plugin](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin)` system variable. Support in Client Libraries --------------------------- ### Using the Plugin with MariaDB Connector/C [MariaDB Connector/C](../mariadb-connector-c/index) supports `sha256_password` and `caching_sha2_password` authentication using the [client authentication plugins](client-authentication-plugins) mentioned in the previous section. It has supported the `sha256_password` client authentication plugin since MariaDB Connector/C 3.0.2. See [CONC-229](https://jira.mariadb.org/browse/CONC-229) for more information. It has supported the `caching_sha256_password` client authentication plugin since MariaDB Connector/C 3.0.8 and MariaDB Connector/C 3.1.0. See [CONC-312](https://jira.mariadb.org/browse/CONC-312) for more information. ### Using the Plugin with MariaDB Connector/ODBC [MariaDB Connector/ODBC](../about-mariadb-connector-odbc/index) supports `sha256_password` and `caching_sha2_password` authentication using the [client authentication plugins](client-authentication-plugins) mentioned in the previous section. It has supported `sha256_password` and `caching_sha2_password` authentication since MariaDB Connector/ODBC 3.1.4. See [ODBC-241](https://jira.mariadb.org/browse/ODBC-241) for more information. ### Using the Plugin with MariaDB Connector/J [MariaDB Connector/J](../about-mariadb-connector-j/index) supports `sha256_password` and `caching_sha2_password` authentication since MariaDB Connector/J 2.5.0. See [CONJ-327](https://jira.mariadb.org/browse/CONJ-327) and [CONJ-663](https://jira.mariadb.org/browse/CONJ-663) for more information. ### Using the Plugin with MariaDB Connector/Node.js [MariaDB Connector/Node.js](../nodejs-connector/index) supports `sha256_password` and `caching_sha2_password` authentication since MariaDB Connector/Node.js 2.5.0. See [CONJS-76](https://jira.mariadb.org/browse/CONJS-76) and [CONJS-77](https://jira.mariadb.org/browse/CONJS-77) for more information. See Also -------- * [MDEV-9804](https://jira.mariadb.org/browse/MDEV-9804) contains the plans to use if we ever decide to support these protocols. * [History of MySQL and MariaDB authentication protocols](https://mariadb.org/history-of-mysql-mariadb-authentication-protocols) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ADDTIME ADDTIME ======= Syntax ------ ``` ADDTIME(expr1,expr2) ``` Description ----------- `ADDTIME()` adds *expr2* to *expr1* and returns the result. *expr1* is a time or datetime expression, and *expr2* is a time expression. Examples -------- ``` SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002'); +---------------------------------------------------------+ | ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002') | +---------------------------------------------------------+ | 2008-01-02 01:01:01.000001 | +---------------------------------------------------------+ SELECT ADDTIME('01:00:00.999999', '02:00:00.999998'); +-----------------------------------------------+ | ADDTIME('01:00:00.999999', '02:00:00.999998') | +-----------------------------------------------+ | 03:00:01.999997 | +-----------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Sequence Overview Sequence Overview ================= **MariaDB starting with [10.3](../what-is-mariadb-103/index)**Sequences were introduced in [MariaDB 10.3](../what-is-mariadb-103/index). Introduction ------------ A sequence is an object that generates a sequence of numeric values, as specified by the [CREATE SEQUENCE](../create-sequence/index) statement. CREATE SEQUENCE will create a sequence that generates new values when called with NEXT VALUE FOR sequence\_name. It's an alternative to [AUTO INCREMENT](../auto_increment/index) when one wants to have more control of how the numbers are generated. As the SEQUENCE caches values (up to the CACHE value in the [CREATE SEQUENCE](../create-sequence/index) statement, by default 1000) it can in some cases be much faster than AUTO INCREMENT. Another benefit is that one can access the last value generated by all used sequences, which solves one of the limitations with [LAST\_INSERT\_ID()](../last_insert_id/index). Creating a Sequence ------------------- The [CREATE SEQUENCE](../create-sequence/index) statement is used to create a sequence. Here is an example of a sequence starting at 100, incrementing by 10 each time: ``` CREATE SEQUENCE s START WITH 100 INCREMENT BY 10; ``` The CREATE SEQUENCE statement, along with defaults, can be viewd with the [SHOW CREATE SEQUENCE STATEMENT](../show-create-sequence/index), for example: ``` SHOW CREATE SEQUENCE s\G *************************** 1. row *************************** Table: s Create Table: CREATE SEQUENCE `s` start with 100 minvalue 1 maxvalue 9223372036854775806 increment by 10 cache 1000 nocycle ENGINE=InnoDB ``` Using Sequence Objects ---------------------- To get the [next value from a sequence](../next-value-for-sequence_name/index), use ``` NEXT VALUE FOR sequence_name ``` or ``` NEXTVAL(sequence_name) ``` or in Oracle mode ([SQL\_MODE=ORACLE](../sql-mode/index)) ``` sequence_name.nextval ``` For [retrieving the last value](../previous-value-for-sequence_name/index) used by the current connection from a sequence use: ``` PREVIOUS VALUE FOR sequence_name ``` or ``` LASTVAL(sequence_name) ``` or in Oracle mode ([SQL\_MODE=ORACLE](../sql-mode/index)) ``` sequence_name.currval ``` For example: ``` SELECT NEXTVAL(s); +------------+ | NEXTVAL(s) | +------------+ | 100 | +------------+ SELECT NEXTVAL(s); +------------+ | NEXTVAL(s) | +------------+ | 110 | +------------+ SELECT LASTVAL(s); +------------+ | LASTVAL(s) | +------------+ | 110 | +------------+ ``` ### Using Sequences in DEFAULT **MariaDB starting with [10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/)**Starting from 10.3.3 you can use Sequences in DEFAULT: ``` create sequence s1; create table t1 (a int primary key default (next value for s1), b int); insert into t1 (b) values (1),(2); select * from t1; +---+------+ | a | b | +---+------+ | 1 | 1 | | 2 | 2 | +---+------+ ``` Changing a Sequence ------------------- The [ALTER SEQUENCE](../alter-sequence/index) statement is used for changing sequences. For example, to restart the sequence at another value: ``` ALTER SEQUENCE s RESTART 50; SELECT NEXTVAL(s); +------------+ | NEXTVAL(s) | +------------+ | 50 | +------------+ ``` The [SETVAL function](../setval/index) can also be used to set the next value to be returned for a SEQUENCE, for example: ``` SELECT SETVAL(s, 100); +----------------+ | SETVAL(s, 100) | +----------------+ | 100 | +----------------+ ``` `SETVAL` can only be used to increase the sequence value. Attempting to set a lower value will fail, returning NULL: ``` SELECT SETVAL(s, 50); +---------------+ | SETVAL(s, 50) | +---------------+ | NULL | +---------------+ ``` Dropping a Sequence ------------------- The [DROP SEQUENCE](../drop-sequence/index) statement is used to drop a sequence, for example: ``` DROP SEQUENCE s; ``` Replication ----------- If one wants to use Sequences in a master-master setup or with Galera one should use `INCREMENT=0`. This will tell the Sequence to use [auto\_increment\_increment](../replication-and-binary-log-server-system-variables/index#auto_increment_increment) and [auto\_increment\_offset](../replication-and-binary-log-server-system-variables/index#auto_increment_offset) to generate unique values for each server. Standards Compliance -------------------- [MariaDB 10.3](../what-is-mariadb-103/index) supports both ANSI SQL and Oracle syntax for sequences. However as `SEQUENCE` is implemented as a special kind of table, it uses the same namespace as tables. The benefits are that sequences show up in [SHOW TABLES](../show-tables/index), and one can also create a sequence with [CREATE TABLE](../create-table/index) and drop it with [DROP TABLE](../drop-table/index). One can [SELECT](../select/index) from it as from any other table. This ensures that all old tools that work with tables should work with sequences. Since sequence objects act as regular tables in many contexts, they will be affected by [LOCK TABLES](../lock-tables/index). This is not the case in other DBMS, such as Oracle, where LOCK TABLE does not affect sequences. Notes ----- One of the goals with the Sequence implementation is that all old tools, such as [mysqldump](../mysqldump/index), should work unchanged, while still keeping the normal usage of sequence standard compatibly. To make this possible, `sequence` is currently implemented as a table with a few exclusive properties. The special properties for sequence tables are: * A sequence table has always one row. * When one creates a sequence, either with [CREATE TABLE](../create-table/index) or [CREATE SEQUENCE](../create-sequence/index), one row will be inserted. * If one tries to insert into a sequence table, the single row will be updated. This allows [mysqldump](../mysqldump/index) to work but also gives the additional benefit that one can change all properties of a sequence with a single insert. New applications should of course also use `ALTER SEQUENCE`. * [UPDATE](../update/index) or [DELETE](../delete/index) can't be performed on Sequence objects. * Doing a select on the sequence shows the current state of the sequence, except the values that are reserved in the cache. The `next_value` column shows the next value not reserved by the cache. * [FLUSH TABLES](../flush/index) will close the sequence and the next sequence number generated will be according to what's stored in the Sequence object. In effect, this will discard the cached values. * A number of normal table operations work on Sequence tables. See next section. Table Operations that Work with Sequences ----------------------------------------- * [SHOW CREATE TABLE sequence\_name](../show-create-table/index). This shows the table structure that is behind the `SEQUENCE` including the field names that can be used with [SELECT](../select/index) or even [CREATE TABLE](../create-table/index). * [CREATE TABLE sequence-structure ... SEQUENCE=1](../create-table/index) * [ALTER TABLE sequence RENAME TO sequence2](../alter-table/index) * [RENAME TABLE sequence\_name TO new\_sequence\_name](../rename-table/index) * [DROP TABLE sequence\_name](../drop-table/index). This is allowed mainly to get old tools like [mysqldump](../mysqldump/index) to work with sequence tables. * [SHOW TABLES](../show-tables/index) Implementation -------------- Internally, sequence tables are created as a normal table without rollback (the [InnoDB](../innodb/index), [Aria](../aria/index) and [MySAM](../myisam/index) engines support this), wrapped by a sequence engine object. This allowed us to create sequences with almost no performance impact for normal tables. (The cost is one 'if' per insert if the [binary log](../binary-log/index) is enabled). Underlying Table Structure -------------------------- The following example shows the table structure of sequences and how it can be used as a table. (Output of results are slightly edited to make them easier to read) ``` create sequence t1; show create sequence t1\G *************************** 1. row *************************** CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB show create table t1\G *************************** 1. row *************************** Create Table: CREATE TABLE `t1` ( `next_not_cached_value` bigint(21) NOT NULL, `minimum_value` bigint(21) NOT NULL, `maximum_value` bigint(21) NOT NULL, `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', `increment` bigint(21) NOT NULL COMMENT 'increment value', `cache_size` bigint(21) unsigned NOT NULL, `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=InnoDB SEQUENCE=1 select * from t1\G next_not_cached_value: 1 minimum_value: 1 maximum_value: 9223372036854775806 start_value: 1 increment: 1 cache_size: 1000 cycle_option: 0 cycle_count: 0 ``` The `cycle_count` column is incremented every time the sequence wraps around. Credits ------- * Thanks to Jianwe Zhao from Aliyun for his work on SEQUENCE in AliSQL, which gave ideas and inspiration for this work. * Thanks to Peter Gulutzan,who helped test and gave useful comments about the implementation. See Also -------- * [CREATE SEQUENCE](../create-sequence/index) * [ALTER SEQUENCE](../alter-sequence/index) * [DROP SEQUENCE](../drop-sequence/index) * [NEXT VALUE FOR](../next-value-for-sequence_name/index) * [PREVIOUS VALUE FOR](../previous-value-for-sequence_name/index) * [SETVAL()](../setval/index). Set next value for the sequence. * [AUTO INCREMENT](../auto_increment/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb PERFORMANCE_SCHEMA Storage Engine PERFORMANCE\_SCHEMA Storage Engine ================================== If you run [SHOW ENGINES](../show-engines/index), you'll see the following storage engine listed. ``` SHOW ENGINES\G ... Engine: PERFORMANCE_SCHEMA Support: YES Comment: Performance Schema Transactions: NO XA: NO Savepoints: NO ... ``` The PERFORMANCE\_SCHEMA is not a regular storage engine for storing data, it's a mechanism for implementing the [Performance Schema](../performance-schema/index) feature. The [SHOW ENGINE PERFORMANCE\_SCHEMA STATUS](../show-engine/index#show-engine-performance_schema-status) statement is also available, which shows how much memory is used by the tables and internal buffers. See [Performance Schema](../performance-schema/index) for more details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Building MariaDB on Windows Building MariaDB on Windows =========================== Build Requirements ------------------ To build MariaDB you need the following: * [Visual C++](http://www.microsoft.com/visualstudio): We currently support Visual Studio 2019 and 2022. Generally we try to support the two most recent VS versions, but build ourselves using the last one. Community editions will work fine; we only use them in our builds. While installing Visual Studio, make sure to [add "Desktop Development with C++"](https://mariadb.com/kb/en/Building_MariaDB_on_Windows/+image/vs2019_workloads). * [CMake](https://cmake.org/download): We recommend the latest release. Older releases might not support your version of Visual Studio. Visual Studio 2019 requires cmake 3.14 at least. * [Git](https://git-scm.com/download): Required to build newer versions from the source tree. + NOTE: run ``` git config --global core.autocrlf input ``` after the installation, otherwise some mtr tests will fail In the "Adjusting your PATH" dialog, choose "Use Git from Windows command prompt", otherwise wrong (mingw64) git and perl will be in your PATH * [Bison from GnuWin32](http://gnuwin32.sourceforge.net/packages/bison.htm): Bison creates parts of the SQL parser. Choose "Complete package except sources" when downloading. + NOTE: **Do not** install this into your default path with spaces (e.g. under `C:\Program Files\GnuWin32`); the build will break due to [this bison bug](http://sourceforge.net/tracker/index.php?func=detail&aid=2788969&group_id=23617&atid=379173). Instead, install into `C:\GnuWin32`. + Add `C:\GnuWin32\bin` to your system `PATH` after installation. * [Strawberry perl](http://strawberryperl.com): Used to run the test suite. [ActiveState Perl](http://www.activestate.com/activeperl/downloads) is another Win32 Perl distribution and should work as well (but it is not as well tested). NOTE: Cygwin or mingw Perl versions **will not work** for testing. Use Windows native Perl, please. * Optional: If you intend to build the MSI packages, install [Windows Installer XML](https://wixtoolset.org/releases/) . If you build MSI with 10.4, also modify your Visual Studio installation, add "Redistributable MSMs" (see [MDEV-22555](https://jira.mariadb.org/browse/MDEV-22555)) * [Gnu Diff](http://gnuwin32.sourceforge.net/packages/diffutils.htm), needed if you run mysql-test-run.pl tests. Verify that bison.exe, bzr.exe or git.exe, cmake.exe and perl.exe can be found in the PATH environment variable with "`where bison`", "`where git`", "`where perl`" etc. from the command line prompt. Building Windows Binaries ------------------------- The above instructions assume [MariaDB 10.2](../what-is-mariadb-102/index) or higher. Branch the MariaDB bzr repository, or unpack the source archive. On the command prompt, switch to your source directory, then execute: ``` mkdir bld cd bld cmake .. cmake --build . --config RelWithDebInfo ``` The above example builds a release configured for 64 bit systems in a subdirectory named `bld`. "`cmake ...`" is the configuration step, "`cmake --build . --config Relwithdebinfo`" is the build step. Build Variations ---------------- ### Debug Builds Building Debug version is done with: ``` cmake --build . --config Debug ``` ### 32bit and 64 bit Builds #### Build 64 bit binary Visual Studio 2019-2022 cmake generator will use host architecture by default, that is, with the steps above, cmake will build x64 binaries on x64 machine. #### Build 32 bit binary pass -A Win32 parameter for CMake, like this ``` cmake .. -A Win32 ``` Historical note: With Visual Studio 2017 and earlier, one had to pass the name of 32bit generator ,e.g cmake .. -G "Visual Studio 15 2017" For a complete list of available generators, call "cmake" without any parameters. ### IDE Builds Instead of calling "`cmake --build`" as above, open `MySQL.sln`. When Visual Studio starts, choose Build/Compile. Building the ZIP Package ------------------------ ``` cmake --build . --config relwithdebinfo --target package ``` This is how it is "done by the book", standard cmake target. MariaDB however uses non-standard target "win\_package" for the packaging for its releases, it generates 2 ZIPs, a slim one with executables, and another one with debuginfo (.PDB files). The debuginfo is important to be able to debug released binaries, and to analyze crashes. ``` cmake --build . --config relwithdebinfo --target win_package ``` Building the MSI Package ------------------------ ``` cmake --build . --config relwithdebinfo cmake --build . --config relwithdebinfo --target MSI ``` Including HeidiSQL in the MSI Installer --------------------------------------- Starting with [MariaDB 5.2.7](https://mariadb.com/kb/en/mariadb-527-release-notes/), it is possible to build an installer which includes 3rd party products, as described in [MWL#200](http://askmonty.org/worklog/Other/?tid=200). Currently only [HeidiSQL](http://www.heidisql.com) support is implemented; it is also included in the official builds. Use the CMake parameter `-DWITH_THIRD_PARTY=HeidiSQL` to include it in the installer. Code Signing Support for MariaDB Release Processing --------------------------------------------------- MariaDB builds optionally support authenticode code signing with an optional parameter `SIGNCODE`. Use `cmake -DSIGNCODE=1` during the configuration step to sign the binaries in the `ZIP` and `MSI` packages. **Important:** for `SIGNCODE=1` to work, the user that runs the build needs to install a valid authenticode digital certificate into their certificate store, otherwise the packaging step will fail. Building Packages for MariaDB Releases -------------------------------------- The full script to create the release in an out-of-source build with Visual Studio with signed binaries might look like: ``` mkdir bld cd bld cmake .. -DSIGNCODE=1 -DWITH_THIRD_PARTY=HeidiSQL cmake --build . --config relwithdebinfo --target win_package cmake --build . --config relwithdebinfo --target MSI ``` This command sequence will produce a ZIP package (e.g mariadb-5.2.6-win32.zip) and MSI package (e.g mariadb-5.2.6-win32.msi) in the `bld` directory. Running Tests ------------- * **Important: Do not use Cygwin** bash, MinGW bash, Git bash, WSL bash, or any other bash when running the test suite. You will then very likely use the wrong version of Perl too (a "Unix-flavoured" one on Windows), and spend a lot of time trying to figure out why this version of Perl does not work for the test suite. Use native perl, in cmd.exe , or powershell instead, * Switch mysql-test subdirectory of the build directory ``` cd C:\server\bld\mysql-test ``` * Run the test suite ``` perl mysql-test-run.pl --suite=main --parallel=auto ``` ### Running a Test Under Debugger Assuming VS is installed on the machine ``` perl mysql-test-run.pl <test_name> --vsjitdebugger ``` If vsjitdebugger does not start, you can edit AeDebug registry key as mentioned in <https://docs.microsoft.com/en-us/visualstudio/debugger/debug-using-the-just-in-time-debugger?view=vs-2019#jit_errors> Alternatively: ``` perl mysql-test-run.pl <test_name> --devenv ``` (devenv.exe needs to be in PATH) or, if you prefer WinDBG ``` perl mysql-test-run.pl <test_name> --windbg ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_ARRAY_APPEND JSON\_ARRAY\_APPEND =================== **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**JSON functions were added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` JSON_ARRAY_APPEND(json_doc, path, value[, path, value] ...) ``` Description ----------- Appends values to the end of the specified arrays within a JSON document, returning the result, or NULL if any of the arguments are NULL. Evaluation is performed from left to right, with the resulting document from the previous pair becoming the new value against which the next pair is evaluated. If the `json_doc` is not a valid JSON document, or if any of the paths are not valid, or contain a `*` or `**` wildcard, an error is returned. Examples -------- ``` SET @json = '[1, 2, [3, 4]]'; SELECT JSON_ARRAY_APPEND(@json, '$[0]', 5) +-------------------------------------+ | JSON_ARRAY_APPEND(@json, '$[0]', 5) | +-------------------------------------+ | [[1, 5], 2, [3, 4]] | +-------------------------------------+ SELECT JSON_ARRAY_APPEND(@json, '$[1]', 6); +-------------------------------------+ | JSON_ARRAY_APPEND(@json, '$[1]', 6) | +-------------------------------------+ | [1, [2, 6], [3, 4]] | +-------------------------------------+ SELECT JSON_ARRAY_APPEND(@json, '$[1]', 6, '$[2]', 7); +------------------------------------------------+ | JSON_ARRAY_APPEND(@json, '$[1]', 6, '$[2]', 7) | +------------------------------------------------+ | [1, [2, 6], [3, 4, 7]] | +------------------------------------------------+ SELECT JSON_ARRAY_APPEND(@json, '$', 5); +----------------------------------+ | JSON_ARRAY_APPEND(@json, '$', 5) | +----------------------------------+ | [1, 2, [3, 4], 5] | +----------------------------------+ SET @json = '{"A": 1, "B": [2], "C": [3, 4]}'; SELECT JSON_ARRAY_APPEND(@json, '$.B', 5); +------------------------------------+ | JSON_ARRAY_APPEND(@json, '$.B', 5) | +------------------------------------+ | {"A": 1, "B": [2, 5], "C": [3, 4]} | +------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Virtual Machines - Ubuntu 12.04 "precise" Buildbot Setup for Virtual Machines - Ubuntu 12.04 "precise" ============================================================ Base install ------------ ``` qemu-img create -f qcow2 /kvm/vms/vm-precise-amd64-serial.qcow2 8G qemu-img create -f qcow2 /kvm/vms/vm-precise-i386-serial.qcow2 8G ``` Start each VM booting from the server install iso one at a time and perform the following install steps: ``` kvm -m 1024 -hda /kvm/vms/vm-precise-amd64-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-12.04-server-amd64.iso -redir tcp:22255::22 -boot d -smp 2 -cpu qemu64 -net nic,model=virtio -net user kvm -m 1024 -hda /kvm/vms/vm-precise-i386-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-12.04-server-i386.iso -redir tcp:22256::22 -boot d -smp 2 -cpu qemu32,-nx -net nic,model=virtio -net user ``` Once running you can connect to the VNC server from your local host with: ``` vncviewer -via ${remote-host} localhost ``` Replace ${remote-host} with the host the vm is running on. **Note:** When you activate the install, vncviewer may disconnect with a complaint about the rect being too large. This is fine. Ubuntu has just resized the vnc screen. Simply reconnect. Install, picking default options mostly, with the following notes: * Set the hostname to ubuntu-precise * When partitioning disks, choose "Guided - use entire disk" (we do not want LVM) * No automatic updates * Choose software to install: OpenSSH server Now that the VM is installed, it's time to configure it. If you have the memory you can do the following simultaneously: ``` kvm -m 1024 -hda /kvm/vms/vm-precise-amd64-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-12.04-server-amd64.iso -redir tcp:22255::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic kvm -m 1024 -hda /kvm/vms/vm-precise-i386-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-12.04-server-i386.iso -redir tcp:22256::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic ssh -p 22255 localhost # edit /boot/grub/menu.lst and visudo, see below ssh -p 22256 localhost # edit /boot/grub/menu.lst and visudo, see below ssh -t -p 22255 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" ssh -t -p 22256 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" scp -P 22255 /kvm/vms/authorized_keys localhost:.ssh/ scp -P 22256 /kvm/vms/authorized_keys localhost:.ssh/ echo $'Buildbot\n\n\n\n\ny' | ssh -p 22255 localhost 'chmod -R go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' echo $'Buildbot\n\n\n\n\ny' | ssh -p 22256 localhost 'chmod -R go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' scp -P 22255 /kvm/vms/ttyS0.conf buildbot@localhost: scp -P 22256 /kvm/vms/ttyS0.conf buildbot@localhost: ssh -p 22255 buildbot@localhost 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ssh -p 22256 buildbot@localhost 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ``` Enabling passwordless sudo: ``` sudo VISUAL=vi visudo # Add line at end: `%sudo ALL=NOPASSWD: ALL' ``` Editing /boot/grub/menu.lst: ``` sudo vi /etc/default/grub # Add/edit these entries: GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL="serial" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" sudo update-grub ``` VMs for building .debs ---------------------- ``` for i in '/kvm/vms/vm-precise-amd64-serial.qcow2 22255 qemu64' '/kvm/vms/vm-precise-i386-serial.qcow2 22256 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/build/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get -y build-dep mysql-server-5.5" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts hardening-wrapper fakeroot doxygen texlive-latex-base ghostscript libevent-dev libssl-dev zlib1g-dev libpam0g-dev libreadline-gplv2-dev autoconf automake automake1.9 defoma dpatch ghostscript-x libfontenc1 libjpeg62 libltdl-dev libltdl7 libmail-sendmail-perl libxfont1 lmodern psfontmgr texlive-latex-base-doc ttf-dejavu ttf-dejavu-extra libaio-dev xfonts-encodings xfonts-utils" ; \ done ``` Also: * [Installing the Boost library needed for the OQGraph storage engine](../installing-the-boost-library-needed-for-the-oqgraph-storage-engine/index) VMs for install testing. ------------------------ See [Buildbot Setup for Virtual Machines - General Principles](../buildbot-setup-for-virtual-machines-general-principles/index) for how to obtain `my.seed` and `sources.append`. ``` for i in '/kvm/vms/vm-precise-amd64-serial.qcow2 22255 qemu64' '/kvm/vms/vm-precise-i386-serial.qcow2 22256 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/install/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils" \ "= scp -P $2 /kvm/vms/my.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "sudo debconf-set-selections /tmp/my.seed" \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'"; \ done ``` VMs for MySQL upgrade testing ----------------------------- ``` for i in '/kvm/vms/vm-precise-amd64-install.qcow2 22255 qemu64' '/kvm/vms/vm-precise-i386-install.qcow2 22256 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/install/upgrade/')" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libaio1 mysql-server-5.5' \ 'mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' ;\ done ``` VMs for MariaDB upgrade testing ------------------------------- *The steps below are based on the Natty steps on [Installing VM images for testing .deb upgrade between versions](../installing-vm-images-for-testing-deb-upgrade-between-versions/index).* 64-bit Ubuntu precise: ``` qemu-img create -b vm-precise-amd64-install.qcow2 -f qcow2 vm-precise-amd64-upgrade2.qcow2 kvm -m 512 -hda vm-precise-amd64-upgrade2.qcow2 -redir 'tcp:22200::22' -boot c -smp 1 -cpu qemu64 -net nic,model=virtio -net user -nographic ssh -p 22200 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost sudo sh -c 'cat > /etc/apt/sources.list.d/tmp.list' deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu oneiric main deb-src http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu oneiric main sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1BB943DB sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated mariadb-server mariadb-test libmariadbclient-dev sudo apt-get -f install mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t" sudo rm /etc/apt/sources.list.d/tmp.list sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libaio1 sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y sudo shutdown -h now ``` 32-bit Ubuntu precise: ``` qemu-img create -b vm-precise-i386-install.qcow2 -f qcow2 vm-precise-i386-upgrade2.qcow2 kvm -m 512 -hda vm-precise-i386-upgrade2.qcow2 -redir 'tcp:22200::22' -boot c -smp 1 -cpu qemu64 -net nic,model=virtio -net user -nographic ssh -p 22200 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no buildbot@localhost sudo sh -c 'cat > /etc/apt/sources.list.d/tmp.list' deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu oneiric main deb-src http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu oneiric main sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1BB943DB sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated mariadb-server mariadb-test libmariadbclient-dev sudo apt-get -f install mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t" sudo rm /etc/apt/sources.list.d/tmp.list sudo apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libaio1 sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y sudo shutdown -h now ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore Performance Tuning ColumnStore Performance Tuning =============================== | Title | Description | | --- | --- | | [MariaDB ColumnStore Performance Concepts](../mariadb-columnstore-performance-concepts/index) | A high level summary of data loading and query execution as it relates to o... | | [Analyzing Queries in ColumnStore](../analyzing-queries-in-columnstore/index) | Utilities and commands to monitor queries and their performance | | [MariaDB ColumnStore Performance Related Configuration Settings](../mariadb-columnstore-performance-related-configuration-settings/index) | Details on configuration parameters that influence ColumnStore performance. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WSREP_SYNC_WAIT_UPTO_GTID WSREP\_SYNC\_WAIT\_UPTO\_GTID ============================= **MariaDB starting with [10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)**WSREP\_SYNC\_WAIT\_UPTO\_GTID was added as part of Galera 4 in [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/). Syntax ------ ``` WSREP_SYNC_WAIT_UPTO_GTID(gtid[,timeout]) ``` Description ----------- Blocks the client until the transaction specified by the given [Global Transaction ID](../gtid/index) is applied and committed by the node. The optional *timeout* argument can be used to specify a block timeout in seconds. If not provided, the timeout will be indefinite. Returns the node that applied and committed the Global Transaction ID, `ER_LOCAL_WAIT_TIMEOUT` if the function is timed out before this, or `ER_WRONG_ARGUMENTS` if the function is given an invalid GTID. The result from [WSREP\_LAST\_SEEN\_GTID](../wsrep_last_seen_gtid/index) can be useful to determine the transaction to provide to WSREP\_SYNC\_WAIT\_UPTO\_GTID for waiting and unblocking purposes. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Diagnostics Diagnostics ============ The diagnostics area contains information about the error conditions which were produced by an SQL statement, as well as some information about the statement which generated them. | Title | Description | | --- | --- | | [Error Codes](../error-codes/index) | MariaDB error codes and SQLSTATE codes | | [DECLARE CONDITION](../declare-condition/index) | For declaring a named error condition (SQLSTATE or error code). | | [DECLARE HANDLER](../declare-handler/index) | Construct to declare how errors are handled. | | [Diagnostics Area](../diagnostics-area/index) | A description of the diagnostics area and how it is populated. | | [GET DIAGNOSTICS](../get-diagnostics/index) | Copy information about the diagnostics area into variables. | | [RESIGNAL](../resignal/index) | Used to send a SIGNAL again for the previous error. | | [SHOW ERRORS](../show-errors/index) | Displays errors. | | [SHOW WARNINGS](../show-warnings/index) | Displays errors, warnings and notes. | | [SIGNAL](../signal/index) | May be used to produce a custom error message. | | [SQL Error Log Plugin](../sql-error-log-plugin/index) | Records SQL-level errors to a log file. | | [SQLSTATE](../sqlstate/index) | A string which identifies a condition's class and subclass | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Basic Optimizer Trace Example Basic Optimizer Trace Example ============================= ``` MariaDB> select * from information_schema.optimizer_trace limit 1\G *************************** 1. row *************************** QUERY: select * from t1 where a<10 TRACE: { "steps": [ { "join_preparation": { "select_id": 1, "steps": [ { "expanded_query": "select t1.a AS a,t1.b AS b,t1.c AS c from t1 where t1.a < 10" } ] } }, { "join_optimization": { "select_id": 1, "steps": [ { "condition_processing": { "condition": "WHERE", "original_condition": "t1.a < 10", "steps": [ { "transformation": "equality_propagation", "resulting_condition": "t1.a < 10" }, { "transformation": "constant_propagation", "resulting_condition": "t1.a < 10" }, { "transformation": "trivial_condition_removal", "resulting_condition": "t1.a < 10" } ] } }, { "table_dependencies": [ { "table": "t1", "row_may_be_null": false, "map_bit": 0, "depends_on_map_bits": [] } ] }, { "ref_optimizer_key_uses": [] }, { "rows_estimation": [ { "table": "t1", "range_analysis": { "table_scan": { "rows": 1000, "cost": 206.1 }, "potential_range_indexes": [ { "index": "a", "usable": true, "key_parts": ["a"] }, { "index": "b", "usable": false, "cause": "not applicable" } ], "setup_range_conditions": [], "group_index_range": { "chosen": false, "cause": "no group by or distinct" }, "analyzing_range_alternatives": { "range_scan_alternatives": [ { "index": "a", "ranges": ["(NULL) < (a) < (10)"], "rowid_ordered": false, "using_mrr": false, "index_only": false, "rows": 10, "cost": 13.751, "chosen": true } ], "analyzing_roworder_intersect": { "cause": "too few roworder scans" }, "analyzing_index_merge_union": [] }, "chosen_range_access_summary": { "range_access_plan": { "type": "range_scan", "index": "a", "rows": 10, "ranges": ["(NULL) < (a) < (10)"] }, "rows_for_plan": 10, "cost_for_plan": 13.751, "chosen": true } } }, { "selectivity_for_indexes": [ { "index_name": "a", "selectivity_from_index": 0.01 } ], "selectivity_for_columns": [], "cond_selectivity": 0.01 } ] }, { "considered_execution_plans": [ { "plan_prefix": [], "table": "t1", "best_access_path": { "considered_access_paths": [ { "access_type": "range", "resulting_rows": 10, "cost": 13.751, "chosen": true } ] } } ] }, { "attaching_conditions_to_tables": { "original_condition": "t1.a < 10", "attached_conditions_computation": [], "attached_conditions_summary": [ { "table": "t1", "attached": "t1.a < 10" } ] } } ] } }, { "join_execution": { "select_id": 1, "steps": [] } } ] } MISSING_BYTES_BEYOND_MAX_MEM_SIZE: 0 INSUFFICIENT_PRIVILEGES: 0 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CROSSES CROSSES ======= Syntax ------ ``` Crosses(g1,g2) ``` Description ----------- Returns `1` if `g1` spatially crosses `g2`. Returns `NULL` if `g1` is a [Polygon](../polygon/index) or a [MultiPolygon](../multipolygon/index), or if `g2` is a [Point](../point/index) or a [MultiPoint](../multipoint/index). Otherwise, returns `0`. The term spatially crosses denotes a spatial relation between two given geometries that has the following properties: * The two geometries intersect * Their intersection results in a geometry that has a dimension that is one less than the maximum dimension of the two given geometries * Their intersection is not equal to either of the two given geometries CROSSES() is based on the original MySQL implementation, and uses object bounding rectangles, while [ST\_CROSSES()](../st_crosses/index) uses object shapes. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-hotcopy mariadb-hotcopy =============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-hotcopy` is a symlink to `mysqlhotcopy`, the deprecated backup script. See [mysqlhotcopy](../mysqlhotcopy/index) for details. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-hotcopy` is the name of the script, with `mysqlhotcopy` a symlink . Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema prepared_statements_instances Table Performance Schema prepared\_statements\_instances Table ======================================================== **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The prepared\_statements\_instances table was introduced in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The `prepared_statements_instances` table contains aggregated statistics of prepared statements. The maximum number of rows in the table is determined by the [performance\_schema\_max\_prepared\_statement\_instances](../performance-schema-system-variables/index#performance_schema_max_prepared_statement_instances) system variable, which is by default autosized on startup. The table contains the following columns: ``` +-----------------------------+--------------------------------------------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------------------+--------------------------------------------------------+------+-----+---------+-------+ | OBJECT_INSTANCE_BEGIN | bigint(20) unsigned | NO | | NULL | | | STATEMENT_ID | bigint(20) unsigned | NO | | NULL | | | STATEMENT_NAME | varchar(64) | YES | | NULL | | | SQL_TEXT | longtext | NO | | NULL | | | OWNER_THREAD_ID | bigint(20) unsigned | NO | | NULL | | | OWNER_EVENT_ID | bigint(20) unsigned | NO | | NULL | | | OWNER_OBJECT_TYPE | enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') | YES | | NULL | | | OWNER_OBJECT_SCHEMA | varchar(64) | YES | | NULL | | | OWNER_OBJECT_NAME | varchar(64) | YES | | NULL | | | TIMER_PREPARE | bigint(20) unsigned | NO | | NULL | | | COUNT_REPREPARE | bigint(20) unsigned | NO | | NULL | | | COUNT_EXECUTE | bigint(20) unsigned | NO | | NULL | | | SUM_TIMER_EXECUTE | bigint(20) unsigned | NO | | NULL | | | MIN_TIMER_EXECUTE | bigint(20) unsigned | NO | | NULL | | | AVG_TIMER_EXECUTE | bigint(20) unsigned | NO | | NULL | | | MAX_TIMER_EXECUTE | bigint(20) unsigned | NO | | NULL | | | SUM_LOCK_TIME | bigint(20) unsigned | NO | | NULL | | | SUM_ERRORS | bigint(20) unsigned | NO | | NULL | | | SUM_WARNINGS | bigint(20) unsigned | NO | | NULL | | | SUM_ROWS_AFFECTED | bigint(20) unsigned | NO | | NULL | | | SUM_ROWS_SENT | bigint(20) unsigned | NO | | NULL | | | SUM_ROWS_EXAMINED | bigint(20) unsigned | NO | | NULL | | | SUM_CREATED_TMP_DISK_TABLES | bigint(20) unsigned | NO | | NULL | | | SUM_CREATED_TMP_TABLES | bigint(20) unsigned | NO | | NULL | | | SUM_SELECT_FULL_JOIN | bigint(20) unsigned | NO | | NULL | | | SUM_SELECT_FULL_RANGE_JOIN | bigint(20) unsigned | NO | | NULL | | | SUM_SELECT_RANGE | bigint(20) unsigned | NO | | NULL | | | SUM_SELECT_RANGE_CHECK | bigint(20) unsigned | NO | | NULL | | | SUM_SELECT_SCAN | bigint(20) unsigned | NO | | NULL | | | SUM_SORT_MERGE_PASSES | bigint(20) unsigned | NO | | NULL | | | SUM_SORT_RANGE | bigint(20) unsigned | NO | | NULL | | | SUM_SORT_ROWS | bigint(20) unsigned | NO | | NULL | | | SUM_SORT_SCAN | bigint(20) unsigned | NO | | NULL | | | SUM_NO_INDEX_USED | bigint(20) unsigned | NO | | NULL | | | SUM_NO_GOOD_INDEX_USED | bigint(20) unsigned | NO | | NULL | | +-----------------------------+--------------------------------------------------------+------+-----+---------+-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Derived Table with Key Optimization Derived Table with Key Optimization =================================== The idea -------- If a derived table cannot be merged into its parent SELECT, it will be materialized in a temporary table, and then parent select will treat it as a regular base table. Before [MariaDB 5.3](../what-is-mariadb-53/index)/MySQL 5.6, the temporary table would never have any indexes, and the only way to read records from it would be a full table scan. Starting from the mentioned versions of the server, the optimizer has an option to create an index and use it for joins with other tables. Example ------- Consider a query: we want to find countries in Europe, that have more than one million people living in cities. This is accomplished with this query: ``` select * from Country, (select sum(City.Population) as urban_population, City.Country from City group by City.Country having urban_population > 1*1000*1000 ) as cities_in_country where Country.Code=cities_in_country.Country and Country.Continent='Europe'; ``` The EXPLAIN output for it will show: ``` +----+-------------+------------+------+-------------------+-----------+---------+--------------------+------+---------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+------+-------------------+-----------+---------+--------------------+------+---------------------------------+ | 1 | PRIMARY | Country | ref | PRIMARY,continent | continent | 17 | const | 60 | Using index condition | | 1 | PRIMARY | <derived2> | ref | key0 | key0 | 3 | world.Country.Code | 17 | | | 2 | DERIVED | City | ALL | NULL | NULL | NULL | NULL | 4079 | Using temporary; Using filesort | +----+-------------+------------+------+-------------------+-----------+---------+--------------------+------+---------------------------------+ ``` One can see here that * table `<derived2>` is accessed through `key0`. * `ref` column shows `world.Country.Code` * if we look that up in the original query, we find the equality that was used to construct `ref` access: `Country.Code=cities_in_country.Country`. Factsheet --------- * The idea of "derived table with key" optimization is to let the materialized derived table have one key which is used for joins with other tables. * The optimization is applied then the derived table could not be merged into its parent SELECT + which happens when the derived table doesn't meet criteria for mergeable VIEW * The optimization is ON by default, it can be switched off like so: ``` set optimizer_switch='derived_with_keys=off' ``` See Also -------- * [Optimizing Subqueries in the FROM Clause](http://dev.mysql.com/doc/refman/5.6/en/from-clause-subquery-optimization.html) in MySQL 5.6 manual * [What is MariaDB 5.3](../what-is-mariadb-53/index) * [Subquery Optimizations Map](../subquery-optimizations-map/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb CONNECT XML Table Type CONNECT XML Table Type ====================== Overview -------- CONNECT supports tables represented by XML files. For these tables, the standard input/output functions of the operating system are not used but the parsing and processing of the file is delegated to a specialized library. Currently two such systems are supported: libxml2, a part of the GNOME framework, but which does not require GNOME and, on Windows, MS-DOM (DOMDOC), the Microsoft standard support of XML documents. DOMDOC is the default for the Windows version of CONNECT and libxml2 is always used on other systems. On Windows the choice can be specified using the XMLSUP [CREATE TABLE](../create-table/index) list option, for instance specifying `option_list='xmlsup=libxml2'`. Creating XML tables ------------------- First of all, it must be understood that XML is a very general language used to encode data having any structure. In particular, the tag hierarchy in an XML file describes a tree structure of the data. For instance, consider the file: ``` <?xml version="1.0" encoding="ISO-8859-1"?> <BIBLIO SUBJECT="XML"> <BOOK ISBN="9782212090819" LANG="fr" SUBJECT="applications"> <AUTHOR> <FIRSTNAME>Jean-Christophe</FIRSTNAME> <LASTNAME>Bernadac</LASTNAME> </AUTHOR> <AUTHOR> <FIRSTNAME>François</FIRSTNAME> <LASTNAME>Knab</LASTNAME> </AUTHOR> <TITLE>Construire une application XML</TITLE> <PUBLISHER> <NAME>Eyrolles</NAME> <PLACE>Paris</PLACE> </PUBLISHER> <DATEPUB>1999</DATEPUB> </BOOK> <BOOK ISBN="9782840825685" LANG="fr" SUBJECT="applications"> <AUTHOR> <FIRSTNAME>William J.</FIRSTNAME> <LASTNAME>Pardi</LASTNAME> </AUTHOR> <TRANSLATOR PREFIX="adapté de l'anglais par"> <FIRSTNAME>James</FIRSTNAME> <LASTNAME>Guerin</LASTNAME> </TRANSLATOR> <TITLE>XML en Action</TITLE> <PUBLISHER> <NAME>Microsoft Press</NAME> <PLACE>Paris</PLACE> </PUBLISHER> <DATEPUB>1999</DATEPUB> </BOOK> </BIBLIO> ``` It represents data having the structure: ``` <BIBLIO> __________|_________ | | <BOOK:ISBN,LANG,SUBJECT> | ______________|_______________ | | | | | | <AUTHOR> <TITLE> <PUBLISHER> <DATEPUB> | ____|____ ___|____ | | | | | | | <FIRST> | <LAST> <NAME> <PLACE> | | | <AUTHOR> <BOOK:ISBN,LANG,SUBJECT> ____|____ ______________________|__________________ | | | | | | | <FIRST> <LAST> <AUTHOR> <TRANSLATOR> <TITLE> <PUBLISHER> <DATEPUB> _____|_ ___|___ ___|____ | | | | | | <FIRST> <LAST> <FIRST> <LAST> <NAME> <PLACE> ``` This structure seems at first view far from being tabular. However, modern database management systems, including MariaDB, implement something close to the relational model and work on tables that are structurally not hierarchical but tabular with rows and columns. Nevertheless, CONNECT can do it. Of course, it cannot guess what you want to extract from the XML structure, but gives you the possibility to specify it when you create the table[[1](#_note-0)]. Let us take a first example. Suppose you want to make a table from the above document, displaying the node contents. For this, you can define a table *xsamptag* as: ``` create table xsamptag ( AUTHOR char(50), TITLE char(32), TRANSLATOR char(40), PUBLISHER char(40), DATEPUB int(4)) engine=CONNECT table_type=XML file_name='Xsample.xml'; ``` It will be displayed as: | AUTHOR | TITLE | TRANSLATOR | PUBLISHER | DATEPUB | | --- | --- | --- | --- | --- | | Jean-Christophe Bernadac | Construire une application XML | <null> | Eyrolles Paris | 1999 | | William J. Pardi | XML en Action | James Guerin | Microsoft Press Paris | 1999 | Let us try to understand what happened. By default the column names correspond to tag names. Because this file is rather simple, CONNECT was able to default the top tag of the table as the root node `<BIBLIO>` of the file, and the row tags as the `<BOOK>` children of the table tag. In a more complex file, this should have been specified, as we will see later. Note that we didn't have to worry about the sub-tags such as `<FIRSTNAME>` or `<LASTNAME>` because CONNECT automatically retrieves the entire text contained in a tag and its sub-tags[[2](#_note-1)]. Only the first author of the first book appears. This is because only the first occurrence of a column tag has been retrieved so the result has a proper tabular structure. We will see later what we can do about that. How can we retrieve the values specified by attributes? By using a *Coltype* table option to specify the default column type. The value ‘@’ means that column names match attribute names. Therefore, we can retrieve them by creating a table such as: ``` create table xsampattr ( ISBN char(15), LANG char(2), SUBJECT char(32)) engine=CONNECT table_type=XML file_name='Xsample.xml' option_list='Coltype=@'; ``` This table returns the following: | ISBN | LANG | SUBJECT | | --- | --- | --- | | 9782212090819 | fr | applications | | 9782840825685 | fr | applications | Now to define a table that will give us all the previous information, we must specify the column type for each column. Because in the next statement the column type defaults to Node, the *field\_format* column parameter was used to indicate which columns are attributes: From Connect 1.7.0002 ``` create table xsamp ( ISBN char(15) xpath='@', LANG char(2) xpath='@', SUBJECT char(32) xpath='@', AUTHOR char(50), TITLE char(32), TRANSLATOR char(40), PUBLISHER char(40), DATEPUB int(4)) engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK'; ``` Before Connect 1.7.0002 ``` create table xsamp ( ISBN char(15) field_format='@', LANG char(2) field_format='@', SUBJECT char(32) field_format='@', AUTHOR char(50), TITLE char(32), TRANSLATOR char(40), PUBLISHER char(40), DATEPUB int(4)) engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK'; ``` Once done, we can enter the query: ``` select subject, lang, title, author from xsamp; ``` This will return the following result: | SUBJECT | LANG | TITLE | AUTHOR | | --- | --- | --- | --- | | applications | fr | Construire une application XML | Jean-Christophe Bernadac | | applications | fr | XML en Action | William J. Pardi | Note that we have been lucky. Because unlike SQL, XML is case sensitive and the column names have matched the node names only because the column names were given in upper case. Note also that the order of the columns in the table could have been different from the order in which the nodes appear in the XML file. Using Xpaths with XML tables ---------------------------- Xpath is used by XML to locate and retrieve nodes. The table's main node Xpath is specified by the `tabname` option. If just the node name is given, CONNECT constructs an Xpath such as `‘*BIBLIO’*` in the example above that should retrieve the `BIBLIO` node wherever it is within the XML file. The row nodes are by default the children of the table node. However, for instance to eliminate some children nodes that are not real row nodes, the row node name can be specified using the `rownode` sub-option of the `option_list` option. The field\_format options we used above can be specified to locate more precisely where and what information to retrieve using an Xpath-like syntax. For instance: From Connect 1.7.0002 ``` create table xsampall ( isbn char(15) xpath='@ISBN', language char(2) xpath='@LANG', subject char(32) xpath='@SUBJECT', authorfn char(20) xpath='AUTHOR/FIRSTNAME', authorln char(20) xpath='AUTHOR/LASTNAME', title char(32) xpath='TITLE', translated char(32) xpath='TRANSLATOR/@PREFIX', tranfn char(20) xpath='TRANSLATOR/FIRSTNAME', tranln char(20) xpath='TRANSLATOR/LASTNAME', publisher char(20) xpath='PUBLISHER/NAME', location char(20) xpath='PUBLISHER/PLACE', year int(4) xpath='DATEPUB') engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK'; ``` Before Connect 1.7.0002 ``` create table xsampall ( isbn char(15) field_format='@ISBN', language char(2) field_format='@LANG', subject char(32) field_format='@SUBJECT', authorfn char(20) field_format='AUTHOR/FIRSTNAME', authorln char(20) field_format='AUTHOR/LASTNAME', title char(32) field_format='TITLE', translated char(32) field_format='TRANSLATOR/@PREFIX', tranfn char(20) field_format='TRANSLATOR/FIRSTNAME', tranln char(20) field_format='TRANSLATOR/LASTNAME', publisher char(20) field_format='PUBLISHER/NAME', location char(20) field_format='PUBLISHER/PLACE', year int(4) field_format='DATEPUB') engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK'; ``` This very flexible column parameter serves several purposes: * To specify the tag name, or the attribute name if different from the column name. * To specify the type (tag or attribute) by a prefix of '@' for attributes. * To specify the path for sub-tags using the '/' character. This path is always relative to the current context (the column top node) and cannot be specified as an absolute path from the document root, therefore a leading '/' cannot be used. The path cannot be variable in node names or depth, therefore using '`//`' is not allowed. The query: ``` select isbn, title, translated, tranfn, tranln, location from xsampall where translated is not null; ``` replies: | ISBN | TITLE | TRANSLATED | TRANFN | TRANLN | LOCATION | | --- | --- | --- | --- | --- | --- | | 9782840825685 | XML en Action | adapté de l'anglais par | James | Guerin | Paris | ### Libxml2 default name space issue An issue with libxml2 is that some files can declare a default name space in their root node. Because Xpath only searches in that name space, the nodes will not be found if they are not prefixed. If this happens, specify the tabname option as an Xpath ignoring the current name space: ``` TABNAME="//*[local-name()='BIBLIO']" ``` This must also be done for the default of specified Xpath of the not attribute columns. For instance: ``` title char(32) field_format="*[local-name()='TITLE']", ``` Note: This raises an error (and is useless anyway) with DOMDOC. ### Direct access on XML tables Direct access is available on XML tables. This means that XML tables can be sorted and used in joins, even in the one-side of the join. However, building a permanent index is not yet implemented. It is unclear whether this can be useful. Indeed, the DOM implementation that is used to access these tables firstly parses the whole file and constructs a node tree in memory. This may often be the longest part of the process, so the use of an index would not be of great value. Note also that this limits the XML files to a reasonable size. Anyway, when speed is important, this table type is not the best to use. Therefore, in these cases, it is probably better to convert the file to another type by inserting the XML table into another table of a more appropriate type for performance. ### Accessing tags with namespaces With the Windows DOMDOC support, this can be done using the prefix in the tabname column option and/or xpath column option. For instance, given the file gns.xml: ``` <?xml version="1.0" encoding="UTF-8"?> <gpx xmlns:gns="http:dummy"> <gns:trkseg> <trkpt lon="-121.9822235107421875" lat="37.3884925842285156"> <gns:ele>6.610851287841797</gns:ele> <time>2014-04-01T14:54:05.000Z</time> </trkpt> <trkpt lon="-121.9821929931640625" lat="37.3885803222656250"> <ele>6.787827968597412</ele> <time>2014-04-01T14:54:08.000Z</time> </trkpt> <trkpt lon="-121.9821624755859375" lat="37.3886299133300781"> <ele>6.771987438201904</ele> <time>2014-04-01T14:54:10.000Z</time> </trkpt> </gns:trkseg> </gpx> ``` and the defined CONNECT table: ``` CREATE TABLE xgns ( `lon` double(21,16) NOT NULL `xpath`='@', `lat` double(20,16) NOT NULL `xpath`='@', `ele` double(21,16) NOT NULL `xpath`='gns:ele', `time` datetime date_format="YYYY-MM-DD 'T' hh:mm:ss '.000Z'" ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=XML `file_name`='gns.xml' tabname='gns:trkseg' option_list='xmlsup=domdoc'; ``` ``` select * from xgns; ``` Displays: | lon | lat | ele | time | | --- | --- | --- | --- | | -121,982223510742 | 37,3884925842285 | 6,6108512878418 | 01/04/2014 14:54:05 | | -121,982192993164 | 37,3885803222656 | 0 | 01/04/2014 14:54:08 | | -121,982162475586 | 37,3886299133301 | 0 | 01/04/2014 14:54:10 | Only the prefixed ‘ele’ tag is recognized. However, this does not work with the libxml2 support. The solution is then to use a function ignoring the name space: ``` CREATE TABLE xgns2 ( `lon` double(21,16) NOT NULL `xpath`='@', `lat` double(20,16) NOT NULL `xpath`='@', `ele` double(21,16) NOT NULL `xpath`="*[local-name()='ele']", `time` datetime date_format="YYYY-MM-DD 'T' hh:mm:ss '.000Z'" ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=XML `file_name`='gns.xml' tabname="*[local-name()='trkseg']" option_list='xmlsup=libxml2'; ``` Then : ``` select * from xgns2; ``` Displays: | lon | lat | ele | time | | --- | --- | --- | --- | | -121,982223510742 | 37,3884925842285 | 6,6108512878418 | 01/04/2014 14:54:05 | | -121,982192993164 | 37,3885803222656 | 6.7878279685974 | 01/04/2014 14:54:08 | | -121,982162475586 | 37,3886299133301 | 6.7719874382019 | 01/04/2014 14:54:10 | This time, all ‘ele` tags are recognized. This solution does not work with DOMDOC. Having Columns defined by Discovery ----------------------------------- It is possible to let the MariaDB discovery process do the job of column specification. When columns are not defined in the [CREATE TABLE](../create-table/index) statement, CONNECT endeavours to analyze the XML file and to provide the column specifications. This is possible only for true XML tables, but not for HTML tables. For instance, the *xsamp* table could have been created specifying: ``` create table xsamp engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK'; ``` Let’s check how it was actually specified using the SHOW CREATE TABLE statement: ``` CREATE TABLE `xsamp` ( `ISBN` char(13) NOT NULL `FIELD_FORMAT`='@', `LANG` char(2) NOT NULL `FIELD_FORMAT`='@', `SUBJECT` char(12) NOT NULL `FIELD_FORMAT`='@', `AUTHOR` char(24) NOT NULL, `TRANSLATOR` char(12) DEFAULT NULL, `TITLE` char(30) NOT NULL, `PUBLISHER` char(21) NOT NULL, `DATEPUB` char(4) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='XML' `FILE_NAME`='E:/Data/Xml/Xsample.xml' `TABNAME`='BIBLIO' `OPTION_LIST`='rownode=BOOK'; ``` It is equivalent except for the column sizes that have been calculated from the file as the maximum length of the corresponding column when it was a normal value. Also, all columns are specified as type [CHAR](../char/index) because XML does not provide information about the node content data type. Nullable is set to true if the column is missing in some rows. If a more complex definition is desired, you can ask CONNECT to analyse the XPATH up to a given level using the level option in the option list. The level value is the number of nodes that are taken in the XPATH. For instance: ``` create table xsampall engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK,Level=1'; ``` This will define the table as: From Connect 1.7.0002 ``` CREATE TABLE `xsampall` ( `ISBN` char(13) NOT NULL `XPATH`='@', `LANG` char(2) NOT NULL `XPATH`='@', `SUBJECT` char(12) NOT NULL `XPATH`='@', `AUTHOR_FIRSTNAME` char(15) NOT NULL `XPATH`='AUTHOR/FIRSTNAME', `AUTHOR_LASTNAME` char(8) NOT NULL `XPATH`='AUTHOR/LASTNAME', `TRANSLATOR_PREFIX` char(24) DEFAULT NULL `XPATH`='TRANSLATOR/@PREFIX', `TRANSLATOR_FIRSTNAME` char(7) DEFAULT NULL `XPATH`='TRANSLATOR/FIRSTNAME', `TRANSLATOR_LASTNAME` char(6) DEFAULT NULL `XPATH`='TRANSLATOR/LASTNAME', `TITLE` char(30) NOT NULL, `PUBLISHER_NAME` char(15) NOT NULL `XPATH`='PUBLISHER/NAME', `PUBLISHER_PLACE` char(5) NOT NULL `XPATH`='PUBLISHER/PLACE', `DATEPUB` char(4) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='XML' `FILE_NAME`='Xsample.xml' `TABNAME`='BIBLIO' `OPTION_LIST`='rownode=BOOK,Depth=1'; <</sql>> Before Connect 1.7.0002 <<sql>> CREATE TABLE `xsampall` ( `ISBN` char(13) NOT NULL `FIELD_FORMAT`='@', `LANG` char(2) NOT NULL `FIELD_FORMAT`='@', `SUBJECT` char(12) NOT NULL `FIELD_FORMAT`='@', `AUTHOR_FIRSTNAME` char(15) NOT NULL `FIELD_FORMAT`='AUTHOR/FIRSTNAME', `AUTHOR_LASTNAME` char(8) NOT NULL `FIELD_FORMAT`='AUTHOR/LASTNAME', `TRANSLATOR_PREFIX` char(24) DEFAULT NULL `FIELD_FORMAT`='TRANSLATOR/@PREFIX', `TRANSLATOR_FIRSTNAME` char(7) DEFAULT NULL `FIELD_FORMAT`='TRANSLATOR/FIRSTNAME', `TRANSLATOR_LASTNAME` char(6) DEFAULT NULL `FIELD_FORMAT`='TRANSLATOR/LASTNAME', `TITLE` char(30) NOT NULL, `PUBLISHER_NAME` char(15) NOT NULL `FIELD_FORMAT`='PUBLISHER/NAME', `PUBLISHER_PLACE` char(5) NOT NULL `FIELD_FORMAT`='PUBLISHER/PLACE', `DATEPUB` char(4) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='XML' `FILE_NAME`='Xsample.xml' `TABNAME`='BIBLIO' `OPTION_LIST`='rownode=BOOK,Level=1'; <</sql>> This method can be used as a quick way to make a “template” table definition that can later be edited to make the desired definition. In particular, column names are constructed from all the nodes of their path in order to have distinct column names. This can be manually edited to have the desired names, provided their XPATH is not modified. To have a preview of how columns will be defined, you can use a catalog table like this: <<sql>> create table xsacol engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK,Level=1' catfunc=col; <</sql>> And when asking: <<sql>> select column_name Name, type_name Type, column_size Size, nullable, xpath from xsacol; <</sql>> You get the description of what the table columns will be: <<style class="darkheader-nospace-borders">> |= Name |= Type |= Size |= nullable |= xpath | | ISBN | CHAR | 13 | 0 | @ | | LANG | CHAR | 2 | 0 | @ | | SUBJECT | CHAR | 12 | 0 | @ | | AUTHOR_FIRSTNAME | CHAR | 15 | 0 | AUTHOR/FIRSTNAME | | AUTHOR_LASTNAME | CHAR | 8 | 0 | AUTHOR/LASTNAME | | TRANSLATOR_PREFIX | CHAR | 24 | 1 | TRANSLATOR/@PREFIX | | TRANSLATOR_FIRSTNAME | CHAR | 7 | 1 | TRANSLATOR/FIRSTNAME | | TRANSLATOR_LASTNAME | CHAR | 6 | 1 | TRANSLATOR/LASTNAME | | TITLE | CHAR | 30 | 0 | | | PUBLISHER_NAME | CHAR | 15 | 0 | PUBLISHER/NAME | | PUBLISHER_PLACE | CHAR | 5 | 0 | PUBLISHER/PLACE | | DATEPUB | CHAR | 4 | 0 | | <</style>> == Write operations on XML tables You can freely use the Update, Delete and Insert commands with XML tables. However, you must understand that the format of the updated or inserted data follows the specifications of the table you created, not the ones of the original source file. For instance, let us suppose we insert a new book using the //xsamp// table (not the //xsampall// table) with the command: <<code lang=mysql inline=false>> insert into xsamp (isbn, lang, subject, author, title, publisher,datepub) values ('9782212090529','fr','général','Alain Michard', 'XML, Langage et Applications','Eyrolles Paris',1998); ``` Then if we ask: ``` select subject, author, title, translator, publisher from xsamp; ``` Everything seems correct when we get the result: | SUBJECT | AUTHOR | TITLE | TRANSLATOR | PUBLISHER | | --- | --- | --- | --- | --- | | applications | Jean-Christophe Bernadac | Construire une application XML | | Eyrolles Paris | | applications | William J. Pardi | XML en Action | James Guerin | Microsoft Press Paris | | général | Alain Michard | XML, Langage et Applications | | Eyrolles Paris | However if we enter the apparently equivalent query on the *xsampall* table, based on the same file: ``` select subject, concat(authorfn, ' ', authorln) author , title, concat(tranfn, ' ', tranln) translator, concat(publisher, ' ', location) publisher from xsampall; ``` this returns an apparently wrong answer: | SUBJECT | AUTHOR | TITLE | TRANSLATOR | PUBLISHER | | --- | --- | --- | --- | --- | | applications | Jean-Christophe Bernadac | Construire une application XML | | Eyrolles Paris | | applications | William J. Pardi | XML en Action | James Guerin | Microsoft Press Paris | | général | | XML, Langage et Applications | | | What happened here? Simply, because we used the *xsamp* table to do the Insert, what has been inserted within the XML file had the structure described for *xsamp*: ``` <BOOK ISBN="9782212090529" LANG="fr" SUBJECT="général"> <AUTHOR>Alain Michard</AUTHOR> <TITLE>XML, Langage et Applications</TITLE> <TRANSLATOR></TRANSLATOR> <PUBLISHER>Eyrolles Paris</PUBLISHER> <DATEPUB>1998</DATEPUB> </BOOK> ``` CONNECT cannot "invent" sub-tags that are not part of the *xsamp* table. Because these sub-tags do not exist, the *xsampall* table cannot retrieve the information that should be attached to them. If we want to be able to query the XML file by all the defined tables, the correct way to insert a new book to the file is to use the *xsampall* table, the only one that addresses all the components of the original document: ``` delete from xsamp where isbn = '9782212090529'; insert into xsampall (isbn, language, subject, authorfn, authorln, title, publisher, location, year) values('9782212090529','fr','général','Alain','Michard', 'XML, Langage et Applications','Eyrolles','Paris',1998); ``` Now the added book, in the XML file, will have the required structure: ``` <BOOK ISBN="9782212090529" LANG="fr" SUBJECT="général"> <AUTHOR> <FIRSTNAME>Alain</FIRSTNAME> <LASTNAME>Michard</LASTNAME> </AUTHOR> <TITLE>XML, Langage et Applications</TITLE> <PUBLISHER> <NAME>Eyrolles</NAME> <PLACE>Paris</PLACE> </PUBLISHER> <DATEPUB>1998</DATEPUB> </BOOK> ``` **Note:** We used a column list in the Insert statements when creating the table to avoid generating a `<TRANSLATOR>` node with sub-nodes, all containing null values (this works on Windows only). Multiple nodes in the XML document ---------------------------------- Let us come back to the above example XML file. We have seen that the author node can be "multiple" meaning that there can be more than one author of a book. What can we do to get the complete information fitting the relational model? CONNECT provides you with two possibilities, but is restricted to only one such multiple node per table. The first and most challenging one is to return as many rows than there are authors, the other columns being repeated as if we had make a join between the author column and the rest of the table. To achieve this, simply specify the “multiple” node name and the “expand” option when creating the table. For instance, we can create the *xsamp2* table like this: ``` create table xsamp2 ( ISBN char(15) field_format='@', LANG char(2) field_format='@', SUBJECT char(32) field_format='@', AUTHOR char(40), TITLE char(32), TRANSLATOR char(32), PUBLISHER char(32), DATEPUB int(4)) engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK,Expand=1,Mulnode=AUTHOR,Limit=2'; ``` In this statement, the Limit option specifies the maximum number of values that will be expanded. If not specified, it defaults to `10`. Any values above the limit will be ignored and a warning message issued[[3](#_note-2)]. Now you can enter a query such as: ``` select isbn, subject, author, title from xsamp2; ``` This will retrieve and display the following result: | ISBN | SUBJECT | AUTHOR | TITLE | | --- | --- | --- | --- | | 9782212090819 | applications | Jean-Christophe Bernadac | Construire une application XML | | 9782212090819 | applications | François Knab | Construire une application XML | | 9782840825685 | applications | William J. Pardi | XML en Action | | 9782212090529 | général | Alain Michard | XML, Langage et Applications | In this case, this is as if the table had four rows. However if we enter the query: ``` select isbn, subject, title, publisher from xsamp2; ``` this time the result will be: | ISBN | SUBJECT | TITLE | PUBLISHER | | --- | --- | --- | --- | | 9782212090819 | applications | Construire une application XML | Eyrolles Paris | | 9782840825685 | applications | XML en Action | Microsoft Press Paris | | 9782212090529 | général | XML, Langage et Applications | Eyrolles Paris | Because the author column does not appear in the query, the corresponding row was not expanded. This is somewhat strange because this would have been different if we had been working on a table of a different type. However, it is closer to the relational model for which there should not be two identical rows (tuples) in a table. Nevertheless, you should be aware of this somewhat erratic behavior. For instance: ``` select count(*) from xsamp2; /* Replies 3 */ select count(author) from xsamp2; /* Replies 4 */ select count(isbn) from xsamp2; /* Replies 3 */ select isbn, subject, title, publisher from xsamp2 where author <> ''; ``` This last query replies: | ISBN | SUBJECT | TITLE | PUBLISHER | | --- | --- | --- | --- | | 9782212090819 | applications | Construire une application XML | Eyrolles Paris | | 9782212090819 | applications | Construire une application XML | Eyrolles Paris | | 9782840825685 | applications | XML en Action | Microsoft Press Paris | | 9782212090529 | général | XML, Langage et Applications | Eyrolles Paris | Even though the author column does not appear in the result, the corresponding row was expanded because the multiple column was used in the where clause. Intermediate multiple node -------------------------- The "multiple" node can be an intermediate node. If we want to do the same expanding with the *xsampall* table, there will be nothing more to do. The *xsampall2* table can be created with: From Connect 1.7.0002 ``` create table xsampall2 ( isbn char(15) xpath='@ISBN', language char(2) xpath='@LANG', subject char(32) xpath='@SUBJECT', authorfn char(20) xpath='AUTHOR/FIRSTNAME', authorln char(20) xpath='AUTHOR/LASTNAME', title char(32) xpath='TITLE', translated char(32) xpath='TRANSLATOR/@PREFIX', tranfn char(20) xpath='TRANSLATOR/FIRSTNAME', tranln char(20) xpath='TRANSLATOR/LASTNAME', publisher char(20) xpath='PUBLISHER/NAME', location char(20) xpath='PUBLISHER/PLACE', year int(4) xpath='DATEPUB') engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK,Expand=1,Mulnode=AUTHOR,Limit=2'; ``` Before Connect 1.7.0002 ``` create table xsampall2 ( isbn char(15) field_format='@ISBN', language char(2) field_format='@LANG', subject char(32) field_format='@SUBJECT', authorfn char(20) field_format='AUTHOR/FIRSTNAME', authorln char(20) field_format='AUTHOR/LASTNAME', title char(32) field_format='TITLE', translated char(32) field_format='TRANSLATOR/@PREFIX', tranfn char(20) field_format='TRANSLATOR/FIRSTNAME', tranln char(20) field_format='TRANSLATOR/LASTNAME', publisher char(20) field_format='PUBLISHER/NAME', location char(20) field_format='PUBLISHER/PLACE', year int(4) field_format='DATEPUB') engine=CONNECT table_type=XML file_name='Xsample.xml' tabname='BIBLIO' option_list='rownode=BOOK,Expand=1,Mulnode=AUTHOR,Limit=2'; ``` The only difference is that the "multiple" node is an intermediate node in the path. The resulting table can be seen with a query such as: ``` select subject, language lang, title, authorfn first, authorln last, year from xsampall2; ``` This query displays: | SUBJECT | LANG | TITLE | FIRST | LAST | YEAR | | --- | --- | --- | --- | --- | --- | | applications | fr | Construire une application XML | Jean-Christophe | Bernadac | 1999 | | applications | fr | Construire une application XML | François | Knab | 1999 | | applications | fr | XML en Action | William J. | Pardi | 1999 | | général | fr | XML, Langage et Applications | Alain | Michard | 1998 | These composite tables, half array half tree, reserve some surprises for us when updating, deleting from or inserting into them. Insert just cannot generate this structure; if two rows are inserted with just a different author, two book nodes will be generated in the XML file. Delete always deletes one book node and all its children nodes even if specified against only one author. Update is more complicated: ``` update xsampall2 set authorfn = 'Simon' where authorln = 'Knab'; update xsampall2 set year = 2002 where authorln = 'Bernadac'; update xsampall2 set authorln = 'Mercier' where year = 2002; ``` After these three updates, the first two responding "Affected rows: 1" and the last one responding "Affected rows: 2", the last query answers: | subject | lang | title | first | last | year | | --- | --- | --- | --- | --- | --- | | applications | fr | Construire une application XML | Jean-Christophe | Mercier | 2002 | | applications | fr | Construire une application XML | François | Knab | 2002 | | applications | fr | XML en Action | William J. | Pardi | 1999 | | général | fr | XML, Langage et Applications | Alain | Michard | 1998 | What must be understood here is that the Update modifies node values in the XML file, not cell values in the relational table. The first update worked normally. The second update changed the year value of the book and this shows for the two expanded rows because there is only one DATEPUB node for that book. Because the third update applies to a row having a certain date value, both author names were updated. Making a List of Multiple Values -------------------------------- Another way to see multiple values is to ask CONNECT to make a comma separated list of the multiple node values. This time, it can only be done if the "multiple" node is not intermediate. For example, we can modify the *xsamp2* table definition by: ``` alter table xsamp2 option_list='rownode=BOOK,Mulnode=AUTHOR,Limit=3'; ``` This time 'Expand' is not specified, and Limit gives the maximum number of items in the list. Now if we enter the query: ``` select isbn, subject, author "AUTHOR(S)", title from xsamp2; ``` We will get the following result: | ISBN | SUBJECT | AUTHOR(S) | TITLE | | --- | --- | --- | --- | | 9782212090819 | applications | Jean-Christophe Bernadac, François Knab | Construire une application XML | | 9782840825685 | applications | William J. Pardi | XML en Action | | 9782212090529 | général | Alain Michard | XML, Langage et Applications | Note that updating the "multiple" column is not possible because CONNECT does not know which of the nodes to update. This could not have been done with the *xsampall2* table because the author node is intermediate in the path, and making two lists, one of first names and another one of last names would not make sense anyway. ### What if a table contains several multiple nodes This can be handled by creating several tables on the same file, each containing only one multiple node and constructing the desired result using joins. Support of HTML Tables ---------------------- Most tables included in HTML documents cannot be processed by CONNECT because the HTML language is often not compatible with the syntax of XML. In particular, XML requires all open tags to be matched by a closing tag while it is sometimes optional in HTML. This is often the case concerning column tags. However, you can meet tables that respect the XML syntax but have some of the features of HTML tables. For instance: ``` <?xml version="1.0"?> <Beers> <table> <th><td>Name</td><td>Origin</td><td>Description</td></th> <tr> <td><brandName>Huntsman</brandName></td> <td><origin>Bath, UK</origin></td> <td><details>Wonderful hop, light alcohol</details></td> </tr> <tr> <td><brandName>Tuborg</brandName></td> <td><origin>Danmark</origin></td> <td><details>In small bottles</details></td> </tr> </table> </Beers> ``` Here the different column tags are included in `<td></td>` tags as for HTML tables. You cannot just add this tag in the Xpath of the columns, because the search is done on the first occurrence of each tag, and this would cause this search to fail for all columns except the first one. This case is handled by specifying the *Colnode* table option that gives the name of these column tags, for example: From Connect 1.7.0002 ``` create table beers ( `Name` char(16) xpath='brandName', `Origin` char(16) xpath='origin', `Description` char(32) xpath='details') engine=CONNECT table_type=XML file_name='beers.xml' tabname='table' option_list='rownode=tr,colnode=td'; ``` Before Connect 1.7.0002 ``` create table beers ( `Name` char(16) field_format='brandName', `Origin` char(16) field_format='origin', `Description` char(32) field_format='details') engine=CONNECT table_type=XML file_name='beers.xml' tabname='table' option_list='rownode=tr,colnode=td'; ``` The table will be displayed as: | Name | Origin | Description | | --- | --- | --- | | Huntsman | Bath, UK | Wonderful hop, light alcohol | | Tuborg | Danmark | In small bottles | However, you can deal with tables even closer to the HTML model. For example the *coffee.htm* file: ``` <TABLE summary="This table charts the number of cups of coffe consumed by each senator, the type of coffee (decaf or regular), and whether taken with sugar."> <CAPTION>Cups of coffee consumed by each senator</CAPTION> <TR> <TH>Name</TH> <TH>Cups</TH> <TH>Type of Coffee</TH> <TH>Sugar?</TH> </TR> <TR> <TD>T. Sexton</TD> <TD>10</TD> <TD>Espresso</TD> <TD>No</TD> </TR> <TR> <TD>J. Dinnen</TD> <TD>5</TD> <TD>Decaf</TD> <TD>Yes</TD> </TR> </TABLE> ``` Here column values are directly represented by the TD tag text. You cannot declare them as tags nor as attributes. In addition, they are not located using their name but by their position within the row. Here is how to declare such a table to CONNECT: ``` create table coffee ( `Name` char(16), `Cups` int(8), `Type` char(16), `Sugar` char(4)) engine=connect table_type=XML file_name='coffee.htm' tabname='TABLE' header=1 option_list='Coltype=HTML'; ``` You specify the fact that columns are located by position by setting the *Coltype* option to 'HTML'. Each column position (0 based) will be the value of the *flag* column parameter that is set by default in sequence. Now we are able to display the table: | Name | Cups | Type | Sugar | | --- | --- | --- | --- | | T. Sexton | 10 | Espresso | No | | J. Dinnen | 5 | Decaf | Yes | **Note 1:** We specified '`header=n`' in the create statement to indicate that the first n rows of the table are not data rows and should be skipped. **Note 2:** In this last example, we did not specify the node names using the Rownode and Colnode options because when *Coltype* is set to 'HTML' they default to '`Rownode=TR`' and '`Colnode=TD`'. **Note 3:** The *Coltype* option is a word only the first character of which is significant. Recognized values are: | | | | --- | --- | | T(ag) or N(ode) | Column names match a tag name (the default). | | A(ttribute) or @ | Column names match an attribute name. | | H(tml) or C(ol) or P(os) | Column are retrieved by their position. | ### New file setting Some create options are used only when creating a table on a new file, i. e. when inserting into a file that does not exist yet. When specified, the 'Header' option will create a header row with the name of the table columns. This is chiefly useful for HTML tables to be displayed on a web browser. Some new list-options are used in this context: | | | | --- | --- | | **Encoding** | The encoding of the new document, defaulting to UTF-8. | | **Attribute** | A list of 'attname=attvalue' separated by ';' to add to the table node. | | **HeadAttr** | An attribute list to be added to the header row node. | Let us see for instance, the following create statement: ``` create table handlers ( handler char(64), version char(20), author char(64), description char(255), maturity char(12)) engine=CONNECT table_type=XML file_name='handlers.htm' tabname='TABLE' header=yes option_list='coltype=HTML,encoding=ISO-8859-1, attribute=border=1;cellpadding=5,headattr=bgcolor=yellow'; ``` Supposing the table file does not exist yet, the first insert into that table, for instance by the following statement: ``` insert into handlers select plugin_name, plugin_version, plugin_author, plugin_description, plugin_maturity from information_schema.plugins where plugin_type = 'DAEMON'; ``` will generate the following file: ``` <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Created by CONNECT Version 3.05.0005 August 17, 2012 --> <TABLE border="1" cellpadding="5"> <TR bgcolor="yellow"> <TH>handler</TH> <TH>version</TH> <TH>author</TH> <TH>description</TH> <TH>maturity</TH> </TR> <TR> <TD>Maria</TD> <TD>1.5</TD> <TD>Monty Program Ab</TD> <TD>Compatibility aliases for the Aria engine</TD> <TD>Gamma</TD> </TR> </TABLE> ``` This file can be used to display the table on a web browser (encoding should be `ISO-8859-x`) | handler | version | author | description | maturity | | --- | --- | --- | --- | --- | | Maria | 1.5 | Monty Program Ab | Compatibility aliases for the Aria engine | Gamma | **Note:** The XML document encoding is generally specified in the XML header node and can be different from the DATA\_CHARSET, which is always UTF-8 for XML tables. Therefore the table DATA\_CHARSET character set should be unspecified, or specified as UTF8. The Encoding specification is useful only for new XML files and ignored for existing files having their encoding already specified in the header node. Notes ----- 1. [↑](#_ref-0) CONNECT does not claim to be able to deal with any XML document. Besides, those that can usefully be processed for data analysis are likely to have a structure that can easily be transformed into a table. 2. [↑](#_ref-1) With libxml2, sub tags text can be separated by 0 or several blanks depending on the structure and indentation of the data file. 3. [↑](#_ref-2) This may cause some rows to be lost because an eventual where clause on the “multiple” column is applied only on the limited number of retrieved rows. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb INTERSECTS INTERSECTS ========== Syntax ------ ``` INTERSECTS(g1,g2) ``` Description ----------- Returns `1` or `0` to indicate whether geometry *`g1`* spatially intersects geometry *`g2`*. INTERSECTS() is based on the original MySQL implementation and uses object bounding rectangles, while [ST\_INTERSECTS()](../st_intersects/index) uses object shapes. INTERSECTS() tests the opposite relationship to [DISJOINT()](../disjoint/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb HANDLER for MEMORY Tables HANDLER for MEMORY Tables ========================= This article explains how to use [HANDLER commands](../handler-commands/index) efficiently with [MEMORY/HEAP](../memory-storage-engine/index) tables. If you want to scan a table for over different key values, not just search for exact key values, you should create your keys with 'USING BTREE': ``` CREATE TABLE t1 (a INT, b INT, KEY(a), KEY b USING BTREE (b)) engine=memory; ``` In the above table, `a` is a [HASH](../storage-engine-index-types/index#hash-indexes) key that only supports exact matches (=) while `b` is a [BTREE](../storage-engine-index-types/index#b-tree-indexes) key that you can use to scan the table in key order, starting from start or from a given key value. The limitations for HANDLER READ with Memory|HEAP tables are: Limitations for HASH keys ------------------------- * You must use all key parts when searching for a row. * You can't do a key scan of all values. You can only find all rows with the same key value. * READ NEXT gives error 1031 if the tables changed since last read. Limitations for BTREE keys -------------------------- * READ NEXT gives error 1031 if the tables changed since last read. This limitation can be lifted in the future. Limitations for table scans --------------------------- * READ NEXT gives error 1031 if the table was truncated since last READ call. See also -------- See also the the limitations listed in [HANDLER commands](../handler-commands/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema ROCKSDB_DEADLOCK Table Information Schema ROCKSDB\_DEADLOCK Table ========================================== The [Information Schema](../information_schema/index) `ROCKSDB_DEADLOCK` table is included as part of the [MyRocks](../myrocks/index) storage engine. The `PROCESS` [privilege](../grant/index) is required to view the table. It contains the following columns: | Column | Description | | --- | --- | | `DEADLOCK_ID` | | | `TIMESTAMP` | | | `TRANSACTION_ID` | | | `CF_NAME` | | | `WAITING_KEY` | | | `LOCK_TYPE` | | | `INDEX_NAME` | | | `TABLE_NAME` | | | `ROLLED_BACK` | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Making Backups with mysqldump Making Backups with mysqldump ============================= One of the best utilities to use to make a backup copy of a server's MariaDB's data is [mysqldump](../mysqldump/index). It comes with MariaDB, so it costs you nothing more. Best of all it doesn't require you to shut down MariaDB services to make a backup. It works very simply: it retrieves the data and schema from each database and table and builds a data text file outside of MariaDB. This data text file (known as a dump file) will contain the SQL statements necessary to reconstruct the databases and data. If you were to open a dump file generated by [mysqldump](../mysqldump/index), you would see CREATE TABLE statements and a multitude of [INSERT](../insert/index) statements, one for each row of data. #### Backing Up Everything To export all of the databases in MariaDB using [mysqldump](../mysqldump/index), the following would be entered from the filesystem command-line: ``` mysqldump -u admin_backup -p -x -A > /data/backup/dbs.sql ``` The first set of options here (`-u *admin\_backup* -p`) tell MariaDB that this utility is to be executed by the user *admin\_backup* and that the user needs to be prompted for a password, which will have to be typed in on the next line when asked. Incidentally, although you might be tempted to just use the root user, you should create a special administrative user as we're using here. If the dump is to be executed by cron by way of a shell script, this option can be changed to `-p*mypwd*`, where *mypwd* is the password—there's no space between the `-p` and the password. The `-x` option has MariaDB lock all of the tables before performing the backup. The lock won't be released until the process is finished. To bundle [INSERT](../insert/index) statements together for each table, we've added the `-e` option. This extended insert option will cause the dump file to be smaller and allow any possible future restores to be executed faster. The `-A` option specifies that all databases are to be exported. Finally, the greater-than sign is a shell redirect of the standard output (STDOUT) to the path and file named after it. The example given for backing up all database is the short hand version. The convention is migrating to longer options, not the single letter options. In fact, some are being deprecated and won't be available in the future. So, the above could and should be entered like this: ``` mysqldump --user=admin_backup --password --lock-tables --all-databases > /data/backup/dbs.sql ``` The longer option names are easier to follow and to remember. Again, if the backup is to be executed by a shell script, the user's password should be listed: `--password=*mypwd*`. Notice that the equal-sign is added when the password is given with the long option name. #### Just One Database Backing up all of the databases at once with [mysqldump](../mysqldump/index) may result in one large dump file. This could be take longer to complete the backup and make restoration a bit cumbersome later. Therefore, it might be more useful to stagger backups based on databases, making for possbily several smaller files. You could then backup larger databases during slower traffic times. You might also backup critical databases or ones that are changed much during slower times of the day so that you don't dimish user interaction. To export only one database and not all, enter something like the following from the command-line: ``` mysqldump --user=admin_backup --password --lock-tables --databases db1 > /data/backup/db1.sql ``` The only significant difference in this line is that the `-A` option has been replaced with `-B` and the database to be exported has been given. To export multiple databases, just enter them after the `-B` option, separated by spaces (e.g., `-B db1 db2`). #### Dumping Tables For very large databases, you may want to backup the data based on tables rather than the whole database. You could backup weekly an entire database and then only backup daily individual tables for which data changes often. To backup just one table, the following could be entered from the command line: ``` mysqldump --user=admin_backup --password --lock-tables db1 table1 > /data/backup/db1_table1.sql ``` First notice that the `--databases` option has not been included in the line above. The utility assumes that the first name given is a database and the second name is a table name and not another database. To backup multiple tables from a database, just list them after the database name, separated by spaces (e.g., db1 table1 table2). #### Conclusion As you can see from this article, [mysqldump](../mysqldump/index) is easy to use and very powerful. In fact, it can clobber your data if you're not careful. Therefore, you should practice using it on a test database—a test server even—a few times until you're comfortable with making backups and restoring them. Don't wait until you've lost your data and in a panic to restore your data to find out that you haven't been backing up your data properly or that you don't know how to fine tune data restoration. Develop some skills in advance and in a safe and controled way. To learn how to restore dump files, see our article on Restoring Data. Other References ---------------- * [Backup Tutorial](https://blog.devart.com/mysql-backup-tutorial.html) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Upgrading from MariaDB 10.5 to MariaDB 10.6 Upgrading from MariaDB 10.5 to MariaDB 10.6 =========================================== ### How to Upgrade For Windows, see [Upgrading MariaDB on Windows](../upgrading-mariadb-on-windows/index). For MariaDB Galera Cluster, see [Upgrading from MariaDB 10.5 to MariaDB 10.6 with Galera Cluster](upgrading-from-mariadb-105-to-mariadb-106-with-galera-cluster) instead. Before you upgrade, it would be best to take a backup of your database. This is always a good idea to do before an upgrade. We would recommend [Mariabackup](../mariabackup/index). The suggested upgrade procedure is: 1. Modify the repository configuration, so the system's package manager installs [MariaDB 10.6](../what-is-mariadb-106/index). For example, * On Debian, Ubuntu, and other similar Linux distributions, see [Updating the MariaDB APT repository to a New Major Release](../installing-mariadb-deb-files/index#updating-the-mariadb-apt-repository-to-a-new-major-release) for more information. * On RHEL, CentOS, Fedora, and other similar Linux distributions, see [Updating the MariaDB YUM repository to a New Major Release](../yum/index#updating-the-mariadb-yum-repository-to-a-new-major-release) for more information. * On SLES, OpenSUSE, and other similar Linux distributions, see [Updating the MariaDB ZYpp repository to a New Major Release](../installing-mariadb-with-zypper/index#updating-the-mariadb-zypp-repository-to-a-new-major-release) for more information. 2. [Stop MariaDB](../starting-and-stopping-mariadb-automatically/index). 3. Uninstall the old version of MariaDB. * On Debian, Ubuntu, and other similar Linux distributions, execute the following: `sudo apt-get remove mariadb-server` * On RHEL, CentOS, Fedora, and other similar Linux distributions, execute the following: `sudo yum remove MariaDB-server` * On SLES, OpenSUSE, and other similar Linux distributions, execute the following: `sudo zypper remove MariaDB-server` 4. Install the new version of MariaDB. * On Debian, Ubuntu, and other similar Linux distributions, see [Installing MariaDB Packages with APT](../installing-mariadb-deb-files/index#installing-mariadb-packages-with-apt) for more information. * On RHEL, CentOS, Fedora, and other similar Linux distributions, see [Installing MariaDB Packages with YUM](../yum/index#installing-mariadb-packages-with-yum) for more information. * On SLES, OpenSUSE, and other similar Linux distributions, see [Installing MariaDB Packages with ZYpp](../installing-mariadb-with-zypper/index#installing-mariadb-packages-with-zypp) for more information. 5. Make any desired changes to configuration options in [option files](../configuring-mariadb-with-option-files/index), such as `my.cnf`. This includes removing any options that are no longer supported. 6. [Start MariaDB](../starting-and-stopping-mariadb-automatically/index). 7. Run [mariadb-upgrade](../mariadb-upgrade/index). * `mariadb-upgrade` does two things: 1. Ensures that the system tables in the [mysql](../the-mysql-database-tables/index) database are fully compatible with the new version. 2. Does a very quick check of all tables and marks them as compatible with the new version of MariaDB . ### Incompatible Changes Between 10.5 and 10.6 On most servers upgrading from 10.5 should be painless. However, there are some things that have changed which could affect an upgrade: #### Reserved Word * New [reserved word](../reserved-words/index): OFFSET. This can no longer be used as an [identifier](../identifier-names/index) without being quoted. #### InnoDB COMPRESSED Row Format From [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) until [MariaDB 10.6.5](https://mariadb.com/kb/en/mariadb-1065-release-notes/), tables that are of the `COMPRESSED` row format are read-only by default. This was intended to be the first step towards removing write support and deprecating the feature. This plan has been scrapped, and from [MariaDB 10.6.6](https://mariadb.com/kb/en/mariadb-1066-release-notes/), `COMPRESSED` tables are no longer read-only by default. From [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) to [MariaDB 10.6.5](https://mariadb.com/kb/en/mariadb-1065-release-notes/), set the [innodb\_read\_only\_compressed](../innodb-system-variables/index#innodb_read_only_compressed) variable to `OFF` to make the tables writable. #### Character Sets From [MariaDB 10.6](../what-is-mariadb-106/index), the `utf8` [character set](../character-sets/index) (and related collations) is by default an alias for `utf8mb3` rather than the other way around. It can be set to imply `utf8mb4` by changing the value of the [old\_mode](../server-system-variables/index#old_mode) system variable. #### Options That Have Changed Default Values | Option | Old default value | New default value | | --- | --- | --- | | [character\_set\_client](../server-system-variables/index#character_set_client) | utf8 | utf8mb3 | | [character\_set\_connection](../server-system-variables/index#character_set_connection) | utf8 | utf8mb3 | | [character\_set\_results](../server-system-variables/index#character_set_results) | utf8 | utf8mb3 | | [character\_set\_system](../server-system-variables/index#character_set_system) | utf8 | utf8mb3 | | [innodb\_flush\_method](../innodb-system-variables/index#innodb_flush_method) | fsync | O\_DIRECT | | [old\_mode](../server-system-variables/index#old_mode) | Empty | UTF8\_IS\_UTF8MB3 | #### Options That Have Been Removed or Renamed The following options should be removed or renamed if you use them in your [option files](../configuring-mariadb-with-option-files/index): | Option | Reason | | --- | --- | | [innodb\_adaptive\_max\_sleep\_delay](../innodb-system-variables/index#innodb_adaptive_max_sleep_delay) | | | [innodb\_background\_scrub\_data\_check\_interval](../innodb-system-variables/index#innodb_background_scrub_data_check_interval) | | | [innodb\_background\_scrub\_data\_compressed](../innodb-system-variables/index#innodb_background_scrub_data_compressed) | | | [innodb\_background\_scrub\_data\_interval](../innodb-system-variables/index#innodb_background_scrub_data_interval) | | | [innodb\_background\_scrub\_data\_uncompressed](../innodb-system-variables/index#innodb_background_scrub_data_uncompressed) | | | [innodb\_buffer\_pool\_instances](../innodb-system-variables/index#innodb_buffer_pool_instances) | | | [innodb\_checksum\_algorithm](../innodb-system-variables/index#innodb_checksum_algorithm) | The variable is still present, but the `*innodb` and `*none` options have been removed as the `crc32` algorithm only is supported from [MariaDB 10.6](../what-is-mariadb-106/index). | | [innodb\_commit\_concurrency](../innodb-system-variables/index#innodb_commit_concurrency) | | | [innodb\_concurrency\_tickets](../innodb-system-variables/index#innodb_concurrency_tickets) | | | [innodb\_file\_format](../innodb-system-variables/index#innodb_file_format) | | | [innodb\_large\_prefix](../innodb-system-variables/index#innodb_large_prefix) | | | [innodb\_lock\_schedule\_algorithm](../innodb-system-variables/index#innodb_lock_schedule_algorithm) | | | [innodb\_log\_checksums](../innodb-system-variables/index#innodb_log_checksums) | | | [innodb\_log\_compressed\_pages](../innodb-system-variables/index#innodb_log_compressed_pages) | | | [innodb\_log\_files\_in\_group](../innodb-system-variables/index#innodb_log_files_in_group) | | | [innodb\_log\_optimize\_ddl](../innodb-system-variables/index#innodb_log_optimize_ddl) | | | [innodb\_page\_cleaners](../innodb-system-variables/index#innodb_page_cleaners) | | | [innodb\_replication\_delay](../innodb-system-variables/index#innodb_replication_delay) | | | [innodb\_scrub\_log](../innodb-system-variables/index#innodb_scrub_log) | | | [innodb\_scrub\_log\_speed](../innodb-system-variables/index#innodb_scrub_log_speed) | | | [innodb\_sync\_array\_size](../innodb-system-variables/index#innodb_sync_array_size) | | | [innodb\_thread\_concurrency](../innodb-system-variables/index#innodb_thread_concurrency) | | | [innodb\_thread\_sleep\_delay](../innodb-system-variables/index#innodb_thread_sleep_delay) | | | [innodb\_undo\_logs](../innodb-system-variables/index#innodb_undo_logs) | | #### Deprecated Options The following options have been deprecated. They have not yet been removed, but will be in a future version, and should ideally no longer be used. | Option | Reason | | --- | --- | | [wsrep\_replicate\_myisam](../galera-cluster-system-variables/index#wsrep_replicate_myisam) | Use [wsrep\_mode](../galera-cluster-system-variables/index#wsrep_mode) instead. | | [wsrep\_strict\_ddl](../galera-cluster-system-variables/index#wsrep_strict_ddl) | Use [wsrep\_mode](../galera-cluster-system-variables/index#wsrep_mode) instead. | ### Major New Features To Consider * See also [System Variables Added in MariaDB 10.6](../system-variables-added-in-mariadb-106/index). ### See Also * [The features in MariaDB 10.6](../what-is-mariadb-106/index) * [Upgrading from MariaDB 10.5 to MariaDB 10.6 with Galera Cluster](upgrading-from-mariadb-105-to-mariadb-106-with-galera-cluster) * [Upgrading from MariaDB 10.4 to MariaDB 10.5](../upgrading-from-mariadb-104-to-mariadb-105/index) * [Upgrading from MariaDB 10.3 to MariaDB 10.4](../upgrading-from-mariadb-103-to-mariadb-104/index) * [Upgrading from MariaDB 10.2 to MariaDB 10.3](../upgrading-from-mariadb-102-to-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb NVL2 NVL2 ==== **MariaDB starting with [10.3](../what-is-mariadb-103/index)**The NLV2 function was introduced in [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/). Syntax ------ ``` NVL2(expr1,expr2,expr3) ``` Description ----------- The `NVL2` function returns a value based on whether a specified expression is NULL or not. If *expr1* is not NULL, then NVL2 returns *expr2*. If *expr1* is NULL, then NVL2 returns *expr3*. Examples -------- ``` SELECT NVL2(NULL,1,2); +----------------+ | NVL2(NULL,1,2) | +----------------+ | 2 | +----------------+ SELECT NVL2('x',1,2); +---------------+ | NVL2('x',1,2) | +---------------+ | 1 | +---------------+ ``` See Also -------- * [IFNULL (or NVL)](../ifnull/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BEGIN END BEGIN END ========= Syntax ------ ``` [begin_label:] BEGIN [NOT ATOMIC] [statement_list] END [end_label] ``` `NOT ATOMIC` is required when used outside of a [stored procedure](../stored-procedures/index). Inside stored procedures or within an anonymous block, `BEGIN` alone starts a new anonymous block. Description ----------- `BEGIN ... END` syntax is used for writing compound statements. A compound statement can contain multiple statements, enclosed by the `BEGIN` and `END` keywords. statement\_list represents a list of one or more statements, each terminated by a semicolon (i.e., `;`) statement delimiter. statement\_list is optional, which means that the empty compound statement (`BEGIN END`) is legal. Note that `END` will perform a commit. If you are running in [autocommit](../server-system-variables/index#autocommit) mode, every statement will be committed separately. If you are not running in `autocommit` mode, you must execute a [COMMIT](../commit/index) or [ROLLBACK](../rollback/index) after `END` to get the database up to date. Use of multiple statements requires that a client is able to send statement strings containing the ; statement delimiter. This is handled in the [mysql](mysql-command-line_client) command-line client with the [DELIMITER](../delimiters/index) command. Changing the `;` end-of-statement delimiter (for example, to `//`) allows `;` to be used in a program body. A compound statement within a [stored program](../stored-programs-and-views/index) can be [labeled](../labels/index). `end_label` cannot be given unless `begin_label` also is present. If both are present, they must be the same. `BEGIN ... END` constructs can be nested. Each block can define its own variables, a `CONDITION`, a `HANDLER` and a [CURSOR](../programmatic-and-compound-statements-cursors/index), which don't exist in the outer blocks. The most local declarations override the outer objects which use the same name (see example below). The declarations order is the following: * [`DECLARE` local variables](../declare-variable/index); * [`DECLARE CONDITION`s](../declare-condition/index); * [`DECLARE CURSOR`s](../declare-cursor/index); * [`DECLARE HANDLER`s](../declare-handler/index); Note that `DECLARE HANDLER` contains another `BEGIN ... END` construct. Here is an example of a very simple, anonymous block: ``` BEGIN NOT ATOMIC SET @a=1; CREATE TABLE test.t1(a INT); END| ``` Below is an example of nested blocks in a stored procedure: ``` CREATE PROCEDURE t( ) BEGIN DECLARE x TINYINT UNSIGNED DEFAULT 1; BEGIN DECLARE x CHAR(2) DEFAULT '02'; DECLARE y TINYINT UNSIGNED DEFAULT 10; SELECT x, y; END; SELECT x; END; ``` In this example, a [TINYINT](../tinyint/index) variable, `x` is declared in the outter block. But in the inner block `x` is re-declared as a [CHAR](../char/index) and an `y` variable is declared. The inner [SELECT](../select/index) shows the "new" value of `x`, and the value of `y`. But when x is selected in the outer block, the "old" value is returned. The final [SELECT](../select/index) doesn't try to read `y`, because it doesn't exist in that context. See Also -------- * [Using compound statements outside of stored programs](../using-compound-statements-outside-of-stored-programs/index) * [Changes in Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#simple-syntax-compatibility) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb CONNECT CONNECT ======== Note: You can download a [PDF version of the CONNECT documentation](https://mariadb.com/kb/en/connect-table-types/+attachment/connect_1_7_03) (1.7.0003). | Connect Version | Introduced | Maturity | | --- | --- | --- | | Connect 1.07.0002 | [MariaDB 10.5.9](https://mariadb.com/kb/en/mariadb-1059-release-notes/), [MariaDB 10.4.18](https://mariadb.com/kb/en/mariadb-10418-release-notes/), [MariaDB 10.3.28](https://mariadb.com/kb/en/mariadb-10328-release-notes/), [MariaDB 10.2.36](https://mariadb.com/kb/en/mariadb-10236-release-notes/) | Stable | | Connect 1.07.0001 | [MariaDB 10.4.12](https://mariadb.com/kb/en/mariadb-10412-release-notes/), [MariaDB 10.3.22](https://mariadb.com/kb/en/mariadb-10322-release-notes/), [MariaDB 10.2.31](https://mariadb.com/kb/en/mariadb-10231-release-notes/), [MariaDB 10.1.44](https://mariadb.com/kb/en/mariadb-10144-release-notes/) | Stable | | Connect 1.06.0010 | [MariaDB 10.4.8](https://mariadb.com/kb/en/mariadb-1048-release-notes/), [MariaDB 10.3.18](https://mariadb.com/kb/en/mariadb-10318-release-notes/), [MariaDB 10.2.27](https://mariadb.com/kb/en/mariadb-10227-release-notes/) | Stable | | Connect 1.06.0007 | [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/), [MariaDB 10.2.14](https://mariadb.com/kb/en/mariadb-10214-release-notes/), [MariaDB 10.1.33](https://mariadb.com/kb/en/mariadb-10133-release-notes/) | Stable | | Connect 1.06.0005 | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/), [MariaDB 10.2.10](https://mariadb.com/kb/en/mariadb-10210-release-notes/), [MariaDB 10.1.29](https://mariadb.com/kb/en/mariadb-10129-release-notes/) | Stable | | Connect 1.06.0004 | [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/), [MariaDB 10.2.9](https://mariadb.com/kb/en/mariadb-1029-release-notes/), [MariaDB 10.1.28](https://mariadb.com/kb/en/mariadb-10128-release-notes/) | Stable | | Connect 1.06.0001 | [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/), [MariaDB 10.1.24](https://mariadb.com/kb/en/mariadb-10124-release-notes/) | Beta | | Connect 1.05.0003 | [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/), [MariaDB 10.1.22](https://mariadb.com/kb/en/mariadb-10122-release-notes/) | Stable | | Connect 1.05.0001 | [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/), [MariaDB 10.1.21](https://mariadb.com/kb/en/mariadb-10121-release-notes/) | Stable | | Connect 1.04.0008 | [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), [MariaDB 10.1.17](https://mariadb.com/kb/en/mariadb-10117-release-notes/) | Stable | | Connect 1.04.0006 | [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/), [MariaDB 10.1.13](https://mariadb.com/kb/en/mariadb-10113-release-notes/), | Stable | | Connect 1.04.0005 | [MariaDB 10.1.10](https://mariadb.com/kb/en/mariadb-10110-release-notes/) | Beta | | Connect 1.04.0003 | [MariaDB 10.1.9](https://mariadb.com/kb/en/mariadb-1019-release-notes/) | Beta | The CONNECT storage engine enables MariaDB to access external local or remote data (MED). This is done by defining tables based on different data types, in particular files in various formats, data extracted from other DBMS or products (such as Excel or MongoDB) via ODBC or JDBC, or data retrieved from the environment (for example DIR, WMI, and MAC tables) This storage engine supports table partitioning, MariaDB virtual columns and permits defining *special* columns such as ROWID, FILEID, and SERVID. No precise definition of maturity exists. Because CONNECT handles many table types, each type has a different maturity depending on whether it is old and well-tested, less well-tested or newly implemented. This will be indicated for all data types. | Title | Description | | --- | --- | | [Introduction to the CONNECT Engine](../introduction-to-the-connect-engine/index) | Reasons behind the CONNECT storage engine. | | [Installing the CONNECT Storage Engine](../installing-the-connect-storage-engine/index) | Installing the CONNECT storage engine. | | [Creating and Dropping CONNECT Tables](../creating-and-dropping-connect-tables/index) | Creating and dropping CONNECT tables. | | [CONNECT Data Types](../connect-data-types/index) | Data types supported by CONNECT. | | [Current Status of the CONNECT Handler](../current-status-of-the-connect-handler/index) | The current CONNECT handler is a stable release. | ### [CONNECT Table Types](../connect-table-types/index) | Title | Description | | --- | --- | | [CONNECT Table Types Overview](../connect-table-types-overview/index) | CONNECT can handle many table formats. | | [Inward and Outward Tables](../inward-and-outward-tables/index) | The two broad categories of CONNECT tables. | | [CONNECT Table Types - Data Files](../connect-table-types-data-files/index) | CONNECT plain DOS or UNIX data files. | | [CONNECT Zipped File Tables](../connect-zipped-file-tables/index) | When the table file or files are compressed in one or several zip files. | | [CONNECT DOS and FIX Table Types](../connect-dos-and-fix-table-types/index) | CONNECT tables based on text files | | [CONNECT DBF Table Type](../connect-dbf-table-type/index) | CONNECT dBASE III or IV tables. | | [CONNECT BIN Table Type](../connect-bin-table-type/index) | CONNECT binary files in which each row is a logical record of fixed length | | [CONNECT VEC Table Type](../connect-vec-table-type/index) | CONNECT binary files organized in vectors | | [CONNECT CSV and FMT Table Types](../connect-csv-and-fmt-table-types/index) | Variable length CONNECT data files. | | [CONNECT - NoSQL Table Types](../connect-nosql-table-types/index) | Based on files that do not match the relational format but often represent hierarchical data. | | [CONNECT - Files Retrieved Using Rest Queries](../connect-files-retrieved-using-rest-queries/index) | JSON, XML and CSV data files can be retrieved as results from REST queries. | | [CONNECT JSON Table Type](../connect-json-table-type/index) | JSON (JavaScript Object Notation) is a widely-used lightweight data-interchange format. | | [CONNECT XML Table Type](../connect-xml-table-type/index) | CONNECT XML files | | [CONNECT INI Table Type](../connect-ini-table-type/index) | CONNECT INI Windows configuration or initialization files. | | [CONNECT - External Table Types](../connect-external-table-types/index) | Access tables belonging to the current or another server. | | [CONNECT ODBC Table Type: Accessing Tables From Another DBMS](../connect-odbc-table-type-accessing-tables-from-another-dbms/index) | CONNECT Table Types - ODBC Table Type: Accessing Tables from other DBMS | | [CONNECT JDBC Table Type: Accessing Tables from Another DBMS](../connect-jdbc-table-type-accessing-tables-from-another-dbms/index) | Using JDBC to access other tables. | | [CONNECT MONGO Table Type: Accessing Collections from MongoDB](../connect-mongo-table-type/index) | Used to directly access MongoDB collections as tables. | | [CONNECT MYSQL Table Type: Accessing MySQL/MariaDB Tables](../connect-mysql-table-type-accessing-mysqlmariadb-tables/index) | Accessing a MySQL or MariaDB table or view | | [CONNECT PROXY Table Type](../connect-proxy-table-type/index) | Tables that access and read the data of another table or view | | [CONNECT XCOL Table Type](../connect-xcol-table-type/index) | Based on another table/view, used when object tables have a column that contains a list of values | | [CONNECT OCCUR Table Type](../connect-occur-table-type/index) | Extension to the PROXY type when referring to a table/view having several c... | | [CONNECT PIVOT Table Type](../connect-pivot-table-type/index) | Transform the result of another table into another table along “pivot” and "fact" columns. | | [CONNECT TBL Table Type: Table List](../connect-tbl-table-type-table-list/index) | Define a table as a list of tables of any engine and type. | | [CONNECT - Using the TBL and MYSQL Table Types Together](../connect-using-the-tbl-and-mysql-table-types-together/index) | Used together, the TBL and MYSQL types lift all the limitations of the FEDERATED and MERGE engines | | [CONNECT Table Types - Special "Virtual" Tables](../connect-table-types-special-virtual-tables/index) | VIR, WMI and MAC special table types | | [CONNECT Table Types - VIR](../connect-table-types-vir/index) | VIR virtual type for CONNECT | | [CONNECT Table Types - OEM: Implemented in an External LIB](../connect-table-types-oem/index) | CONNECT OEM table types are implemented in an external library. | | [CONNECT Table Types - Catalog Tables](../connect-table-types-catalog-tables/index) | Catalog tables return information about another table or data source | | [Adding DataFlex 3.1c .dat Files As An External Table Type With CONNECT](../adding-dataflex-31c-dat-files-as-an-external-table-type-with-connect/index) | I'm using MariaDB's CONNECT engine to access / utilize a set of Visual FoxP... | | [CONNECT engine windows](../connect-engine-windows/index) | with mariadb 10.07 installed on windows, how to setup engines, particulary ... | | [creating pivot table fails](../creating-pivot-table-fails/index) | I tried to create a pivot table based on an existing table "test1" and get ... | | [limit of number of columns](../limit-of-number-of-columns/index) | I have a table of 6MB with 50 values in the pivot-values leading to 50 colu... | ### Other CONNECT Articles | Title | Description | | --- | --- | | [CONNECT - Security](../connect-security/index) | CONNECT requires the FILE privilege for "outward" tables | | [CONNECT - OEM Table Example](../connect-oem-table-example/index) | Example showing how an OEM table can be implemented. | ### [Using CONNECT](../using-connect/index) | Title | Description | | --- | --- | | [Using CONNECT - General Information](../using-connect-general-information/index) | Using CONNECT - General Information. | | [Using CONNECT - Virtual and Special Columns](../using-connect-virtual-and-special-columns/index) | Virtual and special columns example usage | | [Using CONNECT - Importing File Data Into MariaDB Tables](../using-connect-importing-file-data-into-mariadb-tables/index) | Directly using external (file) data has many advantages | | [Using CONNECT - Exporting Data From MariaDB](../using-connect-exporting-data-from-mariadb/index) | Exporting data from MariaDB with CONNECT | | [Using CONNECT - Indexing](../using-connect-indexing/index) | Indexing with the CONNECT handler | | [Using CONNECT - Condition Pushdown](../using-connect-condition-pushdown/index) | Using CONNECT - Condition Pushdown. | | [USING CONNECT - Offline Documentation](../using-connect-offline-documentation/index) | CONNECT Plugin User Manual. | | [Using CONNECT - Partitioning and Sharding](../using-connect-partitioning-and-sharding/index) | Partitioning and Sharding with CONNECT | ### Other CONNECT Articles | Title | Description | | --- | --- | | [CONNECT - Making the GetRest Library](../connect-making-the-getrest-library/index) | Compiling the function calling the cpprestsdk package separately that will be loaded by CONNECT. | | [CONNECT - Adding the REST Feature as a Library Called by an OEM Table](../connect-adding-the-rest-feature-as-a-library-called-by-an-oem-table/index) | How the REST feature can be added as a library called by an OEM table. | | [CONNECT - Compiling JSON UDFs in a Separate Library](../connect-compiling-json-udfs-in-a-separate-library/index) | There are situations when you may need to have JSON UDFs in a separate library. | | [CONNECT System Variables](../connect-system-variables/index) | System variables related to the CONNECT storage engine. | | [JSON Sample Files](../json-sample-files/index) | expense.json sample file | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Server Monitoring & Logs Server Monitoring & Logs ========================= MariaDB can keep a number of log files, including the error log, the binary log, the general query log and the slow query log. | Title | Description | | --- | --- | | [Overview of MariaDB Logs](../overview-of-mariadb-logs/index) | What to log and what not to log | | [Error Log](../error-log/index) | Record of critical errors that occurred during the server's operation. | | [Setting the Language for Error Messages](../setting-the-language-for-error-messages/index) | Specifying the language for the server error messages. | | [General Query Log](../general-query-log/index) | Log of every SQL query received from a client, as well as connects/disconnects. | | [Slow Query Log](../slow-query-log/index) | Logging slow queries | | [Rotating Logs on Unix and Linux](../rotating-logs-on-unix-and-linux/index) | Rotating logs on Unix and Linux with logrotate. | | [Binary Log](../binary-log/index) | Contains a record of all changes to the databases, both data and structure | | [InnoDB Redo Log](../innodb-redo-log/index) | The redo log is used by InnoDB during crash recovery. | | [InnoDB Undo Log](../innodb-undo-log/index) | InnoDB Undo log. | | [MyISAM Log](../myisam-log/index) | Records all changes to MyISAM tables | | [Transaction Coordinator Log](../transaction-coordinator-log/index) | The transaction coordinator log (tc\_log) is used to coordinate transactions... | | [SQL Error Log Plugin](../sql-error-log-plugin/index) | Records SQL-level errors to a log file. | | [Writing Logs Into Tables](../writing-logs-into-tables/index) | The general query log and the slow query log can be written into system tables | | [Performance Schema](../performance-schema/index) | Monitoring server performance. | | [MariaDB Audit Plugin](../mariadb-audit-plugin/index) | Logging user activity with the MariaDB Audit Plugin. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-report mariadb-report ============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-report` is a symlink to `mysqlreport`, the binary for showing the value of important status variables. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-report` is the name of the binary, with `mysqlreport` a symlink . See [mysqlreport](../mysqlreport/index) for details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb COALESCE COALESCE ======== Syntax ------ ``` COALESCE(value,...) ``` Description ----------- Returns the first non-NULL value in the list, or NULL if there are no non-NULL values. At least one parameter must be passed. The function is useful when substituting a default value for null values when displaying data. See also [NULL Values in MariaDB](../null-values-in-mariadb/index). Examples -------- ``` SELECT COALESCE(NULL,1); +------------------+ | COALESCE(NULL,1) | +------------------+ | 1 | +------------------+ ``` ``` SELECT COALESCE(NULL,NULL,NULL); +--------------------------+ | COALESCE(NULL,NULL,NULL) | +--------------------------+ | NULL | +--------------------------+ ``` When two arguments are given, COALESCE() is the same as [IFNULL()](../ifnull/index): ``` SET @a=NULL, @b=1; SELECT COALESCE(@a, @b), IFNULL(@a, @b); +------------------+----------------+ | COALESCE(@a, @b) | IFNULL(@a, @b) | +------------------+----------------+ | 1 | 1 | +------------------+----------------+ ``` Hex type confusion: ``` CREATE TABLE t1 (a INT, b VARCHAR(10)); INSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61)); SELECT * FROM t1; +------+------+ | a | b | +------+------+ | 49 | a | | 1 | a | +------+------+ ``` The reason for the differing results above is that when 0x31 is inserted directly to the column, it's treated as a number (see [Hexadecimal Literals](../hexadecimal-literals/index)), while when 0x31 is passed to COALESCE(), it's treated as a string, because: * HEX values have a string data type by default. * COALESCE() has the same data type as the argument. Substituting zero for NULL (in this case when the aggregate function returns NULL after finding no rows): ``` SELECT SUM(score) FROM student; +------------+ | SUM(score) | +------------+ | NULL | +------------+ SELECT COALESCE(SUM(score),0) FROM student; +------------------------+ | COALESCE(SUM(score),0) | +------------------------+ | 0 | +------------------------+ ``` See also -------- * [NULL values](../null-values/index) * [IS NULL operator](../is-null/index) * [IS NOT NULL operator](../is-not-null/index) * [IFNULL function](../ifnull/index) * [NULLIF function](../nullif/index) * [CONNECT data types](../connect-data-types/index#null-handling) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_REMOVE JSON\_REMOVE ============ **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**JSON functions were added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` JSON_REMOVE(json_doc, path[, path] ...) ``` Description ----------- Removes data from a JSON document returning the result, or NULL if any of the arguments are null. If the element does not exist in the document, no changes are made. An error will occur if JSON document is invalid, the path is invalid or if the path contains a `*` or `**` wildcard. Path arguments are evaluated from left to right, with the result from the earlier evaluation being used as the value for the next. Examples -------- ``` SELECT JSON_REMOVE('{"A": 1, "B": 2, "C": {"D": 3}}', '$.C'); +-------------------------------------------------------+ | JSON_REMOVE('{"A": 1, "B": 2, "C": {"D": 3}}', '$.C') | +-------------------------------------------------------+ | {"A": 1, "B": 2} | +-------------------------------------------------------+ SELECT JSON_REMOVE('["A", "B", ["C", "D"], "E"]', '$[1]'); +----------------------------------------------------+ | JSON_REMOVE('["A", "B", ["C", "D"], "E"]', '$[1]') | +----------------------------------------------------+ | ["A", ["C", "D"], "E"] | +----------------------------------------------------+ ``` See Also -------- * [JSON video tutorial](https://www.youtube.com/watch?v=sLE7jPETp8g) covering JSON\_REMOVE. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb EXP EXP === Syntax ------ ``` EXP(X) ``` Description ----------- Returns the value of e (the base of natural logarithms) raised to the power of X. The inverse of this function is [LOG()](../log/index) (using a single argument only) or [LN()](../ln/index). If `X` is `NULL`, this function returns `NULL`. Examples -------- ``` SELECT EXP(2); +------------------+ | EXP(2) | +------------------+ | 7.38905609893065 | +------------------+ SELECT EXP(-2); +--------------------+ | EXP(-2) | +--------------------+ | 0.1353352832366127 | +--------------------+ SELECT EXP(0); +--------+ | EXP(0) | +--------+ | 1 | +--------+ SELECT EXP(NULL); +-----------+ | EXP(NULL) | +-----------+ | NULL | +-----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb How do I setup a Buildbot build slave? How do I setup a Buildbot build slave? ====================================== These build instructions should in general be platform agnostic. It is based on a post by Adam M. Dutko on maria-discuss. See the [list archive](https://lists.launchpad.net/maria-discuss/msg00372.html). To setup a build slave, the basic outline is: 1. Install Python (2.4 or later) 2. Install Twisted (twistedmatrix.com 8.0.x or later) - need Core, Mail, Web and Words (possibly Conch too) 3. Install ZopeInterface (<http://www.zope.org/Products/ZopeInterface>) 4. Install all the necessary compiler/build components. 5. Install Buildbot 6. Install [Git](../using-git/index) and make sure you can clone from the main project 7. Get a username/login and password from the buildmaster (dbart on [Libera.Chat](../irc/index)) 8. Verify your buildbot can talk to the buildbot master instance and can run builds. The following links will also help: 1. <http://docs.buildbot.net/> 2. [buildbot-setup-buildbot-setup-notes](../buildbot-setup-buildbot-setup-notes/index) 3. [about-buildbot](../about-buildbot/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Virtual Machines - Ubuntu 13.04 "raring" Buildbot Setup for Virtual Machines - Ubuntu 13.04 "raring" ============================================================ Base install ------------ ``` qemu-img create -f qcow2 /kvm/vms/vm-raring-amd64-serial.qcow2 15G qemu-img create -f qcow2 /kvm/vms/vm-raring-i386-serial.qcow2 15G ``` Start each VM booting from the server install iso one at a time and perform the following install steps: ``` kvm -m 2048 -hda /kvm/vms/vm-raring-amd64-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-13.04-server-amd64.iso -boot d -smp 2 -cpu qemu64 -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:2279-:22 kvm -m 2048 -hda /kvm/vms/vm-raring-i386-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-13.04-server-i386.iso -boot d -smp 2 -cpu qemu64 -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:2280-:22 ``` Once running you can connect to the VNC server from your local host with: ``` vncviewer -via ${remote-host} localhost ``` Replace ${remote-host} with the host the vm is running on. **Note:** When you activate the install, vncviewer may disconnect with a complaint about the rect being too large. This is fine. Ubuntu has just resized the vnc screen. Simply reconnect. Install, picking default options mostly, with the following notes: * Set the hostname to ubuntu-raring-amd64 or ubuntu-raring-i386 * When partitioning disks, choose "Guided - use entire disk" (we do not want LVM) * No automatic updates * Choose software to install: OpenSSH server Now that the VM is installed, it's time to configure it. If you have the memory you can do the following simultaneously: ``` kvm -m 2048 -hda /kvm/vms/vm-raring-amd64-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-13.04-server-amd64.iso -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:2279-:22 -nographic kvm -m 2048 -hda /kvm/vms/vm-raring-i386-serial.qcow2 -cdrom /kvm/iso/ubuntu/ubuntu-13.04-server-i386.iso -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:2280-:22 -nographic ssh -p 2279 localhost # edit /boot/grub/menu.lst and visudo, see below ssh -p 2280 localhost # edit /boot/grub/menu.lst and visudo, see below ssh -t -p 2279 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" ssh -t -p 2280 localhost "mkdir -v .ssh; sudo addgroup $USER sudo" scp -P 2279 /kvm/vms/authorized_keys localhost:.ssh/ scp -P 2280 /kvm/vms/authorized_keys localhost:.ssh/ echo $'Buildbot\n\n\n\n\ny' | ssh -p 2279 localhost 'chmod -vR go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir -v ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' echo $'Buildbot\n\n\n\n\ny' | ssh -p 2280 localhost 'chmod -vR go-rwx .ssh; sudo adduser --disabled-password buildbot; sudo addgroup buildbot sudo; sudo mkdir -v ~buildbot/.ssh; sudo cp -vi .ssh/authorized_keys ~buildbot/.ssh/; sudo chown -vR buildbot:buildbot ~buildbot/.ssh; sudo chmod -vR go-rwx ~buildbot/.ssh' scp -P 2279 /kvm/vms/ttyS0.conf buildbot@localhost: scp -P 2280 /kvm/vms/ttyS0.conf buildbot@localhost: ssh -p 2279 buildbot@localhost 'sudo apt-get update && sudo apt-get -y dist-upgrade;' ssh -p 2280 buildbot@localhost 'sudo apt-get update && sudo apt-get -y dist-upgrade;' ssh -p 2279 buildbot@localhost 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ssh -p 2280 buildbot@localhost 'sudo cp -vi ttyS0.conf /etc/init/; rm -v ttyS0.conf; sudo shutdown -h now' ``` Enabling passwordless sudo: ``` sudo VISUAL=vi visudo # Add line at end: `%sudo ALL=NOPASSWD: ALL' ``` Editing /boot/grub/menu.lst: ``` sudo vi /etc/default/grub # Add/edit these entries: GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=0 GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL="serial" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" sudo update-grub # exit back to the host server ``` VMs for building .debs ---------------------- ``` for i in '/kvm/vms/vm-raring-amd64-serial.qcow2 2279 qemu64' '/kvm/vms/vm-raring-i386-serial.qcow2 2280 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/build/')" \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/boost_1_49_0.tar.gz buildbot@localhost:/dev/shm/" \ "= scp -P $2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /kvm/thrift-0.9.0.tar.gz buildbot@localhost:/dev/shm/" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get -y build-dep mysql-server-5.5" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts hardening-wrapper fakeroot doxygen texlive-latex-base ghostscript libevent-dev libssl-dev zlib1g-dev libpam0g-dev libreadline-gplv2-dev autoconf automake automake1.9 dpatch ghostscript-x libfontenc1 libjpeg62 libltdl-dev libltdl7 libmail-sendmail-perl libxfont1 lmodern texlive-latex-base-doc ttf-dejavu ttf-dejavu-extra libaio-dev xfonts-encodings xfonts-utils libxml2-dev unixodbc-dev bzr" \ "bzr co --lightweight lp:mariadb-native-client" \ "cd /usr/local/src;sudo tar zxf /dev/shm/thrift-0.9.0.tar.gz;pwd;ls" \ "cd /usr/local/src/thrift-0.9.0;echo;pwd;sudo ./configure --prefix=/usr --enable-shared=no --enable-static=yes CXXFLAGS=-fPIC CFLAGS=-fPIC && echo && echo 'now making' && echo && sleep 3 && sudo make && echo && echo 'now installing' && echo && sleep 3 && sudo make install" \ "cd /usr/local/src;sudo tar zxf /dev/shm/boost_1_49_0.tar.gz;cd /usr/local/include/;sudo ln -vs ../src/boost_1_49_0/boost ." ; \ done ``` VMs for install testing. ------------------------ See [Buildbot Setup for Virtual Machines - General Principles](../buildbot-setup-for-virtual-machines-general-principles/index) for how to obtain `my.seed` and `sources.append`. ``` for i in '/kvm/vms/vm-raring-amd64-serial.qcow2 2279 qemu64' '/kvm/vms/vm-raring-i386-serial.qcow2 2280 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/install/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "sudo debconf-set-selections /tmp/my55.seed" \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'"; \ done ``` VMs for MySQL upgrade testing ----------------------------- ``` for i in '/kvm/vms/vm-raring-amd64-serial.qcow2 2279 qemu64' '/kvm/vms/vm-raring-i386-serial.qcow2 2280 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade/')" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "sudo debconf-set-selections /tmp/my55.seed" \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server-5.5' \ 'mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' ;\ done ``` VMs for MariaDB upgrade testing ------------------------------- *The steps below are based on the Natty steps on [Installing VM images for testing .deb upgrade between versions](../installing-vm-images-for-testing-deb-upgrade-between-versions/index).* ``` for i in '/kvm/vms/vm-raring-amd64-serial.qcow2 2279 qemu64' '/kvm/vms/vm-raring-i386-serial.qcow2 2280 qemu64' ; do \ set $i; \ runvm --user=buildbot --logfile=kernel_$2.log --base-image=$1 --port=$2 --cpu=$3 "$(echo $1 | sed -e 's/serial/upgrade2/')" \ "= scp -P $2 /kvm/vms/my55.seed /kvm/vms/sources.append buildbot@localhost:/tmp/" \ "= scp -P $2 /kvm/vms/mariadb-raring.list buildbot@localhost:/tmp/tmp.list" \ "sudo debconf-set-selections /tmp/my55.seed" \ 'sudo mv -vi /tmp/tmp.list /etc/apt/sources.list.d/' \ 'sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 0xcbcb082a1bb943db' \ "sudo DEBIAN_FRONTEND=noninteractive apt-get update" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server mariadb-server-5.5 mariadb-client mariadb-client-5.5 mariadb-test libmariadbclient-dev mysql-common=5.5.30-mariadb1~quantal libmysqlclient18=5.5.30-mariadb1~quantal' \ 'mysql -uroot -prootpass -e "create database mytest; use mytest; create table t(a int primary key); insert into t values (1); select * from t"' \ 'sudo rm -v /etc/apt/sources.list.d/tmp.list' \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get update' \ "sudo sh -c 'cat /tmp/sources.append >> /etc/apt/sources.list'" \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y patch libaio1 debconf-utils' \ 'sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y'; \ done ``` Add Key to known\_hosts ----------------------- Do the following on each kvm host server (terrier, terrier2, i7, etc...) to add the VMs to known\_hosts. ``` # raring-amd64 cp -avi /kvm/vms/vm-raring-amd64-install.qcow2 /kvm/vms/vm-raring-amd64-test.qcow2 kvm -m 1024 -hda /kvm/vms/vm-raring-amd64-test.qcow2 -redir tcp:2279::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic sudo su - buildbot ssh -p 2279 buildbot@localhost sudo shutdown -h now # answer "yes" when prompted exit # the buildbot user rm -v /kvm/vms/vm-raring-amd64-test.qcow2 # raring-i386 cp -avi /kvm/vms/vm-raring-i386-install.qcow2 /kvm/vms/vm-raring-i386-test.qcow2 kvm -m 1024 -hda /kvm/vms/vm-raring-i386-test.qcow2 -redir tcp:2280::22 -boot c -smp 2 -cpu qemu64 -net nic,model=virtio -net user -nographic sudo su - buildbot ssh -p 2280 buildbot@localhost sudo shutdown -h now # answer "yes" when prompted exit # the buildbot user rm -v /kvm/vms/vm-raring-i386-test.qcow2 ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BACKUP LOCK BACKUP LOCK =========== **MariaDB starting with [10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/)**The BACKUP LOCK command was introduced in [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/). BACKUP LOCK blocks a table from DDL statements. This is mainly intended to be used by tools like [mariabackup](../mariabackup/index) that need to ensure there are no DDLs on a table while the table files are opened. For example, for an Aria table that stores data in 3 files with extensions .frm, .MAI and .MAD. Normal read/write operations can continue as normal. Syntax ------ To lock a table: ``` BACKUP LOCK table_name ``` To unlock a table: ``` BACKUP UNLOCK ``` Usage in a Backup Tool ---------------------- ``` BACKUP LOCK [database.]table_name; - Open all files related to a table (for example, t.frm, t.MAI and t.MYD) BACKUP UNLOCK; - Copy data - Close files ``` This ensures that all files are from the same generation, that is created at the same time by the MariaDB server. This works, because the open files will point to the original table files which will not be affected if there is any ALTER TABLE while copying the files. Privileges ---------- BACKUP LOCK requires the [RELOAD](../grant/index) privilege. Notes ----- * The idea is that the `BACKUP LOCK` should be held for as short a time as possible by the backup tool. The time to take an uncontested lock is very short! One can easily do 50,000 locks/unlocks per second on low end hardware. * One should use different connections for [BACKUP STAGE](../backup-stage/index) commands and `BACKUP LOCK`. Implementation -------------- * Internally, BACKUP LOCK is implemented by taking an `MDLSHARED_HIGH_PRIO` MDL lock on the table object, which protects the table from any DDL operations. See Also -------- * [BACKUP STAGE](../backup-stage/index) * [MDEV-17309](https://jira.mariadb.org/browse/MDEV-17309) - BACKUP LOCK: DDL locking of tables during backup Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Optimizer Hints Optimizer Hints =============== Optimizer hints --------------- There are some options available in [SELECT](../select/index) to affect the execution plan. These are known as optimizer hints. #### HIGH PRIORITY `HIGH_PRIORITY` gives the statement a higher priority. If the table is locked, high priority `SELECT`s will be executed as soon as the lock is released, even if other statements are queued. `HIGH_PRIORITY` applies only if the storage engine only supports table-level locking (`MyISAM`, `MEMORY`, `MERGE`). See [HIGH\_PRIORITY and LOW\_PRIORITY clauses](../high_priority-and-low_priority-clauses/index) for details. #### SQL\_CACHE / SQL\_NO\_CACHE If the [query\_cache\_type](../server-system-variables/index#query_cache_type) system variable is set to 2 or `DEMAND`, and the current statement is cacheable, `SQL_CACHE` causes the query to be cached and `SQL_NO_CACHE` causes the query not to be cached. For `UNION`s, `SQL_CACHE` or `SQL_NO_CACHE` should be specified for the first query. See also [The Query Cache](../the-query-cache/index) for more detail and a list of the types of statements that aren't cacheable. #### SQL\_BUFFER\_RESULT `SQL_BUFFER_RESULT` forces the optimizer to use a temporary table to process the result. This is useful to free locks as soon as possible. #### SQL\_SMALL\_RESULT / SQL\_BIG\_RESULT `SQL_SMALL_RESULT` and `SQL_BIG_RESULT` tell the optimizer whether the result is very big or not. Usually, `GROUP BY` and `DISTINCT` operations are performed using a temporary table. Only if the result is very big, using a temporary table is not convenient. The optimizer automatically knows if the result is too big, but you can force the optimizer to use a temporary table with `SQL_SMALL_RESULT`, or avoid the temporary table using `SQL_BIG_RESULT`. #### STRAIGHT\_JOIN `STRAIGHT_JOIN` applies to the [JOIN](../join/index) queries, and tells the optimizer that the tables must be read in the order they appear in the `SELECT`. For `const` and `system` table this options is sometimes ignored. #### SQL\_CALC\_FOUND\_ROWS `SQL_CALC_FOUND_ROWS` is only applied when using the `LIMIT` clause. If this option is used, MariaDB will count how many rows would match the query, without the `LIMIT` clause. That number can be retrieved in the next query, using [FOUND\_ROWS()](../found_rows/index). #### USE/FORCE/IGNORE INDEX `USE INDEX`, `FORCE INDEX` and `IGNORE INDEX` constrain the query planning to a specific index. For further information about some of these options, see [How to force query plans](../how-to-force-query-plans/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Preparing for ColumnStore Installation - 1.2.0 Preparing for ColumnStore Installation - 1.2.0 ============================================== ### Prerequisite With the 1.2.0 version of MariaDB ColumnStore, there should be no versions of MariaDB Server or MySQL pre-installed on the OS before a MariaDB ColumnStore binary or RPM is installed on the system. If you have an installation of MariaDB server, uninstall it before proceeding. #### Configuration preparation Before installing MariaDB ColumnStore, there is some preparation necessary. You will need to determine the following. Please refer to the MariaDB ColumnStore Architecture Document for additional information. * How many User Modules (UMs) will your system need? * How many Performance Modules (PMs) will your system need? * How much disk space will your system need? * Would have passwordless ssh access between PMs? * Do you want to run the install as root or noon-root? ##### OS information MariaDB ColumnStore is certified to run on: RHEL/CentOS v6, v7 Ubuntu 16.04 LTS, Ubuntu 18.04 LTS Debian v8, v9 SUSE 12 but it should run on any recent Linux system. Make sure the same OS is installed on all the servers for a multi-node system. Make sure the locale setting on all servers are all the same. To set locale to en\_US and UTf-8, run: ``` # localedef -i en_US -f UTF-8 en_US.UTF-8 ``` ##### System administration information Information your system administrator must provide you before you start installing MariaDB ColumnStore: * The hostnames of each interface on each node (optional). * The IP address of each interface on each node. * The root/non-root password for the nodes (all nodes must have the same root/non-root password or root/non-root ssh keys must be set up between servers). MariaDB ColumnStore can be installed as root or a non-root user. Example for 3 PM, 1UM system, these are the steps required to configure PM-1 for passwordless ssh. The equivalent steps must be repeated on every PM in the system. The equivalent steps must be repeated on every UM in the system if the MariaDB ColumnStore Data Replication feature is enabled during the install process. ``` [root@pm- 1 ~] $ ssh-keygen [root@pm- 1 ~] $ ssh-copy-id -i ~/.ssh/id_rsa.pub pm-1 [root@pm- 1 ~] $ ssh-copy-id -i ~/.ssh/id_rsa.pub pm-2 [root@pm- 1 ~] $ ssh-copy-id -i ~/.ssh/id_rsa.pub pm-3 [root@pm- 1 ~] $ ssh-copy-id -i ~/.ssh/id_rsa.pub um-1 ``` If utilizing ssh-keys and will be utilizing the MariaDB ColumnStore Data Redundancy feature, make sure you setup an ssh-key on the PM1 node to itself. This is required for Data Redundancy feature. If utilizing ssh-keys and will be utilizing the MariaDB ColumnStore Data Replication feature, make sure you setup an ssh-key between all UM nodes. And if you enabled the Local Query Feature, will also need between all UM nodes and all PM nodes. ##### Network configuration MariaDB ColumnStore is quite flexible regarding networking. Some options are as follows: * The interconnect between UMs and PMs can be one or more private VLANs. In this case MariaDB ColumnStore will automatically trunk the individual LANs together to provide greater effective bandwidth between the UMs and PMs. * The PMs do not require a public LAN access as they only need to communicate with the UMs, unless the local query feature is desired. * The UMs most likely require at least one public interface to access the MySQL server front end from the site LAN. This interface can be a separate physical or logical connection from the PM interconnect. * You can use whatever security your site requires on the public access to the MySQL server front end on the UMs. By default it is listening on port 3306. * MariaDB ColumnStore software only requires a TCP/IP stack to be present to function. You can use any physical layer you desire. #### MariaDB ColumnStore port usage The MariaDB ColumnStore daemon utilizes port 3306. You must reserve the following ports to run the MariaDB ColumnStore software: 8600 - 8630, 8700, and 8800 #### Storage and Database files (DBRoots) MariaDB ColumnStore supports being able to configure with different Storage options. * Internal - Meaning you will be utilize the local root level storage on the server. Also with the Internal storage option, you can use soft-links to map the root level data directory to a SAN storage device. With Internal storage setup, there is no High/Availability Performance Module Failover capabilities. This is one of the limitations to using Internal (local) storage. * External - Meaning to can map the root level data directory to EXTx SAN storage devices and have all of the Data directories (DBRoot) configured in the Fstab to have shared mounting to all Performance Modules in the system. With External storage setup, there is High/Availability Performance Module Failover capabilities supported. Meaning if a Performance Module was to go down, another Performance Module would automatically mount to the DBRoots that were previously mounted to the downed Performance Module. Then the system functionality would still be working since the system has access to all the of data on the DBRoots. * Data Redundancy - This feature is support in 1.1 versions and later. MariaDB ColumnStore supports Data Redundancy on both internal root level data directories or if you have them mounted with EXTx SAN devices. For Data Redundancy to be an option, the user is required to install the Third Party GlusterFS software on all Performance Module. This is discussed later the the Package Dependency section. With Data Redundancy storage setup, High/Availability Performance Module Failover capabilities is supported. With H/A, Performance Module was to go down, another Performance Module will have a copy of the DBRoots that were on the downed Performance Module. Then the system functionality would still be working since the system has access to all the of data on the DBRoots. DBRoots are the MariaDB ColumnStore Datafile containers or directories. For example on a root install, they are /usr/local/mariadb/columnstore/data<N> where N is the dbroot number. IMPORTANT: When using Storage (extX, NFS, etc), setup to have the MariaDB front-end data and the DBRoots back-end data files mounted. Don't setup a mount where the actually MariaDB Columnstore package as a whole is mounted, i.e. /usr/local/mariadb or /usr/local/mariadb/columnstore. This would included mounts for: * /usr/local/mariadb/columnstore/mysql/db # optional for the front-end schemas and non-Columnstore data * /usr/local/mariadb/columnstore/dataX # DBroots, Columnstore data ##### Local database files If you are using local disk to store the database files, the DBRoot directories will be created under the installation directory, for example /usr/local/mariadb/columnstore/data<N> where N is the DBRoot number. You should setup to have 1 DBRoot per Performance Module when configuring the system. Use of soft-links for the Data If you want to setup an install where the Data is stored out in a separate directory in the case you have limit amount local storage, this can be done. It is recommended that the soft-links be setup at the Data Directory Levels, like mariadb/columnstore/data and mariadb/columnstore/dataX. With this setup, you can perform upgrades using any of the package types, rpm, debian, or binary. In the case where you prefer OR have to set a soft-link at the top directory, like /usr/local/mariadb, you will need to install using the binary package. If you install using the rpm package and tool, this soft-link will be deleted when you perform the upgrade process and the upgrade will fail. ##### SAN mounted database files If you are using a SAN to store the database files, the following must be taken into account: * Each of these DBRoots must be a separate, mountable partition/directory * You might have more than 1 DBRoot assigned to a Performance Module and you can have different number of DBroots per Performance Module, but its recommend to have the same number and same physical size of the storage device on each Performance Module. Here is an example: If you setup 1 Performance Module and you have 2 separate devices that aren't stripped, then you would configure 2 DBRoots to this 1 Performance Module and setup the /etc/fstab with 2 mounts. * MariaDB ColumnStore will run on most Linux filesystems, but we test most heavily with EXT2. You should have no problems with EXT3 or EXT4, but the journaling in these filesystems can be expensive for a database application. You should carefully evaluate the write characteristics of your chosen filesystem to make sure they meet your specific business needs. In any event, MariaDB ColumnStore writes relatively few, very large (64MB) files. You should consult with your Linux system administrator to see if configuring a larger bytes-per-inode setting than the default is available in your chosen filesystem. * MariaDB ColumnStore supports High Availability failover in the case where a Performance Module was to go down when you are using SAN storage devices. To setup a system to support this, all of the SAN devices would need to be mountable to all of the Performance Modules. So in a system that had 2 Performance Modules and each one had 1 SAN device. If 1 of the Performance Modules was to go offline, the system would automatically detect this and would remount the SAN device from the downed module to the 1 active Performance Module. And the system would be able to continue to perform while the module remain offline. * The fstab file must be set up (/etc/fstab). These entries would need to be added to each PM pointing to the all the dbroot(s) being used on all PMs. The 'noauto' option indicates that all dbroots will be associated to every PM but will not be automatically mounted at server startup. The associated dbroots that are assigned to each PM will be specifically mounted to that PM at Columnstore startup. The following example shows an /etc/fstab setup for 2 dbroots total for all PMs, but they can setup any disk type they want: ``` /dev/sda1 /usr/local/mariadb/columnstore/data1 ext2 noatime,nodiratime,noauto 0 0 /dev/sdd1 /usr/local/mariadb/columnstore/data2 ext2 noatime,nodiratime,noauto 0 0 ``` #### Performance optimization considerations There are optimizations that should be made when using MariaDB ColumnStore listed below. As always, please consult with your network administrator for additional optimization considerations for your specific installation needs. ##### GbE NIC settings: * Modify /etc/rc.d/rc.local to include the following: ``` /sbin/ifconfig eth0 txqueuelen 10000 ``` * Modify /etc/sysctl.conf for the following: ``` # increase TCP max buffer size net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 # increase Linux autotuning TCP buffer limits # min, default, and max number of bytes to use net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 # don't cache ssthresh from previous connection net.ipv4.tcp_no_metrics_save = 1 # recommended to increase this for 1000 BT or higher net.core.netdev_max_backlog = 2500 # for 10 GigE, use this net.core.netdev_max_backlog = 30000 NOTE: Make sure there is only 1 setting of net.core.netdev_max_backlog in the /etc/sysctl.conf file. ``` * Cache memory settings: To optimize Linux to cache directories and inodes the vm.vfs\_cache\_pressure can be set to a lower value than 100 to attempt to retain caches for inode and directory structures. This will help improve read performance. A value of 10 is suggested. The following commands must all be run as the root user or with sudo. To check the current value: ``` cat /proc/sys/vm/vfs_cache_pressure ``` To set the current value until the next reboot: ``` sysctl -w vm.vfs_cache_pressure=10 ``` To set the value permanently across reboots, add the following to /etc/sysctl.conf: ``` vm.vfs_cache_pressure = 10 ``` #### System settings considerations ##### umask setting The default setting of 022 in /etc/profile is what is recommended. It it required that it the setting doesn't end with a 7, like 077. Example, on a root install, mysqld that runs as 'mysql' user needs to be able to read the MariaDB ColumnStore configuration file, Columnstore.xml. So a last digit of 7 would prevent this and cause the install to fail. The current umask can be determined: ``` umask ``` A value of 022 can be set in the current session or in /etc/profile as follows: ``` umask 022 ``` #### Firewall considerations The MariaDB ColumnStore utilizes these ports 3306, 8600 - 8630, 8700, and 8800. So on multi-node installs, these ports will need to be accessible between the servers. So if there is any firewall software running on the system that could block these ports, either that firewall would need to be disabled as shown below or the ports listed above will need to be configured to allow both input and output on all servers within the firewall software. You will also want to allow these ports to be passed though on any routers that might be connected between the servers. To disable any local firewalls and SELinux on mutli-node installs You must be a Root user. CentOS 6 and systems using iptables ``` #service iptables save (Will save your existing IPTable Rules) #service iptables stop (It will disable firewall Temporary) ``` To Disable it Permanentely: ``` #chkconfig iptables off ``` CentOS 7 and systems using systemctl with firewalld installed ``` #systemctl status firewalld #systemctl stop firewalld #systemctl disable firewalld ``` Ubuntu and systems using ufw ``` #service ufw stop (It will disable firewall Temporary) ``` To Disable it Permanently: ``` #chkconfig ufw off ``` SUSE ``` #/sbin/rcSuSEfirewall2 status #/sbin/rcSuSEfirewall2 stop ``` To disable SELinux, ``` edit file "/etc/selinux/config" and find line; SELINUX=enforcing Now replace it with, SELINUX=disabled ``` ### Package dependencies All packages should be install as root user or use 'sudo' command when installing as non-root uster #### Boost libraries MariaDB ColumnStore requires that the boost package of 1.53 or newer is installed. For Centos 7, Ubuntu 16, Debian 8, SUSE 12 and other newer OS's, you can just install the boost packages via yum or apt-get. ``` # yum -y install boost ``` or ``` # apt-get -y install libboost-all-dev ``` For CentOS 6, you can either download and install the MariaDB Columnstore Centos 6 boost library package or install the boost source of 1.55 and build it to generate the required libraries. That means both the build and the install machines require this. How to download, go to binaries download page and download "centos6\_boost\_1\_55.tar.gz" <https://mariadb.com/downloads/columnstore> Click All Versions - > 1.0.x -> centos -> x86\_64 Install package on each server in the cluster ``` wget https://downloads.mariadb.com/ColumnStore/1.0.14/centos/x86_64/centos6_boost_1_55.tar.gz tar xfz centos6_boost_1_55.tar.gz -C /usr/lib ldconfig ``` Downloading and build the boost libraries: NOTE: This means that the "Development Tools" group install be done prior to this. ``` yum groupinstall "Development Tools" yum install cmake ``` Here is the procedure to download and build the boost source: ``` cd /usr/ wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz tar zxvf boost_1_55_0.tar.gz cd boost_1_55_0 ./bootstrap.sh --with-libraries=atomic,date_time,exception,filesystem,iostreams,locale,program_options,regex,signals,system,test,thread,timer,log --prefix=/usr ./b2 install ldconfig ``` For SUSE 12, you will need to install the boost-devel package, which is part of the SLE-SDK package. ``` SUSEConnect -p sle-sdk/12.2/x86_64 zypper install boost-devel ``` #### Other packages Make sure these packages are installed on the nodes where the MariaDB ColumnStore packages will be installed: ##### Centos 6/7 ``` # yum -y install expect perl perl-DBI openssl zlib file sudo libaio rsync snappy net-tools numactl-libs nmap ``` ##### Ubuntu 16/18 ``` # apt-get -y install tzdata libtcl8.6 expect perl openssl file sudo libdbi-perl libboost-all-dev libreadline-dev rsync libsnappy1v5 net-tools libnuma1 nmap ``` ##### Debian 8 ``` # apt-get install expect perl openssl file sudo libdbi-perl libboost-all-dev libreadline-dev rsync libsnappy1 net-tools libnuma1 nmap ``` ##### Debian 9 ``` # apt-get install expect perl openssl file sudo libdbi-perl libboost-all-dev libreadline-dev rsync net-tools libsnappy1v5 libreadline5 libaio1 libnuma1 nmap ``` ##### SUSE 12 ``` zypper install expect perl perl-DBI openssl file sudo libaio1 rsync net-tools libsnappy1 libnuma1 nmap ``` #### Data Redundancy packages In 1.1.0 and later, MariaDB ColumnStore supports Data Redundancy by utilize the third party software GlusterFS. So if you wanted to utilize the Data Redundancy feature, you would need to install the the GlusterFS package on all nodes that will be used as Performance Modules. Requires 3.3.1 version or later. ##### Centos 6/7 ``` # yum -y install centos-release-gluster # yum -y install glusterfs glusterfs-fuse glusterfs-server start / enable service: # systemctl enable glusterd.service # systemctl start glusterd.service ``` ##### Ubuntu 16/18 ``` # apt-get install glusterfs-server attr start / enable service: # systemctl start glusterfs-server.service # systemctl enable glusterfs-server.service ``` ##### Debian 8 ``` # apt-get -y install glusterfs-server attr start / enable service: # update-rc.d glusterfs-server defaults ``` ##### Debian 9 ``` # apt-get install glusterfs-server attr start / enable service: # systemctl start glusterfs-server.service # systemctl enable glusterfs-server.service ``` ##### SUSE 12 ``` # zypper install glusterfs start / enable service: # chkconfig glusterd on ``` #### System Logging Package MariaDB ColumnStore utilizes the System Logging applications for generating logs. So one of the below system logging applications should be install on all servers in the ColumnStore system: * syslog * rsyslog * syslog-ng ### Choosing the type of initial download/install Installing MariaDB ColumnStore with the use of soft-links. If you want to setup an install where the Data is stored out in a separate directory in the case you have limit amount local storage, this can be done. It is required that the soft-links be setup at the Data Directory Levels, like mariadb/columnstore/data and mariadb/columnstore/dataX. With this setup, you can perform upgrades using any of the package types, rpm, debian, or binary. Dont set a softlink at the top directory, like /usr/local/mariadb or /usr/local/mariadb/columnstore. IMPORTANT: Make sure there are no other version of MariaDB server install. If so, these will need to be uninstalled before installing MariaDB ColumnStore. #### Where to Install ##### Non-Distributed Install The default MariaDB ColumnStore installation process supports a Non-Distributed installation functionality for Multi-Node installs. With Non-Distributed, the MariaDB ColumnStore packages needed to be installed on all the nodes. ##### Distributed Install With the Distributed option, MariaDB ColumnStore would distribute the packages across to the other nodes in the system and will install them automatically. MariaDB ColumnStore also supports a Distributed option for Multi-Node installs. With this option, the user can install the MariaDB ColumnStore on Performance Module #1 (pm1) and the postConfigure install script will distribute it to all the nodes in the system. ### Root user installs #### Initial download/install of MariaDB ColumnStore Package Repositories The MariaDB ColumnStore RPM and DEB Packages can be installed using yum/apt-get commands. Check here for additional Information: [https://mariadb.com/kb/en/library/installing-mariadb-ax-from-the-package-repositories](../library/installing-mariadb-ax-from-the-package-repositories) #### Initial download/install of MariaDB ColumnStore Package with the AX package The MariaDB ColumnStore RPM, DEB and binary Packages can be installed along with all of the other packages that make up the AX package. Check here for additional Information: [https://mariadb.com/kb/en/library/columnstore-getting-started-installing-mariadb-ax-from-the-mariadb-download/](../library/columnstore-getting-started-installing-mariadb-ax-from-the-mariadb-download/index) #### Initial download/install of MariaDB ColumnStore RPMs 1. Install MariaDB ColumnStore as user root (use 'su -' to establish a login shell if you access the box using another account): Note: MariaDB ColumnStore installation will install with a single MariaDB userid of root with no password. You may setup users and permissions for a MariaDB ColumnStore-MySQL account just as you would in MySQL. Note: The packages will be installed into /usr/local. This is required for root user installs **Download the package mariadb-columnstore-release#.x86\_64.tar.gz (RHEL5 64-BIT) to the server where you are installing MariaDB ColumnStore and place in the /root directory.** Unpack the tarball, which will generate multiple RPMs that will reside in the /root/ directory. `tar -zxf mariadb-columnstore-release#.x86_64.tar` **Install the RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. `rpm -ivh mariadb-columnstore*release#*.rpm`** #### Initial download/install of MariaDB ColumnStore binary package The MariaDB ColumnStore binary package can be installed from the MariaDB Downloads page. <CLICK> on the "all versions" link and then step down into the OS version to the bottom level directory where you will see 2 packages, one for rpm/deb and the other for the binary. Select the binary package to download. Install MariaDB ColumnStore as user root on the server designated as PM1: Note: You may setup users and permissions for an MariaDB ColumnStore account just as you would in MariaDB. **For root user installs, MariaDB Columnstore needs to run in /usr/local. You can either install directly into /usr/local or install elsewhere and then setup a softlink to /usr/local. Here is an example of setting up a soft-link if you install the binary package in /mnt/mariadb** ``` # ln -s /mnt/mariadb /usr/local ``` * Download the package into the /root/ and copy to /usr/local directory to the server where you are installing MariaDB ColumnStore. ``` cp /root/mariadb-columnstore-release#.x86_64.bin.tar.gz /usr/local/ mariadb-columnstore-release#.x86_64.bin.tar.gz ``` * Unpack the tarball, which will generate the /usr/local/ directory. `tar -zxvf mariadb-columnstore-release#.x86_64.bin.tar.gz` Run the post-install script: ``` /usr/local/mariadb/columnstore/bin/post-install ``` #### Initial download/install of MariaDB ColumnStore DEB package DEB package installs are not supported in the current version, but there is an Ubuntu 16.04 binary package that you can use to install. Just follow the binary package instructions above Install MariaDB ColumnStore on a Debian or Ubuntu OS as user root: Note: You may setup users and permissions for an MariaDB ColumnStore account just as you would in MariaDB. 1. Download the package mariadb-columnstore-release#.amd64.deb.tar.gz (DEB 64- BIT) into the /root directory of the server where you are installing MariaDB ColumnStore. 2. Unpack the tarball, which will generate DEBs. `tar -zxf mariadb-columnstore-release#.amd64.deb.tar.gz` 3. Install the MariaDB ColumnStore DEBs. The MariaDB ColumnStore software will be installed in /usr/ local/. `dpkg -i mariadb-columnstore*release#*.deb` ### Non-root user installs MariaDB Columnstore can be installed to run as a non-root user using the binary tar file installation. These procedures will also allow you to change the installation from the default install directory into a user-specified directory. These procedures will need to be run on all the MariaDB ColumnStore Servers. Non-root user, since the MariaDB Server runs under the user mysql, you can also install the MariaDB ColumnStore package and run as the mysql user. For the purpose of these instructions, the following assumptions are: * Non-root user "mysql" is used in this example * Installation directory is /home/mysql/mariadb/columnstore Tasks involved: * Create the non-root user and group of the same name (by root user) * Update sudo configuration (by root user) * Set the user file limits (by root user) * Modify fstab if using SAN Mounted files (by root user) * Uninstall existing MariaDB Columnstore installation if needed (by root user) * Update permissions on certain directories that MariaDB Columnstore writes (by root user) * MariaDB Columnstore Installation (by non-root user) * Enable MariaDB Columnstore to start automatically at boot time #### Creation of the non-root user (by root user) Before beginning the binary tar file installation you will need your system administrator to set up accounts for you on every MariaDB Columnstore node. The account name must be the same on every node. The password used must be the same on every node. If you subsequently change the password on one node, you must change it on every node. The user-id must be the same on every node as well. In the examples below we will use the account name 'mysql' and the password 'mariadb'. Additionally, every node must have a basic Linux server package setup and additionally have expect (and all its dependencies) installed. * create new user Group ID is an example, can be different than 1000, but needs to be the same on all servers in the cluster `adduser mysql -u 1000` * create group ``` addgroup mysql moduser -g mysql mysql ``` The value for user-id must be the same for all nodes. * Assign password to newly created user `passwd mysql` * Log in as user mysql `su - mysql` * Choose an installation directory in which the non-root user has full read-write access. The installation directory must be the same on every node. In the examples below we will use the path '/home/mysql/mariadb/columnstore'. On each host, the following will be in a /etc/profile.d/columnstore.sh This file is setup during install. ``` export COLUMNSTORE_INSTALL_DIR=$HOME/mariadb/columnstore export PATH=$COLUMNSTORE_INSTALL_DIR/bin:$COLUMNSTORE_INSTALL_DIR/mysql/bin:/usr/sbin:$PATH export LD_LIBRARY_PATH=$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib ``` #### Update sudo configuration (by root user) The sudo configuration file on each node will need to be modified to add in the non-root user. The recommended way is to use the Unix command, visudo. The following example will add the ‘mysql’ user: visudo * Add the following line for the non-root user: ``` mysql ALL=(ALL) NOPASSWD: ALL ``` * Comment out the following line, which will allow the user to login without 'tty': ``` #Defaults requiretty ``` #### Set the user file limits (by root user) ColumnStore needs the open file limit to be increased for the specified user. To do this edit the /etc/security/limits.conf file and make the following additions at the end of the file: ``` mysql hard nofile 65536 mysql soft nofile 65536 ``` If you are already logged in as 'mysql' you will need to log out and back in again for this change to take effect. #### Modify fstab if using SAN Mounted Database Files (by root user) If you are using a SAN to store the database files, an ‘users‘ option will need to be added to the fstab entries (by the root user). For more information, please see the “SAN Mounted Database Files” section earlier in this guide. Example entries: /dev/sda1 /home/mysql/mariadb/columnstore/data1 ext2 noatime,nodiratime,noauto,users 0 0 /dev/sdd1 /home/mariadb/columnstore/data2 ext2 noatime,nodiratime,noauto,users 0 0 The disk device being used will need to have its user permissions set to the non-root user name. This is an example command run as 'root' user setting the user ownership of dbroot /dev/sda1 to non-root user of 'mysql': ``` mke2fs dbroot (i.e., /dev/sda1) mount /dev/sda1 /tmpdir chown -R mysql:mysql /tmpdir umount /tmpdir ``` #### Uninstall existing MariaDB Columnstore installation, if needed (by root user) If MariaDB Columnstore has ever before been installed on any of the planned hosts as a root user install, you must have the system administrator verify that no remnants of that installation exist. The non-root installation will not be successful if there are MariaDB Columnstore files owned by root on any of the hosts. * Verify the MariaDB Columnstore installation directory does not exist: The /usr/local/mariadb/columnstore directory should not exist at all unless it is your target directory, in which case it must be completely empty and owned by the non-root user. * Verify the /etc/fstab entries are correct for the new installation. * Verify the /etc/default/columnstore directory does not exist. * Verify the /var/lock/subsys/mysql-Columnstore file does not exist. * Verify the /tmp/StopColumnstore file does not exist. There should not be any files or directories owned by root in the /tmp directory #### Update permissions on certain directories that MariaDB Columnstore writes (by root user) These directories are written to by MariaDB Columnstore applications. Permissions need to be set to allow the applications to create files. The rootuser must set the permissions to the following: ``` chmod 777 /tmp chmod 777 /dev/shm ``` #### MariaDB Columnstore installation (by non-root user) You should be familiar with the general MariaDB Columnstore installation instructions in this guide as you will be asked the same questions during installation. If performing the MariaDB ColumnStore Multi-node Distributed Installation, the binary package only needs to be installed on Performance Module #1 (pm1). If performing Non-Distributed installs, the binary package is required to install the MariaDB ColumnStore on all the nodes in the system. * Log in as non-root user ( mysql, in our example) Note: Ensure you are at your home directory before proceeding to the next step * Now place the MariaDB Columnstore binary tar file in your home directory on the host you will be using as PM1. Untar the binary distribution package to the /home/mysql directory: tar -xf mariadb-columnstore-release#.x86\_64.bin.tar.gz * Run post installation: If performing the MariaDB ColumnStore Multi-node Distributed Installation, the post-install only needs to be run on Performance Module #1 (pm1). If performing Non-Distributed installs, the post-install needs to be run the MariaDB ColumnStore on all the nodes in the system. ``` ./mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore ``` * Run the 2 export command lines that were outputted by the previous post-install command, which would look like the following. See the “MariaDB Columnstore Configuration” in this guide for more information: ``` export COLUMNSTORE_INSTALL_DIR=/home/mysql/mariadb/columnstore export LD_LIBRARY_PATH=/home/mysql/mariadb/columnstore/lib:/home/mysql/mariadb/columnstore/mysql/lib /home/mysql/mariadb/columnstore/bin/postConfigure -i /home/mysql/mariadb/columnstore ``` * Start MariaDB ColumnStore Service for Non-Distributed installs If performing the MariaDB ColumnStore Multi-node Non-Distributed installs, the 'columnstore' service needs to be started on all the nodes in the system except Performance Module #1 (pm1). postConfigure is run from pm1, which is documented in the next section Starting the 'columnstore' service: ``` ./mariadb/columnstore/bin/columnstore start ``` #### Post-installation (by root user) Optional items to assist in MariaDB Columnstore auto-start and logging: * To configure MariaDB Columnstore to start automatically at boot time, perform the following steps in each Columnstore server: * Add the following to the /etc/rc.local or /etc/rc.d/rc.local (centos7) file: su - mysql -l -c "/home/mysql/mariadb/columnstore/bin/columnstore start" or sudo runuser -l mariadb-user -c "/home/mariadb-user/mariadb/columnstore/bin/columnstore start" Note: Make sure the above entry is added to the rc.local file that gets executed at boot time. Depending on the OS installation, rc.local could be in a different location. * MariaDB Columnstore will setup and log using your current system logging application in the directory /var/log/mariadb/columnstore. ### ColumnStore Cluster Test Tool This tool can be running before doing installation on a single-server or multi-node installs. It will verify the setup of all servers that are going to be used in the Columnstore System. [https://mariadb.com/kb/en/mariadb/mariadb-columnstore-cluster-test-tool](../mariadb/mariadb-columnstore-cluster-test-tool) The next step would be to run the install script postConfigure, check the Single Server Or Multi-Server Install guide. ### ColumnStore Configuration and Installation Tool MariaDB Columnstore System Configuration and Installation tool, 'postConfigure', will Configure the MariaDB Columnstore System and will perform a Package Installation of all of the Servers within the System that is being configured. It will prompt the user to configuration information like server, storage, MariaDB Server, and system features. It updates the MariaDB Columnstore System Configuration File, Columnstore.xml. At the end, it will start up the ColumnStore system. NOTE: When prompted for password, enter the non-user account password OR just hit enter if you have setup the non-root user with password-less ssh keys on all nodes (Please see the “System Administration Information” section earlier in this guide for more information on ssh keys.) This tool is always run on the Performance Module #1. Example uses of this script are shown in the Single and Multi Server Installations Guides. `<<code>>` 1. /usr/local/mariadb/columnstore/bin/postConfigure -h This is the MariaDB ColumnStore System Configuration and Installation tool. It will Configure the MariaDB ColumnStore System based on Operator inputs and will perform a Package Installation of all of the Modules within the System that is being configured. IMPORTANT: This tool should only be run on a Performance Module Server, preferably Module #1 Instructions: Press 'enter' to accept a value in (), if available or Enter one of the options within [], if available, or Enter a new value Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-qa][-port][-i][-n][-d][-sn][-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count] -h Help -c Config File to use to extract configuration data, default is Columnstore.xml.rpmsave -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave If ssh-keys aren't setup, you should provide passwords as command line arguments -p Unix Password, used with no-prompting option -qs Quick Install - Single Server -qm Quick Install - Multi Server -port MariaDB ColumnStore Port Address -i Non-root Install directory, Only use for non-root installs -n Non-distributed install, meaning postConfigure will not install packages on remote nodes -d Distributed install, meaning postConfigure will install packages on remote nodes -sn System Name -pm-ip-addrs Performance Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx -um-ip-addrs User Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb InnoDB System Tablespaces InnoDB System Tablespaces ========================= When InnoDB needs to store general information relating to the system as a whole, rather than a specific table, the specific file it writes to is the system tablespace. By default, this is the `ibdata1` file located in the data directory, (as defined by either the `[datadir](../server-system-variables/index#datadir)` or `[innodb\_data\_home\_dir](../innodb-system-variables/index#innodb_data_home_dir)` system variables). InnoDB uses the system tablespace to store the data dictionary, change buffer, and undo logs. You can define the system tablespace filename or filenames, size and other options by setting the `[innodb\_data\_file\_path](../innodb-system-variables/index#innodb_data_file_path)` system variable. This system variable can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... innodb_data_file_path=ibdata1:50M:autoextend ``` This system variable defaults to the file `ibdata1`, and it defaults to a minimum size of `12M`, and it defaults with the `autoextend` attribute enabled. Changing Sizes -------------- InnoDB defaults to allocating 12M to the `ibdata1` file for the system tablespace. While this is sufficient for most use cases, it may not be for all. You may find after using MariaDB for a while that the allocation is too small for the system tablespace or it grows too large for your disk. Fortunately, you can adjust this size as need later. ### Increasing the Size When setting the `[innodb\_data\_file\_path](../innodb-system-variables/index#innodb_data_file_path)` system variable, you can define a size for each file given. In cases where you need a larger system tablespace, add the `autoextend` option to the last value. ``` [mariadb] ... innodb_data_file_path=ibdata1:12M;ibdata2:50M:autoextend ``` Under this configuration, when the last system tablespace grows beyond the size allocation, InnoDB increases the size of the file by increments. To control the allocation increment, set the `[innodb\_autoextend\_increment](../innodb-system-variables/index#innodb_autoextend_increment)` system variable. ### Decreasing the Size In cases where the InnoDB system tablespace has grown too large, the process to reduce it in size is a little more complicated than increasing the size. MariaDB does not allow you to remove data from the tablespace file itself. Instead you need to delete the tablespace files themselves, then restore the database from backups. The backup utility mysqldump produces backup files containing the SQL statements needed to recreate the database. As a result, it restores a database with the bare minimum data rather than any additional information that might have built up in the tablespace file. Use mysqldump to backup all of your InnoDB database tables, including the system tables in the `mysql` database that use InnoDB. You can find out what they are using the Information Schema. ``` SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'mysql' AND ENGINE = 'InnoDB'; ``` If you only use InnoDB, you may find it easier to back up all databases and tables. ``` $ mysqldump -u root -p --all-databases > full-backup.sql ``` Then stop the MariaDB Server and remove the InnoDB tablespace files. In the data directory or the InnoDB data home directory, delete all the `ibdata` and `ib_log` files as well as any file with an `.ibd` or `.frm` extension. Once this is done, restart the server and import the dump file: ``` $ mysql -u root -p < full-backup.sql ``` Using Raw Disk Partitions ------------------------- Instead of having InnoDB write to the file system, you can set it to use raw disk partitions. On Windows and some Linux distributions, this allows you to perform non-buffered I/O without the file system overhead. Note that in many use cases this may not actually improve performance. Run tests to verify if there are any real gains for your application usage. To enable a raw disk partition, first start MariaDB with the `newraw` option set on the tablespace. For example: ``` [mariadb] ... innodb_data_file_path=/dev/sdc:10Gnewraw ``` When the MariaDB Server starts, it initializes the partition. Don't create or change any data, (any data written to InnoDB at this stage will be lost on restart). Once the server has successful started, stop it then edit the configuration file again, changing the `newraw` keyword to `raw`. ``` [mariadb] ... innodb_data_file_path=/dev/sdc:10Graw ``` When you start MariaDB again, it'll read and write InnoDB data to the given disk partition instead of the file system. ### Raw Disk Partitions on Windows When defining a raw disk partition for InnoDB on the Windows operating system, use the same procedure as defined above, but when defining the path for the `[innodb\_data\_file\_path](../innodb-system-variables/index#innodb_data_file_path)` system variable, use `*./*` at the start. For example: ``` [mariadb] ... innodb_data_file_path=//./E::10Graw ``` The given path is synonymous with the Windows syntax for accessing the physical drive. System Tables within the InnoDB System Tablespace ------------------------------------------------- InnoDB creates some system tables within the InnoDB System Tablespace: * `SYS_DATAFILES` * `SYS_FOREIGN` * `SYS_FOREIGN_COLS` * `SYS_TABLESPACES` * `SYS_VIRTUAL` * `SYS_ZIP_DICT` * `SYS_ZIP_DICT_COLS` These tables cannot be queried. However, you might see references to them in some places, such as in the `[INNODB\_SYS\_TABLES](../information-schema-innodb_sys_tables-table/index)` table in the `[information\_schema](../information-schema-tables/index)` database. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Status Variables Added in MariaDB 10.3 Status Variables Added in MariaDB 10.3 ====================================== This is a list of [status variables](../server-status-variables/index) that were added in the [MariaDB 10.3](../what-is-mariadb-103/index) series. | Variable | Added | | --- | --- | | [Acl\_package\_body\_grants](../server-status-variables/index#acl_package_body_grants) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Acl\_package\_spec\_grants](../server-status-variables/index#acl_package_spec_grants) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_alter\_sequence](../server-status-variables/index#com_alter_sequence) | [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/) | | [Com\_create\_package](../server-status-variables/index#com_create_package) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_create\_package\_body](../server-status-variables/index#com_create_package_body) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_create\_sequence](../server-status-variables/index#com_create_sequence) | [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) | | [Com\_drop\_package](../server-status-variables/index#com_drop_package) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_drop\_package\_body](../server-status-variables/index#com_drop_package_body) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_drop\_sequence](../server-status-variables/index#com_drop_sequence) | [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) | | [Com\_show\_create\_package](../server-status-variables/index#com_show_create_package) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_show\_create\_package\_body](../server-status-variables/index#com_show_create_package_body) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_show\_package\_status](../server-status-variables/index#com_show_package_status) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Com\_show\_package\_body\_status](../server-status-variables/index#com_show_package_body_status) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Feature\_json](../server-status-variables/index#feature_json) | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) | | [Feature\_system\_versioning](../server-status-variables/index#feature_system_versioning) | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) | | [Handler\_tmp\_delete](../server-status-variables/index#handler_tmp_delete) | [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) | | [Innodb\_buffer\_pool\_load\_incomplete](../xtradbinnodb-server-status-variables/index#innodb_buffer_pool_load_incomplete) | [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/) | | [Memory\_used\_initial](../server-status-variables/index#memory_used_initial) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Rpl\_semi\_sync\*](../semisynchronous-replication-plugin-status-variables/index) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Rpl\_transactions\_multi\_engine](../replication-and-binary-log-status-variables/index#rpl_transactions_multi_engine) | [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/) | | [Table\_open\_cache\_active\_instances](../server-status-variables/index#table_open_cache_active_instances) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Table\_open\_cache\_hits](../server-status-variables/index#table_open_cache_hits) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Table\_open\_cache\_misses](../server-status-variables/index#table_open_cache_misses) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Table\_open\_cache\_overflows](../server-status-variables/index#table_open_cache_overflows) | [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) | | [Transactions\_gtid\_foreign\_engine](../replication-and-binary-log-server-status-variables/index#transactions_gtid_foreign_engine) | [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/) | | [Transactions\_multi\_engine](../replication-and-binary-log-server-status-variables/index#transactions_multi_engine) | [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/) | See Also -------- * [System variables added in MariaDB 10.3](../system-variables-added-in-mariadb-103/index) * [Status variables added in MariaDB 10.4](../status-variables-added-in-mariadb-104/index) * [Status variables added in MariaDB 10.2](../status-variables-added-in-mariadb-102/index) * [Status variables added in MariaDB 10.1](../status-variables-added-in-mariadb-101/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Commit ColumnStore Commit ================== The COMMIT statement makes changes to a table permanent. You should only commit changes after you have verified the integrity of the changed data. Once data is committed, it cannot be undone with the ROLLBACK statement. To return the database to its former state, you must restore the data from backups. images here Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Galera 10.0 Changelogs MariaDB Galera 10.0 Changelogs =============================== Changelogs for MariaDB Galera Cluster 10.0.x releases. | Title | Description | | --- | --- | | [MariaDB Galera Cluster 10.0.38 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10038-changelog/) | Status: Stable (GA) | Release Date: 4 Feb 2019 | | [MariaDB Galera Cluster 10.0.37 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10037-changelog/) | Status: Stable (GA) | Release Date: 6 Nov 2018 | | [MariaDB Galera Cluster 10.0.36 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10036-changelog/) | Status: Stable (GA) | Release Date: 7 Aug 2018 | | [MariaDB Galera Cluster 10.0.35 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10035-changelog/) | Status: Stable (GA) | Release Date: 9 May 2018 | | [MariaDB Galera Cluster 10.0.34 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10034-changelog/) | Status: Stable (GA) | Release Date: 6 Feb 2018 | | [MariaDB Galera Cluster 10.0.33 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10033-changelog/) | Status: Stable (GA) | Release Date: 14 Nov 2017 | | [MariaDB Galera Cluster 10.0.32 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10032-changelog/) | Status: Stable (GA) | Release Date: 17 Aug 2017 | | [MariaDB Galera Cluster 10.0.31 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10031-changelog/) | Status: Stable (GA) | Release Date: 2 Jun 2017 | | [MariaDB Galera Cluster 10.0.30 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10030-changelog/) | Status: Stable (GA) | Release Date: 22 Mar 2017 | | [MariaDB Galera Cluster 10.0.29 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10029-changelog/) | Status: Stable (GA) | Release Date: 16 Jan 2017 | | [MariaDB Galera Cluster 10.0.28 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10028-changelog/) | Status: Stable (GA) | Release Date: 7 Nov 2016 | | [MariaDB Galera Cluster 10.0.27 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10027-changelog/) | Status: Stable (GA) | Release Date: 29 Aug 2016 | | [MariaDB Galera Cluster 10.0.26 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10026-changelog/) | Status: Stable (GA) | Release Date: 1 Jul 2016 | | [MariaDB Galera Cluster 10.0.25 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10025-changelog/) | Status: Stable (GA) | Release Date: 3 May 2016 | | [MariaDB Galera Cluster 10.0.24 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10024-changelog/) | Status: Stable (GA) | Release Date: 26 Feb 2015 | | [MariaDB Galera Cluster 10.0.23 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10023-changelog/) | Status: Stable (GA) | Release Date: 24 Dec 2015 | | [MariaDB Galera Cluster 10.0.22 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10022-changelog/) | Status: Stable (GA) | Release Date: 19 Nov 2015 | | [MariaDB Galera Cluster 10.0.21 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10021-changelog/) | Status: Stable (GA) | Release Date: 18 Aug 2015 | | [MariaDB Galera Cluster 10.0.20 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10020-changelog/) | Status: Stable (GA) | Release Date: 27 Jun 2015 | | [MariaDB Galera Cluster 10.0.19 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10019-changelog/) | Status: Stable (GA) | Release Date: 18 May 2015 | | [MariaDB Galera Cluster 10.0.17 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10017-changelog/) | Status: Stable (GA) | Release Date: 11 Mar 2015 | | [MariaDB Galera Cluster 10.0.16 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10016-changelog/) | Status: Stable (GA) | Release Date: 29 Jan 2015 | | [MariaDB Galera Cluster 10.0.15 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10015-changelog/) | Status: Stable (GA) | Release Date: 12 Dec 2014 | | [MariaDB Galera Cluster 10.0.14 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10014-changelog/) | Status: Stable (GA) | Release Date: 16 Oct 2014 | | [MariaDB Galera Cluster 10.0.13 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10013-changelog/) | Status: Stable (GA) | Release Date: 3 Sep 2014 | | [MariaDB Galera Cluster 10.0.12 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10012-changelog/) | Status: Stable (GA) | Release Date: 28 Jun 2014 | | [MariaDB Galera Cluster 10.0.11 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10011-changelog/) | Status: Beta | Release Date: 11 Jun 2014 | | [MariaDB Galera Cluster 10.0.10 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-10010-changelog/) | Status: Beta | Release Date: 22 Apr 2014 | | [MariaDB Galera Cluster 10.0.7 Changelog](https://mariadb.com/kb/en/mariadb-galera-cluster-1007-changelog/) | Status: Alpha | Release Date: 24 Feb 2014 | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema ROCKSDB_CF_OPTIONS Table Information Schema ROCKSDB\_CF\_OPTIONS Table ============================================= The [Information Schema](../information_schema/index) `ROCKSDB_CF_OPTIONS` table is included as part of the [MyRocks](../myrocks/index) storage engine, and contains infomation about MyRocks [column families](../myrocks-column-families/index). The `PROCESS` [privilege](../grant/index) is required to view the table. It contains the following columns: | Column | Description | | --- | --- | | `CF_NAME` | [Column family](../myrocks-column-families/index) name. | | `OPTION_TYPE` | | | `VALUE` | | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Binary Log Formats Binary Log Formats ================== Supported Binary Log Formats ---------------------------- There are three supported formats for [binary log](../binary-log/index) events: * Statement-Based Logging * Row-Based Logging * Mixed Logging Regardless of the format, [binary log](../binary-log/index) events are always stored in a binary format, rather than in plain text. MariaDB includes the [mysqlbinlog](../mysqlbinlog/index) utility that can be used to output [binary log](../binary-log/index) events in a human-readable format. You may want to set the binary log format in the following cases: * If you execute single statements that update many rows, then statement-based logging will be more efficient than row-based logging for the slave to download. * If you execute many statements that don't affect any rows, then row-based logging will be more efficient than statement-based logging for the slave to download. * If you execute statements that take a long time to complete, but they ultimately only insert, update, or delete a few rows in the table, then row-based logging will be more efficient than statement-based logging for the slave to apply. The default, since [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/), is [mixed logging](index#mixed-logging) which is replication-safe and requires less storage space than [row logging](index#row-based-logging). The storage engine API also allows storage engines to set or limit the logging format, which helps reduce errors with replicating between masters and slaves with different storage engines. ### Statement-Based Logging **MariaDB until [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**In [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) and before, statement-based logging is the default. In later versions [mixed logging](index#mixed-logging) is the default. When statement-based logging is enabled, statements are logged to the [binary log](../binary-log/index) exactly as they were executed. Temporary tables created on the master will also be created on the slave. This mode is only recommended where one needs to keep the binary log as small as possible, the master and slave have identical data (including using the same storage engines for all tables), and all functions being used are deterministic (repeatable with the same arguments). Statements and tables using timestamps or auto\_increment are safe to use with statement-based logging. This mode can be enabled by setting the [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) system variable to `STATEMENT`. In certain cases when it would be impossible to execute the statement on the slave, the server will switch to row-based logging for the statement. Some cases of this are: * When replication has been changed from row-based to statement-based and a statement uses data from a temporary table created during row-based mode. In this case, the temporary tables are not stored on the slave, so row logging is the only alternative. * [ALTER TABLE](../alter-table/index) of a table using a storage engine that stores data remotely, such as the [S3 storage engine](../s3-storage-engine/index), to another storage engine. * One is using [SEQUENCE's](../sequences/index) in the statement or the [CREATE TABLE](../create-table/index) definition. In certain cases, a statement may not be deterministic, and therefore not safe for [replication](../replication/index). If MariaDB determines that an unsafe statement has been executed, then it will issue a warning. For example: ``` [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. ``` See [Unsafe Statements for Statement-based Replication](../unsafe-statements-for-statement-based-replication/index) for more information. If you need to execute non-deterministic statements, then it is safer to use mixed logging or row-based. ### Mixed Logging **MariaDB starting with [10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)**In [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) and later, mixed logging is the default. When mixed logging is enabled, the server uses a combination of statement-based logging and row-based logging. Statement-based logging is used by default, but when the server determines a statement may not be safe for statement-based logging, it will use row-based logging instead. See [Unsafe Statements for Statement-based Replication: Unsafe Statements](../unsafe-statements-for-statement-based-replication/index#unsafe-statements) for a list of unsafe statements. During one transaction, some statements may be logged with row logging while others are logged with statement-based logging. This mode can be enabled by setting the [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) system variable to `MIXED`. ### Row-Based Logging When row-based logging is enabled, DML statements are **not** logged to the [binary log](../binary-log/index). Instead, each insert, update, or delete performed by the statement for each row is logged to the [binary log](../binary-log/index) separately. DDL statements are still logged to the [binary log](../binary-log/index). Row-based logging uses more storage than the other log formats but is the safest to use. In practice [mixed logging](index#mixed-logging) should be as safe. If one wants to be able to see the original query that was logged, one can enable [annotated rows events](../annotate_rows_event/index), that is shown with [mysqlbinlog](../mysqlbinlog/index), with [--binlog-annotate-row-events](../replication-and-binary-log-server-system-variables/index#binlog_annotate_row_events). This option is on by default. This mode can be enabled by setting the [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) system variable to `ROW`. Compression of the Binary Log ----------------------------- [Compression of the binary log](../compressing-events-to-reduce-size-of-the-binary-log/index) can be used with any of the binary log formats, but the best results come from using mixed or row-based logging. You can enable compression by using the [--log\_bin\_compress](../replication-and-binary-log-server-system-variables/index#log_bin_compress) startup option. Configuring the Binary Log Format --------------------------------- The format for [binary log](../binary-log/index) events can be configured by setting the [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) system variable. If you have the [SUPER](../grant/index#global-privileges) privilege, then you can change it dynamically with [SET GLOBAL](../set/index#global-session). For example: ``` SET GLOBAL binlog_format='ROW'; ``` You can also change it dynamically for just a specific session with [SET SESSION](../set/index#global-session). For example: ``` SET SESSION binlog_format='ROW'; ``` It can also be set in a server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index) prior to starting up the server. For example: ``` [mariadb] ... binlog_format=ROW ``` Be careful when changing the binary log format when using [replication](../replication/index). When you change the binary log format on a server, it only changes the format for that server. Changing the binary log format on a master has no effect on the slave's binary log format. This can cause replication to give inconsistent results or to fail. Be careful changing the binary log format dynamically when the server is a slave and [parallel replication](../parallel-replication/index) is enabled. If you change the global value dynamically, then that does not also affect the session values of any currently running threads. This can cause problems with [parallel replication](../parallel-replication/index), because the [worker threads](../replication-threads/index#worker-threads) will remain running even after [STOP SLAVE](../stop-slave/index) is executed. This can be worked around by resetting the [slave\_parallel\_threads](../replication-and-binary-log-server-system-variables/index#slave_parallel_threads) system variable. For example: ``` STOP SLAVE; SET GLOBAL slave_parallel_threads=0; SET GLOBAL binlog_format='ROW'; SET GLOBAL slave_parallel_threads=4; START SLAVE ``` Effect of the Binary Log Format on Slaves ----------------------------------------- In [MariaDB 10.0.22](https://mariadb.com/kb/en/mariadb-10022-release-notes/) and later, a slave will apply any events it gets from the master, regardless of the binary log format. The [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) system variable only applies to normal (not replicated) updates. If you are running MySQL or an older MariaDB than 10.0.22, you should be aware of that if you are running the slave in `binlog_format=STATEMENT` mode, the slave will stop if the master is used with `binlog_format` set to anything else than `STATEMENT`. The binary log format is upwards-compatible. This means replication should always work if the slave is the same or a newer version of MariaDB than the master. The mysql Database ------------------ Statements that affect the `mysql` database can be logged in a different way to that expected. If the mysql database is edited directly, logging is performed as expected according to the [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format). Statements that directly edit the mysql database include [INSERT](../insert/index), [UPDATE](../update/index), [DELETE](../delete/index), [REPLACE](../replace/index), [DO](../do/index), [LOAD DATA INFILE](../load-data-infile/index), [SELECT](../select/index), and [TRUNCATE TABLE](../truncate-table/index). If the `mysql` database is edited indirectly, statement logging is used regardless of [binlog\_format](../replication-and-binary-log-server-system-variables/index#binlog_format) setting. Statements editing the `mysql` database indirectly include [GRANT](../grant/index), [REVOKE](../revoke/index), [SET PASSWORD](../set-password/index), [RENAME USER](../rename-user/index), [ALTER](../alter/index), [DROP](../drop/index) and [CREATE](../create/index) (except for the situation described below). CREATE TABLE ... SELECT can use a combination of logging formats. The [CREATE TABLE](../create-table/index) portion of the statement is logged using statement-based logging, while the [SELECT](../select/index) portion is logged according to the value of `binlog_format`. See Also -------- * [Setting up replication](../setting-up-replication/index) * [Compressing the binary log](../compressing-events-to-reduce-size-of-the-binary-log/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb RANK RANK ==== **MariaDB starting with [10.2](../what-is-mariadb-102/index)**The RANK() function was first introduced with [window functions](../window-functions/index) in [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/). Syntax ------ ``` RANK() OVER ( [ PARTITION BY partition_expression ] [ ORDER BY order_list ] ) ``` Description ----------- RANK() is a [window function](../window-functions/index) that displays the number of a given row, starting at one and following the [ORDER BY](../order-by/index) sequence of the window function, with identical values receiving the same result. It is similar to the [ROW\_NUMBER()](../row_number/index) function except that in that function, identical values will receive a different row number for each result. Examples -------- The distinction between [DENSE\_RANK()](../dense_rank/index), RANK() and [ROW\_NUMBER()](../row_number/index): ``` CREATE TABLE student(course VARCHAR(10), mark int, name varchar(10)); INSERT INTO student VALUES ('Maths', 60, 'Thulile'), ('Maths', 60, 'Pritha'), ('Maths', 70, 'Voitto'), ('Maths', 55, 'Chun'), ('Biology', 60, 'Bilal'), ('Biology', 70, 'Roger'); SELECT RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank, DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank, ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num, course, mark, name FROM student ORDER BY course, mark DESC; +------+------------+---------+---------+------+---------+ | rank | dense_rank | row_num | course | mark | name | +------+------------+---------+---------+------+---------+ | 1 | 1 | 1 | Biology | 70 | Roger | | 2 | 2 | 2 | Biology | 60 | Bilal | | 1 | 1 | 1 | Maths | 70 | Voitto | | 2 | 2 | 2 | Maths | 60 | Thulile | | 2 | 2 | 3 | Maths | 60 | Pritha | | 4 | 3 | 4 | Maths | 55 | Chun | +------+------------+---------+---------+------+---------+ ``` See Also -------- * [DENSE\_RANK()](../dense_rank/index) * [ROW\_NUMBER()](../row_number/index) * [ORDER BY](../order-by/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CHAR Function CHAR Function ============= Syntax ------ ``` CHAR(N,... [USING charset_name]) ``` Description ----------- `CHAR()` interprets each argument as an `[INT](../int/index)` and returns a string consisting of the characters given by the code values of those integers. `NULL` values are skipped. By default, `CHAR()` returns a binary string. To produce a string in a given [character set](../data-types-character-sets-and-collations/index), use the optional `USING` clause: ``` SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8)); +---------------------+--------------------------------+ | CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) | +---------------------+--------------------------------+ | binary | utf8 | +---------------------+--------------------------------+ ``` If `USING` is given and the result string is illegal for the given character set, a warning is issued. Also, if strict [SQL mode](../sql_mode/index) is enabled, the result from `CHAR()` becomes `NULL`. Examples -------- ``` SELECT CHAR(77,97,114,'105',97,'68',66); +----------------------------------+ | CHAR(77,97,114,'105',97,'68',66) | +----------------------------------+ | MariaDB | +----------------------------------+ SELECT CHAR(77,77.3,'77.3'); +----------------------+ | CHAR(77,77.3,'77.3') | +----------------------+ | MMM | +----------------------+ 1 row in set, 1 warning (0.00 sec) Warning (Code 1292): Truncated incorrect INTEGER value: '77.3' ``` See Also -------- * [Character Sets and Collations](../data-types-character-sets-and-collations/index) * [ASCII()](../ascii/index) - Return ASCII value of first character * [ORD()](../ord/index) - Return value for character in single or multi-byte character sets * [CHR](../chr/index) - Similar, Oracle-compatible, function Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Spider Differences Between SpiderForMySQL and MariaDB Spider Differences Between SpiderForMySQL and MariaDB ===================================================== ### SQL Syntax * With `SpiderForMySQL`, the [CREATE TABLE](../create-table/index) statement uses `CONNECTION` to define spider table variables whereas MariaDB uses `COMMENT`. ### Features * `[HANDLER](../handler/index)` can not be translated to SQL in MariaDB * Concurrent background search is not yet implemented in MariaDB * Vertical partitioning storage engine VP is not implemented in MariaDB * `CREATE TABLE` can use [table discovery](../table-discovery/index) in MariaDB * `[JOIN](../join-syntax/index)` performance improvement using `[join\_cache\_level](../server-system-variables/index#join_cache_level)>1` and `[join\_buffer\_size](../server-system-variables/index#join_buffer_size)` in MariaDB Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb EXECUTE IMMEDIATE EXECUTE IMMEDIATE ================= **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**EXECUTE IMMEDIATE was introduced in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` EXECUTE IMMEDIATE statement ``` Description ----------- `EXECUTE IMMEDIATE` executes a dynamic SQL statement created on the fly, which can reduce performance overhead. For example: ``` EXECUTE IMMEDIATE 'SELECT 1' ``` which is shorthand for: ``` prepare stmt from "select 1"; execute stmt; deallocate prepare stmt; ``` EXECUTE IMMEDIATE supports complex expressions as prepare source and parameters: ``` EXECUTE IMMEDIATE CONCAT('SELECT COUNT(*) FROM ', 't1', ' WHERE a=?') USING 5+5; ``` Limitations: subselects and stored function calls are not supported as a prepare source. The following examples return an error: ``` CREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN 'SELECT * FROM t1'; EXECUTE IMMEDIATE f1(); ERROR 1970 (42000): EXECUTE IMMEDIATE does not support subqueries or stored functions EXECUTE IMMEDIATE (SELECT 'SELECT * FROM t1'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 'SELECT * FROM t1')' at line 1 CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10; EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING f1(); ERROR 1970 (42000): EXECUTE..USING does not support subqueries or stored functions EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING (SELECT 10); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 10)' at line 1 ``` One can use a user or an SP variable as a workaround: ``` CREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN 'SELECT * FROM t1'; SET @stmt=f1(); EXECUTE IMMEDIATE @stmt; SET @stmt=(SELECT 'SELECT 1'); EXECUTE IMMEDIATE @stmt; CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10; SET @param=f1(); EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING @param; SET @param=(SELECT 10); EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING @param; ``` EXECUTE IMMEDIATE supports user variables and SP variables as OUT parameters ``` DELIMITER $$ CREATE OR REPLACE PROCEDURE p1(OUT a INT) BEGIN SET a:= 10; END; $$ DELIMITER ; SET @a=2; EXECUTE IMMEDIATE 'CALL p1(?)' USING @a; SELECT @a; +------+ | @a | +------+ | 10 | +------+ ``` Similar to PREPARE, EXECUTE IMMEDIATE is allowed in stored procedures but is not allowed in stored functions. This example uses EXECUTE IMMEDIATE inside a stored procedure: ``` DELIMITER $$ CREATE OR REPLACE PROCEDURE p1() BEGIN EXECUTE IMMEDIATE 'SELECT 1'; END; $$ DELIMITER ; CALL p1; +---+ | 1 | +---+ | 1 | +---+ ``` This script returns an error: ``` DELIMITER $$ CREATE FUNCTION f1() RETURNS INT BEGIN EXECUTE IMMEDIATE 'DO 1'; RETURN 1; END; $$ ERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger ``` EXECUTE IMMEDIATE can use DEFAULT and IGNORE indicators as bind parameters: ``` CREATE OR REPLACE TABLE t1 (a INT DEFAULT 10); EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)' USING DEFAULT; SELECT * FROM t1; +------+ | a | +------+ | 10 | +------+ ``` EXECUTE IMMEDIATE increments the [Com\_execute\_immediate](../server-status-variables/index#com_execute_immediate) status variable, as well as the [Com\_stmt\_prepare](../server-status-variables/index#com_stmt_prepare), [Com\_stmt\_execute](../server-status-variables/index#com_stmt_execute) and [Com\_stmt\_close](../server-status-variables/index#com_stmt_close) status variables. Note, EXECUTE IMMEDIATE does not increment the [Com\_execute\_sql](../server-status-variables/index#com_execute_sql) status variable. *Com\_execute\_sql* is used only for [PREPARE](../prepare-statement/index)..[EXECUTE](../execute-statement/index). This session screenshot demonstrates how EXECUTE IMMEDIATE affects status variables: ``` SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE ('COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)'); +-----------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +-----------------------+----------------+ | COM_EXECUTE_IMMEDIATE | 0 | | COM_EXECUTE_SQL | 0 | | COM_STMT_CLOSE | 0 | | COM_STMT_EXECUTE | 0 | | COM_STMT_PREPARE | 0 | +-----------------------+----------------+ EXECUTE IMMEDIATE 'SELECT 1'; +---+ | 1 | +---+ | 1 | +---+ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE ('COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)'); +-----------------------+----------------+ | VARIABLE_NAME | VARIABLE_VALUE | +-----------------------+----------------+ | COM_EXECUTE_IMMEDIATE | 1 | | COM_EXECUTE_SQL | 0 | | COM_STMT_CLOSE | 1 | | COM_STMT_EXECUTE | 1 | | COM_STMT_PREPARE | 1 | +-----------------------+----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LOCALTIMESTAMP LOCALTIMESTAMP ============== Syntax ------ ``` LOCALTIMESTAMP LOCALTIMESTAMP([precision]) ``` Description ----------- `LOCALTIMESTAMP` and `LOCALTIMESTAMP()` are synonyms for `[NOW()](../now/index)`. See Also -------- * [Microseconds in MariaDB](../microseconds-in-mariadb/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb System Tables System Tables ============== | Title | Description | | --- | --- | | [Information Schema](../information-schema/index) | Articles about the Information Schema | | [Performance Schema](../performance-schema/index) | Monitoring server performance. | | [The mysql Database Tables](../the-mysql-database-tables/index) | mysql database tables. | | [Sys Schema](../sys-schema/index) | Collection of views, functions and procedures to help administrators get in... | | [mariadb\_schema](../mariadb_schema/index) | mariadb\_schema is used to enforce MariaDB native types independent of SQL\_MODE. | | [Writing Logs Into Tables](../writing-logs-into-tables/index) | The general query log and the slow query log can be written into system tables | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Status Variables Added in MariaDB 10.4 Status Variables Added in MariaDB 10.4 ====================================== This is a list of [status variables](../server-status-variables/index) that were added in the [MariaDB 10.4](../what-is-mariadb-104/index) series. | Variable | Added | | --- | --- | | [Aborted\_connects\_preauth](../server-status-variables/index#aborted_connects_preauth) | [MariaDB 10.4.5](https://mariadb.com/kb/en/mariadb-1045-release-notes/) | | [Com\_backup](../server-status-variables/index#com_backup) | [MariaDB 10.4.1](https://mariadb.com/kb/en/mariadb-1041-release-notes/) | | [Com\_backup\_lock](../server-status-variables/index#com_backup_lock) | [MariaDB 10.4.2](https://mariadb.com/kb/en/mariadb-1042-release-notes/) | | [Feature\_application\_time\_periods](../server-status-variables/index#feature_application_time_periods) | [MariaDB 10.4.5](https://mariadb.com/kb/en/mariadb-1045-release-notes/) | | [wsrep\_applier\_thread\_count](../galera-cluster-status-variables/index#wsrep_applier_thread_count) | [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/) | | [wsrep\_rollbacker\_thread\_count](../galera-cluster-status-variables/index#wsrep_rollbacker_thread_count) | [MariaDB 10.4.7](https://mariadb.com/kb/en/mariadb-1047-release-notes/) | See Also -------- * [System Variables Added in MariaDB 10.4](../system-variables-added-in-mariadb-104/index) * [Status Variables Added in MariaDB 10.5](../status-variables-added-in-mariadb-105/index) * [Status Variables Added in MariaDB 10.3](../status-variables-added-in-mariadb-103/index) * [Status Variables Added in MariaDB 10.2](../status-variables-added-in-mariadb-102/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Using TLSv1.3 Using TLSv1.3 ============= OpenSSL 1.1.1 introduced support for TLSv1.3. TLSv1.3 is a major rewrite of the TLS protocol. Some even argued it should've been called TLSv2.0. One of the changes is that it introduces a new set of cipher suites that only work with TLSv1.3. Additionally, TLSv1.3 does not support cipher suites from previous TLS protocol versions. This incompatible change had a non-obvious consequence. If a user had been explicitly specifying cipher suites to disable old and obsolete TLS protocol version, then that user may have also inadvertently prevented TLSv1.3 from working, unless the user remembered to add the TLSv1.3 cipher suites to their cipher list. After upgrading to OpenSSL 1.1.1, this user might believe they are using TLSv1.3, when their existing cipher suite configuration might be preventing it. To avoid this problem, OpenSSL developers decided that TLSv1.3 cipher suites should not be affected by the normal cipher-selecting API. This means that `[ssl\_cipher](../ssltls-system-variables/index#ssl_cipher)` system variable has no effect on the TLSv1.3 cipher suites. See this [OpenSSL blog post](https://www.openssl.org/blog/blog/2018/02/08/tlsv1.3/) and [GitHub issue](https://github.com/openssl/openssl/issues/5359) for more information. ### See Also * [Secure Connections Overview](../secure-connections-overview/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InteriorRingN InteriorRingN ============= A synonym for [ST\_InteriorRingN](../st_interiorringn/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP FUNCTION DROP FUNCTION ============= Syntax ------ ``` DROP FUNCTION [IF EXISTS] f_name ``` Description ----------- The DROP FUNCTION statement is used to drop a [stored function](../stored-functions/index) or a user-defined function (UDF). That is, the specified routine is removed from the server, along with all privileges specific to the function. You must have the `ALTER ROUTINE` [privilege](../grant/index) for the routine in order to drop it. If the [automatic\_sp\_privileges](../server-system-variables/index#automatic_sp_privileges) server system variable is set, both the `ALTER ROUTINE` and `EXECUTE` privileges are granted automatically to the routine creator - see [Stored Routine Privileges](../stored-routine-privileges/index). #### IF EXISTS The `IF EXISTS` clause is a MySQL/MariaDB extension. It prevents an error from occurring if the function does not exist. A `NOTE` is produced that can be viewed with [SHOW WARNINGS](../show-warnings/index). For dropping a [user-defined functions](../user-defined-functions/index) (UDF), see [DROP FUNCTION UDF](../drop-function-udf/index). Examples -------- ``` DROP FUNCTION hello; Query OK, 0 rows affected (0.042 sec) DROP FUNCTION hello; ERROR 1305 (42000): FUNCTION test.hello does not exist DROP FUNCTION IF EXISTS hello; Query OK, 0 rows affected, 1 warning (0.000 sec) SHOW WARNINGS; +-------+------+------------------------------------+ | Level | Code | Message | +-------+------+------------------------------------+ | Note | 1305 | FUNCTION test.hello does not exist | +-------+------+------------------------------------+ ``` See Also -------- * [DROP PROCEDURE](../drop-procedure/index) * [Stored Function Overview](../stored-function-overview/index) * [CREATE FUNCTION](../create-function/index) * [CREATE FUNCTION UDF](../create-function-udf/index) * [ALTER FUNCTION](../alter-function/index) * [SHOW CREATE FUNCTION](../show-create-function/index) * [SHOW FUNCTION STATUS](../show-function-status/index) * [Stored Routine Privileges](../stored-routine-privileges/index) * [INFORMATION\_SCHEMA ROUTINES Table](../information-schema-routines-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW AUTHORS SHOW AUTHORS ============ Syntax ------ ``` SHOW AUTHORS ``` Description ----------- The `SHOW AUTHORS` statement displays information about the people who work on MariaDB. For each author, it displays Name, Location, and Comment values. All columns are encoded as latin1. These include: * First the active people in MariaDB are listed. * Then the active people in MySQL. * Last the people that have contributed to MariaDB/MySQL in the past. The order is somewhat related to importance of the contribution given to the MariaDB project, but this is not 100% accurate. There is still room for improvement and debate... Example ------- ``` SHOW AUTHORS\G *************************** 1. row *************************** Name: Michael (Monty) Widenius Location: Tusby, Finland Comment: Lead developer and main author *************************** 2. row *************************** Name: Sergei Golubchik Location: Kerpen, Germany Comment: Architect, Full-text search, precision math, plugin framework, merges etc *************************** 3. row *************************** Name: Igor Babaev Location: Bellevue, USA Comment: Optimizer, keycache, core work *************************** 4. row *************************** Name: Sergey Petrunia Location: St. Petersburg, Russia Comment: Optimizer *************************** 5. row *************************** Name: Oleksandr Byelkin Location: Lugansk, Ukraine Comment: Query Cache (4.0), Subqueries (4.1), Views (5.0) *************************** 6. row *************************** Name: Timour Katchaounov Location: Sofia , Bulgaria Comment: Optimizer *************************** 7. row *************************** Name: Kristian Nielsen Location: Copenhagen, Denmark Comment: Replication, Async client prototocol, General buildbot stuff *************************** 8. row *************************** Name: Alexander (Bar) Barkov Location: Izhevsk, Russia Comment: Unicode and character sets *************************** 9. row *************************** Name: Alexey Botchkov (Holyfoot) Location: Izhevsk, Russia Comment: GIS extensions, embedded server, precision math *************************** 10. row *************************** Name: Daniel Bartholomew Location: Raleigh, USA Comment: MariaDB documentation, Buildbot, releases *************************** 11. row *************************** Name: Colin Charles Location: Selangor, Malesia Comment: MariaDB documentation, talks at a LOT of conferences *************************** 12. row *************************** Name: Sergey Vojtovich Location: Izhevsk, Russia Comment: initial implementation of plugin architecture, maintained native storage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache *************************** 13. row *************************** Name: Vladislav Vaintroub Location: Mannheim, Germany Comment: MariaDB Java connector, new thread pool, Windows optimizations *************************** 14. row *************************** Name: Elena Stepanova Location: Sankt Petersburg, Russia Comment: QA, test cases *************************** 15. row *************************** Name: Georg Richter Location: Heidelberg, Germany Comment: New LGPL C connector, PHP connector *************************** 16. row *************************** Name: Jan Lindström Location: Ylämylly, Finland Comment: Working on InnoDB *************************** 17. row *************************** Name: Lixun Peng Location: Hangzhou, China Comment: Multi Source replication *************************** 18. row *************************** Name: Olivier Bertrand Location: Paris, France Comment: CONNECT storage engine *************************** 19. row *************************** Name: Kentoku Shiba Location: Tokyo, Japan Comment: Spider storage engine, metadata_lock_info Information schema *************************** 20. row *************************** Name: Percona Location: CA, USA Comment: XtraDB, microslow patches, extensions to slow log *************************** 21. row *************************** Name: Vicentiu Ciorbaru Location: Bucharest, Romania Comment: Roles *************************** 22. row *************************** Name: Sudheera Palihakkara Location: Comment: PCRE Regular Expressions *************************** 23. row *************************** Name: Pavel Ivanov Location: USA Comment: Some patches and bug fixes *************************** 24. row *************************** Name: Konstantin Osipov Location: Moscow, Russia Comment: Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0) *************************** 25. row *************************** Name: Ian Gilfillan Location: South Africa Comment: MariaDB documentation *************************** 26. row *************************** Name: Federico Razolli Location: Italy Comment: MariaDB documentation Italian translation *************************** 27. row *************************** Name: Guilhem Bichot Location: Bordeaux, France Comment: Replication (since 4.0) *************************** 28. row *************************** Name: Andrei Elkin Location: Espoo, Finland Comment: Replication *************************** 29. row *************************** Name: Dmitri Lenev Location: Moscow, Russia Comment: Time zones support (4.1), Triggers (5.0) *************************** 30. row *************************** Name: Marc Alff Location: Denver, CO, USA Comment: Signal, Resignal, Performance schema *************************** 31. row *************************** Name: Mikael Ronström Location: Stockholm, Sweden Comment: NDB Cluster, Partitioning, online alter table *************************** 32. row *************************** Name: Ingo Strüwing Location: Berlin, Germany Comment: Bug fixing in MyISAM, Merge tables etc *************************** 33. row *************************** Name: Marko Mäkelä Location: Helsinki, Finland Comment: InnoDB core developer ... ``` ### See Also * [SHOW CONTRIBUTORS](../show-contributors/index). This list [all members and sponsors of the MariaDB Foundation](https://mariadb.org/en/supporters) and other sponsors. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb dbForge Data Compare dbForge Data Compare ==================== [**dbForge Data Compare**](https://www.devart.com/dbforge/mysql/datacompare/) helps compare and synchronize data in MariaDB, MySQL, and Percona databases and scripts folders. With this powerful GIU tool, you can easily find differences between your data, as it helps analyze comparison results, creates a synchronization script, and applies changes. Plus, MariaDB data can be compared with command-line support. dbForge Data Compare Tool Features: ----------------------------------- ### 1. Database Synchronization Features * Create accurate synchronization scripts * Synchronize asynchronous data * Create custom scripts with execution before/after the process of data synchronization * Get warning messages on errors during synchronization ### 2. MySQL & MariaDB Task Automation * Automate routine synchronizations with a command-line interface * Plan your routine execution with Windows Scheduler * Support for PowerShell compatibility ### 3. Script for Folder Data Comparison * Compare data from your database with the data placed in the script folder locally * Choose any database, connection, or script folder with the new Data Comparison Wizard * See the data comparison results in a data result grid ### 4. Rich configurations for data comparison * Enjoy various options for automatic mapping * Compare customized queries * Compare custom keys ### 5. Supported Data * Tables * Views * BLOB data * Compare databases and sync different MariaDB versions ### 6. Broad Compatibility Options * All popular MariaDB server versions * MariaDB set up on Windows, Linux, FreeBSD, etc. * Various cloud services: Amazon RDS, Amazon Aurora, Google Cloud, Oracle MySQL Cloud, Alibaba Cloud * Secure Socket Layer (SSL), Secure Shell (SSH), HTTP Tunneling, PAM Percona security connections ### 7. Manage Comparison Results * Find tables by name * Filter the comparison process results * Enter the values of default comparison options * Group records by type in each compared object ### 8. Export Comparison Results * Use only relevant data in your reports * Generate comparison reports in various formats Download a free 30-day trial of dbForge Data Compare [here](https://www.devart.com/dbforge/mysql/datacompare/download.html). [Documentation](https://docs.devart.com/data-compare-for-mysql) | Version | Introduced | | --- | --- | | dbForge Data Compare 5.7 | Connectivity support for [MariaDB 10.5](../what-is-mariadb-105/index) is added | | dbForge Data Compare 5.5 | Support for [MariaDB 10.4](../what-is-mariadb-104/index) | | dbForge Data Compare 5.4 | Support for [MariaDB 10.3](../what-is-mariadb-103/index) | | dbForge Data Compare 5.3 | Support for [MariaDB 10.2](../what-is-mariadb-102/index), Support for [MariaDB 10.1](../what-is-mariadb-101/index) | | dbForge Data Compare 4.1 | [MariaDB 10.0](../what-is-mariadb-100/index), [MariaDB 5.5](../what-is-mariadb-55/index) | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb GET DIAGNOSTICS GET DIAGNOSTICS =============== ``` GET [CURRENT] DIAGNOSTICS { statement_property [, statement_property] ... | CONDITION condition_number condition_property [, condition_property] ... } statement_property: variable = statement_property_name condition_property: variable = condition_property_name statement_property_name: NUMBER | ROW_COUNT condition_property_name: CLASS_ORIGIN | SUBCLASS_ORIGIN | RETURNED_SQLSTATE | MESSAGE_TEXT | MYSQL_ERRNO | CONSTRAINT_CATALOG | CONSTRAINT_SCHEMA | CONSTRAINT_NAME | CATALOG_NAME | SCHEMA_NAME | TABLE_NAME | COLUMN_NAME | CURSOR_NAME | ROW_NUMBER ``` The [diagnostics area](../diagnostics-area/index) contains information about the errors, warnings and notes which were produced by the last SQL statement. If that statement didn't produce any warnings, the diagnostics area contains information about the last executed statement which involved a table. The GET DIAGNOSTICS statement copies the requested information from the diagnostics area to the specified variables. It is possible to use both user variables or [local variables](../declare-variable/index). To use GET DIAGNOSTICS, it is important to know how the diagnostics area is structured. It has two sub-areas: the statement information area and the error conditions information area. For details, please refer to the [diagnostics area](../diagnostics-area/index) page. Each single GET DIAGNOSTICS command can read information from the statement information area or from a single error condition. This means that, if you have two warnings and you want to know the number of warnings, and read both the warnings, you need to issue GET DIAGNOSTICS three times. The CURRENT keywords adds nothing to the statement, because MariaDB has only one diagnostics area. If GET DIAGNOSTICS produces an error condition (because the command is properly parsed but not correctly used), the diagnostics area is not emptied, and the new condition is added. Getting Information from a Condition ------------------------------------ To read information from a condition, the CONDITION keyword must be specified and it must be followed by the condition number. This number can be specified as a constant value or as a variable. The first condition's index is 1. If the error condition does not exist, the variables will not change their value and a 1758 error will be produced ("Invalid condition number"). The condition properties that can be read with GET DIAGNOSTICS are the same that can be set with SIGNAL and RESIGNAL statements. They are explained in the [diagnostics area](../diagnostics-area/index) page. However, there is one more property: RETURNED\_SQLSTATE, which indicates the condition's [SQLSTATE](../sqlstate/index). For a list of SQLSTATE values and MariaDB error codes, see [MariaDB Error Codes](../mariadb-error-codes/index). The type for all the condition properties is VARCHAR(64), except for MYSQL\_ERRNO, whose valid range is 1 to 65534. **MariaDB starting with [10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/)**ROW\_NUMBER ----------- Until [MariaDB 10.7](../what-is-mariadb-107/index), there was no way, short of parsing the error text, to know in what row an error had happened. From 10.7, one can use the ROW\_NUMBER property to retrieve the row number too, even if the error text does not mention it. Note that this property was named ERROR\_INDEX in the [MariaDB 10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/) preview release. Examples -------- In the following example, a statement generates two warnings, and GET DIAGNOSTICS is used to get the number of warnings: ``` CREATE TABLE `test`.`t` (`c` INT) ENGINE = x; Query OK, 0 rows affected, 2 warnings (0.19 sec) GET DIAGNOSTICS @num_conditions = NUMBER; SELECT @num_conditions; +-----------------+ | @num_conditions | +-----------------+ | 2 | +-----------------+ ``` Then, we can see the warnings: ``` GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE, @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT; SELECT @sqlstate, @errno, @text; +-----------+--------+----------------------------+ | @sqlstate | @errno | @text | +-----------+--------+----------------------------+ | 42000 | 1286 | Unknown storage engine 'x' | +-----------+--------+----------------------------+ GET DIAGNOSTICS CONDITION 2 @sqlstate = RETURNED_SQLSTATE, @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT; SELECT @sqlstate, @errno, @text; +-----------+--------+-------------------------------------------+ | @sqlstate | @errno | @text | +-----------+--------+-------------------------------------------+ | HY000 | 1266 | Using storage engine InnoDB for table 't' | +-----------+--------+-------------------------------------------+ ``` From [MariaDB 10.7](../what-is-mariadb-107/index): ``` INSERT INTO t1 VALUES (4,'d',1.00104),(1,'a',1.00101),(2,'b',1.00102); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' GET DIAGNOSTICS CONDITION 1 @row_num= ROW_NUMBER; SELECT @row_num; +----------+ | @row_num | +----------+ | 2 | +----------+ ``` See Also -------- * [Diagnostics Area](../diagnostics-area/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ENCRYPT ENCRYPT ======= Syntax ------ ``` ENCRYPT(str[,salt]) ``` Description ----------- Encrypts a string using the Unix crypt() system call, returning an encrypted binary string. The `salt` argument should be a string with at least two characters or the returned result will be NULL. If no salt argument is given, a random value of sufficient length is used. It is not recommended to use ENCRYPT() with utf16, utf32 or ucs2 multi-byte character sets because the crypt() system call expects a string terminated with a zero byte. Note that the underlying crypt() system call may have some limitations, such as ignoring all but the first eight characters. If the [have\_crypt](../server-system-variables/index#have_crypt) system variable is set to `NO` (because the crypt() system call is not available), the ENCRYPT function will always return NULL. Examples -------- ``` SELECT ENCRYPT('encrypt me'); +-----------------------+ | ENCRYPT('encrypt me') | +-----------------------+ | 4I5BsEx0lqTDk | +-----------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysqladmin mysqladmin ========== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-admin` is a symlink to `mysqladmin`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-admin` is the name of the script, with `mysqladmin` a symlink . `mysqladmin` is an administration program for the mysqld daemon. It can be used to: * Monitor what the MariaDB clients are doing (processlist) * Get usage statistics and variables from the MariaDB server * Create/drop databases * Flush (reset) logs, statistics and tables * Kill running queries. * Stop the server (shutdown) * Start/stop replicas * Check if the server is alive (ping) Using mysqladmin ---------------- The command to use `mysqladmin` and the general syntax is: ``` mysqladmin [options] command [command-arg] [command [command-arg]] ... ``` ### Options `mysqladmin` supports the following options: | Option | Description | Added | | --- | --- | --- | | `--character-sets-dir=name` | Directory where the [character set](../data-types-character-sets-and-collations/index) files are located. | | | `-C`, `--compress` | Compress all information sent between the client and the server if both support compression. | | | `--connect_timeout=val` | Maximum time in seconds before connection timeout. The default value is 43200 (12 hours). | | | `-c val`, `--count=val` | Number of iterations to make. This works with `-i` (`--sleep`) only. | | | `--debug[=debug_options]`, `-# [debug_options]` | Write a debugging log. A typical debug\_options string is `d:t:o,file_name`. The default is `d:t:o,/tmp/mysqladmin.trace`. | | | `--debug-check` | Check memory and open file usage at exit. | | | `--debug-info` | Print debugging information and memory and CPU usage statistics when the program exits. | | | `--default-auth=plugin` | Default authentication client-side plugin to use. | | | `--default-character-set=name` | Set the default character set. | | | `-f`, `--force` | Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs. | | | `-?`, `--help` | Display this help and exit. | | | `-h name`, `--host=name` | Hostname to connect to. | | | `-l`, `--local` | Suppress the SQL command(s) from being written to the [binary log](../binary-log/index) by enabling [sql\_log\_bin=0](../replication-and-binary-log-server-system-variables/index#sql_log_bin) for the session, or, from [MariaDB 10.2.7](https://mariadb.com/kb/en/mariadb-1027-release-notes/) and [MariaDB 10.1.24](https://mariadb.com/kb/en/mariadb-10124-release-notes/), for flush commands only, using `FLUSH LOCAL` rather than `SET sql_log_bin=0`, so the privilege requirement is RELOAD rather than SUPER. | [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/), [MariaDB 10.1.22](https://mariadb.com/kb/en/mariadb-10122-release-notes/) | | `-b`, `--no-beep` | Turn off beep on error. | | | `-p[password]`, `--password[=password]` | Password to use when connecting to server. If password is not given it's asked from the terminal. | | | `--pipe`, `-W` | On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections. | | | `-P portnum`, `--port=portnum` | Port number to use for connection, or 0 for default to, in order of preference, my.cnf, $MYSQL\_TCP\_PORT, /etc/services, built-in default (3306). | | | `--protocol=name` | The protocol to use for connection (tcp, socket, pipe, memory). | | | `-r`, `--relative` | Show difference between current and previous values when used with `-i`. Currently only works with extended-status. | | | `-O value`, `--set-variable=vaue` | Change the value of a variable. Please note that this option is deprecated; you can set variables directly with `--variable-name=value`. | | | `--shutdown_timeout=val` | Maximum number of seconds to wait for server shutdown. The default value is 3600 (1 hour). | | | `-s`, `--silent` | Silently exit if one can't connect to server. | | | `-i delay`, `--sleep=delay` | Execute commands repeatedly, sleeping for *delay* seconds in between. The `--count` option determines the number of iterations. If `--count` is not given, *mysqladmin* executes commands indefinitely until interrupted. | | | `-S name`, `--socket=name` | For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. | | | `--ssl` | Enables [TLS](../data-in-transit-encryption/index). TLS is also enabled even without setting this option when certain other TLS options are set. Starting with [MariaDB 10.2](../what-is-mariadb-102/index), the `--ssl` option will not enable [verifying the server certificate](../secure-connections-overview/index#server-certificate-verification) by default. In order to verify the server certificate, the user must specify the `--ssl-verify-server-cert` option. | | | `--ssl-ca=name` | Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option implies the `--ssl` option. | | | `--ssl-capath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option is only supported if the client was built with OpenSSL or yaSSL. If the client was built with GnuTLS or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. This option implies the `--ssl` option. | | | `--ssl-cert=name` | Defines a path to the X509 certificate file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | | `--ssl-cipher=name` | List of permitted ciphers or cipher suites to use for [TLS](../data-in-transit-encryption/index). This option implies the `--ssl` option. | | | `--ssl-crl=name` | Defines a path to a PEM file that should contain one or more revoked X509 certificates to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | | `--ssl-crlpath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | | `--ssl-key=name` | Defines a path to a private key file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | | `--ssl-verify-server-cert` | Enables [server certificate verification](../secure-connections-overview/index#server-certificate-verification). This option is disabled by default. | | | `--tls-version=name` | This option accepts a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. See [Secure Connections Overview: TLS Protocol Versions](../secure-connections-overview/index#tls-protocol-versions) for more information. | [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/) | | `-u`, `--user=name` | User for login if not current user. | | | `-v`, `--verbose` | Write more information. | | | `-V`, `--version` | Output version information and exit. | | | `-E`, `--vertical` | Print output vertically. Is similar to '`--relative`', but prints output vertically. | | | `-w[count]`, `--wait[=count]` | If the connection cannot be established, wait and retry instead of aborting. If a *count* value is given, it indicates the number of times to retry. The default is one time. | | | `--wait-for-all-slaves` | Wait for the last binlog event to be sent to all connected replicas before shutting down. This option is off by default. | [MariaDB 10.4.4](https://mariadb.com/kb/en/mariadb-1044-release-notes/) | ### Option Files In addition to reading options from the command-line, `mysqladmin` can also read options from [option files](../configuring-mariadb-with-option-files/index). If an unknown option is provided to `mysqladmin` in an option file, then it is ignored. The following options relate to how MariaDB command-line tools handles option files. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | | `--defaults-group-suffix=#` | In addition to the default option groups, also read option groups with this suffix. | In [MariaDB 10.2](../what-is-mariadb-102/index) and later, `mysqladmin` is linked with [MariaDB Connector/C](../about-mariadb-connector-c/index). However, MariaDB Connector/C does not yet handle the parsing of option files for this client. That is still performed by the server option file parsing code. See [MDEV-19035](https://jira.mariadb.org/browse/MDEV-19035) for more information. #### Option Groups `mysqladmin` reads options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysqladmin]` | Options read by `mysqladmin`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-admin]` | Options read by `mysqladmin`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[client]` | Options read by all MariaDB and MySQL [client programs](../clients-utilities/index), which includes both MariaDB and MySQL clients. For example, `mysqldump`. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[client-mariadb]` | Options read by all MariaDB [client programs](../clients-utilities/index). | mysqladmin Variables -------------------- Variables can be set with `--variable-name=value`. | Variables and boolean options | Value | | --- | --- | | `count` | `0` | | `debug-check` | `FALSE` | | `debug-info` | `FALSE` | | `force` | `FALSE` | | `compress` | `FALSE` | | `character-sets-dir` | *(No default value)* | | `default-character-set` | *(No default value)* | | `host` | *(No default value)* | | `no-beep` | `FALSE` | | `port` | `3306` | | `relative` | `FALSE` | | `socket` | `/var/run/mysqld/mysqld.sock` | | `sleep` | `0` | | `ssl` | `FALSE` | | `ssl-ca` | *(No default value)* | | `ssl-capath` | *(No default value)* | | `ssl-cert` | *(No default value)* | | `ssl-cipher` | *(No default value)* | | `ssl-key` | *(No default value)* | | `ssl-verify-server-cert` | `FALSE` | | `user` | *(No default value)* | | `verbose` | `FALSE` | | `vertical` | `FALSE` | | `connect_timeout` | `43200` | | `shutdown_timeout` | `3600` | mysqladmin Commands ------------------- ``` mysqladmin [options] command [command-arg] [command [command-arg]] ... ``` *Command* is one or more of the following. Commands may be shortened to a unique prefix. | Command | Description | Added | | --- | --- | --- | | `create databasename` | Create a new database. | | | `debug` | Instruct server to write debug information to log. | | | `drop databasename` | Delete a database and all its tables. | | | `extended-status` | Return all [status variables](../server-status-variables/index) and their values. | | | `flush-all-statistics` | Flush all statistics tables | | | `flush-all-status` | Flush status and statistics. | | | `flush-binary-log` | Flush [binary log](../binary-log/index). | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-client-statistics` | Flush client statistics. | | | `flush-engine-log` | Flush engine log. | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-error-log` | Flush [error log](../error-log/index). | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-general-log` | Flush [general query log](../general-query-log/index). | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-hosts` | Flush all cached hosts. | | | `flush-index-statistics` | Flush index statistics. | | | `flush-logs` | Flush all logs. | | | `flush-privileges` | Reload grant tables (same as reload). | | | `flush-relay-log` | Flush [relay log](../relay-log/index). | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-slow-log` | Flush slow query log. | | | `flush-ssl` | Flush SSL certificates. | [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) | | `flush-status` | Clear [status variables](../server-status-variables/index). | | | `flush-table-statistics` | Clear table statistics. | | | `flush-tables` | Flush all tables. | | | `flush-threads` | Flush the thread cache. | | | `flush-user-resources` | Flush user resources. | [MariaDB 10.1.25](https://mariadb.com/kb/en/mariadb-10125-release-notes/), [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/) | | `flush-user-statistics` | Flush user statistics. | | | `kill id,id,...` | Kill mysql threads. | | | `password new-password` | Change old password to new-password. The new password can be passed on the commandline as the next argument (for example, `mysqladmin password "new_password"`, or can be omitted (as long as no other command follows), in which case the user will be prompted for a password. If the password contains special characters, it needs to be enclosed in quotation marks. In Windows, the quotes can only be double quotes, as single quotes are assumed to be part of the password. If the server was started with the [--skip-grant-tables](../mysqld-options/index#-skip-grant-tables) option, changing the password in this way will have no effect. | | | `old-password new-password` | Change old password to new-password using the old pre-MySQL 4.1 format. | | | `ping` | Check if mysqld is alive. Return status is 0 if the server is running (even in the case of an error such as access denied), 1 if it is not. | | | `processlist` | Show list of active threads in server, equivalent to [SHOW PROCESSLIST](../show-processlist/index). With `--verbose`, equivalent to [SHOW FULL PROCESSLIST](../show-processlist/index). | | | `reload` | Reload grant tables. | | | `refresh` | Flush all tables and close and open log files. | | | `shutdown` | Take server down by executing the [SHUTDOWN](../shutdown/index) command on the server. If connected to a local server using a Unix socket file, mysqladmin waits until the server's process ID file has been removed to ensure that the server has stopped properly. See also the `--wait-for-all-slaves` option. | | | `status` | Gives a short status message from the server. | | | `start-all-slaves` | Start all replicas. | | | `start-slave` | Start replication on a replica server. | | | `stop-all-slaves` | Stop all replicas. | | | `stop-slave` | Stop replication on a replica server. | | | `variables` | Prints variables available. | | | `version` | Returns version as well as status info from the server. | | The shutdown Command and the --wait-for-all-slaves Option --------------------------------------------------------- **MariaDB starting with [10.4.4](https://mariadb.com/kb/en/mariadb-1044-release-notes/)**The `--wait-for-all-slaves` option was first added in [MariaDB 10.4.4](https://mariadb.com/kb/en/mariadb-1044-release-notes/). When a master server is shutdown and it goes through the normal shutdown process, the master kills client threads in random order. By default, the master also considers its binary log dump threads to be regular client threads. As a consequence, the binary log dump threads can be killed while client threads still exist, and this means that data can be written on the master during a normal shutdown that won't be replicated. This is true even if [semi-synchronous replication](../semisynchronous-replication/index) is being used. In [MariaDB 10.4](../what-is-mariadb-104/index) and later, this problem can be solved by shutting down the server with the `[mysqladmin](index)` utility and by providing the `--wait-for-all-slaves` option to the utility and by executing the `shutdown` command with the utility. For example: ``` mysqladmin --wait-for-all-slaves shutdown ``` When the `--wait-for-all-slaves` option is provided, the server only kills its binary log dump threads after all client threads have been killed, and it only completes the shutdown after the last [binary log](../binary-log/index) has been sent to all connected replicas. See [Replication Threads: Binary Log Dump Threads and the Shutdown Process](../replication-threads/index#binary-log-dump-threads-and-the-shutdown-process) for more information. Examples -------- Quick check of what the server is doing: ``` shell> mysqladmin status Uptime: 8023 Threads: 1 Questions: 14 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.1 shell> mysqladmin processlist +----+-------+-----------+----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-------+-----------+----+---------+------+-------+------------------+ .... +----+-------+-----------+----+---------+------+-------+------------------+ ``` More extensive information of what is happening 'just now' changing (great for troubleshooting a slow server): ``` shell> mysqladmin --relative --sleep=1 extended-status | grep -v " 0 " ``` Check the variables for a running server: ``` shell> mysqladmin variables | grep datadir | datadir | /my/data/ | ``` Using a shortened prefix for the `version` command: ``` shell> mysqladmin ver mysqladmin Ver 9.1 Distrib 10.1.6-MariaDB, for debian-linux-gnu on x86_64 Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Server version 10.1.6-MariaDB-1~trusty-log Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 1 hour 33 min 33 sec Threads: 1 Questions: 281 Slow queries: 0 Opens: 64 Flush tables: 1 Open tables: 76 Queries per second avg: 0.050 ``` ### Other Ways To Stop mysqld (Unix) If you get the error: ``` mysqladmin: shutdown failed; error: 'Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation' ``` It means that you didn't use `mysqladmin` with a user that has the SUPER or SHUTDOWN privilege. If you don't know the user password, you can still take the mysqld process down with a system `kill` command: ``` kill -SIGTERM pid-of-mysqld-process ``` The above is identical to `mysqladmin shutdown`. On windows you should use: ``` NET STOP MySQL ``` You can use the [SHUTDOWN](../shutdown/index) command from any client. See Also -------- * [SHUTDOWN command](../shutdown/index) * [mytop](http://www.mysqlfanboy.com/mytop-3/), a 'top' like program for MariaDB/MySQL that allows you to see what the server is doing. A mytop optimized for MariaDB is included in [MariaDB 5.3](../what-is-mariadb-53/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb VALUES / VALUE VALUES / VALUE ============== Syntax ------ **MariaDB starting with [10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/)** ``` VALUE(col_name) ``` **MariaDB until [10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/)** ``` VALUES(col_name) ``` Description ----------- In an [INSERT ... ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index) statement, you can use the `VALUES(col_name)` function in the [UPDATE](../update/index) clause to refer to column values from the [INSERT](../insert/index) portion of the statement. In other words, `VALUES(col_name)` in the `UPDATE` clause refers to the value of col\_name that would be inserted, had no duplicate-key conflict occurred. This function is especially useful in multiple-row inserts. The `VALUES()` function is meaningful only in `INSERT ... ON DUPLICATE KEY UPDATE` statements and returns `NULL` otherwise. In [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/) this function was renamed to `VALUE()`, because it's incompatible with the standard Table Value Constructors syntax, implemented in [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/). The `VALUES()` function can still be used even from [MariaDB 10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/), but only in `INSERT ... ON DUPLICATE KEY UPDATE` statements; it's a syntax error otherwise. Examples -------- **MariaDB starting with [10.3.3](https://mariadb.com/kb/en/mariadb-1033-release-notes/)** ``` INSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b); ``` **MariaDB until [10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/)** ``` INSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b); ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Character Set and Collation Overview Character Set and Collation Overview ==================================== What Are Character Sets and Collations -------------------------------------- A character set is a set of characters while a collation is the rules for comparing and sorting a particular character set. For example, a subset of a character set could consist of the letters `A`, `B` and `C`. A default collation could define these as appearing in an ascending order of `A, B, C`. If we consider different case characters, more complexity is added. A binary collation would evaluate the characters `A` and `a` differently, ordering them in a particular way. A case-insensitive collation would evaluate `A` and `a` equivalently, while the German phone book collation evaluates the characters `ue` and `ü` equivalently. A character set can have many collations associated with it, while each collation is only associated with one character set. In MariaDB, the character set name is always part of the collation name. For example, the `latin1_german1_ci` collation applies only to the `latin1` character set. Each character set also has one default collation. The `latin1` default collation is `latin1_swedish_ci`. As an example, by default, the character `y` comes between `x` and `z`, while in Lithuanian, it's sorted between `i` and `k`. Similarly, the German phone book order is different to the German dictionary order, so while they share the same character set, the collation is different. Viewing Character Sets and Collations ------------------------------------- In MariaDB, the default character set is latin1, and the default collation is latin1\_swedish\_ci (however this may differ in some distros, see for example [Differences in MariaDB in Debian](../differences-in-mariadb-in-debian/index)). You can view a full list of character sets and collations supported by MariaDB at [Supported Character Sets and Collations](../supported-character-sets-and-collations/index), or see what's supported on your server with the [SHOW CHARACTER SET](../show-character-set/index) and [SHOW COLLATION](../show-collation/index) commands. By default, `A` comes before `Z`, so the following evaluates to true: ``` SELECT "A" < "Z"; +-----------+ | "A" < "Z" | +-----------+ | 1 | +-----------+ ``` By default, comparisons are case-insensitive: ``` SELECT "A" < "a", "A" = "a"; +-----------+-----------+ | "A" < "a" | "A" = "a" | +-----------+-----------+ | 0 | 1 | +-----------+-----------+ ``` Changing Character Sets and Collations -------------------------------------- Character sets and collations can be set from the server level right down to the column level, as well as for client-server communication. For example, `ue` and `ü` are by default evaluated differently. ``` SELECT 'Mueller' = 'Müller'; +----------------------+ | 'Müller' = 'Mueller' | +----------------------+ | 0 | +----------------------+ ``` By using the [collation\_connection](../server-system-variables/index#collation_connection) system variable to change the connection character set to `latin1_german2_ci`, or German phone book, the same two characters will evaluate as equivalent. ``` SET collation_connection = latin1_german2_ci; SELECT 'Mueller' = 'Müller'; +-----------------------+ | 'Mueller' = 'Müller' | +-----------------------+ | 1 | +-----------------------+ ``` See [Setting Character Sets and Collations](../setting-character-sets-and-collations/index) for more. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Install cmake on build VMs Install cmake on build VMs ========================== [MariaDB 5.5](../what-is-mariadb-55/index) Requires cmake. Install cmake on all -build VMs (and other Unix-like machines) with: ``` wget http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz tar -zxvf cmake-2.8.8.tar.gz cd cmake-2.8.8;./configure make sudo make install ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Installing MariaDB RPM Files Installing MariaDB RPM Files ============================= MariaDB provides RPM packages for several RPM-based Linux distributions. MariaDB also provides YUM/DNF and ZYpp repositories for these Linux distributions. The articles here provide information and instructions on using the RPM packages and the related repositories. | Title | Description | | --- | --- | | [About the MariaDB RPM Files](../about-the-mariadb-rpm-files/index) | Describes the contents of the RPM packages that come with each MariaDB release. | | [Installing MariaDB with yum/dnf](../yum/index) | Installing MariaDB with yum or dnf on RHEL, CentOS, Fedora, and similar distros. | | [Installing MariaDB with zypper](../installing-mariadb-with-zypper/index) | How to install MariaDB with zypper on SLES, OpenSUSE, and other similar Linux distributions. | | [Installing MariaDB With the rpm Tool](../installing-mariadb-with-the-rpm-tool/index) | Downloading and installing RPM files using the rpm command | | [Checking MariaDB RPM Package Signatures](../checking-mariadb-rpm-package-signatures/index) | Steps to check MariaDB RPM package signatures | | [Troubleshooting MariaDB Installs on Red Hat/CentOS](../troubleshooting-mariadb-installs-on-red-hatcentos/index) | Issues people have encountered when installing MariaDB on Red Hat / CentOS | | [MariaDB for DirectAdmin Using RPMs](../mariadb-for-directadmin-using-rpms/index) | Using DirectAdmin when installing MariaDB with YUM | | [MariaDB Installation (Version 10.1.21) via RPMs on CentOS 7](../mariadb-installation-version-10121-via-rpms-on-centos-7/index) | Detailed steps for installing MariaDB (version 10.1.21) via RPMs on CentOS 7 | | [Why Source RPMs (SRPMs) Aren't Packaged For Some Platforms](../why-source-rpms-srpms-arent-packaged-for-some-platforms/index) | Explanation for why source RPM (SRPMs) aren't packaged for some platforms | | [Building MariaDB from a Source RPM](../building-mariadb-from-a-source-rpm/index) | How to build MariaDB from a source RPM (SRPM). | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema table_handles Table Performance Schema table\_handles Table ======================================= **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The `table_handles` table was added in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The `table_handles` table contains table lock information. It uses the `wait/lock/table/sql/handler` instrument, which is enabled by default. Information includes which table handles are open, which sessions are holding the locks, and how they are locked. The table is read-only, and [TRUNCATE TABLE](../truncate-table/index) cannot be performed on the table. The maximum number of opened table objects is determined by the [performance\_schema\_max\_table\_handles](../performance-schema-system-variables/index#performance_schema_max_table_handles) system variable. The table contains the following columns: | Column | Description | | --- | --- | | OBJECT\_TYPE | The table opened by a table handle. | | OBJECT\_SCHEMA | The schema that contains the object. | | OBJECT\_NAME | The name of the instrumented object. | | OBJECT\_INSTANCE\_BEGIN | The table handle address in memory. | | OWNER\_THREAD\_ID | The thread owning the table handle. | | OWNER\_EVENT\_ID | The event which caused the table handle to be opened. | | INTERNAL\_LOCK | The table lock used at the SQL level. | | EXTERNAL\_LOCK | The table lock used at the storage engine level. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB 5.3/MySQL 5.5 Windows performance patches MariaDB 5.3/MySQL 5.5 Windows performance patches ================================================= I just backported Windows performance patches I've done for 5.5 back to [MariaDB 5.3](../what-is-mariadb-53/index). There will be a bit more in Maria that in MySQL 5.5, but more on this later. First, I feel Windows performance improvements in 5.5 were never adequately described, so here is the redux. For those familiar with Windows systems programming, MySQL code used to offer of low-hanging performance fruits. I picked some of them those back in my days in MySQL/Sun. The result benchmark curve became really nice: look at [Calvin's blog entry](http://blogs.innodb.com/wp/2010/09/mysql-5-5-innodb-performance-improvements-on-windows/). If graphs in this blog looks familiar to you, it is because it was often used by Oracle marketing as proof of big-O's positive influence on MySQL code :) There were 3 Windows performance related patches. I comment on the bugs history a little bit, too. * [Bug#24509](http://bugs.mysql.com/bug.php?id=24509). The fix removed the limit of 2048 open MyISAM files, and as a nice side-effect allowed for much bigger table cache. When mysqld starts, it checks the maximum open files value, and corrects the value of table cache, if max\_open\_files is low or max\_connection is high. This is what also happened during benchmarks. If you look at the read-only benchmark graph in the Calvin's blog above, you'll notice a drop around 64 concurrent users. No wonder, mysql server recalculated table cache size, setting it to the absolute minimum, that is to 64. The fix was to create an own sort-of C runtime library on top of pure Win32, which is capable of handling more than 2048 open files (16K default). Some other things are also done nicer than in Microsofts C runtime, e.g there are no locks, and there is an acceptable pread()/pwrite() implementation. The main advantage as I said is being able to have a large table cache - for this, rewriting C runtime is likely an overkill, but I did not come up with anything better. * [Bug#52102](http://bugs.mysql.com/bug.php?id=52102). This bug was fixing a lot of questionable places in InnoDB that were written probably back in the NT3.1 days . First it is importantto understand how innodb "mutex" structure is acquired. Details on it are hairy, mutex is a composite structure which has a real os mutex( known under Windows as CRITICAL\_SECTION) plus innodb event (known under Windows as event). There are a couple of variations on the implementation - mutex can be an interlocked (aka atomic for my Unix friends) variable, under Unix event is represented as condition variable. Acquisition is done in 2 steps - first, trylock on os mutex is performed , possibly several times with in a loop, if unsuccessfull, event is reserved in a global table of events known as "sync array", event is entering a waiting state. mutex unlock would wakeup the waiters if there are any. Do not ask me why the implementation is so complicated, it is so :) Maybe, this design helps to find deadlocks. Variation of this implementation - instead of trylock on mutex, there might be a compare\_exchange instruction on interlocked(atomic) variable. Back to Windows, the implementation of the above exposed a couple of interesting self-compensating bugs. 1. First, I fixed os\_mutex\_trylock() to be what it really means . The implementation was EnterCriticalSection, which is "try very hard", and actually acquire the lock. A more conscious trylock would be TryEnterCriticalSection. When I fixed that, contrary to my expectation, this made mysqld really slow. When trylock() failed, innodb started to enter code paths it has never seen before. for example, reserving space in the mentioned "sync array". Access to sync array is protected by so-called "slow lock" and this showed up very often in the profiler. The next step was fixing the "slow lock" 2. "slow Innodb mutex" was implemented as kernel object aka Windows mutex (for my Unix friends this is sort of SysV semaphore). It can be used to synchronize processes but is an absolute overkill for synchronization of threads inside the same process. It was a "really slow mutex". Changing this to CRITICAL\_SECTION made it faster however... 3. When all of the above was fixed, found out that Windows events (mentioned events) did not really scale well in many-threads scenarios. On newer Windows (Vista+), there is a CONDITION\_VARIABLE that is documented to scale better, and measuring also showed that it scaled really well. So I used condition variables when possible, which is ironic, because InnoDB events were really modeled after Windows events. 4. Reenabled implementation of fast mutexes as atomic variables. Prior to the patch, precompiler flags to enable atomics were commented out with "Windows atomics do not work well" in CMakeLists.txt. Great comment, given that unlike software developers, atomic instructions have no preferences for the OSes they are being used on :) So, the story about "atomics did not work well on Windows" was a cumulative effect of different things. Prior to that patch . Once atomics were enabled, implementation of fast mutexes did not use CRITICAL\_SECTION, but compare\_exchange instruction. Ingenious "trylock\_veryhard" as we have seen at the step 1. above is not used anymore, instead it is a quite correct "try" lock . Once try\_lock() began to fail with many concurrent threads, overhead of sync array guard implemented as Windows kernel object that we have seen in 2. became apparent, and less-then inefficient Windows events mentioned in 3. finished that picture. * [Bug#56585](http://bugs.mysql.com/bug.php?id=56585) This patch was merely to compensate for negative effects of the 5.5 metadata lock on MyISAM bechmarks, and fix was using native Vista performance primitives. The patch per se is not interesting, and repeats a lot of what was done for Innodb. What was great, was a discussion prior to the patch between myself, Davi, Dmitry on different implementations of reader writer locks, including 2 homebacked ones, and one by [Vance Morrison](http://blogs.msdn.com/b/vancem/archive/2006/03/28/563180.aspx). Without doubt, the discussions around that was a highlight in my very short stint at Oracle. Also, if you want to get a MySQL-classic-style code review with 17 things to fix, of which at least 10 would be marked with "Coding Style" (yes, both words capitalized) , try to get Dmitry Lenev as a reviewer, he's great - this is the proof <http://lists.mysql.org/commits/118295> Anyway, the patch improves MyISAM throughput by 10-20% , which I think is quite ok. Somehow those percents were subsequently eaten by MDL though :) Notes ----- Taken from a note on Facebook: <https://www.facebook.com/note.php?note_id=238505812835782> by Vladislav Vaintroub. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb password_reuse_check_interval password\_reuse\_check\_interval ================================ The password\_reuse\_check\_interval system variable is available when the [password\_reuse\_check plugin](../password_reuse_check-plugin/index) is installed. It determines the retention period for the password history in days. Zero, the default, means passwords are never discarded. * **Commandline:** `--password_reuse_check_interval=#` * **Scope:** Global * **Read-only:** No * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `36500` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Managing Secrets in Ansible Managing Secrets in Ansible =========================== An Ansible role often runs commands that require certain privileges, so it must perform some forms of login, using passwords or key pairs. In the context of database automation, we normally talk about: SSH access, sudo access, and access to MariaDB. If we write these secrets (passwords or private keys) in clear text in an Ansible repository, anyone who has access to the repository can access them, and this is not what we want. Let's see how we can manage secrets. The SSH Password or Keys ------------------------ Most of the times, Ansible connects to the target hosts via SSH. It is common to use the system username and the SSH keys installed in `/.ssh`, which is the SSH clients default. In this case, nothing has to be done on the clients to be able to allow Ansible to use SSH, as long as they are already able to connect to the target hosts. It is also possible to specify a different username as `[ANSIBLE\_REMOTE\_USER](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#envvar-ANSIBLE_REMOTE_USER)` and an SSH configuration file as `[ANSIBLE\_NETCONF\_SSH\_CONFIG](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#envvar-ANSIBLE_NETCONF_SSH_CONFIG)`. These settings can be specified in Ansible configuration file or as environment variables. `[ANSIBLE\_ASK\_PASS](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#envvar-ANSIBLE_ASK_PASS)` can be specified. If this is the case, Ansible will prompt the user asking to type an SSH password. Avoiding Sharing Secrets ------------------------ As a general rule, any configuration that implies communicating sensible information to the persons who will connects to a system implies some degree of risk. Therefore, the most common choice is to allow users to login into remote systems with their local usernames, using SSH keys. Once Ansible is able to connect remote hosts, it can also be used to install the public keys of some users to grant them access. Sharing these keys implies no risk. Sharing private keys is never necessary, and must be avoided. MariaDB has a [UNIX\_SOCKET](../authentication-plugin-unix-socket/index) plugin that can be used to let some users avoid entering a password, as far as they're logged in the operating system. This authentication method is used by default for the root user. This is a good way to avoid having one more password and possibly writing to a `.my.cnf` file so that the user doesn't have to type it. Even for users who connect remotely, it is normally not necessary to insert passwords in an Ansible file. When we create a user with a password, a hash of the original password is stored in MariaDB. That hash can be found in the [mysql.user table](../mysqluser-table/index). To know the hash of a password without even creating a user, we can use the [PASSWORD()](../password/index) function: ``` SELECT PASSWORD('my_password12') AS hash; ``` When we create a user, we can actually specify a hash instead of the password the user will have to type: ``` CREATE USER user@host IDENTIFIED BY PASSWORD '*54958E764CE10E50764C2EECBB71D01F08549980'; ``` ansible-vault ------------- Even if you try to avoid sharing secrets, it's likely you'll have to keep some in Ansible. For example, MariaDB users that connect remotely have passwords, and if we want Ansible to create and manage those users, the hashes must be placed somewhere in our Ansible repository. While a hash cannot be converted back to a password, treating hashes as secrets is usually a good idea. Ansible provides a native way to handle secrets: [ansible-vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html). In the simplest case, we can manage all our passwords with a single ansible-vault password. When we add or change a new password in some file (typically a file in `host_vars` or `group_vars`) we'll use ansible-vault to crypt this password. While doing so, we'll be asked to insert our ansible-vault password. When we apply a role and Ansible needs to decrypt this password, it will ask us to enter again our ansible-vault password. ansible-vault can use more than one password. Each password can manage a different set of secrets. So, for example, some users may have the password to manage regular MariaDB users passwords, and only one may have the password that is needed to manage the root user. --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Views Views ====== Views are stored queries that act as a virtual table. | Title | Description | | --- | --- | | [Creating & Using Views](../creating-using-views/index) | A tutorial on creating and using views. | | [CREATE VIEW](../create-view/index) | Create or replace a view. | | [ALTER VIEW](../alter-view/index) | Change a view definition. | | [DROP VIEW](../drop-view/index) | Removes one or more views. | | [SHOW CREATE VIEW](../show-create-view/index) | Show the CREATE VIEW statement that created a view. | | [Inserting and Updating with Views](../inserting-and-updating-with-views/index) | Views can be used for inserting or updating with certain limitations. | | [RENAME TABLE](../rename-table/index) | Change a table's name. | | [View Algorithms](../view-algorithms/index) | Optional ALGORITHM clause when creating views | | [Information Schema VIEWS Table](../information-schema-views-table/index) | Information about views. | | [SHOW TABLES](../show-tables/index) | List of non-temporary tables, views or sequences. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Configuring Sphinx Configuring Sphinx ================== Before you can get Sphinx working with the Sphinx Storage Engine on MariaDB, you need to configure it. * The default configuration file is called `sphinx.conf`, usually located in `/etc/sphinxsearch` (Debian/Ubuntu), `/etc/sphinx/sphinx.conf.` (Red Hat/CentOS) or `C:\Sphinx\sphinx.conf` (Windows). If it doesn't already exist, you can use the sample configuration file, `sphinx.conf.dist`. There is also sample data supplied that we can use for testing. Load the sample data (which creates two tables, `documents` and `tags` in the `test` database), for example: `mysql -u test < /usr/local/sphinx/etc/example.sql` (Red Hat, CentOS) `mysql -u test < /usr/share/doc/sphinxsearch/example-conf/example.sql` (Debian/Ubuntu) The sample configuration file documents the available options. You will need to make at least a few changes. A MariaDB user with permission to access the database must be created. For example: ``` CREATE USER 'sphinx'@localhost IDENTIFIED BY 'sphinx_password'; GRANT SELECT on test.* to 'sphinx'@localhost; ``` Add these details to the `mysql` section of the config file: ``` sql_host = localhost sql_user = sphinx sql_pass = sphinx_password sql_db = test sql_port = 3306 ``` On Windows, the `path` and `pid` lines will need to be changed to reflect a valid path, usually as follows: ``` path = C:\Sphinx\docsidx ... pid_file = C:\Sphinx\sphinx.pid ``` The query in the configuration files is the query that will be used for building the index. In the sample data, this is: ``` sql_query = \ SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \ FROM documents ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Custom Installation of Multi-Server ColumnStore Cluster Custom Installation of Multi-Server ColumnStore Cluster ======================================================= If you choose not to do the quick install and chose to customize the various options of installations using a wizard, you may use MariaDB ColumnStore postConfigure script. Custom Install Wizard: postConfigure ------------------------------------ The postConfigure script is a customer wizard to do the system(server and storage) configuration and setup. Before running the postConfigure script, you must have done [Preparing for ColumnStore Installation 1.2.x](../preparing-for-columnstore-installation-12x/index) steps and the pre-requisite validation using [ColumnStore Cluster Tester Tool](../mariadb-columnstore-cluster-test-tool/index). Once you have done these steps, then run the postConfigure script from the node designated as PM1. The script can take several parameters. However, all are optional ``` Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-qa][-port][-i][-n][-d][-sn][-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count] -h Help -c Config File to use to extract configuration data, the default is Columnstore.xml.rpmsave -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave If ssh-keys aren't setup, you should provide passwords as command line arguments -p Unix Password, used with no-prompting option -qs Quick Install - Single Server -qm Quick Install - Multi Server -port MariaDB ColumnStore Port Address -i Non-root Install directory, Only use for non-root installs -n Non-distributed install, meaning postConfigure will not install packages on remote nodes -d Distributed install, meaning postConfigure will install packages on remote nodes -sn System Name -pm-ip-addrs Performance Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx -um-ip-addrs User Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx ``` Running postConfigure is a bit different when launching as root user or a non-root user. As a non-root user, you will be required the setup 2 Environment variables and provide the base directory where MariaDB ColumnStore resides. #### Running postConfigure as root user ``` /usr/local/mariadb/columnstore/bin/postConfigure ``` #### Running postConfigure as non-root user ``` export COLUMNSTORE_INSTALL_DIR=/home/guest/mariadb/columnstore export LD_LIBRARY_PATH=/home/guest/mariadb/columnstore/lib:/home/guest/mariadb/columnstore/mysql/lib/mysql /home/guest/mariadb/columnstore/bin/postConfigure -i /home/guest/mariadb/columnstore ``` ### Distributed vs Non-Distributed options The postConfigure script supports 2 different types of installs: * Non-Distributed Install * Distributed Install #### Non-Distributed Install Before starting postConfigure for Non-Distributed Install, please ensure you have installed the MariaDB ColumnStore packages on all the nodes per [Preparation Steps](../preparing-for-columnstore-installation-12x/index). And on the non-pm1 nodes startup the ColumnStore service before running postConfigure. Non-Distributed Install is the default setting, so no additional command line arguments needs to be provided. #### Distributed Install Distributed Install by postConfigure interacts with all the nodes in the system during the configuration and setup process. It pushes copies of the MariaDB ColumnStore packages from the 'pm1' node where postConfigure is running. During upgrades, it will also make sure the ColumnStore service is stopped and will replace any packages that were previously installed with the new package. Since it pushes the new packages to the other nodes, it is required that the packages be placed in the current home directory of the user doing the install, i.e. /root/ for root user install. Distributed Install does require an additional command line argument "-d" as shown in this example: ``` /usr/local/mariadb/columnstore/bin/postConfigure -d ``` ### Storage Configuration Options When running postConfigure, you will be prompted for the type of storage configuration. Usually the options are 'internal' and 'external'. If GlusterFS is installed, then 'DataRedundancy' will be an option. Check this document to determine which type of storage you will want to select: [https://mariadb.com/kb/en/library/preparing-for-and-installing-columnstore-version-121/#storage-and-database-files-dbroots](../library/preparing-for-and-installing-columnstore-version-121/index#storage-and-database-files-dbroots) ### Common Installation Examples The following is a transcript of a typical run of the MariaDB ColumnStore configuration script. Plain-text formatting indicates output from the script and bold text indicates responses to questions. After each question, there is a short discussion of what the question is asking and what some typical answers might be. You will not see these during the running the actual configuration script. During postConfigure, there are 2 questions that are asked where the answer given determines the path that postConfigure takes in configuring the system. Those 2 questions are as follows: ``` Select the type of server install [1=single, 2=multi] (2) > ``` and ``` Select the Type of Module Install being performed: 1. Separate - User and Performance functionalities on separate servers 2. Combined - User and Performance functionalities on the same server Enter Server Type ID [1-2] (1) > ``` The following examples illustrate some common configurations and helps to provide answers to the above questions: * Single Node - User and Performance running on 1 server - single / combined * Mutli-Node #1 - User and Performance running on some server - multi / combined * Mutli-Node #2 - User and Performance running on separate servers - multi / separate #### Distributed Install example This is an example of a Distributed Install of a 1UM/2PM system with internal storage. MariaDB ColumnStore 'rpm's packages was installed for this example. No password is provide on the command line, so the root user password is provided when prompted. ``` # /usr/local/mariadb/columnstore/bin/postConfigure -d This is the MariaDB ColumnStore System Configuration and Installation tool. It will Configure the MariaDB ColumnStore System and will perform a Package Installation of all of the Servers within the System that is being configured. IMPORTANT: This tool should only be run on the Parent OAM Module which is a Performance Module, preferred Module #1 Prompting instructions: Press 'enter' to accept a value in (), if available or Enter one of the options within [], if available, or Enter a new value ===== Setup System Server Type Configuration ===== There are 2 options when configuring the System Server Type: single and multi 'single' - Single-Server install is used when there will only be 1 server configured on the system. It can also be used for production systems, if the plan is to stay single-server. 'multi' - Multi-Server install is used when you want to configure multiple servers now or in the future. With Multi-Server install, you can still configure just 1 server now and add on addition servers/modules in the future. Select the type of System Server install [1=single, 2=multi] (2) > ===== Setup System Module Type Configuration ===== There are 2 options when configuring the System Module Type: separate and combined 'separate' - User and Performance functionality on separate servers. 'combined' - User and Performance functionality on the same server Select the type of System Module Install [1=separate, 2=combined] (2) > 1 Separate Server Installation will be performed. NOTE: Local Query Feature allows the ability to query data from a single Performance Module. Check MariaDB ColumnStore Admin Guide for additional information. Enable Local Query feature? [y,n] (n) > NOTE: The MariaDB ColumnStore Schema Sync feature will replicate all of the schemas and InnoDB tables across the User Module nodes. This feature can be enabled or disabled, for example, if you wish to configure your own replication post installation. MariaDB ColumnStore Schema Sync feature, do you want to enable? [y,n] (y) > NOTE: MariaDB ColumnStore Replication Feature is enabled Enter System Name (columnstore-1) > mymcs-1 ===== Setup Storage Configuration ===== ----- Setup Performance Module DBRoot Data Storage Mount Configuration ----- There are 3 options when configuring the storage: internal or external 'internal' - This is specified when a local disk is used for the DBRoot storage. High Availability Server Failover is not Supported in this mode 'external' - This is specified when the DBRoot directories are mounted. High Availability Server Failover is Supported in this mode. Select the type of Data Storage [1=internal, 2=external] (1) > ===== Setup Memory Configuration ===== NOTE: Setting 'NumBlocksPct' to 70% Setting 'TotalUmMemory' to 50% ===== Setup the Module Configuration ===== ----- User Module Configuration ----- Enter number of User Modules [1,1024] (1) > *** User Module #1 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > um1-hostname Enter Nic Interface #1 IP Address of um1-hostname (0.0.0.0) > 172.30.0.59 Enter Nic Interface #2 Host Name (unassigned) > ----- Performance Module Configuration ----- Enter number of Performance Modules [1,1024] (1) > 2 *** Parent OAM Module Performance Module #1 Configuration *** Enter Nic Interface #1 Host Name (ip-172-30-0-161.us-west-2.compute.internal) > Enter Nic Interface #1 IP Address of ip-172-30-0-161.us-west-2.compute.internal (172.30.0.161) > Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm1' (1) > *** Performance Module #2 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > pm2-hostname Enter Nic Interface #1 IP Address of pm2-hostname (0.0.0.0) > 172.30.0.152 Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm2' () > 2 ===== System Installation ===== System Configuration is complete. Performing System Installation. Performing a MariaDB ColumnStore System install using RPM packages located in the /root directory. Next step is to enter the password to access the other Servers. This is either your password or you can default to using a ssh key If using a password, the password needs to be the same on all Servers. Enter password, hit 'enter' to default to using a ssh key, or 'exit' > Confirm password > ----- Performing Install on 'um1 / um1-hostname' ----- Install log file is located here: /tmp/um1_rpm_install.log ----- Performing Install on 'pm2 / pm2-hostname' ----- Install log file is located here: /tmp/pm2_rpm_install.log MariaDB ColumnStore Package being installed, please wait ... DONE ===== Checking MariaDB ColumnStore System Logging Functionality ===== The MariaDB ColumnStore system logging is setup and working on local server ===== MariaDB ColumnStore System Startup ===== System Installation is complete. If any part of the install failed, the problem should be investigated and resolved before continuing. package installed and the associated service started. Would you like to startup the MariaDB ColumnStore System? [y,n] (y) > ----- Starting MariaDB ColumnStore on local server ----- MariaDB ColumnStore successfully started MariaDB ColumnStore Database Platform Starting, please wait ......... DONE System Catalog Successfully Created MariaDB ColumnStore Install Successfully Completed, System is Active Enter the following command to define MariaDB ColumnStore Alias Commands . /usr/local/mariadb/columnstore/bin/columnstoreAlias Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console # ``` IMPORTANT: If postConfigure fails at any point, you can use the following guides to help trouble shoot any issues. And once an issue has been fixed, it is required that you re-run postConfigure until you get a successful completion. [https://mariadb.com/kb/en/library/system-troubleshooting-mariadb-columnstore/#multi-node-install-problems-and-how-to-diagnose](../library/system-troubleshooting-mariadb-columnstore/index#multi-node-install-problems-and-how-to-diagnose) #### Non-Distributed Install example This is an example of a Non-Distributed Install of a 2PM system with External storage. MariaDB ColumnStore 'rpm's packages was installed for this example. A password of 'ssh' is provide on the command line, which means that ssh-keys are setup and no password prompt will be required. This example also was done on a system that had the GlusterFS third party package installed, so it will show the storage option for the MariaDB ColumnStore Data Replication. If GlusterFS wasnt installed, it would not show up as a Storage Option. ``` # /usr/local/mariadb/columnstore/bin/postConfigure -n -p ssh This is the MariaDB ColumnStore System Configuration and Installation tool. It will Configure the MariaDB ColumnStore System and will perform a Package Installation of all of the Servers within the System that is being configured. IMPORTANT: This tool should only be run on the Parent OAM Module which is a Performance Module, preferred Module #1 Prompting instructions: Press 'enter' to accept a value in (), if available or Enter one of the options within [], if available, or Enter a new value ===== Setup System Server Type Configuration ===== There are 2 options when configuring the System Server Type: single and multi 'single' - Single-Server install is used when there will only be 1 server configured on the system. It can also be used for production systems, if the plan is to stay single-server. 'multi' - Multi-Server install is used when you want to configure multiple servers now or in the future. With Multi-Server install, you can still configure just 1 server now and add on addition servers/modules in the future. Select the type of System Server install [1=single, 2=multi] (2) > ===== Setup System Module Type Configuration ===== There are 2 options when configuring the System Module Type: separate and combined 'separate' - User and Performance functionality on separate servers. 'combined' - User and Performance functionality on the same server Select the type of System Module Install [1=separate, 2=combined] (2) > Separate Server Installation will be performed. NOTE: The MariaDB ColumnStore Schema Sync feature will replicate all of the schemas and InnoDB tables across the User Module nodes. This feature can be enabled or disabled, for example, if you wish to configure your own replication post installation. MariaDB ColumnStore Schema Sync feature, do you want to enable? [y,n] (y) > NOTE: MariaDB ColumnStore Replication Feature is enabled Enter System Name (columnstore-1) > mymcs-1 ===== Setup Storage Configuration ===== ----- Setup Performance Module DBRoot Data Storage Mount Configuration ----- There are 3 options when configuring the storage: internal or external 'internal' - This is specified when a local disk is used for the DBRoot storage. High Availability Server Failover is not Supported in this mode 'external' - This is specified when the DBRoot directories are mounted. High Availability Server Failover is Supported in this mode. Select the type of Data Storage [1=internal, 2=external] (1) > 2 ===== Setup Memory Configuration ===== NOTE: Setting 'NumBlocksPct' to 70% Setting 'TotalUmMemory' to 50% ===== Setup the Module Configuration ===== ----- Performance Module Configuration ----- Enter number of Performance Modules [1,1024] (1) > 2 *** Parent OAM Module Performance Module #1 Configuration *** Enter Nic Interface #1 Host Name (ip-172-30-0-161.us-west-2.compute.internal) > Enter Nic Interface #1 IP Address of ip-172-30-0-161.us-west-2.compute.internal (172.30.0.161) > Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm1' (1) > *** Performance Module #2 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > pm2-hostname Enter Nic Interface #1 IP Address of pm2-hostname (0.0.0.0) > 172.30.0.152 Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm2' () > 2 ===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts ===== post-mysqld-install Successfully Completed post-mysql-install Successfully Completed ===== Checking MariaDB ColumnStore System Logging Functionality ===== The MariaDB ColumnStore system logging is setup and working on local server MariaDB ColumnStore System Configuration and Installation is Completed ===== MariaDB ColumnStore System Startup ===== System Installation is complete. If any part of the install failed, the problem should be investigated and resolved before continuing. Non-Distributed Install: make sure all other modules have MariaDB ColumnStore package installed and the associated service started. ----- Starting MariaDB ColumnStore on local server ----- MariaDB ColumnStore successfully started MariaDB ColumnStore Database Platform Starting, please wait ......... DONE System Catalog Successfully Created MariaDB ColumnStore Install Successfully Completed, System is Active Enter the following command to define MariaDB ColumnStore Alias Commands . /usr/local/mariadb/columnstore/bin/columnstoreAlias Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console # ``` IMPORTANT: If postConfigure fails at any point, you can use the following guides to help trouble shoot any issues. And once an issue has been fixed, it is required that you re-run postConfigure until you get a successful completion. [https://mariadb.com/kb/en/library/system-troubleshooting-mariadb-columnstore/#multi-node-install-problems-and-how-to-diagnose](../library/system-troubleshooting-mariadb-columnstore/index#multi-node-install-problems-and-how-to-diagnose) #### Data Replication Install example This is an example of a Distributed Install of a 1UM/2PM system with Data Replication storage. Root user password is passed in as a command line argument. As part of the Preparing for Install, the GlusterFS third party package would have already been installed on all of the PM servers within this system. During the running of postConfigure, the user will be required to enter some Data Replication options based on the type of system you want. Example is number of copies of the Database you would like to have maintained across the PM servers. This example also enabled the Local Query Feature. ``` /usr/local/mariadb/columnstore/bin/postConfigure -p 'root-user-password' This is the MariaDB ColumnStore System Configuration and Installation tool. It will Configure the MariaDB ColumnStore System and will perform a Package Installation of all of the Servers within the System that is being configured. IMPORTANT: This tool should only be run on the Parent OAM Module which is a Performance Module, preferred Module #1 Prompting instructions: Press 'enter' to accept a value in (), if available or Enter one of the options within [], if available, or Enter a new value ===== Setup System Server Type Configuration ===== There are 2 options when configuring the System Server Type: single and multi 'single' - Single-Server install is used when there will only be 1 server configured on the system. It can also be used for production systems, if the plan is to stay single-server. 'multi' - Multi-Server install is used when you want to configure multiple servers now or in the future. With Multi-Server install, you can still configure just 1 server now and add on addition servers/modules in the future. Select the type of System Server install [1=single, 2=multi] (2) > ===== Setup System Module Type Configuration ===== There are 2 options when configuring the System Module Type: separate and combined 'separate' - User and Performance functionality on separate servers. 'combined' - User and Performance functionality on the same server Select the type of System Module Install [1=separate, 2=combined] (2) > 1 Seperate Server Installation will be performed. NOTE: Local Query Feature allows the ability to query data from a single Performance Module. Check MariaDB ColumnStore Admin Guide for additional information. Enable Local Query feature? [y,n] (n) > y NOTE: Local Query Feature is enabled NOTE: MariaDB ColumnStore Replication Feature is enabled Enter System Name (columnstore-1) > mymcs-1 ===== Setup Storage Configuration ===== ----- Setup Performance Module DBRoot Data Storage Mount Configuration ----- There are 3 options when configuring the storage: internal, external, or DataRedundancy 'internal' - This is specified when a local disk is used for the DBRoot storage. High Availability Server Failover is not Supported in this mode 'external' - This is specified when the DBRoot directories are mounted. High Availability Server Failover is Supported in this mode. 'DataRedundancy' - This is specified when gluster is installed and you want the DBRoot directories to be controlled by ColumnStore Data Redundancy. High Availability Server Failover is Supported in this mode. NOTE: glusterd service must be running and enabled on all PMs. Select the type of Data Storage [1=internal, 2=external, 3=DataRedundancy] (1) > 3 ===== Setup Memory Configuration ===== NOTE: Setting 'NumBlocksPct' to 70% Setting 'TotalUmMemory' to 50% ===== Setup the Module Configuration ===== ----- User Module Configuration ----- Enter number of User Modules [1,1024] (1) > *** User Module #1 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > um1-hostname Enter Nic Interface #1 IP Address of um1-hostname (0.0.0.0) > 172.30.0.59 Enter Nic Interface #2 Host Name (unassigned) > ----- Performance Module Configuration ----- Enter number of Performance Modules [1,1024] (1) > 2 *** Parent OAM Module Performance Module #1 Configuration *** Enter Nic Interface #1 Host Name (ip-172-30-0-161.us-west-2.compute.internal) > Enter Nic Interface #1 IP Address of ip-172-30-0-161.us-west-2.compute.internal (172.30.0.161) > Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm1' (1) > *** Performance Module #2 Configuration *** Enter Nic Interface #1 Host Name (unassigned) > pm2-hostname Enter Nic Interface #1 IP Address of pm2-hostname (0.0.0.0) > 172.30.0.152 Enter Nic Interface #2 Host Name (unassigned) > Enter the list (Nx,Ny,Nz) or range (Nx-Nz) of DBRoot IDs assigned to module 'pm2' () > 2 ===== System Installation ===== System Configuration is complete. Performing System Installation. Performing a MariaDB ColumnStore System install using RPM packages located in the /root directory. ===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts ===== post-mysqld-install Successfully Completed post-mysql-install Successfully Completed ----- Performing Install on 'um1 / um1-hostname' ----- Install log file is located here: /tmp/um1_rpm_install.log ----- Performing Install on 'pm2 / pm2-hostname' ----- Install log file is located here: /tmp/pm2_rpm_install.log MariaDB ColumnStore Package being installed, please wait ... DONE ===== Configuring MariaDB ColumnStore Data Redundancy Functionality ===== Only 2 PMs configured. Setting number of copies at 2. ----- Setup Data Redundancy Network Configuration ----- 'existing' - This is specified when using previously configured network devices. (NIC Interface #1) No additional network configuration is required with this option. 'dedicated' - This is specified when it is desired for Data Redundancy traffic to use a separate network than one previously configured for ColumnStore. You will be prompted to provide Hostname and IP information for each PM. Select the data redundancy network [1=existing, 2=dedicated] (1) > ----- Performing Data Redundancy Configuration ----- gluster peer probe 172.30.0.161 gluster peer probe 172.30.0.152 Gluster create and start volume dbroot1...DONE Gluster create and start volume dbroot2...DONE ----- Data Redundancy Configuration Complete ----- ===== Checking MariaDB ColumnStore System Logging Functionality ===== The MariaDB ColumnStore system logging is setup and working on local server ===== MariaDB ColumnStore System Startup ===== System Installation is complete. If any part of the install failed, the problem should be investigated and resolved before continuing. package installed and the associated service started. Would you like to startup the MariaDB ColumnStore System? [y,n] (y) > ----- Starting MariaDB ColumnStore on local server ----- MariaDB ColumnStore successfully started MariaDB ColumnStore Database Platform Starting, please wait .......... DONE System Catalog Successfully Created MariaDB ColumnStore Install Successfully Completed, System is Active Enter the following command to define MariaDB ColumnStore Alias Commands . /usr/local/mariadb/columnstore/bin/columnstoreAlias Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console # ``` IMPORTANT: If postConfigure fails at any point, you can use the following guides to help trouble shoot any issues. And once an issue has been fixed, it is required that you re-run postConfigure until you get a successful completion. [https://mariadb.com/kb/en/library/system-troubleshooting-mariadb-columnstore/#multi-node-install-problems-and-how-to-diagnose](../library/system-troubleshooting-mariadb-columnstore/index#multi-node-install-problems-and-how-to-diagnose) MariaDB Columnstore Memory Configuration ---------------------------------------- During the installation process, postConfigure will set the 2 main Memory configuration settings based on the size of memory detected on the local node. The 2 settings are in the MariaDB Columnstore Configuration file, /usr/local/mariadb/columnstore/etc/Columnstore.xml. These 2 settings are: ``` 'NumBlocksPct' - Performance Module Data cache memory setting TotalUmMemory - User Module memory setting, used as temporary memory for joins ``` On a system that has the Performance Module and User Module functionality combined on the same server, this is the default settings: ``` NumBlocksPct - 50% of total memory TotalUmMemory - 25% of total memory, default maximum the percentage equal to 16G ``` On a system that has the Performance Module and User Module functionality on different servers, this is the default settings: ``` NumBlocksPct - This setting is NOT configured, and the default that the applications will then use is 70% TotalUmMemory - 50% of total memory ``` The user can choose to change these settings after the install is completed if for instance, they want to set up more memory for Joins to utilize. On a single server or combined UM/PM server, it is recommended to not have the combination of these 2 settings over 75% of total memory Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore System Databases ColumnStore System Databases ============================ When using ColumnStore, MariaDB Server creates a series of system databases used for operational purposes. | Database | Description | | --- | --- | | `calpontsys` | Database maintains table metadata about ColumnStore tables. | | `infinidb_querystats` | Database maintains information about query performance. For more information, see [Query Analysis](../analyzing-queries-in-columnstore/index). | | `infinidb_vtable` | Database used in creation of temporary tables in query execution. This database only exists in ColumnStore 1.2 and below. In those versions, users executing ColumnStore queries must have `CREATE TEMPORARY TABLE` privilege on this database. For more information, see [User Management](../columnstore-database-user-management/index). | | `columnstore_info` | Database for stored procedures used to retrieve information about ColumnStore usage. For more information, see the [ColumnStore Information Schema](../columnstore-information-schema-tables/index) tables. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Creating and Building Plugins Creating and Building Plugins ============================== | Title | Description | | --- | --- | | [Specifying Which Plugins to Build](../specifying-which-plugins-to-build/index) | Specifying which plugins to build. | | [Writing Plugins for MariaDB](../development-writing-plugins-for-mariadb/index) | Writing plugins for MariaDB. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CREATE CREATE ======= Articles on the various CREATE statements. | Title | Description | | --- | --- | | [CREATE DATABASE](../create-database/index) | Create a database. | | [CREATE EVENT](../create-event/index) | Create and schedule a new event. | | [CREATE FUNCTION](../create-function/index) | Creates a stored function. | | [CREATE FUNCTION UDF](../create-function-udf/index) | Create a user-defined function. | | [CREATE INDEX](../create-index/index) | Create an index on one or more columns. | | [CREATE LOGFILE GROUP](../create-logfile-group/index) | The CREATE LOGFILE GROUP statement is not supported by MariaDB. It was orig... | | [CREATE PACKAGE](../create-package/index) | Create a stored package, in Oracle-mode. | | [CREATE PACKAGE BODY](../create-package-body/index) | Creates the package body for a stored package. | | [CREATE PROCEDURE](../create-procedure/index) | Creates a stored procedure. | | [CREATE ROLE](../create-role/index) | Add new roles. | | [CREATE SEQUENCE](../create-sequence/index) | Creates a sequence that generates new values when called with NEXT VALUE FOR. | | [CREATE SERVER](../create-server/index) | Define a server. | | [CREATE TABLE](../create-table/index) | Creates a new table. | | [CREATE TABLESPACE](../create-tablespace/index) | CREATE TABLESPACE is not available in MariaDB. | | [CREATE TRIGGER](../create-trigger/index) | Create a new trigger. | | [CREATE USER](../create-user/index) | Create new MariaDB accounts. | | [CREATE VIEW](../create-view/index) | Create or replace a view. | | [Silent Column Changes](../silent-column-changes/index) | MariaDB silently changes column specifications in certain situations. | | [Generated (Virtual and Persistent/Stored) Columns](../generated-columns/index) | Generated (virtual and persistent/stored) columns. | | [Invisible Columns](../invisible-columns/index) | Invisible columns are hidden in certain contexts. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW CREATE FUNCTION SHOW CREATE FUNCTION ==================== Syntax ------ ``` SHOW CREATE FUNCTION func_name ``` Description ----------- This statement is similar to [SHOW CREATE PROCEDURE](../show-create-procedure/index) but for [stored functions](../stored-functions/index). The output of this statement is unreliably affected by the [sql\_quote\_show\_create](../server-system-variables/index#sql_quote_show_create) server system variable - see <http://bugs.mysql.com/bug.php?id=12719> Example ------- ``` SHOW CREATE FUNCTION VatCents\G *************************** 1. row *************************** Function: VatCents sql_mode: Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION `VatCents`(price DECIMAL(10,2)) RETURNS int(11) DETERMINISTIC BEGIN DECLARE x INT; SET x = price * 114; RETURN x; END character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci ``` See Also -------- * [Stored Functions](../stored-functions/index) * `[CREATE FUNCTION](../create-function/index)` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb UUID UUID ==== Syntax ------ ``` UUID() ``` Description ----------- Returns a Universally Unique Identifier (UUID). A UUID is designed as a number that is globally unique in space and time. Two calls to `UUID()` are expected to generate two different values, even if these calls are performed on two separate computers that are not connected to each other. UUID() results are intended to be unique, but cannot always be relied upon to unpredictable and unguessable, so should not be relied upon for these purposes. A UUID is a 128-bit number represented by a utf8 string of five hexadecimal numbers in `aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee` format: * The first three numbers are generated from a timestamp. * The fourth number preserves temporal uniqueness in case the timestamp value loses monotonicity (for example, due to daylight saving time). * The fifth number is an IEEE 802 node number that provides spatial uniqueness. A random number is substituted if the latter is not available (for example, because the host computer has no Ethernet card, or we do not know how to find the hardware address of an interface on your operating system). In this case, spatial uniqueness cannot be guaranteed. Nevertheless, a collision should have very low probability. Currently, the MAC address of an interface is taken into account only on FreeBSD and Linux. On other operating systems, MariaDB uses a randomly generated 48-bit number. Statements using the UUID() function are not [safe for replication](../unsafe-statements-for-replication/index). The results are generated according to the "DCE 1.1:Remote Procedure Call" (Appendix A) CAE (Common Applications Environment) Specifications published by The Open Group in October 1997 ([Document Number C706](http://www.opengroup.org/public/pubs/catalog/c706.htm)). Examples -------- ``` SELECT UUID(); +--------------------------------------+ | UUID() | +--------------------------------------+ | cd41294a-afb0-11df-bc9b-00241dd75637 | +--------------------------------------+ ``` See Also -------- * [UUID\_SHORT()](../uuid_short/index) - Return short (64 bit) Universal Unique Identifier * [SYS\_GUID](../sys_guid/index) - UUID without the `-` character for Oracle compatibility * [UUID data type](../uuid-data-type/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_DIFFERENCE ST\_DIFFERENCE ============== Syntax ------ ``` ST_DIFFERENCE(g1,g2) ``` Description ----------- Returns a geometry representing the point set difference of the given geometry values. Example ------- ``` SET @g1 = POINT(10,10), @g2 = POINT(20,20); SELECT ST_AsText(ST_Difference(@g1, @g2)); +------------------------------------+ | ST_AsText(ST_Difference(@g1, @g2)) | +------------------------------------+ | POINT(10 10) | +------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Valentina Studio Valentina Studio ================ [Valentina Studio](https://valentina-db.com/en/valentina-studio-overview) is a graphical front end for MariaDB with two versions: a free version which supports features offered only in paid for versions of competing products and a Pro version that adds advanced features. Free Valentina Studio offers the following features: * natively available on macOS, Windows & Linux * a feature rich, visual SQL Editor with powerful search functionality * SQLDIFF * a highly productive Data Editor * support for many data sources including all versions of MariaDB and MySQL 5.0.6 and later\* * ODBC import * Schema Editor with powerful visual diagramming features, Diagram Editor; import diagrams from MySQL Workbench * Report Viewer with printing, export to PDF and HTML (local reports and from Valentina Server) * Forms Client for working with visual forms and MariaDB (locally and from Valentina Server) * Free supports most popular data sources, MariaDB, MySQL, SQL Server, SQLite, PostgreSQL and more Use the [Valentina Studio FREE vs Valentina Studio PRO feature matrix](https://valentina-db.com/en/compare-free-vs-pro) to see which version is best for your needs or [download to immediately evaluate.](https://valentina-db.com/en/all-downloads/current) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Primary Keys with Nullable Columns Primary Keys with Nullable Columns ================================== **MariaDB starting with [10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/)**[MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/) introduced new behavior for dealing with primary keys over nullable columns. Take the following table structure: ``` CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT, c2 INT NULL DEFAULT NULL, PRIMARY KEY(c1,c2) ); ``` Column c2 is part of a primary key, and thus it cannot be [NULL](../null-values/index). Before [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/), MariaDB (as well as versions of MySQL before MySQL 5.7) would silently convert it into a NOT NULL column with a default value of *0*. Since [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/), the column is converted to NOT NULL, but without a default value. If we then attempt to insert a record without explicitly setting *c2*, a warning (or, in strict mode, an error), will be thrown, for example: ``` INSERT INTO t1() VALUES(); Query OK, 1 row affected, 1 warning (0.00 sec) Warning (Code 1364): Field 'c2' doesn't have a default value SELECT * FROM t1; +----+----+ | c1 | c2 | +----+----+ | 1 | 0 | +----+----+ ``` MySQL, since 5.7, will abort such a CREATE TABLE with an error. The [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/) behavior adheres to the SQL 2003 standard. SQL-2003, Part II, “Foundation” says: **11.7 <unique constraint definition>** **Syntax Rules** … *5) If the <unique specification> specifies PRIMARY KEY, then for each <column name> in the explicit or implicit <unique column list> for which NOT NULL is not specified, NOT NULL is implicit in the <column definition>.* Essentially this means that all PRIMARY KEY columns are automatically converted to NOT NULL. Furthermore: **11.5 <default clause>** **General Rules** … *3) When a site S is set to its default value,* … *b) If the data descriptor for the site includes a <default option>, then S is set to the value specified by that <default option>.* … *e) Otherwise, S is set to the null value.* There is no concept of “no default value” in the standard. Instead, a column always has an implicit default value of NULL. On insertion it might however fail the NOT NULL constraint. MariaDB and MySQL instead mark such a column as “not having a default value”. The end result is the same — a value must be specified explicitly or an INSERT will fail. MariaDB since 10.1.7 behaves in a standard compatible manner — being part of a PRIMARY KEY, the nullable column gets an automatic NOT NULL constraint, on insertion one must specify a value for such a column. MariaDB before 10.1.7 was automatically assigning a default value of 0 — this behavior was non-standard. Issuing an error at CREATE TABLE time is also non-standard. See Also -------- * [MDEV-12248](https://jira.mariadb.org/browse/MDEV-12248) describes an edge-case that may result in replication problems when replicating from a master server before this change to a slave server after this change. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LAST_VALUE LAST\_VALUE =========== Syntax ------ ``` LAST_VALUE(expr,[expr,...]) ``` ``` LAST_VALUE(expr) OVER ( [ PARTITION BY partition_expression ] [ ORDER BY order_list ] ) ``` Description ----------- `LAST_VALUE()` evaluates all expressions and returns the last. This is useful together with [setting user variables to a value with @var:=expr](../set/index), for example when you want to get data of rows updated/deleted without having to do two queries against the table. Since [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), LAST\_VALUE can be used as a [window function](../window-functions/index). Returns NULL if no last value exists. Examples -------- ``` CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES(1,10),(2,20); DELETE FROM t1 WHERE a=1 AND last_value(@a:=a,@b:=b,1); SELECT @a,@b; +------+------+ | @a | @b | +------+------+ | 1 | 10 | +------+------+ ``` As a [window function](../window-functions/index): ``` CREATE TABLE t1 ( pk int primary key, a int, b int, c char(10), d decimal(10, 3), e real ); INSERT INTO t1 VALUES ( 1, 0, 1, 'one', 0.1, 0.001), ( 2, 0, 2, 'two', 0.2, 0.002), ( 3, 0, 3, 'three', 0.3, 0.003), ( 4, 1, 2, 'three', 0.4, 0.004), ( 5, 1, 1, 'two', 0.5, 0.005), ( 6, 1, 1, 'one', 0.6, 0.006), ( 7, 2, NULL, 'n_one', 0.5, 0.007), ( 8, 2, 1, 'n_two', NULL, 0.008), ( 9, 2, 2, NULL, 0.7, 0.009), (10, 2, 0, 'n_four', 0.8, 0.010), (11, 2, 10, NULL, 0.9, NULL); SELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc, LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc, FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc, LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc FROM t1 ORDER BY pk DESC; +----+-----------+----------+------------+-----------+ | pk | first_asc | last_asc | first_desc | last_desc | +----+-----------+----------+------------+-----------+ | 11 | 1 | 11 | 11 | 11 | | 10 | 1 | 10 | 11 | 10 | | 9 | 1 | 9 | 11 | 9 | | 8 | 1 | 8 | 11 | 8 | | 7 | 1 | 7 | 11 | 7 | | 6 | 1 | 6 | 11 | 6 | | 5 | 1 | 5 | 11 | 5 | | 4 | 1 | 4 | 11 | 4 | | 3 | 1 | 3 | 11 | 3 | | 2 | 1 | 2 | 11 | 2 | | 1 | 1 | 1 | 11 | 1 | +----+-----------+----------+------------+-----------+ ``` ``` CREATE OR REPLACE TABLE t1 (i int); INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); SELECT i, FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS f_1f, LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS l_1f, FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS f_1p1f, LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS f_1p1f, FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS f_2p1p, LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS f_2p1p, FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS f_1f2f, LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS f_1f2f FROM t1; +------+------+------+--------+--------+--------+--------+--------+--------+ | i | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p | f_1f2f | f_1f2f | +------+------+------+--------+--------+--------+--------+--------+--------+ | 1 | 1 | 2 | 1 | 2 | NULL | NULL | 2 | 3 | | 2 | 2 | 3 | 1 | 3 | 1 | 1 | 3 | 4 | | 3 | 3 | 4 | 2 | 4 | 1 | 2 | 4 | 5 | | 4 | 4 | 5 | 3 | 5 | 2 | 3 | 5 | 6 | | 5 | 5 | 6 | 4 | 6 | 3 | 4 | 6 | 7 | | 6 | 6 | 7 | 5 | 7 | 4 | 5 | 7 | 8 | | 7 | 7 | 8 | 6 | 8 | 5 | 6 | 8 | 9 | | 8 | 8 | 9 | 7 | 9 | 6 | 7 | 9 | 10 | | 9 | 9 | 10 | 8 | 10 | 7 | 8 | 10 | 10 | | 10 | 10 | 10 | 9 | 10 | 8 | 9 | NULL | NULL | +------+------+------+--------+--------+--------+--------+--------+--------+ ``` See Also -------- * [Setting a variable to a value](../set/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-convert-table-format mariadb-convert-table-format ============================ **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-convert-table-format` is a symlink to `mysql_convert_table_format`, the tool for converting the tables in a database to use a particular storage engine. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-convert-table-format` is the name of the tool, with `mysql_convert_table_format` a symlink . See [mysql\_convert\_table\_format](../mysql_convert_table_format/index) for details. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Introduction to Relational Databases Introduction to Relational Databases ==================================== What is a Database? ------------------- The easiest way to understand a database is as a collection of related files. Imagine a file (either paper or digital) of sales orders in a shop. Then there's another file of products, containing stock records. To fulfil an order, you'd need to look up the product in the order file and then look up and adjust the stock levels for that particular product in the product file. A database and the software that controls the database, called a *database management system* (DBMS), helps with this kind of task. Most databases today are *relational* databases, named such because they deal with tables of data related by a common field. For example, Table 1 below shows the product table, and Table 2 shows the invoice table. As you can see, the relation between the two tables is based on the common field `product_code`. Any two tables can relate to each other simply by having a field in common. ### Table 1 | *Product\_code* | Description | Price | | --- | --- | --- | | A416 | Nails, box | $0.14 | | C923 | Drawing pins, box | $0.08 | ### Table 2 | Invoice\_code | Invoice\_line | *Product\_code* | Quantity | | --- | --- | --- | --- | | 3804 | 1 | A416 | 10 | | 3804 | 2 | C923 | 15 | Database Terminology -------------------- Let's take a closer look at the previous two tables to see how they are organized: * Each table consists of many *rows* and *columns*. * Each new row contains data about one single *entity* (such as one product or one order line). This is called a *record*. For example, the first row in Table 1 is a record; it describes the A416 product, which is a box of nails that costs fourteen cents. The terms *row* and *record* are interchangeable. * Each column (also called an *attribute*) contains one piece of data that relates to the record, called a *tuple*. Examples of attributes are the quantity of an item sold or the price of a product. An attribute, when referring to a database table, is called a *field*. For example, the data in the *Description* column in Table 1 are fields. The terms *attribute* and *field* are interchangeable. Given this kind of structure, the database gives you a way to manipulate this data: SQL. SQL (structured query language) is a powerful way to search for records or make changes. Almost all DBMSs use SQL, although many have added their own enhancements to it. This means that when you learn SQL while using MariaDB, almost all of it is not specific to MariaDB and can be used with other relational databases as well, such as PostgreSQL, MySQL, Oracle and SQL Server. MariaDB was originally-created as a drop-in replacement to MySQL, so MariaDB and MySQL are particularly close. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb GET_FORMAT GET\_FORMAT =========== Syntax ------ ``` GET_FORMAT({DATE|DATETIME|TIME}, {'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL'}) ``` Description ----------- Returns a format string. This function is useful in combination with the [DATE\_FORMAT()](../date_format/index) and the [STR\_TO\_DATE()](../str_to_date/index) functions. Possible result formats are: | Function Call | Result Format | | --- | --- | | GET\_FORMAT(DATE,'EUR') | '%d.%m.%Y' | | GET\_FORMAT(DATE,'USA') | '%m.%d.%Y' | | GET\_FORMAT(DATE,'JIS') | '%Y-%m-%d' | | GET\_FORMAT(DATE,'ISO') | '%Y-%m-%d' | | GET\_FORMAT(DATE,'INTERNAL') | '%Y%m%d' | | GET\_FORMAT(DATETIME,'EUR') | '%Y-%m-%d %H.%i.%s' | | GET\_FORMAT(DATETIME,'USA') | '%Y-%m-%d %H.%i.%s' | | GET\_FORMAT(DATETIME,'JIS') | '%Y-%m-%d %H:%i:%s' | | GET\_FORMAT(DATETIME,'ISO') | '%Y-%m-%d %H:%i:%s' | | GET\_FORMAT(DATETIME,'INTERNAL') | '%Y%m%d%H%i%s' | | GET\_FORMAT(TIME,'EUR') | '%H.%i.%s' | | GET\_FORMAT(TIME,'USA') | '%h:%i:%s %p' | | GET\_FORMAT(TIME,'JIS') | '%H:%i:%s' | | GET\_FORMAT(TIME,'ISO') | '%H:%i:%s' | | GET\_FORMAT(TIME,'INTERNAL') | '%H%i%s' | Examples -------- Obtaining the string matching to the standard European date format: ``` SELECT GET_FORMAT(DATE, 'EUR'); +-------------------------+ | GET_FORMAT(DATE, 'EUR') | +-------------------------+ | %d.%m.%Y | +-------------------------+ ``` Using the same string to format a date: ``` SELECT DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR')); +--------------------------------------------------+ | DATE_FORMAT('2003-10-03',GET_FORMAT(DATE,'EUR')) | +--------------------------------------------------+ | 03.10.2003 | +--------------------------------------------------+ SELECT STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA')); +--------------------------------------------------+ | STR_TO_DATE('10.31.2003',GET_FORMAT(DATE,'USA')) | +--------------------------------------------------+ | 2003-10-31 | +--------------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB ColumnStore software upgrade 1.0.9 to 1.0.10 MariaDB ColumnStore software upgrade 1.0.9 to 1.0.10 ==================================================== MariaDB ColumnStore software upgrade 1.0.9 to 1.0.10 ---------------------------------------------------- Note: Columnstore.xml modifications you manually made are not automatically carried forward on an upgrade. These modifications will need to be incorporated back into .XML once the upgrade has occurred. The previous configuration file will be saved as /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave. If you have specified a root database password (which is good practice), then you must configure a .my.cnf file with user credentials for the upgrade process to use. Create a .my.cnf file in the user home directory with 600 file permissions with the following content (updating PASSWORD as appropriate): ``` [mysqladmin] user = root password = PASSWORD ``` ### Choosing the type of upgrade As noted on the Preparing guide, you can installing MariaDB ColumnStore with the use of soft-links. If you have the softlinks be setup at the Data Directory Levels, like mariadb/columnstore/data and mariadb/columnstore/dataX, then your upgrade will happen without any issues. In the case where you have a softlink at the top directory, like /usr/local/mariadb, you will need to upgrade using the binary package. If you updating using the rpm package and tool, this softlink will be deleted when you perform the upgrade process and the upgrade will fail. #### Root User Installs #### Upgrading MariaDB ColumnStore using RPMs Upgrade MariaDB ColumnStore as user root on the server designated as PM1: **Download the package mariadb-columnstore-1.0.10-1-centos#.x86\_64.rpm.tar.gz to the PM1 server where you are installing MariaDB ColumnStore.** Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate a set of RPMs that will reside in the /root/ directory. ``` # tar -zxf mariadb-columnstore-1.0.10-1-centos#.x86_64.rpm.tar.gz ``` * Upgrade the RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` # rpm -e --nodeps $(rpm -qa | grep '^mariadb-columnstore') # rpm -ivh mariadb-columnstore-*1.0.10*rpm ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml.rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` For RPM Upgrade, the previous configuration file will be saved as: /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /usr/local directory -mariadb-columnstore-1.0.10-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # /usr/local/mariadb/columnstore/bin/pre-uninstall ``` * Unpack the tarball, in the /usr/local/ directory. ``` # tar -zxvf -mariadb-columnstore-1.0.10-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # /usr/local/mariadb/columnstore/bin/post-install ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` ### Upgrading MariaDB ColumnStore using the DEB package A DEB upgrade would be done on a system that supports DEBs like Debian or Ubuntu systems. Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /root directory mariadb-columnstore-1.0.10-1.amd64.deb.tar.gz (DEB 64-BIT) to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate DEBs. ``` # tar -zxf mariadb-columnstore-1.0.10-1.amd64.deb.tar.gz ``` * Remove, purge and install all MariaDB ColumnStore debs ``` # cd /root/ # dpkg -r $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg -P $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg --install mariadb-columnstore-*1.0.10-1*deb ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` #### Non-Root User Installs ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /home/'non-root-user" directory mariadb-columnstore-1.0.10-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # $HOME/mariadb/columnstore/bin/pre-uninstall --installdir= /home/guest/mariadb/columnstore ``` * Unpack the tarball, which will generate the $HOME/ directory. ``` # tar -zxvf -mariadb-columnstore-1.0.10-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # $HOME/mariadb/columnstore/bin/post-install --installdir=/home/guest/mariadb/columnstore ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # $HOME/mariadb/columnstore/bin/postConfigure -u -i /home/guest/mariadb/columnstore ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Key Management and Encryption Plugins Key Management and Encryption Plugins ====================================== | Title | Description | | --- | --- | | [Encryption Key Management](../encryption-key-management/index) | Managing encryption keys for data-at-rest encryption. | | [File Key Management Encryption Plugin](../file-key-management-encryption-plugin/index) | A key management and encryption plugin for data-at-rest encryption that uses a plain-text file. | | [Hashicorp Key Management Plugin](../hashicorp-key-management-plugin/index) | Implement encryption using keys stored in the Hashicorp Vault KMS. | | [AWS Key Management Encryption Plugin](../aws-key-management-encryption-plugin/index) | A key management and encryption plugin for data-at-rest encryption that use... | | [Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Setup Guide](../aws-key-management-encryption-plugin-setup-guide/index) | Plugin that uses the AWS Key Management Service. | | [Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Advanced Usage](../aws-key-management-encryption-plugin-advanced-usage/index) | This document assumes you've already set up an Amazon Web Services (AWS) a... | | [Eperi Key Management Encryption Plugin](../eperi-key-management-encryption-plugin/index) | A key management and encryption plugin for data-at-rest encryption that use... | | [Encryption Plugin API](../encryption-plugin-api/index) | MariaDB uses plugins to handle key management and encryption of data. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb BLOB BLOB ==== Syntax ------ ``` BLOB[(M)] ``` Description ----------- A `BLOB` column with a maximum length of `65,535` (`216 - 1`) bytes. Each `BLOB` value is stored using a two-byte length prefix that indicates the number of bytes in the value. An optional length `M` can be given for this type. If this is done, MariaDB creates the column as the smallest `BLOB` type large enough to hold values *`M`* bytes long. BLOBS can also be used to store [dynamic columns](../dynamic-columns/index). Before [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/), `BLOB` and `TEXT` columns could not be assigned a [DEFAULT](../create-table/index#default) value. This restriction was lifted in [MariaDB 10.2.1](https://mariadb.com/kb/en/mariadb-1021-release-notes/). ### Indexing **MariaDB starting with [10.4](../what-is-mariadb-104/index)**From [MariaDB 10.4](../what-is-mariadb-104/index), it is possible to set a [unique index](../getting-started-with-indexes/index#unique-index) on a column that uses the `BLOB` data type. In previous releases this was not possible, as the index would only guarantee the uniqueness of a fixed number of characters. ### Oracle Mode **MariaDB starting with [10.3](../what-is-mariadb-103/index)**In [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#synonyms-for-basic-sql-types), `BLOB` is a synonym for `LONGBLOB`. See Also -------- * [BLOB and TEXT Data Types](../blob-and-text-data-types/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) * [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#synonyms-for-basic-sql-types) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Fusion-io Introduction Fusion-io Introduction ====================== Fusion-io develops PCIe based NAND flash memory cards and related software that can be used to speed up MariaDB databases. The ioDrive branded products can be used as block devices (super-fast disks) or to extend basic DRAM memory. ioDrive is deployed by installing it on an x86 server and then installing the card driver under the operating system. All main line 64-bit operating systems and hypervisors are supported: RHEL, CentOS, SuSe, Debian, OEL etc. and VMware, Microsoft Windows/Server etc. Drivers and their features are constantly developed further. ioDrive cards support software RAID and you can combine two or more physical cards into one logical drive. Through ioMemory SDK and its APIs, one can integrate and enable more thorough interworking between your own software and the cards - and cut latency. The key differentiator between a Fusion-io and a legacy SSD/HDD is the following: **A Fusion-io card is connected directly on the system bus (PCIe)**, this enables high data transfer throughput (1.5 GB/s, 3.0 GB/s or 6GB/s) and the fast direct memory access (DMA) method can be used to transfer data. The ATA/SATA protocol stack is omitted and therefore latency is cut short. Fusion-io performance is dependent on server speed: the faster processors and the newer PCIe-bus version you have, the better is the ioDrive performance. Fusion-io memory is non-volatile, in other words, data remains on the card even when the server is powered off. Use Cases --------- 1. You can start by using ioDrive for database files that need heavy random access. 2. Whole database on ioDrive. 3. In some cases, Fusion-io devices allow for atomic writes, which allows the server to safely disable the [doublewrite buffer](../xtradbinnodb-doublewrite-buffer/index). 4. Use ioDrive as a write-through read cache. This is possible on server level with Fusion-io directCache software or in VMware environments using ioTurbine software or the ioCache bundle product. Reads happen from ioDrive and all writes go directly to your SAN or disk. 5. Highly Available shared storage with ION. Have two different hosts, Fusion-io cards in them and share/replicate data with Fusion-io's ION software. 6. The luxurious Platinum setup: [MariaDB Galera Cluster](http://kb.askmonty.org/en/what-is-mariadb-galera-cluster/) running on Fusion-io SLC cards on several hosts. Atomic Writes ------------- Starting with [MariaDB 5.5.31](https://mariadb.com/kb/en/mariadb-5531-release-notes/), MariaDB Server supports atomic writes on Fusion-io devices that use the NVMFS (formerly called DirectFS) file system. Unfortunately, NVMFS was never offered under ‘General Availability’, and SanDisk declared that NVMFS would reach end-of-life in December 2015. Therefore, NVMFS support is no longer offered by SanDisk. MariaDB Server does not currently support atomic writes on Fusion-io devices with any other file systems. See [atomic write support](../atomic-write-support/index) for more information about MariaDB Server's atomic write support. Future Suggested Development ---------------------------- * Extend InnoDB disk cache to be stored on Fusion-io acting as extended memory. Settings For Best Performance ----------------------------- Fusion-io memory can be formatted with different sector size of either 512 or 4096 bytes. Bigger sectors are expected to be faster, but only if I/O is done in blocks of 4KB or multiples of that. Speaking of MariaDB: if only InnoDB data files are stored in Fusion-io memory, all I/O is done in blocks of 16K and thus 4K sector size can be used. If the InnoDB redo log (I/O block size: 512 bytes) goes to the same Fusion-io memory, then short sectors should be used. Note: XtraDB has the experimental feature of an increased InnoDB log block size of 4K. If this is enabled, then both redo log I/O and page I/O in InnoDB will match a sector size of 4K. As of file systems: currently XFS is expected to yield the best performance with MariaDB. However depending on the exact kernel version and version of XFS code in use, one might be affected by [a bug that severely limits XFS performance in concurrent environments](http://www.mysqlperformanceblog.com/2012/03/15/ext4-vs-xfs-on-ssd/comment-page-1/#comment-903938). This has [been fixed in kernel versions above 3.5](https://github.com/torvalds/linux/commit/507630b29f13a3d8689895618b12015308402e22) or [RHEL6 kernels kernel-2.6.32-358 or later](https://rhn.redhat.com/errata/RHSA-2013-0496.html) (because of [bug 807503 being fixed)](https://bugzilla.redhat.com/show_bug.cgi?id=807503). For the pitbull machine where I have run such tests, ext4 was faster than xfs for 32 or more threads: * up to 8 threads xfs was few percent faster (10% on average). * at 16 threads it was a draw (2036 tps vs. 2070 tps). * at 32 threads ext4 was 28% faster (2345 tps vs. 1829 tps). * at 64 threads ext4 was even 47% faster (2362 tps vs. 1601 tps). * at higher concurrency ext4 lost it’s bite, but was still constantly better than xfs. Those numbers are for spinning disks. I guess for Fusion-io memory the XFS numbers will be even worse. Example Configuration --------------------- Card Models ----------- There are several card models. ioDrive is older generation, ioDrive2 is newer. SLC sustains more writes. MLC is good enough for normal use. 1. ioDrive2, capacities per card 365GB, 785GB, 1.2TB with MLC. 400GB and 600GB with SLC, performance up to 535000 IOPS & 1.5GB/s bandwidth 2. ioDrive2 Duo, capacities per card 2.4TB MLC and 1.2TB SLC, performance up to 935000 IOPS & 3.0GB/s bandwidth 3. ioDrive, capacities per card 320GB, 640GB MLC and 160GB, 320GB SLC, performance up to 145000 IOPS & 790MB/s bandwidth 4. ioDrive Duo, capacities per card 640GB, 1.28TB MLC and 320GB, 640GB SLC, performance up to 285000 IOPS & 1.5GB/s bandwidth 5. ioDrive Octal, capacities per card 5TB and 10TB MLC, performance up to 1350000 IOPS & 6.7GB/s bandwidth 6. ioFX, a 420GB QDP MLC workstation product, 1.4GB/s bandwidth 7. ioCache, a 600GB MLC card with ioTurbine software bundle that can be used to speed up VMware based virtual hosts. 8. ioScale, 3.2TB card, building block to enable all-flash data center build out in hyperscale web and cloud environments. Product has been developed in co-operation with Facebook. Additional Software ------------------- * directCache - transforms ioDrive to work as a read cache in your server. Writes go directly to your SAN * ioTurbine - read cache software for VMware * ION - transforms ioDrive into a shareable storage * ioSphere - software to manage and monitor several ioDrives See Also -------- * [FusionIO atomic-series devices](http://www.fusionio.com/products/atomic-series) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Information Schema SQL_FUNCTIONS Table Information Schema SQL\_FUNCTIONS Table ======================================= **MariaDB starting with [10.6.3](https://mariadb.com/kb/en/mariadb-1063-release-notes/)**The `SQL_FUNCTIONS` table was added in [MariaDB 10.6.3](https://mariadb.com/kb/en/mariadb-1063-release-notes/). Description ----------- The [Information Schema](../information_schema/index) `SQL_FUNCTIONS` table contains the list of [MariaDB functions](../built-in-functions/index). It contains a single column: | Column | Description | | --- | --- | | `FUNCTION` | Function name | The table is not a standard Information Schema table, and is a MariaDB extension. Example ------- ``` SELECT * FROM INFORMATION_SCHEMA.SQL_FUNCTIONS; +---------------------------+ | FUNCTION | +---------------------------+ | ADDDATE | | ADD_MONTHS | | BIT_AND | | BIT_OR | | BIT_XOR | | CAST | | COUNT | | CUME_DIST | | CURDATE | | CURTIME | | DATE_ADD | | DATE_SUB | | DATE_FORMAT | | DECODE | | DENSE_RANK | | EXTRACT | | FIRST_VALUE | | GROUP_CONCAT | | JSON_ARRAYAGG | | JSON_OBJECTAGG | | LAG | | LEAD | | MAX | | MEDIAN | | MID | | MIN | | NOW | | NTH_VALUE | | NTILE | | POSITION | | PERCENT_RANK | | PERCENTILE_CONT | | PERCENTILE_DISC | | RANK | | ROW_NUMBER | | SESSION_USER | | STD | | STDDEV | | STDDEV_POP | | STDDEV_SAMP | | SUBDATE | | SUBSTR | | SUBSTRING | | SUM | | SYSTEM_USER | | TRIM | | TRIM_ORACLE | | VARIANCE | | VAR_POP | | VAR_SAMP | | ABS | | ACOS | | ADDTIME | | AES_DECRYPT | | AES_ENCRYPT | | ASIN | | ATAN | | ATAN2 | | BENCHMARK | | BIN | | BINLOG_GTID_POS | | BIT_COUNT | | BIT_LENGTH | | CEIL | | CEILING | | CHARACTER_LENGTH | | CHAR_LENGTH | | CHR | | COERCIBILITY | | COLUMN_CHECK | | COLUMN_EXISTS | | COLUMN_LIST | | COLUMN_JSON | | COMPRESS | | CONCAT | | CONCAT_OPERATOR_ORACLE | | CONCAT_WS | | CONNECTION_ID | | CONV | | CONVERT_TZ | | COS | | COT | | CRC32 | | DATEDIFF | | DAYNAME | | DAYOFMONTH | | DAYOFWEEK | | DAYOFYEAR | | DEGREES | | DECODE_HISTOGRAM | | DECODE_ORACLE | | DES_DECRYPT | | DES_ENCRYPT | | ELT | | ENCODE | | ENCRYPT | | EXP | | EXPORT_SET | | EXTRACTVALUE | | FIELD | | FIND_IN_SET | | FLOOR | | FORMAT | | FOUND_ROWS | | FROM_BASE64 | | FROM_DAYS | | FROM_UNIXTIME | | GET_LOCK | | GREATEST | | HEX | | IFNULL | | INSTR | | ISNULL | | IS_FREE_LOCK | | IS_USED_LOCK | | JSON_ARRAY | | JSON_ARRAY_APPEND | | JSON_ARRAY_INSERT | | JSON_COMPACT | | JSON_CONTAINS | | JSON_CONTAINS_PATH | | JSON_DEPTH | | JSON_DETAILED | | JSON_EXISTS | | JSON_EXTRACT | | JSON_INSERT | | JSON_KEYS | | JSON_LENGTH | | JSON_LOOSE | | JSON_MERGE | | JSON_MERGE_PATCH | | JSON_MERGE_PRESERVE | | JSON_QUERY | | JSON_QUOTE | | JSON_OBJECT | | JSON_REMOVE | | JSON_REPLACE | | JSON_SET | | JSON_SEARCH | | JSON_TYPE | | JSON_UNQUOTE | | JSON_VALID | | JSON_VALUE | | LAST_DAY | | LAST_INSERT_ID | | LCASE | | LEAST | | LENGTH | | LENGTHB | | LN | | LOAD_FILE | | LOCATE | | LOG | | LOG10 | | LOG2 | | LOWER | | LPAD | | LPAD_ORACLE | | LTRIM | | LTRIM_ORACLE | | MAKEDATE | | MAKETIME | | MAKE_SET | | MASTER_GTID_WAIT | | MASTER_POS_WAIT | | MD5 | | MONTHNAME | | NAME_CONST | | NVL | | NVL2 | | NULLIF | | OCT | | OCTET_LENGTH | | ORD | | PERIOD_ADD | | PERIOD_DIFF | | PI | | POW | | POWER | | QUOTE | | REGEXP_INSTR | | REGEXP_REPLACE | | REGEXP_SUBSTR | | RADIANS | | RAND | | RELEASE_ALL_LOCKS | | RELEASE_LOCK | | REPLACE_ORACLE | | REVERSE | | ROUND | | RPAD | | RPAD_ORACLE | | RTRIM | | RTRIM_ORACLE | | SEC_TO_TIME | | SHA | | SHA1 | | SHA2 | | SIGN | | SIN | | SLEEP | | SOUNDEX | | SPACE | | SQRT | | STRCMP | | STR_TO_DATE | | SUBSTR_ORACLE | | SUBSTRING_INDEX | | SUBTIME | | SYS_GUID | | TAN | | TIMEDIFF | | TIME_FORMAT | | TIME_TO_SEC | | TO_BASE64 | | TO_CHAR | | TO_DAYS | | TO_SECONDS | | UCASE | | UNCOMPRESS | | UNCOMPRESSED_LENGTH | | UNHEX | | UNIX_TIMESTAMP | | UPDATEXML | | UPPER | | UUID | | UUID_SHORT | | VERSION | | WEEKDAY | | WEEKOFYEAR | | WSREP_LAST_WRITTEN_GTID | | WSREP_LAST_SEEN_GTID | | WSREP_SYNC_WAIT_UPTO_GTID | | YEARWEEK | +---------------------------+ 234 rows in set (0.001 sec) ``` See Also -------- * [Reserved Words](../reserved-words/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Athens - Replication in MariaDB - notes Athens - Replication in MariaDB - notes ======================================= **Note:** This page is obsolete. The information is old, outdated, or otherwise currently incorrect. We are keeping the page for historical reasons only. **Do not** rely on the information in this article. Overview of Replication in MariaDB: [Replication](../replication/index) In [MariaDB 5.3](../what-is-mariadb-53/index): ---------------------------------------------- * Group Commit for the binary log. + [Mark Callaghan from Facebook did some benchmarks:](http://www.facebook.com/note.php?note_id=10150211546215933) + The Facebook patch and the implementation in [MariaDB 5.3](../what-is-mariadb-53/index) are two different solutions to the same problem. The latest Facebook patch is close to the performance in MariaDB, but MariaDB is still faster. + [Benchmarking thread scheduling in group commit, part 2](http://kristiannielsen.livejournal.com/15739.html) * Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT + Is actually consistent now ... + non-blocking slave privisioning * Annotation of row-based replication events with the original SQL statement + A separate, but very similar, implementation is in 5.6 * Row-based replication for tables with no primary key * PBXT consistent commit ordering * Binlog Event Checksums (backport from MySQL 5.6 To be in [MariaDB 5.5](../what-is-mariadb-55/index) --------------------------------------------------- * `@@do_not_replicate` Additional: ----------- * Fixing `rpl_transaction_enabled` in case we crash and rollback during XA Misc: ----- * This preview also includes a small change to make mysqlbinlog omit redundatn use statements around BEGIN, SACEPOINT, COMMIT, and ROLLBACK events when reading MySQL 5.0 binlogs. * The preview included a feature `--innodb-release-locks-early`. However we decided to omit this feature from future MariaDB releases because of a fundamental design bug, [Bug #798213](https://bugs.launchpad.net/bugs/798213) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Sphinx Status Variables Sphinx Status Variables ======================= This page documents status variables related to the [Sphinx storage engine](../sphinx-storage-engine/index). See [Server Status Variables](../server-status-variables/index) for a complete list of status variables that can be viewed with [SHOW STATUS](../show-status/index). See also the [Full list of MariaDB options, system and status variables](../full-list-of-mariadb-options-system-and-status-variables/index). #### `Sphinx_error` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Sphinx_time` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Sphinx_total` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Sphinx_total_found` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Sphinx_word_count` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Sphinx_words` * **Description:** See [SHOW ENGINE SPHINX STATUS](../about-sphinxse/index#show-engine-sphinx-status). * **Scope:** Global, Session * **Data Type:** `numeric` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Building MariaDB on Fedora Building MariaDB on Fedora ========================== In the event that you are using the Linux-based operating system Fedora or any of its derivatives and would like to compile MariaDB from source code, you can do so using the MariaDB build in the official repositories. Installing Build Dependencies ----------------------------- MariaDB requires a number of packages to compile from source. Fortunately, you can use the package in the Fedora repository to retrieve most of the relevant build dependencies through DNF. ``` # dnf builddep mariadb-server ``` Running DNF in this way pulls the build dependencies for the release of MariaDB compiled by your version of Fedora. These may not be all the dependencies you need to build the particular version of MariaDB you want to use, but it will retrieve most of them. You'll also need to install Git to retrieve the source repository: ``` # dnf install git ``` Building MariaDB ---------------- Once you have the base dependencies installed, you can retrieve the source code and start building MariaDB. The source code is available on GitHub. Use the `--branch` option to specify the particular version of MariaDB you want to build. ``` $ git clone --branch 10.3 https://github.com/MariaDB/server.git mariadb-server ``` With the source repository cloned onto your system, you can start building MariaDB. Change into the new `mariadb-server/` directory and run CMake to prepare the build. ``` $ mkdir mariadb-build $ cd mariadb-build $ cmake -DRPM=fedora ../mariadb-server ``` Once CMake readies the relevant Makefile for your system, use Make to build MariaDB. ``` $ make package ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Optimizing String and Character Fields Optimizing String and Character Fields ====================================== Comparing String Columns ------------------------ When values from different columns are compared, the comparison runs more quickly when the columns are of the same character set and collation. If they are different, the strings need to be converted while the query runs. So, where possible, declare string columns using the same character set and collation when you may need to compare them. VARCHAR vs BLOB --------------- ORDER BY and GROUP BY clauses can generate temporary tables in memory (see [MEMORY Storage Engine](../memory-storage-engine/index)) if the original table doesn't contain any BLOB fields. If a column is less than 8KB, you can make use of a Binary VARCHAR rather than a BLOB. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Monitors InnoDB Monitors =============== The [InnoDB](../innodb/index) Monitor refers to particular kinds of monitors included in MariaDB and since the early versions of MySQL. There are four types: the standard InnoDB monitor, the InnoDB Lock Monitor, InnoDB Tablespace Monitor and the InnoDB Table Monitor. Standard InnoDB Monitor ----------------------- The standard InnoDB Monitor returns extensive InnoDB information, particularly lock, semaphore, I/O and buffer activity: To enable the standard InnoDB Monitor, from [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), set the [innodb\_status\_output](../xtradbinnodb-server-system-variables/index#innodb_status_output) system variable to 1. Before [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), running the following statement was the method used: ``` CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; ``` To disable the standard InnoDB monitor, either set the system variable to zero, or, before [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), drop the table ``` DROP TABLE innodb_monitor; ``` The CREATE TABLE and DROP TABLE method of enabling and disabling the InnoDB Monitor has been deprecated, and may be removed in a future version of MariaDB. For a description of the output, see [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index). InnoDB Lock Monitor ------------------- The InnoDB Lock Monitor displays additional lock information. To enable the InnoDB Lock Monitor, the standard InnoDB monitor must be enabled. Then, from [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), set the [innodb\_status\_output\_locks](../xtradbinnodb-server-system-variables/index#innodb_status_output_locks) system variable to 1. Before [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), running the following statement was the method used: ``` CREATE TABLE innodb_lock_monitor (a INT) ENGINE=INNODB; ``` To disable the standard InnoDB monitor, either set the system variable to zero, or, before [MariaDB 10.0.14](https://mariadb.com/kb/en/mariadb-10014-release-notes/), drop the table ``` DROP TABLE innodb_lock_monitor; ``` The CREATE TABLE and DROP TABLE method of enabling and disabling the InnoDB Lock Monitor has been deprecated, and may be removed in a future version of MariaDB. InnoDB Tablespace Monitor ------------------------- The InnoDB Tablespace Monitor is deprecated, and may be removed in a future version of MariaDB. Enabling the Tablespace Monitor outputs a list of file segments in the shared tablespace to the error log, and validates the tablespace allocation data structures. To enable the Tablespace Monitor, run the following statement: ``` CREATE TABLE innodb_tablespace_monitor (a INT) ENGINE=INNODB; ``` To disable it, drop the table: ``` DROP TABLE innodb_tablespace_monitor; ``` InnoDB Table Monitor -------------------- The InnoDB Table Monitor is deprecated, and may be removed in a future version of MariaDB. Enabling the Table Monitor outputs the contents of the InnoDB internal data dictionary to the error log every fifteen seconds. To enable the Table Monitor, run the following statement: ``` CREATE TABLE innodb_table_monitor (a INT) ENGINE=INNODB; ``` To disable it, drop the table: ``` DROP TABLE innodb_table_monitor; ``` SHOW ENGINE INNODB STATUS ------------------------- The [SHOW ENGINE INNODB STATUS](../show-engine-innodb-status/index) statement can be used to obtain the standard InnoDB Monitor output when required, rather than sending it to the error log. It will also display the InnoDB Lock Monitor information if the [innodb\_status\_output\_locks](../xtradbinnodb-server-system-variables/index#innodb_status_output_locks) system variable is set to `1`. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_NumInteriorRings ST\_NumInteriorRings ==================== Syntax ------ ``` ST_NumInteriorRings(poly) NumInteriorRings(poly) ``` Description ----------- Returns an integer containing the number of interior rings in the Polygon value `poly`. Note that according the the OpenGIS standard, a [POLYGON](../polygon/index) should have exactly one ExteriorRing and all other rings should lie within that ExteriorRing and thus be the InteriorRings. Practically, however, some systems, including MariaDB's, permit polygons to have several 'ExteriorRings'. In the case of there being multiple, non-overlapping exterior rings ST\_NumInteriorRings() will return `1`. `ST_NumInteriorRings()` and `NumInteriorRings()` are synonyms. Examples -------- ``` SET @poly = 'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'; SELECT NumInteriorRings(GeomFromText(@poly)); +---------------------------------------+ | NumInteriorRings(GeomFromText(@poly)) | +---------------------------------------+ | 1 | +---------------------------------------+ ``` Non-overlapping 'polygon': ``` SELECT ST_NumInteriorRings(ST_PolyFromText('POLYGON((0 0,10 0,10 10,0 10,0 0), (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))')) AS NumInteriorRings; +------------------+ | NumInteriorRings | +------------------+ | 1 | +------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb LAST_DAY LAST\_DAY ========= Syntax ------ ``` LAST_DAY(date) ``` Description ----------- Takes a date or datetime value and returns the corresponding value for the last day of the month. Returns NULL if the argument is invalid. Examples -------- ``` SELECT LAST_DAY('2003-02-05'); +------------------------+ | LAST_DAY('2003-02-05') | +------------------------+ | 2003-02-28 | +------------------------+ SELECT LAST_DAY('2004-02-05'); +------------------------+ | LAST_DAY('2004-02-05') | +------------------------+ | 2004-02-29 | +------------------------+ SELECT LAST_DAY('2004-01-01 01:01:01'); +---------------------------------+ | LAST_DAY('2004-01-01 01:01:01') | +---------------------------------+ | 2004-01-31 | +---------------------------------+ SELECT LAST_DAY('2003-03-32'); +------------------------+ | LAST_DAY('2003-03-32') | +------------------------+ | NULL | +------------------------+ 1 row in set, 1 warning (0.00 sec) Warning (Code 1292): Incorrect datetime value: '2003-03-32' ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb A MariaDB Primer A MariaDB Primer ================ This primer is designed to teach you the basics of getting information into and out of an existing MariaDB database using the [mysql](../mysql-command-line-client/index) command-line client program. It's not a complete reference and will not touch on any advanced topics. It is just a quick jump-start into using MariaDB. #### Logging into MariaDB Log into your MariaDB server from the command-line like so: ``` mysql -u //user_name// -p -h //ip_address// //db_name// ``` Replace *user\_name* with your database username. Replace *ip\_address* with the host name or address of your server. If you're accessing MariaDB from the same server you're logged into, then don't include `-h` and the *ip\_address*. Replace *db\_name* with the name of the database you want to access (such as *test*, which sometimes comes already created for testing purposes - note that Windows does not create this database, and some setups may also have removed the `test` database by running [mariadb-secure-installation/mysql\_secure\_installation](../mysql_secure_installation/index), in which case you can leave the *db\_name* out). When prompted to enter your password, enter it. If your login is successful you should see something that looks similar to this: ``` MariaDB [test]> ``` This is where you will enter in all of your SQL statements. More about those later. For now, let's look at the components of the prompt: The "MariaDB" part means you that you are connected to a MariaDB database server. The word between the brackets is the name of your default database, the *test* database in this example. #### The Basics of a Database To make changes to a database or to retrieve data, you will need to enter an SQL statement. SQL stands for Structured Query Language. An SQL statement that requests data is called a query. Databases store information in tables. They're are similar to spreadsheets, but much more efficient at managing data. Note that the *test* database may not contain any data yet. If you want to follow along with the primer, copy and paste the following into the [mysql](../mysql-command-line-client/index) client. This will create the tables we will use and add some data to them. Don't worry about understanding them yet; we'll get to that later. ``` CREATE DATABASE IF NOT EXISTS test; USE test; CREATE TABLE IF NOT EXISTS books ( BookID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Title VARCHAR(100) NOT NULL, SeriesID INT, AuthorID INT); CREATE TABLE IF NOT EXISTS authors (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT); CREATE TABLE IF NOT EXISTS series (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT); INSERT INTO books (Title,SeriesID,AuthorID) VALUES('The Fellowship of the Ring',1,1), ('The Two Towers',1,1), ('The Return of the King',1,1), ('The Sum of All Men',2,2), ('Brotherhood of the Wolf',2,2), ('Wizardborn',2,2), ('The Hobbbit',0,1); ``` Notice the semi-colons used above. The [mysql](../mysql-command-line-client/index) client lets you enter very complex SQL statements over multiple lines. It won't send an SQL statement until you type a semi-colon and hit [Enter]. Let's look at what you've done so far. Enter the following: ``` SHOW TABLES; +----------------+ | Tables_in_test | +----------------+ | authors | | books | | series | +----------------+ 3 rows in set (0.00 sec) ``` Notice that this displays a list of the tables in the database. If you didn't already have tables in your `test` database, your results should look the same as above. Let's now enter the following to get information about one of these tables: ``` DESCRIBE books; +----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+----------------+ | BookID | int(11) | NO | PRI | NULL | auto_increment | | Title | varchar(100) | NO | | NULL | | | SeriesID | int(11) | YES | | NULL | | | AuthorID | int(11) | YES | | NULL | | +----------+--------------+------+-----+---------+----------------+ ``` The main bit of information of interest to us is the *Field* column. The other columns provide useful information about the structure and type of data in the database, but the *Field* column gives us the names, which is needed to retrieve data from the table. Let's retrieve data from the `books` table. We'll do so by executing a [SELECT](../select/index) statement like so: ``` SELECT * FROM books; +--------+----------------------------+----------+----------+ | BookID | Title | SeriesID | AuthorID | +--------+----------------------------+----------+----------+ | 1 | The Fellowship of the Ring | 1 | 1 | | 2 | The Two Towers | 1 | 1 | | 3 | The Return of the King | 1 | 1 | | 4 | The Sum of All Men | 2 | 2 | | 5 | Brotherhood of the Wolf | 2 | 2 | | 6 | Wizardborn | 2 | 2 | | 7 | The Hobbbit | 0 | 1 | +--------+----------------------------+----------+----------+ 7 rows in set (0.00 sec) ``` This SQL statement or query asks the database to show us all of the data in the `books` table. The wildcard ('`*`') character indicates to select all columns. #### Inserting Data Suppose now that we want to add another book to this table. We'll add the book, *Lair of Bones*. To insert data into a table, you would use the [INSERT](../insert/index) statement. To insert information on a book, we would enter something like this: ``` INSERT INTO books (Title, SeriesID, AuthorID) VALUES ("Lair of Bones", 2, 2); Query OK, 1 row affected (0.00 sec) ``` Notice that we put a list of columns in parentheses after the name of the table, then we enter the keyword `VALUES` followed by a list of values in parentheses--in the same order as the columns were listed. We could put the columns in a different order, as long as the values are in the same order as we list the columns. Notice the message that was returned indicates that the execution of the SQL statement went fine and one row was entered. Execute the following SQL statement again and see what results are returned: ``` SELECT * FROM books; ``` You should see the data you just entered on the last row of the results. In looking at the data for the other books, suppose we notice that the title of the seventh book is spelled wrong. It should be spelled *The Hobbit*, not *The Hobbbit*. We will need to update the data for that row. #### Modifying Data To change data in a table, you will use the [UPDATE](../update/index) statement. Let's change the spelling of the book mentioned above. To do this, enter the following: ``` UPDATE books SET Title = "The Hobbit" WHERE BookID = 7; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 ``` Notice the syntax of this SQL statement. The `SET` clause is where you list the columns and the values to set them. The `WHERE` clause says that you want to update only rows in which the `BookID` column has a value of `7`, of which there are only one. You can see from the message it returned that one row matched the `WHERE` clause and one row was changed. There are no warnings because everything went fine. Execute the [SELECT](../select/index) from earlier to see that the data changed. As you can see, using MariaDB isn't very difficult. You just have to understand the syntax of SQL since it doesn't allow for typing mistakes or things in the wrong order or other deviations. #### See Also * [MariaDB Basics](../mariadb-basics/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Spider Storage Engine Core Concepts Spider Storage Engine Core Concepts =================================== A typical Spider deployment has a shared-nothing clustered architecture. The system works with any inexpensive hardware, and with a minimum of specific requirements for hardware or software. It consists of a set of computers, with one or more MariaDB processes known as nodes. The nodes that store the data will be designed as `Backend Nodes`, and can be any MariaDB, MySQL, Oracle server instances using any storage engine available inside the backend. The `Spider Proxy Nodes` are instances running at least MariaDB 10. `Spider Proxy Nodes` are used to declare per table attachment to the backend nodes. In addition `Spider Proxy Nodes` can be setup to enable the tables to be split and mirrored to multiple `Backend Nodes`. Spider Common Usage ------------------- In the default high availability setup #Spider Nodes# produce SQL errors when a backend server is not responding. Per table monitoring can be setup to enable availability in case of unresponsive backends `monotoring_bg_kind=1` or `monotoring_bg_kind=2`. The Monitoring Spider Nodes will be inter-connected with usage of the system table `mysql.link_mon_servers` to manage network partitioning. Better known as split brain, an even number of `Spider Monitor Nodes` should be setup to allow a consensus based on the majority. Rather a single separated shared `Monitoring Node` instance or a minimum set of 3 `Spider Nodes`. More information can be found [here](http://fr.slideshare.net/Kentoku/spider-ha-20100922dtt7). Spider Storage Engine Federation -------------------------------- Spider is a pluggable Storage Engine, acting as a proxy between the optimizer and the remote backends. When the optimizer requests multiple calls to the storage engine, Spider enforces consistency using the 2 phase commit protocol to the backends and by creating transactions on the backends to preserve atomic operations for a single SQL execution. Preserving atomic operation during execution is used at multiple levels in the architecture,. For the regular optimizer plan, it refers to `multiple split reads` and for concurrent partition scans, it will refer to `semi transactions`. Costly queries can be more efficient when it is possible to fully push down part of the execution plan on each backend and reduce the result afterwards. Spider enables such execution with some direct execution shortcuts. Spider Threading Model ---------------------- Spider uses the per partitions and per table model to concurrently access the remote backend nodes. For memory workload that property can be used to define multiple partitions on a single remote backend node to better adapt the concurrency to available CPUs in the hardware. Spider maintains an internal dictionary of Table and Index statistics based on separated threads. The statistics are pulled per default on a time line basis and refer to `crd` for cardinality and `sts` for table status. Spider Memory Model ------------------- Spider stores resultsets into memory, but [spider\_quick\_mode](../spider-server-system-variables/index#spider_quick_mode)=3 stores resultsets into internal temporary tables if the resultsets are larger than quick\_table\_size. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Subqueries and EXISTS Subqueries and EXISTS ===================== Syntax ------ ``` SELECT ... WHERE EXISTS <Table subquery> ``` Description ----------- [Subqueries](../subqueries/index) using the `EXISTS` keyword will return `true` if the subquery returns any rows. Conversely, subqueries using `NOT EXISTS` will return `true` only if the subquery returns no rows from the table. EXISTS subqueries ignore the columns specified by the [SELECT](../select/index) of the subquery, since they're not relevant. For example, ``` SELECT col1 FROM t1 WHERE EXISTS (SELECT * FROM t2); ``` and ``` SELECT col1 FROM t1 WHERE EXISTS (SELECT col2 FROM t2); ``` produce identical results. Examples -------- ``` CREATE TABLE sq1 (num TINYINT); CREATE TABLE sq2 (num2 TINYINT); INSERT INTO sq1 VALUES(100); INSERT INTO sq2 VALUES(40),(50),(60); SELECT * FROM sq1 WHERE EXISTS (SELECT * FROM sq2 WHERE num2>50); +------+ | num | +------+ | 100 | +------+ SELECT * FROM sq1 WHERE NOT EXISTS (SELECT * FROM sq2 GROUP BY num2 HAVING MIN(num2)=40); Empty set (0.00 sec) ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot ToDo Buildbot ToDo ============= High-priority, High-ROI items ----------------------------- * Ability on the web pages to mark certain builds of high priority, so they will be processed before others as build slaves become available. It must be possible to mark pending builds so not only individually, but also by branch, as well as by (branch,revision). The feature should probably interact in a meaningful way with the existing "nextBuild" ability to prioritise builds (<http://buildbot.net/buildbot/docs/0.8.4/full.html#Prioritizing-Builds>). Eg. it could set appropriate properties somewhere that would be available to the nextBuild function. * We need a way to kill all running builds, and remove all pending builds, for a given combination of branch and revision. It is possible to manually cancel a pending or running build, but this becomes extremely inconvenient when there are many builders. + Comments from buildbot mailing list: "There is already a button (hidden on the change page) for stopping all builds associated to a change. Unfortunately, the only way to get to this page seems to be through the waterfall." "Note that currently, the button on the change page only cancels still-pending builds, it does not stop builds in progress." * Fix problem when pushing multiple bzr revisions at one time: + Buildbot should wait a few moments before starting a build, and then start building the latest (currently it seems to build the first revision immedeately, and even often seems to not build the latest revision at all, getting confused about the order) + When pushing a change that changes revision numbers, the grid display can get really confused, would be nice to fix this somehow. * Any failure other than compile/test failure should mean a re-run. Failures like buildslave reboot or loss of connection or timeout of bazaar operation should be interpreted as if the build has never happened, and the system should re-try building. * In the bzr source step, retry the checkout a couple of times if it fails (to be more robust against temporary Launchpad problems, which we see a number of). Could maybe be done as a general Buildbot optional feature for all revision control systems supported, or maybe specific for the bzr depending on what can work. * Get PBXT test suite fixed in `--valgrind`; once that is done include it in the list of main suites so that it is tested on all platforms (and remove the special extra pbxt test steps in some Buildbot builds, as they will no longer be needed). * Load statistics. We need it to be able to see if adding another tree will starve the buildbot: + Percentage of busy time for available slaves + Median/Max response time (How much time do I have to wait after I've pushed for test run to complete) * Fix that mysql-test-run uses `--skip-ssl` by default. * Fix that `mysql-test-run.pl --mem` doesn't properly clean up `/dev/shm/var*` (so that we can use `--mem` and `--parallel` option to speed up the more powerful machines). * For triggered builds (ie. one builder makes a source tarball which another builder consumes), make it so that the pushed changesets are also transfered, so the blamelist on the build page works (currently the blame list is empty). * Upgrade to Buildbot 0.8 on the master. Then use the facility to use a MariaDB server as backend for both speedup (hopefully) and more flexible querying of buildbot history. Lower priority items -------------------- * It should be easier to setup for a new user. Ideally, there should be one tarball that one can download, unpack and run. Within the tarball there should be a script and/or config files which allow to add the buildslave into automatic startup. The following should not be there: + Dependence of buildslave on a load of python libraries. Ship them. + Same for bzr + Same for mysqld itself. Dl/make/make-install everything we need in the buildbot directory. If the above is not done, we'll never get much participation from old or unusual machines. The owners of such machines do not have the latest libraries, installing them requires some manual effort, which simply sets the bar too high. * Check archivist observation/bug that build slave `uname` info disappears when slave is disconnected. * Self refresh at a time interval (ajax maybe to reduce transfer) so users can know when to fire up a slave. * In the waterfall page, second line from top is "current activity". When displaying a particular branch ("?branch=5.1"), the "current activity" for hosts that are currently building another branch could also display the name of the branch (as a link to waterfall page for that branch) to avoid confusion that it is active on the current branch. * Run with `--valgrind-mysqld` instead of `--valgrind`. Little point in Valgrinding mysqltest when we in any case ignore any errors in that program. * Show pending builds for a slave on the 'builders' page, eg. <http://askmonty.org/buildbot/builders/hardy-x86-rtai> * Show dates in local time of the client. One way is with Javascript: <http://articles.techrepublic.com.com/5100-10878_11-6016329.html> (would be nice if some dates were still shown when javascript is not available). * Check if InnoDB is fixed sufficiently to have no Valgrind leaks with `innodb_use_sys_malloc`; if so remove hack in `mysql-test-run.pl` to disable this in valgrind case. * Fix problem that illegal regexp causes build exception (example: <https://buildbot.askmonty.org/buildbot/builders/sol-sparc-32/builds/157/steps/compile/logs/err.text>). The problem is that Buildbot grabs regexps from the suppression file in the MariaDB tree and tries to compile them; if this throws exception, then the exception should be caught (and possibly warned about), not crash the whole build. Improve binary package build and test ------------------------------------- * Add `apt-get source mariadb-server` checking in buildbot (for package testing). * Add testing of bintar package with real start of server [mysqld\_safe](../mysqld_safe/index) and also test on different distro/version than what was built (eg hardy<->jaunty). * In package build, sign .debs with dummy key, to more accurately test the real build process. * Switch to build the bintar packages on centos 5, to work with older glibc versions? Or maybe even Debian 4 which is older I think? But do the install test in Buildbot also on other/newer distros (should probably test on several in each build). * Add a test step for .deb that tests upgrading from an earlier version of MariaDB (currently we only check upgrade from MySQL). * Add a 'follow log' feature to runvm (which does `ssh guest tail -f log > log`). Use this in the Buildbot packaging step that runs mysql-test-run.pl, so that we can get mysqld.X.err.Y server logs available like for the non-kvm builds. * For runvm: add the options "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" to the ssh command used to login to the guest vm, so we do not get a login failure due to different host keys in different guests. Staging trees ------------- Idea is to set it up so that each developer/group has a stating tree. Any push to this tree will first get a full round of testing in Buildbot. If all results are green after this, it will automatically be pushed to the main tree. If another push gets in first, it will automatically merge the new stuff and re-try a full Buildbot test. If there is a problem (test failure or merge conflict), it will send mail with details. * Get something working, simple initially. * Staging tree per-captain * `mysqltest --require` not-staging to speed up Valgrind Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb NoSQL NoSQL ====== MariaDB supports a lot of commands and interfaces that are closer to NoSQL than to SQL. | Title | Description | | --- | --- | | [CONNECT](../connect/index) | The CONNECT storage engine enables MariaDB to access external local or remote data. | | [HANDLER](../handler/index) | Direct access to reading rows from the storage engine. | | [HandlerSocket](../handlersocket/index) | A NoSQL plugin giving you direct access to InnoDB and SPIDER. | | [Dynamic Columns](../dynamic-columns/index) | Dynamic columns allow one to store different sets of columns for each row in a table | | [Dynamic Columns from MariaDB 10](../dynamic-columns-from-mariadb-10/index) | Improvements to Dynamic Columns from MariaDB 10. | | [Dynamic Column API](../dynamic-column-api/index) | Client-side API for reading and writing Dynamic Columns blobs | | [Dynamic Columns API](../dynamic-columns-api/index) | MariaDB 10.0 API for reading and writing dynamic-columns blobs | | [JSON Functions](../json-functions/index) | Built-in functions related to JSON. | | [LOAD\_FILE](../load_file/index) | Returns file contents as a string. | | [Cassandra Storage Engine](../cassandra/index) | A storage engine interface to Cassandra. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Advanced Usage Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Advanced Usage ======================================================================================= This document assumes you've already set up an Amazon Web Services (AWS) account, created a master key in the Key Management Service (KMS), and have done the basic work to set up the MariaDB AWS KMS plugin. These steps are all described in [Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Setup Guide](../mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/index). Ultimately, keeping all the credentials required to read the key on a single host means that a user who has gained access to the host has enough information to read the encrypted files in the datadir, read the encrypted keys from the datadir, interact with AWS KMS to decrypt the encrypted keys, and then used the decrypted keys to decrypt the encrypted data. Theoretically, a superuser can read the memory of the MariaDB server process to read the decrypted keys or restart MariaDB with password authentication disabled in order to dump data, or add new users to MariaDB in order to allow a user to connect and dump the data. Resolving these issues is beyond the scope of this document. A user who gains root access to your operating system or root access to your MariaDB server will have the ability to decrypt your data. Plan accordingly. Managing AWS credentials ------------------------ Putting the AWS credentials in a file inside the MariaDB home directory is not ideal. By default, any user with the FILE privilege can read any files that the MariaDB server has permission to read, which would include the credentials file. To protect against this, you should set `secure_file_priv` to restrict the location the server will allow a user to read from when executing `LOAD DATA INFILE` or the `LOAD_FILE()` function. But putting them in other locations requires passing additional data to the server, which in the case of CentOS 7 requires customizing the systemd startup procedure. This is most easily done by creating a "drop-in" file in /etc/systemd/system/mariadb.service.d/. The file should end in ".conf" but can otherwise be named whatever you like. After making any changes to systemd files, execute `systemctl daemon-reload` and then start (or restart) the service as usual. You can place the credentials file in a location of your choosing and then refer to that file by setting the `AWS_CREDENTIAL_PROFILES_FILE` environment variable in the drop-in file: ``` [Service] Environment=AWS_CREDENTIAL_PROFILES_FILE=/etc/aws-kms-credentials ``` The credentials file will need to be readable by the "mysql" user, but it does not need to be readable by any other user. AWS credentials can also be put directly into a "drop-in" systemd file that will be read when starting the MariaDB service: ``` # cat /etc/systemd/system/mariadb.service.d/aws-kms.conf [Service] Environment=AWS_ACCESS_KEY_ID=AKIAIRSG2XYZATCJLZ4A Environment=AWS_SECRET_ACCESS_KEY=ux91LZIxCp4ZXabcdefgIViQNtTan42QAmJqJVqV ``` However, any OS user can read this information from systemd, which could be considered a security risk. Another solution is to put the credentials in a separate file that is only readable by root and then refer to that file using an `EnvironmentFile` directive in a drop-in systemd file. ``` # cat /etc/systemd/system/mariadb.service.d/aws-kms.env AWS_ACCESS_KEY_ID=AKIAIRSG2XYZATCJLZ4A AWS_SECRET_ACCESS_KEY=ux91LZIxCp4ZXabcdefgIViQNtTan42QAmJqJVqV # chown root /etc/systemd/system/mariadb.service.d/aws-kms.env # chmod 600 /etc/systemd/system/mariadb.service.d/aws-kms.env # cat /etc/systemd/system/mariadb.service.d/aws-kms.conf [Service] EnvironmentFile=/etc/systemd/system/mariadb.service.d/aws-kms.env ``` That has the advantage the the credentials can only be read directly by root. systemd adds those variables to the environment of the MariaDB server when starting it, and MariaDB can use the credentials to interact with AWS. Note, though, that any process running as the "mysql" user can still read the credentials from the proc filesystem on Linux. ``` $ whoami mysql $ cat /proc/$(pgrep mysqld)/environ | tr '\0' '\n' | grep AWS AWS_ACCESS_KEY_ID=AKIAIRSG2XYZATCJLZ4A AWS_SECRET_ACCESS_KEY=ux91LZIxCp4ZXabcdefgIViQNtTan42QAmJqJVqV ``` AWS KMS Key Policy ------------------ AWS KMS allows flexible, user-editable key policy. This offers fine-grained control over which users can operate on keys. The possibilities range from simply restricting which IP addresses are allowed to perform operations on the key, to requiring a MFA (Multi-Factor Authentication) device to use the key, to enforcing separation of responsibilities by creating an additional user with limited privileges to enable and disable the key. All 3 of these options will be outlined in this section. For more details about customizing the Key Policy for your master keys, please consult the [AWS Key Management Service Key Policy](http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-overview) documentation. ### Source IP restrictions A simple, common-sense restriction to put in place is to restrict the range of IP addresses that are allowed to use your master key. This way, even if someone obtains API credentials, they'll be unable to use them to decrypt your encryptions keys from a different host. To restrict API access from only a specific IP address or range of IP addresses, you'll need to manually edit the key policy. 1. Load the IAM console at <https://console.aws.amazon.com/iam/>. 2. Click "Encryption Keys" in the left-hand sidebar. 3. Click the name of your encryption key to view its details. 4. Click the link labeled "Switch to policy view", to the right of the heading of the "Key Policy" section. 5. Locate the section that contains `"Sid": "Allow use of the key"`. 6. Add this text below the `"Sid"` line: ``` "Condition": { "IpAddress": { "aws:SourceIp": [ "10.1.2.3/32" ] } }, ``` ... replacing `10.1.2.3/32` above with an IP address or range of IP addresses in CIDR format. For example, a single address would be `192.168.12.34/32`, while a range of addresses might be `192.168.0.0/24`. 7. Click "Save Changes". 8. Click "Proceed" if prompted with a warning about using the default view in the future. Access to the API will now be restricted to requests coming from the IP address or range of IP addresses specified in the policy. ### Using a Multi-Factor Authentication (MFA) device One approach is to modify the key policy for the master key so that MFA (Multi-Factor Authentication) is required in order to use the key. This is achieved with a wrapper that handles prompting the user for an MFA token, acquires temporary, limited-privilege credentials from the AWS Security Token Service (STS), and puts those credentials into the environment of the MariaDB server process. The credentials can expire after as little as 15 minutes. To require an MFA token for users of the key, you'll need to manually edit the key policy. 1. Load the IAM console at <https://console.aws.amazon.com/iam/>. 2. Click "Encryption Keys" in the left-hand sidebar. 3. Click the name of your encryption key to view its details. 4. Click the link labeled "Switch to policy view", to the right of the heading of the "Key Policy" section. 5. Locate the section that contains `"Sid": "Allow use of the key"`. 6. Add this text below the `"Sid"` line: ``` "Condition": { "Bool": { "aws:MultiFactorAuthPresent": "True" } }, ``` 7. Click "Save Changes". 8. Click "Proceed" if prompted with a warning about using the default view in the future. Now, add an MFA device for your user. You'll need to have a hardware MFA device or an application such as Google Authenticator installed on your smartphone. 1. Click "Users" in the left-hand sidebar. 2. Click the name of your user. 3. Click the "Security Credentials" tab. 4. In the "Sign-In Credentials" section, click the "Manage MFA Device" button. 5. Complete the steps to activate your MFA device. 6. Copy the ARN for your MFA device. You will need to use this when configuring the wrapper program. Now, set up the wrapper program. 1. Copy the iam-kms-wrapper file to /usr/local/bin/, and ensure that it is executable. 2. Create a drop-in systemd config file in `/etc/systemd/system/mariadb.service.d/`: ``` [Service] EnvironmentFile=/etc/systemd/system/mariadb.service.d/aws-kms.env ExecStart= ExecStart=/usr/local/bin/iam-kms-wrapper --config=/etc/my.cnf.d/iam-kms-wrapper.config /usr/sbin/mysqld $MYSQLD_OPTS ``` 3. Execute `systemctl daemon-reload`. 4. Create a file at `/etc/my.cnf.d/iam-kms-wrapper.config` with these contents, using the ARN for your MFA device as the value for `kms_mfa_id`: ``` [kms] kms_mfa_id = arn:aws:iam::551888187628:mfa/MDBEnc kms_mfa_socket = /tmp/kms_mfa_socket ``` When you start the MariaDB service now, the wrapper will temporarily create a socket file at the location given by the `kms_mfa_socket` option. The wrapper will read the MFA code from the socket and will use it to authenticate to KMS. To give the MFA code, simply write the digits to the socket file using `echo`: `echo 111676 > /tmp/kms_mfa_socket`. The `systemctl` command will block until MariaDB starts, so you will need to write the code to the socket file via a separate terminal. Note that the temporary credentials put into the environment of the MariaDB process will expire after a period of time defined by the request to the AWS Security Token Service (STS). In the example below, they will expire after 900 seconds. After that time, MariaDB may be unable to generate new encrypted data keys, which means that, for example, an attempt to create a table with a previously-unused key ID would fail. #### Wrapper program example Here's an example wrapper program written in go. Build this into an executable named `iam-kms-wrapper` and use it as instructed above. This could of course be written in any language for which an appropriate AWS SDK exists, but go has the benefit of compiling to a static binary, which means you do not have to worry about interpreter versions or installing complex dependencies on the host that runs your MariaDB server. ``` package main import ( "syscall" "os" "log" "flag" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/sts" "github.com/robfig/config" ) func main() { config_file_p := flag.String("config", "", "location of the config file") flag.Parse() if flag.NArg() < 1 { log.Fatal("Command to wrap must be given as first command-line argument") } cmd := flag.Arg(0) args := flag.Args()[0:] conf, err := config.ReadDefault(*config_file_p) if err != nil { log.Fatal(err) } kms_mfa_id, err := conf.String("kms","kms_mfa_id") mfa_socket_file, err := conf.String("kms","kms_mfa_socket") sess := session.New() svc := sts.New(sess) syscall.Umask(0044) log.Printf("Reading MFA token from %s\n",mfa_socket_file) if err := syscall.Mknod(mfa_socket_file, syscall.S_IFIFO|uint32(os.FileMode(0622)), 0); err != nil { log.Fatal(err) } file, err := os.Open(mfa_socket_file) if err != nil { log.Fatal(err) } token := make([]byte, 6) if _, err := file.Read(token); err != nil { log.Fatal(err) } file.Close() if err := syscall.Unlink(mfa_socket_file); err != nil { log.Fatal(err) } mfa_token := string(token) token_params := &sts.GetSessionTokenInput{ DurationSeconds: aws.Int64(900), SerialNumber: aws.String(kms_mfa_id), TokenCode: aws.String(mfa_token), } resp, err := svc.GetSessionToken(token_params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Prints out full error message, including original error if there was one. log.Fatal("Error:", awsErr.Error()) } else { log.Fatal("Error:", err.Error()) } } creds := resp.Credentials os.Setenv("AWS_ACCESS_KEY_ID",*creds.AccessKeyId) os.Setenv("AWS_SECRET_ACCESS_KEY",*creds.SecretAccessKey) os.Setenv("AWS_SESSION_TOKEN",*creds.SessionToken) execErr := syscall.Exec(cmd, args, os.Environ()) if execErr != nil { panic(execErr) } } ``` ### Disabling keys when not needed Another possibility is to use the API to disable access to the master key and enable it only when a trusted administrator knows that the MariaDB service needs to be started. A specialized tool on a separate host could be used to enable the key for a very short period of time while the service starts and then quickly disable the key. To do this, you can create an extra IAM User that can only use the kms:EnableKey and kms:DisableKey API endpoints for your key. This user will not be able to encrypt or decrypt any data using the key. First, create a new user. 1. Load the IAM console at <https://console.aws.amazon.com/iam/>. 2. Click "Users" in the left-hand sidebar. 3. Click "Create New Users". 4. Enter a new user name. (The examples will use "MDBEncAdmin".) 5. Click "Show User Security Credentials". 6. Copy the credentials and put them in a `credentials` file with this structure: ``` [MDBEncAdmin] aws_access_key_id=AKIAJMPPNO7EBKABCDEF aws_secret_access_key=pVdGwbuK5/jG64aBK1oEJOXRlkdM0aAylgabCDef ``` 7. Click "Close". 8. Click "Close" again if prompted. 9. Click the name of your new user to open the details view. 10. Copy the "User ARN" value for your user (for example "arn:aws:iam::551888181234:user/MDBEncAdmin"). You will need this for the next step. Now, give the new user permission to perform API operations on your key. 1. Click "Encryption Keys" in the left-hand sidebar. 2. Click the name of your key to open the details view. 3. Click "Switch to policy view" if it is not already open. (The "policy view" is a large text field that contains JSON describing the key policy.) 4. Create a new item in the `Statement` array with this structure: ``` { "Sid": "Allow Enable and Disable of the key", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::551888181234:user/MDBEncAdmin" }, "Action": [ "kms:EnableKey", "kms:DisableKey" ] }, ``` ...so that your Key Policy looks like this: ``` { "Version": "2012-10-17", "Id": "key-consolepolicy-2", "Statement": [ { "Sid": "Allow Enable and Disable of the key", "Effect": "Allow", "Principal": { ... ``` 5. Click "Save Changes". You've now added a new IAM user and you've given that user privileges to enable and disable your key. This user will be able to perform those operations using the AWS CLI or via a script of your own design using the AWS API. For example, using the [AWS CLI](https://aws.amazon.com/cli/): ``` $ cat ~/.aws/credentials [MDBEncAdmin] aws_access_key_id=AKIAJMPPNO7EBKABCDEF aws_secret_access_key=pVdGwbuK5/jG64aBK1oEJOXRlkdM0aAylgabCDef $ AWS_PROFILE=MDBEncAdmin aws --region us-east-1 kms disable-key --key-id arn:aws:kms:us-east-1:551888181234:key/abcdf8f6-084b-4cff-99ca-abcdef6c7907c ``` In order for MariaDB to start, this new user will have to enable the master key, then the DBA can start MariaDB, and this user can once again disable the master key after the service has started. Note that in this workflow, MariaDB will be unable to create new encryption keys, such as would be done when a user creates a table that refers to a non-existent key ID. The AWS KMS plugin will encounter an error if it tries to generate a new encryption key while the master key is disabled. In that scenario, the key administrator would have to enable the key before the operation could succeed. Here's what you should expect to see in the journal if MariaDB tries to interact with a disabled master key: ``` [ERROR] AWS KMS plugin : GenerateDataKeyWithoutPlaintext failed : DisabledException - Unable to parse ExceptionName: DisabledException Message: arn:aws:kms:us-east-1:551888181234:key/abcdf8f6-084b-4cff-99ca-abcdef6c7907c is disabled. ``` #### Adding MFA It's also possible to add MFA to this technique so that the user that enables & disables the master key has to authenticate using an MFA device. Adapt the instructions in the MFA section above to add MFA to the policy section for the user with EnableKey and DisableKeys privileges, add an MFA device for that user, use Security Token Service (STS) to get temporary security credentials, and then use those credentials to make the API calls. Here's an example Python script that follows that workflow: ``` #!/usr/bin/env python import boto3 import sys # Command-line argument processing should be more robust than this... action= sys.argv[1] mfa_token= sys.argv[2] # These should perhaps go into a config file instead of here mfa_serial= 'arn:aws:iam::551888181234:mfa/MDBEncAdmin' key_id= 'arn:aws:kms:us-east-1:551888181234:key/abcdf8f6-084b-4cff-99ca-abcdef6c7907c' # Make the connection to the Security Token Service to get temporary credentials token_client= boto3.client('sts') token_response= token_client.get_session_token( DurationSeconds= 900, SerialNumber= mfa_serial, TokenCode= mfa_token ) cred= token_response['Credentials'] # Start new session using temporary, MFA-authenticated credentials kms_session= boto3.session.Session( aws_access_key_id= cred['AccessKeyId'], aws_secret_access_key= cred['SecretAccessKey'], aws_session_token= cred['SessionToken'], region_name= key_id.split(':')[3] ) # Start KMS client and execute operation against key kms_client= kms_session.client('kms') if action == 'enable' or action == 'e': action_f= kms_client.enable_key elif action == 'disable' or action == 'd': action_f= kms_client.disable_key else: raise Exception('Action must be either "disable" or "enable"') action_f(KeyId=key_id) ``` ``` $ AWS_PROFILE=MDBEncAdmin python kms-manage-key disable 575290 $ AWS_PROFILE=MDBEncAdmin python kms-manage-key enable 799870 ``` Logging and auditing -------------------- ### CloudTrail Amazon's CloudTrail service creates JSON-formatted text log files for every API interaction. Enabling CloudTrail requires S3, which incurs additional fees. First, enable CloudTrail and add a trail. 1. Load the CloudTrail console at <https://console.aws.amazon.com/cloudtrail/>. 2. If you've never used CloudTrail before, click "Get Started Now". 3. Enter a value for "trail name". This example uses "mariadb-encryption-key". 4. Create a new S3 bucket, using a globally unique name, or use an existing S3 bucket, according to your needs. 5. Click "Turn On". If you navigate to the S3 bucket you created, you should find log files that contain JSON-formatted descriptions of your API interactions. ### CloudWatch Amazon's CloudWatch service allows you to create alarms and event rules that monitor log information. First, send your CloudTrail logs to CloudWatch. 1. Load the CloudTrail console at <https://console.aws.amazon.com/cloudtrail/>. 2. Click "Trails" in the left-hand navigation sidebar. 3. Click the name of your trail to open the Configuration view. 4. In the "CloudWatch Logs" section, click "Configure". 5. Click "Continue". 6. Click "Allow". Now, set up an SNS topic to facilitate email notifications. 1. Open <https://console.aws.amazon.com/sns/>. 2. *Make sure the region in the console (look in the upper-right corner) is the same as the region where you created your key!* 3. Click "Get Started" is prompted. 4. Click "Events" in the left-hand sidebar. 5. Click "Create new topic". 6. Enter a *Topic name* of your choosing. 7. Enter a *Display name* of your choosing. 8. Click "Create topic". 9. Click the ARN of your new SNS topic. 10. Click "Create Subscription". 11. Select "Email" from the Protocol dropdown. 12. Enter the desired notification email address in the Endpoint field. 13. Wait for the confirmation email to show up and follow the instructions. Now, configure CloudWatch and create an Event Rule. 1. Open <https://console.aws.amazon.com/cloudwatch/>. 2. *Make sure the region in the console (look in the upper-right corner) is the same as the region where you created your key and your SNS topic!* 3. Click "Events" in the left-hand sidebar. 4. Click "Create rule". 5. Choose "AWS API call" from the "Select event source" dropdown. 6. Choose "KMS" from the "Service name" dropdown. 7. Decide which operations should trigger the event. (You can eep "Any operation" selected for simplicity.) 8. Click "Add target". 9. Select "SNS target" from the dropdown. 10. Select the SNS topic you created in the previous steps. 11. Click "Configure details". 12. Enter a *Name* and *Description* of your choosing. 13. Click "Create rule". You should now get emails any time someone executes API calls on the KMS service in the region where you've created the CloudWatch Event rule. That means you should get email any time the key is enabled or disabled, and any time the AWS KMS plugin generates new keys or decrypts the keys stored on disk on the MariaDB server. You may also wish to create an event rule (or an additional event) that matches only when an unauthorized user tries to access the key. You might accomplish that by manually editing the Event selector of the rule to look something like this: ``` { "detail-type": [ "AWS API Call via CloudTrail" ], "detail": { "eventSource": [ "kms.amazonaws.com" ], "errorCode": [ "AccessDenied", "UnauthorizedOperation" ] } } ``` The emails are formatted as JSON. Further customization of the CloudWatch email workflow is beyond the scope of this document. There are many other workflows available using CloudWatch, including workflows with alarms and dashboards. Those are beyond the scope of this document. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore Streaming Data Adapters ColumnStore Streaming Data Adapters =================================== The [ColumnStore Bulk Data API](../columnstore-bulk-write-sdk/index) enables the creation of higher performance adapters for ETL integration and data ingestions. The Streaming Data Adapters are out of box adapters using these API for specific data sources and use cases. * MaxScale CDC Data Adapter is integration of the MaxScale CDC streams into MariaDB ColumnStore. * Kafka Data Adapter is integration of the Kafka streams into MariaDB ColumnStore. MaxScale CDC Data Adapter ------------------------- The MaxScale CDC Data Adapter has been deprecated. The MaxScale CDC Data Adapter allows to stream change data events(binary log events) from MariaDB Master hosting non-columnstore engines(InnoDB, MyRocks, MyISAM) to MariaDB ColumnStore. In another words replicate data from MariaDB Master to MariaDB ColumnStore. It acts as a CDC Client for MaxScale and uses the events received from MaxScale as input to MariaDB ColumnStore Bulk Data API to push the data to MariaDB ColumnStore. It registers with MariaDB MaxScale as a CDC Client using the [MaxScale CDC Connector API](https://mariadb.com/downloads/mariadb-ax/connector), receiving change data records from MariaDB MaxScale (that are converted from binlog events received from the Master on MariaDB TX) in a JSON format. Then, using the [MariaDB ColumnStore bulk write SDK](../columnstore-bulk-write-sdk), converts the JSON data into API calls and streams it to a MariaDB PM node. The adapter has options to insert all the events in the same schema as the source database table or insert each event with metadata as well as table data. The event meta data includes the event timestamp, the GTID, event sequence and event type (insert, update, delete). ### Installation #### Pre-requisite: * Download and install MaxScale CDC Connector API from <https://mariadb.com/downloads/mariadb-ax/connector> * Download and install MariaDB ColumnStore bulk write SDK from [https://mariadb.com/kb/en/columnstore-bulk-write-sdk](../columnstore-bulk-write-sdk) #### CentOS 7 ``` sudo yum -y install epel-release sudo yum -y install <data adapter>.rpm ``` #### Debian 9/Ubuntu Xenial: ``` sudo apt-get update sudo dpkg -i <data adapter>.deb sudo apt-get -f install ``` #### Debian 8: ``` sudo echo "deb http://httpredir.debian.org/debian jessie-backports main contrib non-free" >> /etc/apt/sources.list sudo apt-get update sudo dpkg -i <data adapter>.deb sudo apt-get -f install ``` ### Usage ``` Usage: mxs_adapter [OPTION]... DATABASE TABLE -f FILE TSV file with database and table names to stream (must be in `database TAB table NEWLINE` format) -h HOST MaxScale host (default: 127.0.0.1) -P PORT Port number where the CDC service listens (default: 4001) -u USER Username for the MaxScale CDC service (default: admin) -p PASSWORD Password of the user (default: mariadb) -c CONFIG Path to the Columnstore.xml file (default: '/usr/local/mariadb/columnstore/etc/Columnstore.xml') -a Automatically create tables on ColumnStore -z Transform CDC data stream from historical data to current data (implies -n) -s Directory used to store the state files (default: '/var/lib/mxs_adapter') -r ROWS Number of events to group for one bulk load (default: 1) -t TIME Connection timeout (default: 10) -n Disable metadata generation (timestamp, GTID, event type) -i TIME Flush data every TIME seconds (default: 5) -l FILE Log output to FILE instead of stdout -v Print version and exit -d Enable verbose debug output ``` #### Streaming Multiple Tables To stream multiple tables, use the -f parameter to define a path to a TSV formatted file. The file must have one database and one table name per line. The database and table must be separated by a TAB character and the line must be terminated in a newline \n. Here is an example file with two tables, t1 and t2 both in the test database. ``` test t1 test t2 ``` #### Automated Table Creation on ColumnStore You can have the adapter automatically create the tables on the ColumnStore instance with the -a option. In this case, the user used for cross-engine queries will be used to create the table (the values in Columnstore.CrossEngineSupport). This user will require CREATE privileges on all streamed databases and tables. #### Data Transformation Mode The -z option enables the data transformation mode. In this mode, the data is converted from historical, append-only data to the current version of the data. In practice, this replicates changes from a MariaDB master server to ColumnStore via the MaxScale CDC. Note: This mode is not as fast as the append-only mode and might not be suitable for heavy workloads. This is due to the fact that the data transformation is done via various DML statements. ### Quick Start Download and install both [MaxScale](https://mariadb.com/downloads/mariadb-tx/maxscale) and [ColumnStore](https://mariadb.com/downloads/mariadb-ax). Copy the Columnstore.xml file from `/usr/local/mariadb/columnstore/etc/Columnstore.xml` from one of the ColumnStore UM or PM node to the server where the adapter is installed. Configure MaxScale according to the [CDC tutorial](../mariadb-enterprise/mariadb-maxscale-22-avrorouter-tutorial/index). Create a CDC user by executing the following MaxAdmin command on the MaxScale server. Replace the `<service>` with the name of the avrorouter service and `<user>` and `<password>` with the credentials that are to be created. ``` maxadmin call command cdc add_user <service> <user> <password> ``` Then we can start the adapter by executing the following command. ``` mxs_adapter -u <user> -p <password> -h <host> -P <port> -c <path to Columnstore.xml> <database><table> ``` The `<database>` and `<table>` define the table that is streamed to ColumnStore. This table should exist on the master server where MaxScale is reading events from. If the table is not created on ColumnStore, the adapter will print instructions on how to define it in the correct way. The `<user>` and `<password>` are the users created for the CDC user, `<host>` is the MaxScale address and `<port>` is the port where the CDC service listener is listening. The `-c` flag is optional if you are running the adapter on the server where ColumnStore is located. Kafka to ColumnStore Adapter ---------------------------- The Kafka data adapter streams all messages published to Apache Kafka topics in Avro format to MariaDB AX automatically and continuously - enabling data from many sources to be streamed and collected for analysis without complex code. The Kafka adapter is built using [librdkafka](https://cwiki.apache.org/confluence/display/KAFKA/Clients#Clients-C/C++) and the [MariaDB ColumnStore bulk write SDK](../columnstore-bulk-write-sdk) A tutorial for the Kafka adapter for ingesting Avro formatted data can be found in the [kafka-to-columnstore-data-adapter](../kafka-to-columnstore-data-adapter/index) document. ColumnStore - Pentaho Data Integration - Data Adapter ----------------------------------------------------- Starting with MariaDB ColumnStore 1.1.4, a data adapter for Pentaho Data Integration (PDI) / Kettle is available to import data directly into ColumnStore’s WriteEngine. It is build on MariaDB’s rapid paced [Bulk Write SDK](../columnstore-bulk-write-sdk). ### Compatibility notice The plugin was designed for following software composition: * Operating system: Windows 10 / Ubuntu 16.04 / RHEL/CentOS+ 7 * MariaDB ColumnStore >= 1.1.4 * MariaDB Java Database client\* >= 2.2.1 * Java >= 8 * Pentaho Data Integration >= 7 +not officially supported by Pentaho. \*only needed if you want to execute DDL. ### Installation Following steps are necessary to install the ColumnStore Data adapter (bulk loader plugin): 1. build the plugin from [source](https://github.com/mariadb-corporation/mariadb-columnstore-data-adapters/tree/master/kettle-columnstore-bulk-exporter-plugin) or download it from our [website](https://mariadb.com/downloads/mariadb-ax/data-adapters) 2. extract the archive *mariadb-columnstore-kettle-bulk-exporter-plugin-\*.zip* into your PDI installation directory *$PDI-INSTALLATION/plugins*. 3. copy [MariaDB's JDBC Client](https://mariadb.com/downloads/mariadb-ax/connector) *mariadb-java-client-2.2.x.jar* into PDI's lib directory *$PDI-INSTALLATION/lib*. 4. install the additional library dependencies #### Ubuntu dependencies ``` sudo apt-get install libuv1 libxml2 libsnappy1v5 ``` #### CentOS dependencies ``` sudo yum install epel-release sudo yum install libuv libxml2 snappy ``` #### Windows 10 dependencies On Windows the installation of the [Visual Studio 2015/2017 C++ Redistributable (x64)](https://www.microsoft.com/en-us/download/details.aspx?id=48145) is required. ### Configuration Each MariaDB ColumnStore Bulk Loader block needs to be configured. On the one hand it needs to know how to connect to the underlying Bulk Write SDK to inject data into ColumnStore, and on the other hand it needs to have a proper JDBC connection to execute DDL. Both configurations can be set in each block’s settings tab. The database connection configuration follows PDI’s default schema. By default the plugin tries to use ColumnStore's default configuration */usr/local/mariadb/columnstore/etc/Columnstore.xml* to connect to the ColumnStore instance through the Bulk Write SDK. In addition, individual paths or variables can be used too. Information on how to prepare the *Columnstore.xml* configuration file can be found [here](../library/columnstore-bulk-write-sdk/index#environment-configuration). ### Usage Once a block is configured and all inputs are connected in PDI, the inputs have to be mapped to ColumnStore’s table format. One can either choose “Map all inputs”, which sets target columns of adequate type, or choose a custom mapping based on the structure of the existing table. The SQL button can be used to generate DDL based on the defined mapping and to execute it. ### Limitations This plugin is a beta release. In addition, it can't handle blob data types and only supports multi inputs to one block if the input field names are equal for all input sources. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MBRIntersects MBRIntersects ============= Syntax ------ ``` MBRIntersects(g1,g2) ``` Description ----------- Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries g1 and g2 intersect. Examples -------- ``` SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'); SET @g2 = GeomFromText('Polygon((3 3,3 6,6 6,6 3,3 3))'); SELECT mbrintersects(@g1,@g2); +------------------------+ | mbrintersects(@g1,@g2) | +------------------------+ | 1 | +------------------------+ SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'); SET @g2 = GeomFromText('Polygon((4 4,4 7,7 7,7 4,4 4))'); SELECT mbrintersects(@g1,@g2); +------------------------+ | mbrintersects(@g1,@g2) | +------------------------+ | 0 | +------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Optimization Strategies Optimization Strategies ======================== Various optimization strategies used by [the query optimizer](../the-query-optimizer/index). | Title | Description | | --- | --- | | [DuplicateWeedout Strategy](../duplicateweedout-strategy/index) | DuplicateWeedout is an execution strategy for Semi-join subqueries. | | [FirstMatch Strategy](../firstmatch-strategy/index) | FirstMatch is an execution strategy for Semi-join subqueries | | [LooseScan Strategy](../loosescan-strategy/index) | LooseScan is an execution strategy for Semi-join subqueries | | [Semi-join Materialization Strategy](../semi-join-materialization-strategy/index) | Semi-join Materialization is a subquery materialization used for Semi-join subqueries. | | [Improvements to ORDER BY Optimization](../improvements-to-order-by/index) | Several Improvements to the ORDER BY Optimizer in Version 10.1 of MariaDB. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Administration MariaDB Administration ======================= There are many tasks that database administrators (DBAs) have to perform. This section of the MariaDB Documentation provides information on how to do these tasks. | Title | Description | | --- | --- | | [Getting, Installing, and Upgrading MariaDB](../getting-installing-and-upgrading-mariadb/index) | Getting, installing, and upgrading MariaDB Server and related software. | | [User & Server Security](../user-server-security/index) | Creating users, granting privileges, and encryption. | | [Backing Up and Restoring Databases](../backing-up-and-restoring-databases/index) | Tools and methods for backing up and restoring databases. | | [Server Monitoring & Logs](../server-monitoring-logs/index) | Monitoring MariaDB Server and enabling and using logs. | | [Partitioning Tables](../partitioning-tables/index) | Splitting huge tables into multiple table files. | | [MariaDB Audit Plugin](../mariadb-audit-plugin/index) | Logging user activity with the MariaDB Audit Plugin. | | [Variables and Modes](../variables-and-modes/index) | Server variables and SQL modes. | | [Copying Tables Between Different MariaDB Databases and MariaDB Servers](../copying-tables-between-different-mariadb-databases-and-mariadb-servers/index) | Copy table files. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb STDDEV_POP STDDEV\_POP =========== Syntax ------ ``` STDDEV_POP(expr) ``` Description ----------- Returns the population standard deviation of *`expr`* (the square root of `[VAR\_POP()](../var_pop/index)`). You can also use `[STD()](../std/index)` or `[STDDEV()](../stddev/index)`, which are equivalent but not standard SQL. It is an [aggregate function](../aggregate-functions/index), and so can be used with the [GROUP BY](../group-by/index) clause. From [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), STDDEV\_POP() can be used as a [window function](../window-functions/index). STDDEV\_POP() returns `NULL` if there were no matching rows. Examples -------- As an [aggregate function](../aggregate-functions/index): ``` CREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT); INSERT INTO stats VALUES ('a',1),('a',2),('a',3), ('b',11),('b',12),('b',20),('b',30),('b',60); SELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) FROM stats GROUP BY category; +----------+---------------+----------------+------------+ | category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) | +----------+---------------+----------------+------------+ | a | 0.8165 | 1.0000 | 0.6667 | | b | 18.0400 | 20.1693 | 325.4400 | +----------+---------------+----------------+------------+ ``` As a [window function](../window-functions/index): ``` CREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student_test VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87); SELECT name, test, score, STDDEV_POP(score) OVER (PARTITION BY test) AS stddev_results FROM student_test; +---------+--------+-------+----------------+ | name | test | score | stddev_results | +---------+--------+-------+----------------+ | Chun | SQL | 75 | 16.9466 | | Chun | Tuning | 73 | 24.1247 | | Esben | SQL | 43 | 16.9466 | | Esben | Tuning | 31 | 24.1247 | | Kaolin | SQL | 56 | 16.9466 | | Kaolin | Tuning | 88 | 24.1247 | | Tatiana | SQL | 87 | 16.9466 | +---------+--------+-------+----------------+ ``` See Also -------- * [STD](../std/index) (equivalent, non-standard SQL) * [STDDEV](../stddev/index) (equivalent, Oracle-compatible non-standard SQL) * [VAR\_POP](../var_pop/index) (variance) * [STDDEV\_SAMP](../stddev_samp/index) (sample standard deviation) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb AES_ENCRYPT AES\_ENCRYPT ============ Syntax ------ ``` AES_ENCRYPT(str,key_str) ``` Description ----------- `AES_ENCRYPT()` and `[AES\_DECRYPT()](../aes_decrypt/index)` allow encryption and decryption of data using the official AES (Advanced Encryption Standard) algorithm, previously known as "Rijndael." Encoding with a 128-bit key length is used, but you can extend it up to 256 bits by modifying the source. We chose 128 bits because it is much faster and it is secure enough for most purposes. `AES_ENCRYPT()` encrypts a string *`str`* using the key *`key_str`*, and returns a binary string. `AES_DECRYPT()` decrypts the encrypted string and returns the original string. The input arguments may be any length. If either argument is NULL, the result of this function is also `NULL`. Because AES is a block-level algorithm, padding is used to encode uneven length strings and so the result string length may be calculated using this formula: ``` 16 x (trunc(string_length / 16) + 1) ``` If `AES_DECRYPT()` detects invalid data or incorrect padding, it returns `NULL`. However, it is possible for `AES_DECRYPT()` to return a non-`NULL` value (possibly garbage) if the input data or the key is invalid. Examples -------- ``` INSERT INTO t VALUES (AES_ENCRYPT('text',SHA2('password',512))); ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Mroonga User-Defined Functions Mroonga User-Defined Functions =============================== Mroonga provides a number of User-defined functions (UDFs) | Title | Description | | --- | --- | | [Creating Mroonga User-Defined Functions](../creating-mroonga-user-defined-functions/index) | How to install Mroonga's user-defined functions. | | [last\_insert\_grn\_id](../last_insert_grn_id/index) | Returns the unique Groonga id of the last-inserted record. | | [mroonga\_command](../mroonga_command/index) | Pass a command to Groonga to execute. | | [mroonga\_escape](../mroonga_escape/index) | Escaping a string. | | [mroonga\_highlight\_html](../mroonga_highlight_html/index) | Highlights the specified keywords in the target text. | | [mroonga\_normalize](../mroonga_normalize/index) | Uses Groonga's normalizer to normalize text. | | [mroonga\_snippet](../mroonga_snippet/index) | A keyword with surrounding text, or the keyword in context. | | [mroonga\_snippet\_html](../mroonga_snippet_html/index) | It provides a keyword with surrounding text, or the keyword in context. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb HandlerSocket External Resources HandlerSocket External Resources ================================ Some resources and documentation about HandlerSocket. * The home of HandlerSocket is [here](https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL). * The story of handlersocket can be found [here](http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html). * Comparison of [HANDLER](../handler/index) and HandlerSocket can be found [here](http://varokism.blogspot.com/2010/12/using-mysql-as-nosql-story-for_27.html). * [HandlerSocket plugin for MySQL](http://www.slideshare.net/akirahiguchi/handlersocket-20100629en-5698215) presentation by Akira Higuchi of DeNA - June 29 2010 - DeNA Technology Seminar * [HandlerSocket plugin for MySQL](http://www.slideshare.net/akirahiguchi/handlersocket-plugin-for-mysql-4664154) presentation by Akira Higuchi of DeNA - June 29 2011 - in Japanese Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb PointFromText PointFromText ============= A synonym for [ST\_PointFromText](../st_pointfromtext/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MyISAM Storage Formats MyISAM Storage Formats ====================== The [MyISAM](../myisam/index) storage engine supports three different table storage formats. These are FIXED, DYNAMIC and COMPRESSED. FIXED and DYNAMIC can be set with the ROW FORMAT option in the [CREATE TABLE](../create-table/index) statement, or will be chosen automatically depending on the columns the table contains. COMPRESSED can only be set via the [myisampack](../myisampack/index) tool. The [SHOW TABLE STATUS](../show-table-status/index) statement can be used to see the storage format used by a table. Note that `COMPRESSED` tables are reported as `DYNAMIC` in that context. Fixed-length ------------ Fixed-length (or static) tables contain records of a fixed-length. Each column is the same length for all records, regardless of the actual contents. It is the default format if a table has no [BLOB](../blob/index), [TEXT](../text/index), [VARCHAR](../varchar/index) or [VARBINARY](../varbinary/index) fields, and no ROW FORMAT is provided. You can also specify a fixed table with ROW\_FORMAT=FIXED in the table definition. Tables containing BLOB or TEXT fields cannot be FIXED, as by design these are both dynamic fields. However, no error or warning will be raised if you specify FIXED. Fixed-length tables have a number of characteristics * fast, since MariaDB will always know where a record begins * easy to repair: [myisamchk](../myisamchk/index) is always able to recover all rows, except for the last one if it is not entirely written * easy to cache * take up more space than dynamic or compressed tables, as the maximum amount of storage space will be allocated to each record. * reconstructing after a crash is uncomplicated due to the fixed positions * no fragmentation or need to re-organize, unless records have been deleted and you want to free the space up. Dynamic ------- Dynamic tables contain records of a variable length. It is the default format if a table has any BLOB, TEXT, VARCHAR or VARBINARY fields, and no ROW FORMAT is provided. You can also specify a DYNAMIC table with ROW\_FORMAT=DYNAMIC in the table definition. If the table contains BLOB or TEXT columns, its format is always DYNAMIC, and the ROW FORMAT option is ignored. Dynamic tables have a number of characteristics * Each row contains a header indicating the length of the row. * Rows tend to become fragmented easily. UPDATING a record to be longer will likely ensure it is stored in different places on the disk. Use [OPTIMIZE TABLE](../optimize-table/index) when the fragmentation is too high. * All string columns with a length of four or more are dynamic. * They require much less space than fixed-length tables. * Restoring after a crash is more complicated than with FIXED tables. Some fragments may be lost. If a DYNAMIC table has some frequently-accessed fixed-length columns, it could be a good idea to move them into a separate FIXED table to avoid fragmentation. Compressed ---------- Compressed tables are a read-only format, created with the [myisampack](../myisampack/index) tool. This can be done while the server is running, but external lock must not be disabled. [myisamchk](../myisamchk/index) is used to uncompress them. Compressed tables have a number of characteristics: * while the data is read-only, DDL statements such as [DROP TABLE](../drop-table/index) and [TRUNCATE TABLE](../truncate-table/index) will still function. * take much less space than fixed or dynamic tables. Each data has usually a 40-70% compression ratio * rows are compressed separately, reducing access overhead. * row headers will be from one to three bytes. * rows can be compressed with different compression types, including + prefix space compression + suffix space compression + columns with small sets of values are converted to ENUM + numeric zeros are stored with only one bit + integer columns will be reduced to the smallest int type that can hold the contents See Also -------- * [Why we still need MyISAM (for read-only tables)](http://jfg-mysql.blogspot.nl/2017/08/why-we-still-need-myisam.html) describes an important use case for MyISAM compressed tables. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Account Management SQL Commands Account Management SQL Commands ================================ CREATE/DROP USER, GRANT, REVOKE, SET PASSWORD etc. | Title | Description | | --- | --- | | [CREATE USER](../create-user/index) | Create new MariaDB accounts. | | [ALTER USER](../alter-user/index) | Modify an existing MariaDB account. | | [DROP USER](../drop-user/index) | Remove one or more MariaDB accounts. | | [GRANT](../grant/index) | Create accounts and set privileges or roles. | | [RENAME USER](../rename-user/index) | Rename user account. | | [REVOKE](../revoke/index) | Remove privileges or roles. | | [SET PASSWORD](../set-password/index) | Assign password to an existing MariaDB user. | | [CREATE ROLE](../create-role/index) | Add new roles. | | [DROP ROLE](../drop-role/index) | Drop a role. | | [SET ROLE](../set-role/index) | Enable a role. | | [SET DEFAULT ROLE](../set-default-role/index) | Sets a default role for a specified (or current) user. | | [SHOW GRANTS](../show-grants/index) | View GRANT statements. | | [SHOW CREATE USER](../show-create-user/index) | Show the CREATE USER statement for a specified user. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW FUNCTION CODE SHOW FUNCTION CODE ================== Syntax ------ ``` SHOW FUNCTION CODE func_name ``` Description ----------- `SHOW FUNCTION CODE` shows a representation of the internal implementation of the stored function. It is similar to `[SHOW PROCEDURE CODE](../show-procedure-code/index)` but for [stored functions](../stored-functions/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema INNODB_FT_BEING_DELETED Table Information Schema INNODB\_FT\_BEING\_DELETED Table =================================================== The [Information Schema](../information_schema/index) `INNODB_FT_BEING_DELETED` table is only used while document ID's in the related [INNODB\_FT\_DELETED](../information-schema-innodb_ft_deleted-table/index) are being removed from an InnoDB [fulltext index](../full-text-indexes/index) while an [OPTIMIZE TABLE](../optimize-table/index) is underway. At all other times the table will be empty. The `SUPER` [privilege](../grant/index) is required to view the table, and it also requires the [innodb\_ft\_aux\_table](../innodb-system-variables/index#innodb_ft_aux_table) system variable to be set. It has the following column: | Column | Description | | --- | --- | | `DOC_ID` | Document ID of the row being deleted. Either an underlying ID value, or a sequence value generated by InnoDB if no usable option exists. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Reserved Words Reserved Words ============== The following is a list of all reserved words in MariaDB. Reserved words cannot be used as [Identifiers](../identifier-names/index), unless they are quoted. The definitive list of reserved words for each version can be found by examining the `sql/lex.h` and `sql/sql_yacc.yy` files. Reserved Words -------------- | Keyword | Notes | | --- | --- | | ACCESSIBLE | | | ADD | | | ALL | | | ALTER | | | ANALYZE | | | AND | | | AS | | | ASC | | | ASENSITIVE | | | BEFORE | | | BETWEEN | | | BIGINT | | | BINARY | | | BLOB | | | BOTH | | | BY | | | CALL | | | CASCADE | | | CASE | | | CHANGE | | | CHAR | | | CHARACTER | | | CHECK | | | COLLATE | | | COLUMN | | | CONDITION | | | CONSTRAINT | | | CONTINUE | | | CONVERT | | | CREATE | | | CROSS | | | CURRENT\_DATE | | | CURRENT\_ROLE | | | CURRENT\_TIME | | | CURRENT\_TIMESTAMP | | | CURRENT\_USER | | | CURSOR | | | DATABASE | | | DATABASES | | | DAY\_HOUR | | | DAY\_MICROSECOND | | | DAY\_MINUTE | | | DAY\_SECOND | | | DEC | | | DECIMAL | | | DECLARE | | | DEFAULT | | | DELAYED | | | DELETE | | | DELETE\_DOMAIN\_ID | | | DESC | | | DESCRIBE | | | DETERMINISTIC | | | DISTINCT | | | DISTINCTROW | | | DIV | | | DO\_DOMAIN\_IDS | | | DOUBLE | | | DROP | | | DUAL | | | EACH | | | ELSE | | | ELSEIF | | | ENCLOSED | | ESCAPED | | | EXCEPT | Added in [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) | | EXISTS | | | EXIT | | | EXPLAIN | | | FALSE | | | FETCH | | | FLOAT | | | FLOAT4 | | | FLOAT8 | | | FOR | | | FORCE | | | FOREIGN | | | FROM | | FULLTEXT | | | GENERAL | | | GRANT | | | GROUP | | | HAVING | | | HIGH\_PRIORITY | | | HOUR\_MICROSECOND | | | HOUR\_MINUTE | | | HOUR\_SECOND | | | IF | | | IGNORE | | | IGNORE\_DOMAIN\_IDS | | | IGNORE\_SERVER\_IDS | | | IN | | | INDEX | | | INFILE | | | INNER | | | INOUT | | | INSENSITIVE | | | INSERT | | | INT | | | INT1 | | | INT2 | | | INT3 | | | INT4 | | | INT8 | | | INTEGER | | | INTERSECT | Added in [MariaDB 10.3.0](https://mariadb.com/kb/en/mariadb-1030-release-notes/) | | INTERVAL | | | INTO | | | IS | | | ITERATE | | | JOIN | | | KEY | | | KEYS | | | KILL | | | LEADING | | | LEAVE | | | LEFT | | | LIKE | | | LIMIT | | | LINEAR | | | LINES | | | LOAD | | | LOCALTIME | | | LOCALTIMESTAMP | | | LOCK | | | LONG | | | LONGBLOB | | | LONGTEXT | | | LOOP | | | LOW\_PRIORITY | | | MASTER\_HEARTBEAT\_PERIOD | | | MASTER\_SSL\_VERIFY\_SERVER\_CERT | | | MATCH | | | MAXVALUE | | | MEDIUMBLOB | | | MEDIUMINT | | | MEDIUMTEXT | | | MIDDLEINT | | | MINUTE\_MICROSECOND | | | MINUTE\_SECOND | | | MOD | | | MODIFIES | | | NATURAL | | | NOT | | | NO\_WRITE\_TO\_BINLOG | | | NULL | | | NUMERIC | | | OFFSET | Added in [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/) | | ON | | | OPTIMIZE | | | OPTION | | | OPTIONALLY | | | OR | | | ORDER | | | OUT | | | OUTER | | | OUTFILE | | | OVER | Added in [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) | | PAGE\_CHECKSUM | | | PARSE\_VCOL\_EXPR | | | PARTITION | | | POSITION | | | PRECISION | | | PRIMARY | | | PROCEDURE | | | PURGE | | | RANGE | | | READ | | | READS | | | READ\_WRITE | | | REAL | | RECURSIVE | Added in [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/) | | REF\_SYSTEM\_ID | | | REFERENCES | | | REGEXP | | | RELEASE | | | RENAME | | | REPEAT | | | REPLACE | | | REQUIRE | | | RESIGNAL | | | RESTRICT | | | RETURN | | | RETURNING | | | REVOKE | | | RIGHT | | | RLIKE | | | ROWS | Added in [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/) | | SCHEMA | | | SCHEMAS | | | SECOND\_MICROSECOND | | | SELECT | | | SENSITIVE | | | SEPARATOR | | | SET | | | SHOW | | | SIGNAL | | | SLOW | | | SMALLINT | | | SPATIAL | | | SPECIFIC | | | SQL | | | SQLEXCEPTION | | | SQLSTATE | | | SQLWARNING | | | SQL\_BIG\_RESULT | | | SQL\_CALC\_FOUND\_ROWS | | | SQL\_SMALL\_RESULT | | | SSL | | | STARTING | | | STATS\_AUTO\_RECALC | | | STATS\_PERSISTENT | | | STATS\_SAMPLE\_PAGES | | | STRAIGHT\_JOIN | | | TABLE | | | TERMINATED | | | THEN | | | TINYBLOB | | | TINYINT | | | TINYTEXT | | | TO | | | TRAILING | | | TRIGGER | | | TRUE | | | UNDO | | | UNION | | | UNIQUE | | | UNLOCK | | | UNSIGNED | | | UPDATE | | | USAGE | | | USE | | | USING | | | UTC\_DATE | | | UTC\_TIME | | | UTC\_TIMESTAMP | | | VALUES | | | VARBINARY | | | VARCHAR | | | VARCHARACTER | | | VARYING | | | WHEN | | | WHERE | | | WHILE | | | WINDOW | Added in [MariaDB 10.2.0](https://mariadb.com/kb/en/mariadb-1020-release-notes/). From [MariaDB 10.2.12](https://mariadb.com/kb/en/mariadb-10212-release-notes/) only disallowed for table aliases. | | WITH | | | WRITE | | | XOR | | | YEAR\_MONTH | | | ZEROFILL | | Exceptions ---------- Some keywords are exceptions for historical reasons, and are permitted as unquoted identifiers. These include: | Keyword | | --- | | ACTION | | [BIT](../bit/index) | | [DATE](../date/index) | | [ENUM](../enum/index) | | NO | | [TEXT](../text/index) | | [TIME](../time/index) | | [TIMESTAMP](../timestamp/index) | Oracle Mode ----------- In [Oracle mode, from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index), there are a number of extra reserved words: | Keyword | Notes | | --- | --- | | BODY | | | ELSIF | | | GOTO | | | HISTORY | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only | | MINUS | From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/) | | OTHERS | | | PACKAGE | | PERIOD | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only | | RAISE | | | ROWNUM | From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/) | | ROWTYPE | | | SYSDATE | From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/) | | SYSTEM | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only. Note however that SYSTEM sometimes needs to be quoted to avoid confusion with [System-versioned tables](../system-versioned-tables/index). | | SYSTEM\_TIME | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only | | VERSIONING | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only | | WITHOUT | <= [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) only | Function Names -------------- If the `IGNORE_SPACE` [SQL\_MODE](../sql-mode/index) flag is set, function names become reserved words. See Also -------- * [Information Schema KEYWORDS Table](../information-schema-keywords-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WEIGHT_STRING WEIGHT\_STRING ============== Syntax ------ ``` WEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags]) levels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ... ``` Description ----------- Returns a binary string representing the string's sorting and comparison value. A string with a lower result means that for sorting purposes the string appears before a string with a higher result. WEIGHT\_STRING() is particularly useful when adding new collations, for testing purposes. If `str` is a non-binary string ([CHAR](../char/index), [VARCHAR](../varchar/index) or [TEXT](../text/index)), WEIGHT\_STRING returns the string's collation weight. If `str` is a binary string ([BINARY](../binary/index), [VARBINARY](../varbinary/index) or [BLOB](../blob/index)), the return value is simply the input value, since the weight for each byte in a binary string is the byte value. WEIGHT\_STRING() returns NULL if given a NULL input. The optional AS clause permits casting the input string to a binary or non-binary string, as well as to a particular length. AS BINARY(N) measures the length in bytes rather than characters, and right pads with 0x00 bytes to the desired length. AS CHAR(N) measures the length in characters, and right pads with spaces to the desired length. N has a minimum value of 1, and if it is less than the length of the input string, the string is truncated without warning. The optional LEVEL clause specifies that the return value should contain weights for specific collation levels. The `levels` specifier can either be a single integer, a comma-separated list of integers, or a range of integers separated by a dash (whitespace is ignored). Integers can range from 1 to a maximum of 6, dependent on the collation, and need to be listed in ascending order. If the LEVEL clause is no provided, a default of 1 to the maximum for the collation is assumed. If the LEVEL is specified without using a range, an optional modifier is permitted. `ASC`, the default, returns the weights without any modification. `DESC` returns bitwise-inverted weights. `REVERSE` returns the weights in reverse order. Examples -------- The examples below use the [HEX()](../hex/index) function to represent non-printable results in hexadecimal format. ``` SELECT HEX(WEIGHT_STRING('x')); +-------------------------+ | HEX(WEIGHT_STRING('x')) | +-------------------------+ | 0058 | +-------------------------+ SELECT HEX(WEIGHT_STRING('x' AS BINARY(4))); +--------------------------------------+ | HEX(WEIGHT_STRING('x' AS BINARY(4))) | +--------------------------------------+ | 78000000 | +--------------------------------------+ SELECT HEX(WEIGHT_STRING('x' AS CHAR(4))); +------------------------------------+ | HEX(WEIGHT_STRING('x' AS CHAR(4))) | +------------------------------------+ | 0058002000200020 | +------------------------------------+ SELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)); +--------------------------------------+ | HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)) | +--------------------------------------+ | AA22EE | +--------------------------------------+ SELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)); +-------------------------------------------+ | HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)) | +-------------------------------------------+ | 55DD11 | +-------------------------------------------+ SELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)); +----------------------------------------------+ | HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)) | +----------------------------------------------+ | EE22AA | +----------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb mysql.transaction_registry Table mysql.transaction\_registry Table ================================= **MariaDB starting with [10.3.4](https://mariadb.com/kb/en/mariadb-1034-release-notes/)**The `mysql.transaction_registry` table was introduced in [MariaDB 10.3.4](https://mariadb.com/kb/en/mariadb-1034-release-notes/) as part of [system-versioned tables](../system-versioned-tables/index). The `mysql.transaction_registry` table is used for transaction-precise versioning, and contains the following fields: | Field | Type | Null | Key | Default | Description | | --- | --- | --- | --- | --- | --- | | transaction\_id | bigint(20) unsigned | NO | Primary | NULL | | | commit\_id | bigint(20) unsigned | NO | Unique | NULL | | | begin\_timestamp | timestamp(6) | NO | Multiple | 0000-00-00 00:00:00.000000 | Timestamp when the transaction began (BEGIN statement), however see [MDEV-16024](https://jira.mariadb.org/browse/MDEV-16024). | | commit | timestamp(6) | NO | Multiple | 0000-00-00 00:00:00.000000 | Timestamp when the transaction was committed. | | isolation\_level | enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') | NO | | NULL | Transaction [isolation level](../set-transaction/index#isolation-levels). | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Geometry Properties Geometry Properties ==================== Geometry properties | Title | Description | | --- | --- | | [BOUNDARY](../geometry-properties-boundary/index) | Synonym for ST\_BOUNDARY. | | [DIMENSION](../dimension/index) | Synonym for ST\_DIMENSION. | | [ENVELOPE](../geometry-properties-envelope/index) | Synonym for ST\_ENVELOPE. | | [GeometryN](../geometry-properties-geometryn/index) | Synonym for ST\_GeometryN. | | [GeometryType](../geometry-properties-geometrytype/index) | Synonym for ST\_GeometryType. | | [IsClosed](../isclosed/index) | Synonym for ST\_IsClosed. | | [IsEmpty](../geometry-properties-isempty/index) | Synonym for ST\_IsEmpty. | | [IsRing](../isring/index) | Synonym for ST\_IsRing. | | [IsSimple](../geometry-properties-issimple/index) | Synonym for ST\_IsSimple. | | [NumGeometries](../geometry-properties-numgeometries/index) | Synonym for ST\_NumGeometries. | | [SRID](../geometry-properties-srid/index) | Synonym for ST\_SRID. | | [ST\_BOUNDARY](../st_boundary/index) | Returns a geometry that is the closure of a combinatorial boundary. | | [ST\_DIMENSION](../st_dimension/index) | Inherent dimension of a geometry value. | | [ST\_ENVELOPE](../st_envelope/index) | Returns the Minimum Bounding Rectangle for a geometry value. | | [ST\_GEOMETRYN](../st_geometryn/index) | Returns the N-th geometry in a GeometryCollection. | | [ST\_GEOMETRYTYPE](../st_geometrytype/index) | Returns name of the geometry type of which a given geometry instance is a member. | | [ST\_ISCLOSED](../st_isclosed/index) | Returns true if a given LINESTRING's start and end points are the same. | | [ST\_ISEMPTY](../st_isempty/index) | Indicated validity of geometry value. | | [ST\_IsRing](../st_isring/index) | Returns true if a given LINESTRING is both ST\_IsClosed and ST\_IsSimple. | | [ST\_IsSimple](../st_issimple/index) | Returns true if the given Geometry has no anomalous geometric points. | | [ST\_NUMGEOMETRIES](../st_numgeometries/index) | Number of geometries in a GeometryCollection. | | [ST\_RELATE](../st_relate/index) | Returns true if two geometries are related | | [ST\_SRID](../st_srid/index) | Returns a Spatial Reference System ID. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ANALYZE and EXPLAIN Statements ANALYZE and EXPLAIN Statements =============================== | Title | Description | | --- | --- | | [ANALYZE FORMAT=JSON](../analyze-format-json/index) | Mix of the EXPLAIN FORMAT=JSON and ANALYZE statement features. | | [ANALYZE FORMAT=JSON Examples](../analyze-formatjson-examples/index) | Examples with ANALYZE FORMAT=JSON. | | [ANALYZE Statement](../analyze-statement/index) | Invokes the optimizer, executes the statement, and then produces EXPLAIN output. | | [EXPLAIN](../explain/index) | EXPLAIN returns information about index usage, as well as being a synonym for DESCRIBE. | | [EXPLAIN ANALYZE](../explain-analyze/index) | Old implementation, now ANALYZE statement | | [EXPLAIN FORMAT=JSON](../explain-format-json/index) | Variant of EXPLAIN that produces output in JSON form | | [SHOW EXPLAIN](../show-explain/index) | Shows an execution plan for a running query. | | [Using Buffer UPDATE Algorithm](../using-buffer-update-algorithm/index) | Explanation of UPDATE's "Using Buffer" algorithm. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb GUID/UUID Performance GUID/UUID Performance ===================== The problem ----------- GUIDs/UUIDs (Globally/Universally Unique Identifiers) are very random. Therefore, INSERTing into an index means jumping around a lot. Once the index is too big to be cached, most INSERTs involve a disk hit. Even on a beefy system, this limits you to a few hundred INSERTs per second. [MariaDB's UUID function](../uuid/index). This blog is mostly eliminated in MySQL 8.0 with the advent of the following function: [UUID\_TO\_BIN(str, swap\_flag)](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin). Why it is a problem ------------------- A 'standard' GUID/UUID is composed of the time, machine identification and some other stuff. The combination should be unique, even without coordination between different computers that could be generating UUIDs simultaneously. The top part of the GUID/UUID is the bottom part of the current time. The top part is the primary part of what would be used for placing the value in an ordered list (INDEX). This cycles in about 7.16 minutes. Some math... If the index is small enough to be cached in RAM, each insert into the index is CPU only, with the writes being delayed and batched. If the index is 20 times as big as can be cached, then 19 out of 20 inserts will be a cache miss. (This math applies to any "random" index.) Second problem -------------- 36 characters is bulky. If you are using that as a PRIMARY KEY in InnoDB and you have secondary keys, remember that each secondary key has an implicit copy of the PK, thereby making it bulky. It is tempting to declare the UUID [VARCHAR(36)](../varchar/index). And, since you probably are thinking globally, so you have [CHARACTER SET](../character-sets/index) utf8 (or utf8mb4). For utf8: * 2 - Overhead for VAR * 36 - chars * 3 (or 4) bytes per character for utf8 (or utf8mb4) So, max length = 2+3\*36 = 110 (or 146) bytes. For temp tables 108 (or 144) is actually used if a [MEMORY](mariadb/memory-storage-engine) table is used. To compress * utf8 is unnecessary (ascii would do); but this is obviated by the next two steps * Toss dashes * [UNHEX](../unhex/index) Now it will fit in 16 bytes: [BINARY(16)](../binary/index) Combining the problems and crafting a solution ---------------------------------------------- But first, a caveat. This solution only works for ["Time based" / "Version 1" UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) They are recognizable by the "1" at the beginning of the third clump. The manual's sample: 6ccd780c-baba-1026-9564-0040f4311e29 . A more current value (after a few years): 49ea2de3-17a2-11e2-8346-001eecac3efa . Notice how the 3rd part has slowly changed over time? Let's data is rearranged, thus: ``` 1026-baba-6ccd780c-9564-0040f4311e29 11e2-17a2-49ea2de3-8346-001eecac3efa 11e2-17ac-106762a5-8346-001eecac3efa -- after a few more minutes ``` Now we have a number that increases nicely over time. Multiple sources won't be quite in time order, but they will be close. The "hot" spot for inserting into an INDEX(uuid) will be rather narrow, thereby making it quite cacheable and efficient. If your SELECTs tend to be for "recent" uuids, then they, too, will be easily cached. If, on the other hand, your SELECTs often reach for old uuids, they will be random and not well cached. Still, improving the INSERTs will help the system overall. Code to do it ------------- Let's make [Stored Functions](../stored-functions/index) to do the messy work of the two actions: * Rearrange fields * Convert to/from BINARY(16) ``` DELIMITER // CREATE FUNCTION UuidToBin(_uuid BINARY(36)) RETURNS BINARY(16) LANGUAGE SQL DETERMINISTIC CONTAINS SQL SQL SECURITY INVOKER RETURN UNHEX(CONCAT( SUBSTR(_uuid, 15, 4), SUBSTR(_uuid, 10, 4), SUBSTR(_uuid, 1, 8), SUBSTR(_uuid, 20, 4), SUBSTR(_uuid, 25) )); // CREATE FUNCTION UuidFromBin(_bin BINARY(16)) RETURNS BINARY(36) LANGUAGE SQL DETERMINISTIC CONTAINS SQL SQL SECURITY INVOKER RETURN LCASE(CONCAT_WS('-', HEX(SUBSTR(_bin, 5, 4)), HEX(SUBSTR(_bin, 3, 2)), HEX(SUBSTR(_bin, 1, 2)), HEX(SUBSTR(_bin, 9, 2)), HEX(SUBSTR(_bin, 11)) )); // DELIMITER ; ``` Then you would do things like ``` -- Letting MySQL create the UUID: INSERT INTO t (uuid, ...) VALUES (UuidToBin(UUID()), ...); -- Creating the UUID elsewhere: INSERT INTO t (uuid, ...) VALUES (UuidToBin(?), ...); -- Retrieving (point query using uuid): SELECT ... FROM t WHERE uuid = UuidToBin(?); -- Retrieving (other): SELECT UuidFromBin(uuid), ... FROM t ...; ``` Do not flip the WHERE; this will be inefficent because it won't use INDEX(uuid): ``` WHERE UuidFromBin(uuid) = '1026-baba-6ccd780c-9564-0040f4311e29' -- NO ``` TokuDB ------ TokuDB has been deprecated by its upstream maintainer. It is disabled from [MariaDB 10.5](../what-is-mariadb-105/index) and has been been removed in [MariaDB 10.6](../what-is-mariadb-106/index) - [MDEV-19780](https://jira.mariadb.org/browse/MDEV-19780). We recommend [MyRocks](../myrocks/index) as a long-term migration path. [TokuDB](../tokudb/index) is a viable engine if you must have UUIDs (even non-type-1) in a huge table. TokuDB is available in MariaDB as a 'standard' engine, making the barrier to entry very low. There are a small number of differences between [InnoDB](../innodb/index) and TokuDB; I will not go into them here. Tokudb, with its “fractal” indexing strategy builds the indexes in stages. In contrast, InnoDB inserts index entries “immediately” — actually that indexing is buffered by most of the size of the buffer\_pool. To elaborate… When adding a record to an InnoDB table, here are (roughly) the steps performed to write the data (and PK) and secondary indexes to disk. (I leave out logging, provision for rollback, etc.) First the PRIMARY KEY and data: * Check for UNIQUEness constraints * Fetch the BTree block (normally 16KB) that should contain the row (based on the PRIMARY KEY). * Insert the row (overflow typically occurs 1% of the time; this leads to a block split). * Leave the page “dirty” in the buffer\_pool, hoping that more rows are added before it is bumped out of cache (buffer\_pool).. Note that for AUTO\_INCREMENT and TIMESTAMP-based PKs, the “last” block in the data will be updated repeatedly before splitting; hence, this delayed write adds greatly to the efficiency. OTOH, a UUID will be very random; when the table is big enough, the block will almost always be flushed before a second insert occurs in that block. <– This is the inefficiency in UUIDs. Now for any secondary keys: * All the steps are the same, since an index is essentially a "table" except that the "data" is a copy of the PRIMARY KEY. * UNIQUEness must be checked immediately — cannot delay the read. * There are (I think) some other "delays" that avoid some I/O. Tokudb, on the other hand, does something like * Write data/index partially sorted records to disk before finding out exactly where it belongs. * In the background, combine these partially digested blocks. Repeat as needed. * Eventually move the info into the real table/indexes. If you are familiar with how sort-merge works, consider the parallels to Tokudb. Each "sort" does some work of ordering things; each "merge" is quite efficient. To summarize: * In the extreme (data/index much larger than buffer\_pool), InnoDB must read-modify-write one 16KB disk block for each UUID entry. * Tokudb makes each I/O "count" by merging several UUIDs for each disk block. (Yeah, Toku rereads blocks, but it comes out ahead in the long run.) * Tokudb excels when the table is really big, which implies high ingestion rate. Wrapup ------ This shows three thing for speeding up usage of GUIDs/UUIDs: * Shrink footprint (Smaller -> more cacheable -> faster). * Rearrange uuid to make a "hot spot" to improve cachability. * Use TokuDB (MyRocks shares some architectural traits which may also be beneficial in handling UUIDs, but this is hypothetical and hasn't been tested) Note that the benefit of the "hot spot" is only partial: * Chronologically ordered (or approximately ordered) INSERTs benefit; random ones don't. * SELECTs/UPDATEs by "recent" uuids benefit; old ones don't benefit. Postlog ------- Thanks to Trey for some of the ideas here. The tips in this document apply to MySQL, MariaDB, and Percona. Written Oct, 2012. Added TokuDB, Jan, 2015. See Also -------- * [UUID data type](../uuid-data-type/index) * [Detailed discussion of UUID indexing](http://stackoverflow.com/questions/28084901/how-does-mysql-determine-if-an-insert-is-unique/28547410#28547410) * [Graphical display of the random nature of UUID on PRIMARY KEY](http://www.percona.com/blog/2015/04/03/illustrating-primary-key-models-in-innodb-and-their-impact-on-disk-usage/) * [Benchmarks, etc, by Karthik Appigatla](https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/) * [More details on the clock](https://www.famkruithof.net/guid-uuid-timebased.html) * [Percona benchmarks](https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/) * [NHibernate can generate sequential GUIDs](http://nhibernate.info/blog/2009/05/21/using-the-guid-comb-identifier-strategy.html) , but it seems to be backwards. Rick James graciously allowed us to use this article in the Knowledge Base. [Rick James' site](http://mysql.rjweb.org/) has other useful tips, how-tos, optimizations, and debugging tips. Original source: <http://mysql.rjweb.org/doc.php/uuid> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Benefits of Managing Docker Containers with Orchestration Software Benefits of Managing Docker Containers with Orchestration Software ================================================================== In this page we'll discuss why automating [Docker](../docker-and-mariadb/index) containers with software like [Ansible](../ansible-and-mariadb/index) or [Puppet](../automated-mariadb-deployment-and-administration-puppet-and-mariadb/index) may be desirable in some cases. To talk about this, we'll first need to discuss why Docker containers are defined *ephemeral*, and how this applies to containerized database servers (particularly MariaDB). During the discussion, we should keep in mind that Docker can be used to setup production and/or development environments. These use cases are very different from a database perspective: a production database may be big, and typically contains data that we don't want to lose. Development environments usually contain small sample data that can be rebuilt relatively quickly. This page focuses on the latter case. Docker's Ephemeral Nature ------------------------- Docker images are compiled from Dockerfiles. Containers are created from images. Normally, a container is not modified from the moment it is created. In other words, containers are usually designed to be **ephemeral**, meaning that they can be destroyed and replaced with new containers at any time. Provided that there is proper redundancy (for example, there are several web servers running the same services) destroying one container and starting a new one of the same type won't cause any damage. We will discuss a bit later how this applies to MariaDB, and more generally to database servers. When something should change, for example some software version or configuration, normally Dockerfiles are updated and containers are recreated from the latest image versions. For this reason, containers shouldn't contain anything that shouldn't be lost, and recreating them should be an extremely cheap operation. **Docker Compose** or the **Swarm mode** are used to declare which containers form a certain environment, and how they communicate with each other. On the contrary, Ansible and Puppet are mainly built to manage the configuration of existing servers. It doesn't recreate servers, it changes their configuration. So Docker and Ansible have very different approaches. For this reason, Ansible and Puppet are not frequently used to deploy containers to production. However, using them together can bring some benefits, especially for development environments. More on this later in the page. First, we need to understand how these concepts apply to database servers. Stateful Technologies --------------------- Using ephemeral containers works very well for *stateless* technologies, like web servers and proxies. These technologies virtually only need binaries, configuration and small amounts of data (web pages). If some data need to be restored after a container creation, it will be a fast operation. In the case of a database, the problem is that data can be large and need to be written somewhere. We don't want all databases to disappear when we destroy a container. Even if we had an up-to-date backup, restoring it would take time. However, Docker has features called **volumes** and **volume containers**. We won't discuss the difference here, let's focus on their purpose. A volume is a directory in the host system mapped to a directory in one or more containers. Volumes are not destroyed when containers are destroyed. They can be used to share data between any number of containers and the host system. Therefore, they are also a good way to persist data. Suppose a MariaDB container called `mariadb-main-01` uses a volume that is mapped to `/var/docker/volumes/mariadb-main`. At some point we want to use a more recent MariaDB version. As explained earlier, the Docker way to do this is to destroy the container and create a new one that uses a more recent version of the MariaDB image. So, we will destroy `mariadb-main-01`. The volume is still there. Then we create a new container with the same name, but based on a newer image. We make sure to link the volume to the new container too, so it will be able to use `/var/docker/volumes/mariadb-main` again. At this point we may want to run [mysql\_upgrade](../mysql_upgrade/index), but apart from that, everything should *just work*. The above described steps are simple, but running them manually is time consuming and error-prone. Automating them with some automation software like Ansible or Puppet is often desirable. Ways to Deploy Docker Containers -------------------------------- Docker containers can be deployed in the following ways: * Manually. See [Installing and Using MariaDB via Docker](../installing-and-using-mariadb-via-docker/index). This is not recommended for production, or for complex environments. However, it can easily be done for the simplest cases. If we want to make changes to our [custom images](../creating-a-custom-docker-image/index), we'll need to modify the Dockerfiles, destroy the containers and recreate them. * With Docker Compose. See [Setting Up a LAMP Stack with Docker Compose](../setting-up-a-lamp-stack-with-docker-compose/index) for a simple example. When we modify a Dockerfile, we'll need to destroy the containers and recreate them, which is usually as simple as running `docker-compose down` followed by `docker-compose-up`. After changing `docker-cmpose.yml` (maybe to add a container or a network) we'll simply need to run `docker-compose-up` again, because it is idempotent. * Using Ansible, Puppet or other automation software, as mentioned before. We can use Ansible or Puppet to create the containers, and run them again every time we want to apply some change to the containers. This means that the containers are potentially created once and modified any number of times. In all these cases, it is entirely possible to add [Vagrant](../vagrant-and-mariadb/index) to the picture. Vagrant is a way to deploy or provision several hosts, including virtual machines (the most common case), and containers. It is agnostic in regarding the underlying technology, so it can deploy to a virtual machine, a container, or even a remote server in the same way. Docker can work with Vagrant in two ways: * As a [provisioner](../creating-a-vagrantfile/index#provisioners). In this case Vagrant will most commonly deploy a virtual machine, and will use Docker to setup the applications that need to run in it, as containers. This guarantees a higher level of isolation, compared to running the containers in the local host. Especially if you have different environments to deploy locally, because you can have them on different virtual machines. * As a [provider](../creating-a-vagrantfile/index#providers). Vagrant will deploy one or more Docker containers locally. Once each container is up, Vagrant can optionally use a provisioner on it, to make sure that the container runs the proper software with proper configuration. In this case, Ansible, Puppet or other automation software can be used as a provisioner. But again, this is optional: it is possible to make changes to the Dockerfiles and recreate the containers every time. Benefits of Managing Docker Containers with Automation Software --------------------------------------------------------------- Docker containers can be entirely managed with Docker Compose or the Swarm mode. This is often a good idea. However, choosing to use automation software like Ansible or Puppet has some benefits too. Benefits include: * Docker containers allow working without modifying the host system, and their creation is very fast. Much faster than virtual machines. This makes Docker desirable for development environments. * As explained, making all containers ephemeral and using volumes to store important data is possible. But this means adding some complexity to adapt an ephemeral philosophy to technologies that are not ephemeral by nature (databases). Also, many database professionals don't like this approach. Using automation software allows easily triggering upgrades and configuration changes in the containers, treating them as non-ephemeral systems. * Sometimes Docker is only used in development environments. If production databases are managed via Ansible, Puppet, or other automation software, this could lead to some code duplication. Dealing with configuration changes using the same procedures will reduce the cost of maintenance. * While recreating containers is fast, being able to apply small changes with Ansible or Puppet can be more convenient in some cases: particularly if we write files into the container itself, or if recreating a container bootstrap involves some lengthy procedure. * Trying to do something non-standard with Dockerfiles can be tricky. For example, running two processes in a container is possible but can be problematic, as Docker is design to run a process per container. However there are situations when this is desirable. For example PMM containers run several different processes. Launching additional processes with Ansible or Puppet may be easier than doing it with a Dockerfile. With all this in mind, let's see some examples of cases when managing Docker containers with Ansible, Puppet or other automation software is preferable, rather than destroying containers every time we want to make a change: * We use Ansible or Puppet in production, and we try to keep development environments as similar as possible to production. By using Ansible/Puppet in development too, we can reuse part of the code. * We make changes to the containers often, and recreating containers is not as fast as it should be (for example because a MariaDB [dump](../mysqldump/index) needs to be restored). * Creating a container implies some complex logic that does not easily fit a Dockerfile or Docker Compose (including, but not limited to, running multiple processes per container). That said, every case is different. There are environments where these advantages do not apply, or bring a very small benefit. In those cases, the cost of adding some automation with Ansible, Puppet or similar software is probably not justified. How to Deploy to Container from Orchestration Software ------------------------------------------------------ Suppose you want to manage containers configuration with Ansible. **At a first glance**, the simplest way is to run Ansible in the host system. It will need to connect to the containers via SSH, so they need to expose the 22 port. But we have multiple containers, so we'll need to map the 22 port of each container to a different port in the host. This is hard to maintain and potentially insecure: in production you want to avoid exposing any container port to the host. A better solution is to run Ansible itself in a container. The playbooks will be in a Docker volume, so we can access them from the host system to manage them more easily. The Ansible container will communicate with other containers using a Docker network, using the standard 22 port (or another port of your choice) for all containers. See Also -------- See these pages on how to manage Docker containers with different automation technologies: * [Deploying Docker Containers with Ansible](../deploying-docker-containers-with-ansible/index). * [Deploying Docker Containers with Puppet](../deploying-docker-containers-with-puppet/index). --- Content initially contributed by [Vettabase Ltd](https://vettabase.com/). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb TINYINT TINYINT ======= Syntax ------ ``` TINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL] ``` Description ----------- A very small [integer](../sql_language-data_types-int/index). The signed range is -128 to 127. The unsigned range is 0 to 255. For details on the attributes, see [Numeric Data Type Overview](../numeric-data-type-overview/index). [INT1](../int1/index) is a synonym for `TINYINT`. [BOOL and BOOLEAN](../boolean/index) are synonyms for `TINYINT(1)`. Examples -------- ``` CREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c TINYINT ZEROFILL); ``` With [strict\_mode](../sql-mode/index#strict-mode) set, the default from [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/): ``` INSERT INTO tinyints VALUES (-10,-10,-10); ERROR 1264 (22003): Out of range value for column 'b' at row 1 INSERT INTO tinyints VALUES (-10,10,-10); ERROR 1264 (22003): Out of range value for column 'c' at row 1 INSERT INTO tinyints VALUES (-10,10,10); SELECT * FROM tinyints; +------+------+------+ | a | b | c | +------+------+------+ | -10 | 10 | 010 | +------+------+------+ INSERT INTO tinyints VALUES (128,128,128); ERROR 1264 (22003): Out of range value for column 'a' at row 1 INSERT INTO tinyints VALUES (127,128,128); SELECT * FROM tinyints; +------+------+------+ | a | b | c | +------+------+------+ | -10 | 10 | 010 | | 127 | 128 | 128 | +------+------+------+ ``` With [strict\_mode](../sql-mode/index#strict-mode) unset, the default until [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/): ``` INSERT INTO tinyints VALUES (-10,-10,-10); Query OK, 1 row affected, 2 warnings (0.08 sec) Warning (Code 1264): Out of range value for column 'b' at row 1 Warning (Code 1264): Out of range value for column 'c' at row 1 INSERT INTO tinyints VALUES (-10,10,-10); Query OK, 1 row affected, 1 warning (0.11 sec) Warning (Code 1264): Out of range value for column 'c' at row 1 INSERT INTO tinyints VALUES (-10,10,10); SELECT * FROM tinyints; +------+------+------+ | a | b | c | +------+------+------+ | -10 | 0 | 000 | | -10 | 10 | 000 | | -10 | 10 | 010 | +------+------+------+ INSERT INTO tinyints VALUES (128,128,128); Query OK, 1 row affected, 1 warning (0.19 sec) Warning (Code 1264): Out of range value for column 'a' at row 1 INSERT INTO tinyints VALUES (127,128,128); SELECT * FROM tinyints; +------+------+------+ | a | b | c | +------+------+------+ | -10 | 0 | 000 | | -10 | 10 | 000 | | -10 | 10 | 010 | | 127 | 128 | 128 | | 127 | 128 | 128 | +------+------+------+ ``` See Also -------- * [Numeric Data Type Overview](../numeric-data-type-overview/index) * [SMALLINT](../smallint/index) * [MEDIUMINT](../mediumint/index) * [INTEGER](../int/index) * [BIGINT](../bigint/index) * [BOOLEAN](../boolean/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore LOAD DATA INFILE ColumnStore LOAD DATA INFILE ============================ The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. The file name must be given as a literal string. ``` LOAD DATA [LOCAL] INFILE 'file_name' INTO TABLE tbl_name [CHARACTER SET charset_name] [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STARTING BY 'string'] [TERMINATED BY 'string'] ] ``` * ColumnStore ignores the ON DUPLICATE KEY clause. * Non-transactional LOAD DATA INFILE is directed to ColumnStores cpimport tool by default, which significantly increases performance. * Transactional LOAD DATA INFILE statements (that is with AUTOCOMMIT off or after a START TRANSACTION) are processed through normal DML processes. * When using LOAD DATA LOCAL INFILE with the *mcsmysql* utility , use the [--local-infile](../server-system-variables/index#local_infile) command-line option. * Use cpimport for importing UTF-8 data that contains multi-byte values The following example loads data into the a simple 5 column table: A file named /simpletable.tbl *has the following data in it.* ``` 1|100|1000|10000|Test Number 1| 2|200|2000|20000|Test Number 2| 3|300|3000|30000|Test Number 3| ``` The data can then be loaded into the simpletable table with the following syntax: ``` LOAD DATA INFILE 'simpletable.tbl' INTO TABLE simpletable FIELDS TERMINATED BY '|' ``` If the default mode is set to use cpimport internally any output error files will be written to /usr/local/mariadb/columnstore/mysql/db directory (or equivalent directory for non root install). These can be consulted for troubleshooting any errors reported. ### See Also [LOAD DATA INFILE](../load-data-infile/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ALTER DATABASE ALTER DATABASE ============== Modifies a database, changing its overall characteristics. Syntax ------ ``` ALTER {DATABASE | SCHEMA} [db_name] alter_specification ... ALTER {DATABASE | SCHEMA} db_name UPGRADE DATA DIRECTORY NAME alter_specification: [DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collation_name | COMMENT [=] 'comment' ``` Description ----------- `ALTER DATABASE` enables you to change the overall characteristics of a database. These characteristics are stored in the `db.opt` file in the database directory. To use `ALTER DATABASE`, you need the `ALTER` privilege on the database. `ALTER SCHEMA` is a synonym for ALTER DATABASE. The `CHARACTER SET` clause changes the default database character set. The `COLLATE` clause changes the default database collation. See [Character Sets and Collations](../data-types-character-sets-and-collations/index) for more. You can see what character sets and collations are available using, respectively, the [SHOW CHARACTER SET](../show-character-set/index) and [SHOW COLLATION](../show-collation/index) statements. Changing the default character set/collation of a database does not change the character set/collation of any [stored procedures](../stored-procedures/index) or [stored functions](../stored-functions/index) that were previously created, and relied on the defaults. These need to be dropped and recreated in order to apply the character set/collation changes. The database name can be omitted from the first syntax, in which case the statement applies to the default database. The syntax that includes the `UPGRADE DATA DIRECTORY NAME` clause was added in MySQL 5.1.23. It updates the name of the directory associated with the database to use the encoding implemented in MySQL 5.1 for mapping database names to database directory names (see [Identifier to File Name Mapping](../identifier-to-file-name-mapping/index)). This clause is for use under these conditions: * It is intended when upgrading MySQL to 5.1 or later from older versions. * It is intended to update a database directory name to the current encoding format if the name contains special characters that need encoding. * The statement is used by `mysqlcheck` (as invoked by `mysql_upgrade`). For example,if a database in MySQL 5.0 has a name of a-b-c, the name contains instance of the `-' character. In 5.0, the database directory is also named a-b-c, which is not necessarily safe for all file systems. In MySQL 5.1 and up, the same database name is encoded as a@002db@002dc to produce a file system-neutral directory name. When a MySQL installation is upgraded to MySQL 5.1 or later from an older version,the server displays a name such as a-b-c (which is in the old format) as #mysql50#a-b-c, and you must refer to the name using the #mysql50# prefix. Use `UPGRADE DATA DIRECTORY NAME` in this case to explicitly tell the server to re-encode the database directory name to the current encoding format: ``` ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME; ``` After executing this statement, you can refer to the database as a-b-c without the special #mysql50# prefix. #### COMMENT **MariaDB starting with [10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/)**From [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), it is possible to add a comment of a maximum of 1024 bytes. If the comment length exceeds this length, a error/warning code 4144 is thrown. The database comment is also added to the db.opt file, as well as to the [information\_schema.schemata table](../information-schema-schemata-table/index). Examples -------- ``` ALTER DATABASE test CHARACTER SET='utf8' COLLATE='utf8_bin'; ``` From [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/): ``` ALTER DATABASE p COMMENT='Presentations'; ``` See Also -------- * [CREATE DATABASE](../create-database/index) * [DROP DATABASE](../drop-database/index) * [SHOW CREATE DATABASE](../show-create-database/index) * [SHOW DATABASES](../show-databases/index) * [Character Sets and Collations](../character-sets-and-collations/index) * [Information Schema SCHEMATA Table](../information-schema-schemata-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Spider Cluster Management Spider Cluster Management ========================= Direct SQL ---------- Direct SQL is a way to map reduced execution on remote backends and store the results in a local table. This can either be sequential, using the UDF function [spider\_direct\_sql](../spider_direct_sql/index), or concurrently, using [spider\_bg\_direct\_sql](../spider_bg_direct_sql/index). ``` spider1 backend << EOF CREATE TEMPORARY TABLE res ( id int(10) unsigned NOT NULL, k int(10) unsigned NOT NULL DEFAULT '0', c char(120) NOT NULL DEFAULT '', pad char(60) NOT NULL DEFAULT '' ) ENGINE=MEMORY; SELECT spider_direct_sql( 'SELECT * FROM sbtest s WHERE s.id IN(10,12,13)', 'res', concat('host "', host, '", port "', port, '", user "', username, '", password "', password, '", database "', tgt_db_name, '"') ) a FROM mysql.spider_tables WHERE db_name = 'backend' and table_name like 'sbtest#P#pt%'; SELECT * FROM res; EOF ``` Or if you are using a [SERVER](../create-server/index): ``` SELECT spider_direct_sql( 'SELECT * FROM sbtest s WHERE s.id IN(10,12,13)', 'res', concat('server "', server, '"') ) a FROM mysql.spider_tables WHERE db_name = 'backend' and table_name like 'sbtest#P#pt%' ; ``` The default for [spider\_bg\_direct\_sql](../spider_bg_direct_sql/index) is to access concurrently all backends. If you have multiple partitions store inside a single backend, you still can increase parallelism affecting different channels to each partitions. ``` CREATE TEMPORARY TABLE res ( id int(10) unsigned NOT NULL , col_microsec DATETIME(6) default NOW(8), db varchar(20) ) ENGINE=MEMORY; SELECT spider_bg_direct_sql( 'SELECT count(*) ,min(NOW(6)),min(DATABASE())) FROM sbtest', 'res', concat('srv "', server,'" cch ',@rn:=@rn+1 ) ) a FROM mysql.spider_tables,(SELECT @rn:=1) t2 WHERE db_name = 'bsbackend' and table_name like 'sbtest#P#pt%'; ``` Direct Handler Socket --------------------- Check that [Handler Socket](../handlersocket/index) is running on the backend nodes ``` :~# backend2 -e "show variables like 'handler%'" +-------------------------------+---------------+ | Variable_name | Value | +-------------------------------+---------------+ | handlersocket_accept_balance | 0 | | handlersocket_address | 192.168.0.201 | | handlersocket_backlog | 32768 | | handlersocket_epoll | 1 | | handlersocket_plain_secret | | | handlersocket_plain_secret_wr | | | handlersocket_port | 20500 | | handlersocket_port_wr | 20501 | | handlersocket_rcvbuf | 0 | | handlersocket_readsize | 0 | | handlersocket_sndbuf | 0 | | handlersocket_threads | 4 | | handlersocket_threads_wr | 1 | | handlersocket_timeout | 300 | | handlersocket_verbose | 10 | | handlersocket_wrlock_timeout | 12 | +-------------------------------+---------------+ ``` ``` spider1 backend << EOF CREATE TEMPORARY TABLE res ( id int(10) unsigned NOT NULL, k int(10) unsigned NOT NULL DEFAULT '0', c char(120) NOT NULL DEFAULT '', pad char(60) NOT NULL DEFAULT '' ) ENGINE=MEMORY; SELECT spider_direct_sql('1\t=\t1\t2\t100000\t0','res', 'host "192.168.0.202", table "sbtest", database "test", port "20500", access_mode "1"'); ``` Inter Nodes Copy Table ---------------------- The UDF function [spider\_copy\_tables](../spider_copy_tables/index) is available for copying table data from the source link ID to the destination link ID list without stopping your service for copying `spider_copy_tables(Spider table name, source link ID, destination link ID list[, parameters])` * `Returns 1` if copying data succeeded. * `Returns 0` if copying data failed. If the Spider table is partitioned, you must set "Spider table name" with a part name such as "table\_name#P#part\_name". You can check the table name and the link ID with the part name using the following SQL: ``` SELECT table_name FROM mysql.spider_tables; ``` Resharding ---------- General Log ----------- To capture all queries sent to remote backends on a `Spider Node` : ``` SET GLOBAL general_log=ON; SET GLOBAL spider_general_log=ON; SET GLOBAL spider_log_result_errors=1; SET GLOBAL spider_log_result_error_with_sql=3; ``` Compiling in Debug Mode ----------------------- Compile MariaDB in debug mode ``` #cmake -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Debug -DWITH_FAST_MUTEXES=ON -DWITH_VALGRIND=ON ``` Run MariaDB the following way to have a detailed command trace file ``` mysqld --debug=S:T:t:r:p:n:L:i:F:f:D:d,info,error,query,qcache,my,exit,general,where:O,/tmp/mysqld.trace ``` Or with Valgrind to get a complete stack trace on a crash. ``` valgrind /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/inetbase/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/inetbase/mysql/lucifer.err --open-files-limit=65000 --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 ``` Report the issue in [MariaDB JIRA](https://jira.mariadb.org) (see [Reporting Bugs](../reporting-bugs/index)) or to the MariaDB Corporation support center. Compiling in Static ------------------- Available since version 3.1.14 To activate spider as a static plugin change "MODULE\_ONLY" to "MANDATORY" in storage/spider/CMakeList.txt before compiling Note that Spider UDF functions will not work with such settings. Status Variables ---------------- A number of new [status variables](../server-status-variables/index) have been introduced: * [Spider\_direct\_aggregate](../spider-server-status-variables/index#spider_direct_aggregate) * [Spider\_direct\_order\_limit](../spider-server-status-variables/index#spider_direct_order_limit) * [Spider\_mon\_table\_cache\_version](../spider-server-status-variables/index#spider_mon_table_cache_version) * [Spider\_mon\_table\_cache\_version\_req](../spider-server-status-variables/index#spider_mon_table_cache_version_req) Information Schema Tables ------------------------- * A new [Information Schema](../information-schema/index) table is installed - [SPIDER\_ALLOC\_MEM](../information-schema-spider_alloc_mem-table/index). ``` +-------------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+---------------------+------+-----+---------+-------+ | ID | int(10) unsigned | NO | | 0 | | | FUNC_NAME | varchar(64) | YES | | NULL | | | FILE_NAME | varchar(64) | YES | | NULL | | | LINE_NO | int(10) unsigned | YES | | NULL | | | TOTAL_ALLOC_MEM | bigint(20) unsigned | YES | | NULL | | | CURRENT_ALLOC_MEM | bigint(20) | YES | | NULL | | | ALLOC_MEM_COUNT | bigint(20) unsigned | YES | | NULL | | | FREE_MEM_COUNT | bigint(20) unsigned | YES | | NULL | | +-------------------+---------------------+------+-----+---------+-------+ ``` Performance Schema ------------------ The [Performance schema](../performance-schema/index) is commonly used to troubleshoot issues that consume time inside your workload. The Performance schema should not be activated for servers that are experimenting constant heavy load, but most of time it is acceptable to lose 5% to 20% additional CPU to keep track of server internals execution. To activate the performance schema, use the [performance\_schema](../performance-schema-system-variables/index#performance_schema) system variable and add the following to the server section of the [MariaDB configuration file](../configuring-mariadb-with-mycnf/index). ``` performance_schema=on ``` Activate the Spider probes to be monitored. ``` UPDATE performance_schema.setup_instruments SET ENABLED='YES', TIMED='yes' WHERE NAME LIKE '%spider%'; ``` Run your queries ... And check the performance metrics. Remove specific Spider metrics to have a more global view. ``` SELECT * FROM performance_schema.events_waits_summary_global_by_event_name WHERE COUNT_STAR<>0 AND EVENT_NAME LIKE '%spider%' ORDER BY SUM_TIMER_WAIT DESC LIMIT 10; ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LIST Partitioning Type LIST Partitioning Type ====================== LIST partitioning is conceptually similar to [RANGE partitioning](../range-partitioning-type/index). In both cases you decide a partitioning expression (a column, or a slightly more complex calculation) and use it to determine which partitions will contain each row. However, with the RANGE type, partitioning is done by assigning a range of values to each partition. With the LIST type, we assign a set of values to each partition. This is usually preferred if the partitioning expression can return a limited set of values. A variant of this partitioning method, [LIST COLUMNS](../range-columns-and-list-columns-partitioning-types/index), allows us to use multiple columns and more datatypes. Syntax ------ The last part of a [CREATE TABLE](../create-table/index) statement can be the definition of the new table's partitions. In the case of LIST partitioning, the syntax is the following: ``` PARTITION BY LIST (partitioning_expression) ( PARTITION partition_name VALUES IN (value_list), [ PARTITION partition_name VALUES IN (value_list), ... ] [ PARTITION partition_name DEFAULT ] ) ``` PARTITION BY LIST indicates that the partitioning type is LIST. The `partitioning_expression` is an SQL expression that returns a value from each row. In the simplest cases, it is a column name. This value is used to determine which partition should contain a row. `partition_name` is the name of a partition. `value_list` is a list of values. If `partitioning_expression` returns one of these values, the row will be stored in this partition. If we try to insert something that does not belong to any of these value lists, the row will be rejected with an error. The `DEFAULT` partition catches all records which do not fit into other partitions. Only one `DEFAULT` partition is permitted. This option was added in [MariaDB 10.2](../what-is-mariadb-102/index). Use cases --------- LIST partitioning can be useful when we have a column that can only contain a limited set of values. Even in that case, RANGE partitioning could be used instead; but LIST partitioning allows us to equally distribute the rows by assigning a proper set of values to each partition. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ALTER EVENT ALTER EVENT =========== Modifies one or more characteristics of an existing event. Syntax ------ ``` ALTER [DEFINER = { user | CURRENT_USER }] EVENT event_name [ON SCHEDULE schedule] [ON COMPLETION [NOT] PRESERVE] [RENAME TO new_event_name] [ENABLE | DISABLE | DISABLE ON SLAVE] [COMMENT 'comment'] [DO sql_statement] ``` Description ----------- The `ALTER EVENT` statement is used to change one or more of the characteristics of an existing [event](../events/index) without the need to drop and recreate it. The syntax for each of the `DEFINER`, `ON SCHEDULE`, `ON COMPLETION`, `COMMENT`, `ENABLE` `/` `DISABLE`, and `DO` clauses is exactly the same as when used with [CREATE EVENT](../create-event/index). This statement requires the [EVENT](../grant/index#database-privileges) privilege. When a user executes a successful `ALTER EVENT` statement, that user becomes the definer for the affected event. (In MySQL 5.1.11 and earlier, an event could be altered only by its definer, or by a user having the [SUPER](../grant/index#global-privileges) privilege.) `ALTER EVENT` works only with an existing event: ``` ALTER EVENT no_such_event ON SCHEDULE EVERY '2:3' DAY_HOUR; ERROR 1539 (HY000): Unknown event 'no_such_event' ``` Examples -------- ``` ALTER EVENT myevent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 HOUR DO UPDATE myschema.mytable SET mycol = mycol + 1; ``` See Also -------- * [Events Overview](../events-overview/index) * [CREATE EVENT](../create-event/index) * [SHOW CREATE EVENT](../show-create-event/index) * [DROP EVENT](../drop-event/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Cassandra Storage Engine Overview Cassandra Storage Engine Overview ================================= CassandraSE is no longer actively being developed and has been removed in [MariaDB 10.6](../what-is-mariadb-106/index). See [MDEV-23024](https://jira.mariadb.org/browse/MDEV-23024). Installing ---------- **MariaDB starting with [10.0.1](https://mariadb.com/kb/en/mariadb-1001-release-notes/)**Cassandra storage engine is a part of [MariaDB 10.0](../what-is-mariadb-100/index), starting from [MariaDB 10.0.1](https://mariadb.com/kb/en/mariadb-1001-release-notes/). The Cassandra storage engine is included but is not installed/activated by default. If using the [YUM repositories](https://downloads.mariadb.org/mariadb/repositories/) on Fedora, Red Hat, or CentOS, first install the Cassandra storage engine package with: ``` yum install MariaDB-cassandra-engine ``` If using the Debian or Ubuntu repositories, the Cassandra plugin is in the main MariaDB server package. To install/activate the storage engine into MariaDB, issue the following command: ``` install soname 'ha_cassandra.so'; ``` You can also activate the storage engine by using the `--plugin-load` command on server startup. **MariaDB [5.5.27](https://mariadb.com/kb/en/mariadb-5527-release-notes/)**There was also a preview release based on [MariaDB 5.5](../what-is-mariadb-55/index) with a source tarball and x86\_64 binaries for Ubuntu 12.04 Precise Pangolin. It is available from here: * [Binary Tarball](http://downloads.mariadb.org/interstitial/mariadb-5.5.27/cassandra-preview/mariadb-5.5.25-linux-x86_64.tar.gz/from/http://ftp.osuosl.org/pub/mariadb), * [Source Tarball](http://downloads.mariadb.org/interstitial/mariadb-5.5.27/cassandra-preview/mariadb-5.5.25.tar.gz/from/http://ftp.osuosl.org/pub/mariadb). The Cassandra storage engine is not included in any regular [MariaDB 5.5](../what-is-mariadb-55/index) release. Introduction ------------ The Cassandra Storage Engine allows access to data in a Cassandra cluster from MariaDB. The overall architecture is shown in the picture below and is similar to that of the NDB cluster storage engine. You can access the same Cassandra cluster from multiple MariaDB instances, provided each of them runs the Cassandra Storage Engine: The primary goal of Cassandra SE (Storage Engine) is data integration between the SQL and NoSQL worlds. Have you ever needed to: * grab some of Cassandra's data from your web frontend, or SQL query? * insert a few records into Cassandra from some part of your app? Now, this is easily possible. Cassandra SE makes Cassandra's column family appear as a table in MariaDB that you can insert to, update, and select from. You can write joins against this table, it is possible to join data that's stored in MariaDB with data that's stored in Cassandra. ### Versions in MariaDB | Cassandra SE Version | Introduced | Maturity | | --- | --- | --- | | Cassandra SE 1.8 | [MariaDB 10.0.1](https://mariadb.com/kb/en/mariadb-1001-release-notes/) | Experimental | ### What about CQL? The Cassandra Query Language (CQL) is the best way to work with Cassandra. It resembles SQL on first glance, however the resemblance is very shallow. CQL queries are tightly bound to the way Cassandra accesses its data internally. For example, you can't have even the smallest join. In fact, adding a mere `... AND non_indexed_column=1` into a `WHERE` clause is already invalid CQL. Our goal is to let one work in SQL instead of having to move between CQL and SQL all the time. ### Does this make Cassandra an SQL database? No. Cassandra SE is not suitable for running analytics-type queries that sift through huge amounts of data in a Cassandra cluster. That task is better handled by Hadoop-based tools like Apache Pig or Apache Hive. Cassandra SE is rather a "window" from an SQL environment into NoSQL. Data mapping ------------ Let's get specific. In order to access Cassandra's data from MariaDB, one needs to create a table with `engine=cassandra`. The table will represent a view of a Column Family in Cassandra and its definition will look like so: ``` set cassandra_default_thrift_host='192.168.0.10' -- Cassandra's address. It can also -- be specified as startup parameter -- or on per-table basis create table cassandra_tbl -- table name can be chosen at will ( rowkey type PRIMARY KEY, -- represents Column Family's rowkey. Primary key -- must be defined over this column. column1 type, -- Cassandra's static columns can be mapped to column2 type, -- regular SQL columns. dynamic_cols blob DYNAMIC_COLUMN_STORAGE=yes -- If you need to access Cassandra's -- dynamic columns, you can define -- a blob which will receive all of -- them, packed as MariaDB's dynamic -- columns. ) engine=cassandra keyspace= 'cassandra_key_space' -- Cassandra's keyspace.columnFamily we column_family='column_family_name'; -- are accessing. ``` The name of the table can be arbitrary. However, primary key, column names, and types must "match" those of Cassandra. ### Cassandra's rowkey The table must define a column that corresponds to the Column Family's rowkey. * If Cassandra's `rowkey` has an alias (or name), then MariaDB's column must have the same name. + Otherwise, it must be named "rowkey". * The type of MariaDB's column must match the validation\_class of Cassandra's rowkey (datatype matching is covered in more detail below). Note: Multi-column primary keys are currently not supported. Support may be added in a future version, depending on whether there is a demand for it. ### Cassandra's static columns Cassandra allows one to define a "static column family", where column metadata is defined in the Column Family header and is obeyed by all records. These "static" columns can be mapped to regular columns in MariaDB. A static column named 'foo' in Cassandra should have a counterpart named 'foo' in MariaDB. The types must also match, they are covered below. ### Cassandra's dynamic columns Cassandra also allows individual rows to have their own sets of columns. In other words, each row can have its own unique columns. These columns can be accessed through MariaDB's [Dynamic Columns](../dynamic-columns/index) feature. To do so, one must define a column: * with an arbitrary name * of type `blob` * with the `DYNAMIC_COLUMN_STORAGE=yes` attribute Here is an example: ``` dynamic_cols blob DYNAMIC_COLUMN_STORAGE=yes ``` Once define, one can access individual columns with the [new variant](../dynamic-columns-in-mariadb-10/index) of the Dynamic Column functions, which now support string names (they used to support integers only). ### Super columns Cassandra's SuperColumns are not supported, there are currently no plans to support them. ### Datatypes There is no direct 1-to-1 mapping between Cassandra's datatypes and MySQL/MariaDB datatypes. Also, Cassandra's size limitations are often more relaxed than MySQL/MariaDB's. For example, Cassandra's limit on rowkey length is about 2G, while MySQL limits unique key length to about 1.5Kb. The types must be mapped as follows: | Cassandra | MariaDB | | --- | --- | | blob | BLOB, VARBINARY(n) | | ascii | BLOB, VARCHAR(n), use charset=latin1 | | text | BLOB, VARCHAR(n), use charset=utf8 | | varint | VARBINARY(n) | | int | INT | | bigint | BIGINT, TINY, SHORT (pick the one that will fit the real data) | | uuid | CHAR(36), the UUID will be represented in text form on the MariaDB side | | timestamp | TIMESTAMP (second precision), TIMESTAMP(6) (microsecond precision), BIGINT (gets verbatim Cassandra's 64-bit milliseconds-since-epoch) | | boolean | BOOL | | float | FLOAT | | double | DOUBLE | | decimal | VARBINARY(n) | | counter | BIGINT, only reading is supported | For types like "`VARBINARY(n)`", `n` should be chosen sufficiently large to accommodate all the data that is encountered in the table. Command mapping --------------- ### INSERT Cassandra doesn't provide any practical way to make INSERT different from UPDATE. Therefore, INSERT works as INSERT-or-UPDATE, it will overwrite the data, if necessary. `INSERT ... SELECT` and multi-line INSERT will try to write data in batches. Batch size is controlled by the [cassandra\_insert\_batch\_size](../cassandra-system-variables/index#cassandra_insert_batch_size) system variable, which specifies the max. batch size in columns. The status variables [Cassandra\_row\_inserts](../cassandra-status-variables/index#cassandra_row_inserts) and [Cassandra\_row\_insert\_batches](../cassandra-status-variables/index#cassandra_row_insert_batches) allow one to see whether inserts are actually batched. ### UPDATE UPDATE works like one would expect SQL's UPDATE command to work (i.e. changing a primary key value will result in the old record being deleted and a new record being inserted) ### DELETE * `DELETE FROM cassandra_table` maps to the `truncate(column_family)` call. * The DELETE with WHERE clause will do per-row deletions. ### SELECT Generally, all SELECT statements work like one expects SQL to work. Conditions in the form `primary_key=...` allow the server to construct query plans which access Cassandra's rows with key lookups. #### Full table scan Full table scans are performed in a memory-efficient way. Cassandra SE performs a full table scan as a series of batches, each of which reads not more than [cassandra\_rnd\_batch\_size](../cassandra-system-variables/index#cassandra_rnd_batch_size) records. #### Batched Key Access support Cassandra supports Batched Key Access in no-association mode. This means that it requires the SQL layer to do hashing, which means the following settings are required: * optimizer\_switch='join\_cache\_hashed=on' * join\_cache\_level=7|8 Cassandra SE is currently unable to make use of space in the join buffer (the one whose size is controlled by [#join\_buffer\_size](../server-system-variables/index#join_buffer_size)). Instead, it will limit read batches to reading not more than [cassandra\_multiget\_batch\_size](../cassandra-system-variables/index#cassandra_multiget_batch_size) at a time, and memory will be allocated on the heap. Note that the [#join\_buffer\_size](../server-system-variables/index#join_buffer_size) buffer is still needed by the SQL layer, so its value should still be increased if you want to read in big batches. It is possible to track the number of read batches, how many keys were looked-up, and how many results were produced with these status variables: | Variable\_name | Value | | --- | --- | | [Cassandra\_multiget\_reads](../cassandra-status-variables/index#cassandra_multiget_reads) | `0` | | [Cassandra\_multiget\_keys\_scanned](../cassandra-status-variables/index#cassandra_multiget_keys_scanned) | `0` | | [Cassandra\_multiget\_rows\_read](../cassandra-status-variables/index#cassandra_multiget_rows_read) | `0` | System and status variables --------------------------- The following [system variables](../cassandra-system-variables/index) are available: | Variable name | Description | | --- | --- | | [cassandra\_default\_thrift\_host](../cassandra-system-variables/index#cassandra_default_thrift_host) | Host to connect to, if not specified on per-table basis | | [cassandra\_failure\_retries](../cassandra-system-variables/index#cassandra_failure_retries) | Number of times to retry on timeout/unavailable failures | | [cassandra\_insert\_batch\_size](../cassandra-system-variables/index#cassandra_insert_batch_size) | INSERT batch size | | [cassandra\_multiget\_batch\_size](../cassandra-system-variables/index#cassandra_multiget_batch_size) | Batched Key Access batch size | | [cassandra\_rnd\_batch\_size](../cassandra-system-variables/index#cassandra_rnd_batch_size) | Full table scan batch size | | [cassandra\_read\_consistency](../cassandra-system-variables/index#cassandra_read_consistency) | Consistency to use for reading | | [cassandra\_write\_consistency](../cassandra-system-variables/index#cassandra_write_consistency) | Consistency to use for writing | The following [status variables](../cassandra-status-variables/index) are available: | Variable name | Description | | --- | --- | | [Cassandra\_row\_inserts](../cassandra-status-variables/index#cassandra_row_inserts) | Number of rows inserted | | [Cassandra\_row\_insert\_batches](../cassandra-status-variables/index#cassandra_row_insert_batches) | Number of insert batches performed | | [Cassandra\_multiget\_reads](../cassandra-status-variables/index#cassandra_multiget_reads) | Number of read operations | | [Cassandra\_multiget\_keys\_scanned](../cassandra-status-variables/index#cassandra_multiget_keys_scanned) | Number of keys we've made lookups for | | [Cassandra\_multiget\_rows\_read](../cassandra-status-variables/index#cassandra_multiget_rows_read) | Number of rows actually read | | [Cassandra\_timeout\_exceptions](../cassandra-status-variables/index#cassandra_timeout_exceptions) | Number of Timeout exceptions we got from Cassandra | | [Cassandra\_unavailable\_exceptions](../cassandra-status-variables/index#cassandra_unavailable_exceptions) | Number of Unavailable exceptions we got from Cassandra | A note about Cassandra 1.2 -------------------------- Cassandra 1.2 has slightly changed its data model, as described at <http://www.datastax.com/dev/blog/thrift-to-cql3>. This has caused some of Thrift-based clients to no longer work (for example, here's a problem experienced by Pig: [CASSANDRA-5234](https://issues.apache.org/jira/browse/CASSANDRA-5234)). Currently, Cassandra SE is only able to access Cassandra 1.2's column families that were defined `WITH COMPACT STORAGE` attribute. See also -------- * Slides from talk at Percona Live 2013:[MariaDB Cassandra Interoperability](http://www.percona.com/live/mysql-conference-2013/sessions/mariadb-cassandra-interoperability) * [MDEV-431](https://jira.mariadb.org/browse/MDEV-431) - JIRA task for Cassandra SE work * [Instructions for creating binary tarball in MariaDB 5.5](../building-cassandra-storage-engine-for-packaging/index) * [Cassandra Storage Engine - Future Plans](../cassandra-storage-engine-future-plans/index) * [Cassandra Storage Engine - Use Example](../cassandra-storage-engine-use-example/index) * [Cassandra Storage Engine - Issues](../cassandra-storage-engine-issues/index) * [HBase Storage Engine](../hbase-storage-engine/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysqltest and mysqltest-embedded mysqltest and mysqltest-embedded ================================ The `mysqltest` program runs a test case against a MariaDB or MySQL server and optionally compares the output with a result file. This program reads input written in a special test language. Typically, you invoke *mysqltest*> via `[mysql-test-run.pl](../mysql-test-runpl/index)` rather than invoking it directly. `mysqltest_embedded` is similar but is built with support for the `libmysqld` embedded server. Features of mysqltest: * Can send SQL statements to the server for execution * Can execute external shell commands * Can test whether the result from an SQL statement or shell command is as expected * Can connect to one or more standalone mysqld servers and switch between connections * Can connect to an embedded server (libmysqld), if MariaDB or MySQL is compiled with support for libmysqld. (In this case, the executable is named mysqltest\_embedded rather than mysqltest.) By default, mysqltest reads the test case on the standard input. To run mysqltest this way, you normally invoke it like this: ``` shell> mysqltest **[options] [db_name]** < //test_file// ``` You can also name the test case file with a `--test-file=*file\_name*` option. The exit value from mysqltest is 0 for success, 1 for failure, and 62 if it skips the test case (for example, if after checking some preconditions it decides not to run the test). Options ------- mysqltest supports the following options: | Option | Description | | --- | --- | | `--help`, `-?` | Display a help message and exit. | | `--basedir=dir`, `-b dir` | The base directory for tests. | | `--character-sets-dir=path` | The directory where [character sets](../data-types-character-sets-and-collations/index) are installed. | | `--compress`, `-C` | Compress all information sent between the client and the server if both support compression. | | `--connect-timeout=N` | This can be used to set the MYSQL\_OPT\_CONNECT\_TIMEOUT parameter of mysql\_options to change the number of seconds before an unsuccessful connection attempt times out. | | `--continue-on-error` | Continue test even if we got an error. This is mostly useful when testing a storage engine to see what from a test file it can execute, or to find all syntax errors in a newly created big test file | | `--cursor-protocol` | Use cursors for prepared statements. | | `--database=db_name`, `-D db_name` | The default database to use. | | `--debug[=debug_options]`, `-#[debug_options]` | Write a debugging log if MariaDB is built with debugging support. The default debug\_options value is `d:t:S:i:O,/tmp/mysqltest.trace` on Unix and `d:t:i:O,\mysqld.trace` on Windows. | | `--debug-check` | Print some debugging information when the program exits. | | `--debug-info` | Print debugging information and memory and CPU usage statistics when the program exits. | | `--host=host_name`, `-h host_name` | Connect to the server on the given host. | | `--logdir=dir_name` | The directory to use for log files. | | `--mark-progress` | Write the line number and elapsed time to *test\_file.progress*. | | `--max-connect-retries=num` | The maximum number of connection attempts when connecting to server. | | `--max-connections=num` | The maximum number of simultaneous server connections per client (that is, per test). If not set, the maximum is 128. Minimum allowed limit is 8, maximum is 5120. | | `--no-defaults` | Do not read default options from any option files. If used, this must be the first option. | | `--non-blocking-api` | Use the non-blocking client API for communication. | | `--overlay-dir=name` | Overlay directory. | | `--password[=password]`, `-p[password]` | The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the `--password` or `-p` option on the command line, you are prompted for one. | | `plugin-dir` | Directory for client-side plugins. | | `--port=port_num`, `-P port_num` | The TCP/IP port number to use for the connection, or 0 for default to, in order of preference, my.cnf, $MYSQL\_TCP\_PORT, /etc/services, built-in default (3306). | | `--prologue=name` | Include the contents of the given file before processing the contents of the test file. The included file should have the same format as other *mysqltest* test files. This option has the same effect as putting a --source file\_name command as the first line of the test file. | | `--protocol=name` | The protocol to use for connection (tcp, socket, pipe, memory). | | `--ps-protocol` | Use the prepared-statement protocol for communication. | | `--quiet` | Suppress all normal output. This is a synonym for `--silent`. | | `--record`, `-r` | Record the output that results from running the test file into the file named by the `--result-file` option, if that option is given. It is an error to use this option without also using `--result-file`. | | `--result-file=file_name`, `-R file_name` | This option specifies the file for test case expected results. `--result-file`, together with `--record`, determines how mysqltest treats the test actual and expected results for a test case:If the test produces no results, mysqltest exits with an error message to that effect, unless `--result-file` is given and the named file is an empty file.Otherwise, if `--result-file` is not given, mysqltest sends test results to the standard output. With `--result-file` but not `--record`, mysqltest reads the expected results from the given file and compares them with the actual results. If the results do not match, mysqltest writes a reject file in the same directory as the result file, outputs a diff of the two files, and exits with an error. With both `--result-file` and `--record`, mysqltest updates the given file by writing the actual test results to it. | | `--result-format-version=#` | Version of the result file format to use. | | `--server-arg=value`, `-A value` | Pass the argument as an argument to the embedded server. For example, `--server-arg=--tmpdir=/tmp` or `--server-arg=--core`. Up to 64 arguments can be given. | | `--server-file=file_name`, `-F file_name` | Read arguments for the embedded server from the given file. The file should contain one argument per line. | | `--shared-memory-base-name` | Shared-memory name to use for Windows connections using shared memory to a local server (started with the `--shared-memory` option). Case-sensitive. | | `--silent`, `-s` | Suppress all normal output. | | `--sleep=num`, `-T num` | Cause all sleep commands in the test case file to sleep num seconds. This option does not affect real\_sleep commands. An option value of 0 can be used, which effectively disables sleep commands in the test case. | | `--socket=path`, `-S path` | The socket file to use when connecting to localhost (which is the default host). | | `--sp-protocol` | Execute DML statements within a stored procedure. For every DML statement, mysqltest creates and invokes a stored procedure that executes the statement rather than executing the statement directly. | | `--ssl` | Enable [TLS for secure connection](../secure-connections-overview/index) (automatically enabled with other flags). Disable with `--skip-ssl`. | | `--ssl-ca=name` | CA file in PEM format (check OpenSSL docs, implies `--ssl`). | | `--ssl-capath=name` | CA directory (check OpenSSL docs, implies `--ssl`). | | `--ssl-cert=name` | X509 cert in PEM format (implies `--ssl`). | | `--ssl-cipher=name` | SSL cipher to use (implies `--ssl`). | | `--ssl-key=name` | X509 key in PEM format (implies `--ssl`). | | `--ssl-crl=name` | Certificate revocation list (implies `--ssl`). | | `--ssl-crlpath=name` | Certificate revocation list path (implies `--ssl`). | | `--ssl-verify-server-cert` | Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default. | | `--suite-dir=name` | Suite directory. | | `--tail-lines=nn` | Specify how many lines of the result to include in the output if the test fails because an SQL statement fails. The default is 0, meaning no lines of result printed. | | `--test-file=file_name`, `-x file_name` | Read test input from this file. The default is to read from the standard input. | | `--timer-file=file_name`, `-m file_name` | If given, the number of microseconds spent running the test will be written to this file. This is used by [mysql-test-run.pl](../mysql-test-runpl-options/index) for its reporting. | | `--tmpdir=dir_name`, `-t dir_name` | The temporary directory where socket files are created. | | `--user=user_name`, `-u user_name` | The user name to use when connecting to the server. | | `--verbose`, `-v` | Verbose mode. Print out more information about what the program does. | | `--version`, `-V` | Display version information and exit. | | `--view-protocol` | Every SELECT statement is wrapped inside a view. | | `--wait-longer-for-timeouts` | Wait longer for timeouts. Useful when running under valgrind. | See Also -------- * [New Features for mysqltest in MariaDB](../new-features-for-mysqltest-in-mariadb/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb MariaDB Feature Backport MariaDB Feature Backport ======================== **Note:** This page is obsolete. The information is old, outdated, or otherwise currently incorrect. We are keeping the page for historical reasons only. **Do not** rely on the information in this article. Some background --------------- If case you didn't know: ### What features were in 6.0 Features that were in 6.0 and that we can rescue from there and provide value for the users: * MRR+BKA + There are known bugs in the implementation of MRR/InnoDB (but not in MRR/Maria or MRR/MyISAM) which has caused Oracle to request a patch that disables MRR/InnoDB, which SergeyP has given them this May. + BKA itself was used by a customer with a proprietary engine, and also by NDB, so can be assumed tested. *note: unless said otherwise, by MRR we mean MRR and ICP, everywhere* * The first two batches of subquery optimizations: * [MySQL Worklog #2980](https://dev.mysql.com/worklog/task/?id=2980): Subquery optimization: Semijoin + [MySQL Worklog #3740](https://dev.mysql.com/worklog/task/?id=3740): Subquery optimization: Semijoin: Pull-out of inner tables + [MySQL Worklog #3741](https://dev.mysql.com/worklog/task/?id=3741): Subquery optimization: Semijoin: Duplicate elimination strategy + [MySQL Worklog #3750](https://dev.mysql.com/worklog/task/?id=3750): Subquery optimization: Semijoin: First-match strategy + [MySQL Worklog #3751](https://dev.mysql.com/worklog/task/?id=3751): Subquery optimization: Semijoin: Inside-out strategy * [MySQL Worklog #1110](https://dev.mysql.com/worklog/task/?id=1110): Subquery optimization: Materialization * [MySQL Worklog #3985](https://dev.mysql.com/worklog/task/?id=3985): Subquery optimization: smart choice between semi-join and materialization * Semi-join optimizations, including semi-join materialization has issues: + The "outer join and semi-join problem" + The different-datatypes-comparison problem * Subquery optimizations rely on the following WLs to be present in the tree: + [MySQL Worklog #4165](https://dev.mysql.com/worklog/task/?id=4165) Prepared statements: validation + [MySQL Worklog #4166](https://dev.mysql.com/worklog/task/?id=4166) Prepared statements: automatic re-prepare ### Related unfinished 6.x tasks There are also unfinished tasks, in various degrees of public availability and readyness: * [MySQL Worklog #3485](https://dev.mysql.com/worklog/task/?id=3485): Subquery optimization: FROM (SELECT) (Evgen) * [MySQL Worklog #4389](https://dev.mysql.com/worklog/task/?id=4389): Subquery optimizations: Make IN optimizations also handle EXISTS (Roy Lyseng) * [MySQL Worklog #3830](https://dev.mysql.com/worklog/task/?id=3830): Subquery optimization: Materialization: Partial matching of tuples with NULL components (Timour) * [MySQL Worklog #4800](https://dev.mysql.com/worklog/task/?id=4800): Optimizer trace/debugger * : (this is an utitlity task that might be useful for implementation of some of the other WLs. SergeyP has already ported it to MariaDB for such utility purposes, but its code is not ready for being pushed yet. ### Directions for improvement Some (but not all) of the following might be needed to make a well-rounded release: * [No WL]: Single table "UPDATE/DELETE one\_table WHERE subquery\_predicate"<br/>such query will not be executed by semi-join runtime. Ironically, multi-table UPDATE/DELETEs will be, so not multi-table UPDATEs may work faster than single-table. * [MySQL Worklog #3341](https://dev.mysql.com/worklog/task/?id=3341): Subquery optimization: Shortcut the evaluation as soon as there is a match * [MySQL Worklog #1117](https://dev.mysql.com/worklog/task/?id=1117): Subquery optimization: Avoid recalculating subquery if external fields have not changed * [MySQL Worklog #4614](https://dev.mysql.com/worklog/task/?id=4614): Subquery optimization: Materialization: avoid double subquery materialization * [MySQL Worklog #3490](https://dev.mysql.com/worklog/task/?id=3490): Subquery optimization: Subqueries and multiple columns comparison with ALL * [MySQL Worklog #4690](https://dev.mysql.com/worklog/task/?id=4690): Insideout order for materialized non-semijoin subqueries at top-level of the WHERE * [MySQL Worklog #3808](https://dev.mysql.com/worklog/task/?id=3808): Subquery optimization: Materialize and use as ranges for MRR scan of outer tables * [MySQL Worklog #4245](https://dev.mysql.com/worklog/task/?id=4245): Subquery optimization: FirstMatch strategy for anti-semi-join * [MySQL Worklog #3489](https://dev.mysql.com/worklog/task/?id=3489): Subquery optimization: Subquery and loose index scan * [MySQL Worklog #4691](https://dev.mysql.com/worklog/task/?id=4691): Subqueries: No-startup-cost execution for SJ-Materialization-Scan * [No WL#]: Support ORDER BY .. LIMIT clause within a subquery (a quite common user request). * [No WL]: Make the join optimizer take BKA into account Feature-wise plan for 5.4 ------------------------- The following is the "Igor's list": ``` 1. MRR/ICP --------------- WL#2474: Batched range read handler functions WL#2475: Batched range read functions for MyISAM/InnoDB 2. BKA --------- WL #2771: Usage of multi_read_range in nested loop join 3. Metadata integrity ------------------------- WL #4284 (bug #989): Transactional DDL locking WL#4165: Prepared statements: validation WL#4166: Prepared statements: automatic re-prepare 4. Subqueries ----------------- 4.1 Materialization of non-correlated IN subqueries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WL #1110: Materialization WL #4614: Materialization: avoid double subquery materialization WL #4690: Insideout order for materialized non-semijoin subqueries at top-level of the WHERE 4.2. Semi-joins ~~~~~~~~~~~ WL #3740: Subquery optimization: Semijoin: Pull-out of inner tables WL #3741: Subquery optimization: Semijoin: Duplicate elimination strategy WL #3750: Subquery optimization: Semijoin: Duplicate elimination strategy WL #3751: Subquery optimization: Semijoin: Inside-out strategy 4.3. Smart choice between materialization and semi-join ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WL #3985: Subquery optimization: smart choice between semi-join and materialization 4.4. Derived tables ~~~~~~~~~~~~~~ WL #3485: Subquery optimization: FROM (SELECT) 4.5. EXISTs convertible to IN ~~~~~~~~~~~~~~~~~~~~~~ WL #4389: Make IN optimizations also handle EXISTS 4.6. Materialization for non-correlated NOT IN subqueries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WL #3830: Materialization: Partial matching of tuples with NULL components 4.7. Direct evaluation of subqueries with caching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WL #3341: Shortcut the evaluation as soon as there is a match WL #1117: Avoid recalculating subquery if external fields have not changed ``` [MySQL Worklog #4614](https://dev.mysql.com/worklog/task/?id=4614) and [MySQL Worklog #4690](https://dev.mysql.com/worklog/task/?id=4690) are considered droppable. Plan for action (committed) --------------------------- ### General considerations It seems to be infeasible to take mysql-6.0 and fix it until it has release quality. We'll have to do it other way around: start from mariadb-5.2 codebase and pull features to there, one by one. This process will be called "backport". ### Backport MRR/BKA (SergeyP) MRR/BKA has been there for longer time than other features and so is more stable and so is a natural candidate for the first step. Needed actions: * Backport MRR/BKA code + According to Igor, code at SQL layer should be easy to move + Code inside MyISAM and Maria should be easily movable + TODO what to do about MRR/NDB? We need to get it to compile at least. + The trickest engine is InnoDB/XtraDB - will need to take changes that we've made to InnoDB and apply them to XtraDB (TODO will Percona accept that? Or we'll have to maintain patches-to-patches?) * We'll also need to fix the known MRR/InnoDB bugs After MRR has been pushed, it received a number of code cleanups, bugfixes, and interface adjustments (motivated by BKA and NDB/Falcon implementations). This means that there is no single MRR patch, instead one should go through revisions and cherry-pick MRR-related patches (one of the ways to narrow down the number of revisions: most (all?) MRR fixes were made by [email protected], with exception of this fix: ``` 2726 Guilhem Bichot 2009-03-13 Fix for multiple symptoms sharing the same cause: BUG#42297 Maria: crash in multi-range-read code BUG#42298 Maria: SELECT with join returns no rows ... ``` In addition to backport, we need the following adjustments: * Let DS-MRR support clustered primary keys (needed when using BKA). * ~~Remove conditions used for key access from the condition pushed to index (We sometimes get "Using index condition" where there was no "Using where")~~ Considered done as we're unable to find any examples for this. * ~~Introduce a separate @@optimizer\_switch flag for turning on/out ICP.~~ DONE. * Rename multi\_range\_read\_info\_const() to look like it is not a part of MRR interface All of the above is filed as [MWL#67](http://askmonty.org/worklog/?tid=67): <http://askmonty.org/worklog/Server-Sprint/index.pl?tid=67> #### Milestone BKA-1: BKA backported After the above is done, BKA will work in [MariaDB 5.2](../what-is-mariadb-52/index) codebase in the same way as it worked in MySQL 6.0, but without MRR/InnoDB bugs. ### Subquery optimization: Efficient NOT IN execution with NULL (Timour) Implement <http://askmonty.org/worklog/Server-Sprint/index.pl?tid=68> Plan for action (planned) ------------------------- ### Step: Take BKA into account in join optimizer (SergeyP or Igor) Implement this item * [No WL]: Make the join optimizer account for BKA. According to Igor: Within this milestone, assume a certain join\_cache\_level setting (it is likely the estimates will be so rough that it won't matter) TODO: clarify if this includes making the choice between doing MRR scan and then filesorting vs doing non-MRR scan but not having to sort. #### Milestone BKA-2: BKA with cost-based optimization After the above is done, we'll have MRR/BKA with cost-based optimization. ### Step: Subqueries, start: backport and bugfixing This step includes backporting all pushed 6.0's subquery optimizations and fixing open wrong-result or crash bugs, including addressing of these problems: * Semi-join optimizations, including semi-join materialization has issues: + The "outer join and semi-join problem" + The different-datatypes-comparison problem At the moment it seems the preferred course of action is to first fix the bugs and then backport. #### Milestone SUBQ-GET-ON-TRACK After the above is done, we'll be able to assume that we "got on track" with subquery development and will be able to proceed further in many directions. NOTE: it is not fully known what we'll discover when this milestone is reacheed. Perhaps, we'll discover that subquery cost model needs some adjustments (but there's always a way out, penalize all non-5.1 plans so that the 5.1 plan wins in near competitions and thus there are no regressions). ### Step: FROM subqueries After the semi-join subqueries are done, the biggest and most annoying gap in subquery optimizations will be poor FROM subquery handling. Thus, the next item is to take the available code for * [MySQL Worklog #3485](https://dev.mysql.com/worklog/task/?id=3485): Subquery optimization: FROM (SELECT) and finish that. #### Milestone SUBQ-FROM-SUBQUERIES * This milestone adds [MySQL Worklog #3485](https://dev.mysql.com/worklog/task/?id=3485). (is there really sense to have a linear plan that extends further than this? Let's reach this point and release?) ### Step: More subqueries 1 This is a step that has high ROI, can be done more-or-less indepdendently of the other work, and doesn't require in-depth knowlege of new subquery code/features: * [MySQL Worklog #1117](https://dev.mysql.com/worklog/task/?id=1117): Subquery optimization: Avoid recalculating subquery if external fields have not changed this can be passed over to somebody who haven't worked with subquery code before. (note: this task has a natural extension: create and use a cache of external\_field\_values->subquery\_result mappings. Btw, certain nose-trunk databases do not seem to handle this case. ### Step: More subqueries 2 Another separate, high-ROI item: * [MySQL Worklog #3341](https://dev.mysql.com/worklog/task/?id=3341): Subquery optimization: Shortcut the evaluation as soon as there is a match (TODO check if that's really that WL entry). (note: after "More subqueries #1/#2 we'll also need [MySQL Worklog #3830](https://dev.mysql.com/worklog/task/?id=3830) before we could count non-WHERE clause subqueries as covered). ### Step: Backport Metadata integrity code (Timour) Backport the following: ``` WL #2771: Usage of multi_read_range in nested loop join 3. Metadata integrity ------------------------- WL #4284 (bug #989): Transactional DDL locking WL#4165: Prepared statements: validation WL#4166: Prepared statements: automatic re-prepare ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SIGN SIGN ==== Syntax ------ ``` SIGN(X) ``` Description ----------- Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive. Examples -------- ``` SELECT SIGN(-32); +-----------+ | SIGN(-32) | +-----------+ | -1 | +-----------+ SELECT SIGN(0); +---------+ | SIGN(0) | +---------+ | 0 | +---------+ SELECT SIGN(234); +-----------+ | SIGN(234) | +-----------+ | 1 | +-----------+ ``` See Also -------- * [ABS()](../abs/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb The Debug Sync Facility The Debug Sync Facility ======================= The Debug Sync Facility allows placement of synchronization points in the server code by using the DEBUG\_SYNC macro: ``` open_tables(...) DEBUG_SYNC(thd, "after_open_tables"); lock_tables(...) ``` When activated, a sync point can * Emit a signal and/or * Wait for a signal | Nomenclature | Description | | --- | --- | | signal | A value of a global variable that persists until overwritten by a new signal. The global variable can also be seen as a "signal post" or "flag mast". Then the signal is what is attached to the "signal post" or "flag mast". | | emit a signal | Assign the value (the signal) to the global variable ("set a flag") and broadcast a global condition to wake those waiting for a signal. | | wait for a signal | Loop over waiting for the global condition until the global value matches the wait-for signal. | By default, all sync points are inactive. They do nothing (except to burn a couple of CPU cycles for checking if they are active). A sync point becomes active when an action is requested for it. To do so, put a line like this in the test case file: ``` SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed'; ``` This activates the sync point `'after_open_tables'`. It requests it to emit the signal `'opened'` and wait for another thread to emit the signal `'flushed'` when the thread's execution runs through the sync point. For every sync point there can be one action per thread only. Every thread can request multiple actions, but only one per sync point. In other words, a thread can activate multiple sync points. Here is an example how to activate and use the sync points: ``` --connection conn1 SET DEBUG_SYNC= 'after_open_tables SIGNAL opened WAIT_FOR flushed'; send INSERT INTO t1 VALUES(1); --connection conn2 SET DEBUG_SYNC= 'now WAIT_FOR opened'; SET DEBUG_SYNC= 'after_abort_locks SIGNAL flushed'; FLUSH TABLE t1; ``` When `conn1` runs through the `INSERT` statement, it hits the sync point `'after_open_tables'`. It notices that it is active and executes its action. It emits the signal `'opened'` and waits for another thread to emit the signal `'flushed'`. `conn2` waits immediately at the special sync point `'now'` for another thread to emit the `'opened'` signal. A signal remains in effect until it is overwritten. If `conn1` signals `'opened'` before `conn2` reaches `'now'`, `conn2` will still find the `'opened'` signal. It does not wait in this case. When `conn2` reaches `'after_abort_locks'`, it signals `'flushed'`, which lets `conn1` awake. Normally the activation of a sync point is cleared when it has been executed. Sometimes it is necessary to keep the sync point active for another execution. You can add an execute count to the action: ``` SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 3'; ``` This sets the signal point's activation counter to 3. Each execution decrements the counter. After the third execution the sync point becomes inactive. One of the primary goals of this facility is to eliminate sleeps from the test suite. In most cases it should be possible to rewrite test cases so that they do not need to sleep. (But this facility cannot synchronize multiple processes.) However, to support test development, and as a last resort, sync point waiting times out. There is a default timeout, but it can be overridden: ``` SET DEBUG_SYNC= 'name WAIT_FOR sig TIMEOUT 10 EXECUTE 2'; ``` `TIMEOUT 0` is special: If the signal is not present, the wait times out immediately. When a wait timed out (even on `TIMEOUT 0`), a warning is generated so that it shows up in the test result. You can throw an error message and kill the query when a synchronization point is hit a certain number of times: ``` SET DEBUG_SYNC= 'name HIT_LIMIT 3'; ``` Or combine it with signal and/or wait: ``` SET DEBUG_SYNC= 'name SIGNAL sig EXECUTE 2 HIT_LIMIT 3'; ``` Here the first two hits emit the signal, the third hit returns the error message and kills the query. For cases where you are not sure that an action is taken and thus cleared in any case, you can force to clear (deactivate) a sync point: ``` SET DEBUG_SYNC= 'name CLEAR'; ``` If you want to clear all actions and clear the global signal, use: ``` SET DEBUG_SYNC= 'RESET'; ``` This is the only way to reset the global signal to an empty string. For testing of the facility itself you can execute a sync point just as if it had been hit: ``` SET DEBUG_SYNC= 'name TEST'; ``` ### Formal Syntax The string to "assign" to the DEBUG\_SYNC variable can contain: ``` RESET | <sync point name> TEST | <sync point name> CLEAR | <sync point name> {{SIGNAL <signal name> | WAIT_FOR <signal name> [TIMEOUT <seconds>]} [EXECUTE <count>] &| HIT_LIMIT <count>} ``` Here '&|' means 'and/or'. This means that one of the sections separated by '&|' must be present or both of them. ### Activation/Deactivation With a [MariaDB for debug build](../compiling-mariadb-for-debugging/index), it can be enabled by a mysqld command line option: ``` --debug-sync-timeout[=default_wait_timeout_value_in_seconds] ``` `'default_wait_timeout_value_in_seconds'` is the default timeout for the `WAIT_FOR` action. If set to zero, the facility stays disabled. The facility is enabled by default in the test suite, but can be disabled with: ``` mysql-test-run.pl ... --debug-sync-timeout=0 ... ``` Likewise the default wait timeout can be set: ``` mysql-test-run.pl ... --debug-sync-timeout=10 ... ``` The command line option influences the readable value of the [debug\_sync](../server-system-variables/index#debug_sync) system variable. * If the facility is not compiled in, the system variable does not exist. * If `--debug-sync-timeout=0` the value of the variable reads as `"OFF"`. * Otherwise the value reads as `"ON - current signal: "` followed by the current signal string, which can be empty. The readable variable value is the same, regardless if read as a global or session value. Setting the [debug\_sync](../server-system-variables/index#debug_sync) system variable requires the `'SUPER'` privilege. You can never read back the string that you assigned to the variable, unless you assign the value that the variable already has. But that would give a parse error. A syntactically correct string is parsed into a debug sync action and stored apart from the variable value. ### Implementation Pseudo code for a sync point: ``` #define DEBUG_SYNC(thd, sync_point_name) if (unlikely(opt_debug_sync_timeout)) debug_sync(thd, STRING_WITH_LEN(sync_point_name)) ``` The sync point performs a binary search in a sorted array of actions for this thread. The `SET DEBUG_SYNC` statement adds a requested action to the array or overwrites an existing action for the same sync point. When it adds a new action, the array is sorted again. ### A typical synchronization pattern There are quite a few places in MariaDB and MySQL where we use a synchronization pattern like this: ``` mysql_mutex_lock(&mutex); thd->enter_cond(&condition_variable, &mutex, new_message); #if defined(ENABLE_DEBUG_SYNC) if (!thd->killed && !end_of_wait_condition) DEBUG_SYNC(thd, "sync_point_name"); #endif while (!thd->killed && !end_of_wait_condition) mysql_cond_wait(&condition_variable, &mutex); thd->exit_cond(old_message); ``` Here are some explanations: `thd->enter_cond()` is used to register the condition variable and the mutex in `thd->mysys_var`. This is done to allow the thread to be interrupted (killed) from its sleep. Another thread can find the condition variable to signal and mutex to use for synchronization in this thread's `THD::mysys_var`. `thd->enter_cond()` requires the mutex to be acquired in advance. `thd->exit_cond()` unregisters the condition variable and mutex and releases the mutex. If you want to have a Debug Sync point with the wait, please place it behind `enter_cond()`. Only then you can safely decide, if the wait will be taken. Also you will have `THD::proc_info` correct when the sync point emits a signal. `DEBUG_SYNC` sets its own proc\_info, but restores the previous one before releasing its internal mutex. As soon as another thread sees the signal, it does also see the proc\_info from before entering the sync point. In this case it will be "new\_message", which is associated with the wait that is to be synchronized. In the example above, the wait condition is repeated before the sync point. This is done to skip the sync point, if no wait takes place. The sync point is before the loop (not inside the loop) to have it hit once only. It is possible that the condition variable is signaled multiple times without the wait condition to be true. A bit off-topic: At some places, the loop is taken around the whole synchronization pattern: ``` while (!thd->killed && !end_of_wait_condition) { mysql_mutex_lock(&mutex); thd->enter_cond(&condition_variable, &mutex, new_message); if (!thd->killed [&& !end_of_wait_condition]) { [DEBUG_SYNC(thd, "sync_point_name");] mysql_cond_wait(&condition_variable, &mutex); } thd->exit_cond(old_message); } ``` Note that it is important to repeat the test for thd->killed after `enter_cond()`. Otherwise the killing thread may kill this thread after it tested `thd->killed` in the loop condition and before it registered the condition variable and mutex in `enter_cond()`. In this case, the killing thread does not know that this thread is going to wait on a condition variable. It would just set `THD::killed`. But if we would not test it again, we would go asleep though we are killed. If the killing thread would kill us when we are after the second test, but still before sleeping, we hold the mutex, which is registered in mysys\_var. The killing thread would try to acquire the mutex before signaling the condition variable. Since the mutex is only released implicitly in `mysql_cond_wait()`, the signaling happens at the right place. We have a safe synchronization. ### Co-work with the DBUG facility When running the MariaDB test suite with the `--debug-dbug` command line option, the Debug Sync Facility writes trace messages to the DBUG trace. The following shell commands proved very useful in extracting relevant information: ``` egrep 'query:|debug_sync_exec:' mysql-test/var/log/mysqld.1.trace ``` It shows all executed SQL statements and all actions executed by synchronization points. Sometimes it is also useful to see, which synchronization points have been run through (hit) with or without executing actions. Then add `"|debug_sync_point:"` to the egrep pattern. ### Synchronizing DEBUG\_SYNC Actions Tests may need additional synchronization mechanisms between `DEBUG_SYNC` actions, because certain combinations of actions can result in lost signals. More specifically, once a `SIGNAL` action is issued, it is stored in a global variable for any waiting threads to determine if they are depending on that signal for continuing. However, if a subsequent action overwrites that variable before a waiting thread is able to check against it, the original signal is lost. Examples of actions which would change the variable state are another `SIGNAL` or a `RESET`. Therefore, before issuing these commands, the test writer should verify the previous signal has been acknowledged. The following code snippets show an example of a problematic pattern and a potential solution. ``` SET DEBUG_SYNC='now SIGNAL sig'; SET DEBUG_SYNC='RESET'; # Problematic because sig can be cleared before a waiting thread can acknowledge it ``` ``` SET DEBUG_SYNC='now SIGNAL sig'; # Don't issue the RESET until we have proven the waiting thread has received the signal let $wait_condition= select count(*)=0 from information_schema.processlist where state like "debug sync point%"; source include/wait_condition.inc; SET DEBUG_SYNC='RESET'; # Now this is safe ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Galera Test Repositories Galera Test Repositories ======================== To facilitate development and QA, we have created some test repositories for the Galera wsrep provider. These are **test** repositories. There will be periods when they do not work at all, or work incorrectly, or possibly cause earthquakes, typhoons, and tornadoes. You have been warned. Galera Test Repositories for YUM -------------------------------- Replace `${dist}` in the code below for the YUM-based distribution you are testing. Valid distributions are: * `centos5-amd64` * `centos5-x86` * `centos6-amd64` * `centos6-x86` * `centos7-amd64` * `rhel5-amd64` * `rhel5-x86` * `rhel6-amd64` * `rhel6-x86` * `rhel6-ppc64` * `rhel7-amd64` * `rhel7-ppc64` * `rhel7-ppc64le` * `fedora22-amd64` * `fedora22-x86` * `fedora23-amd64` * `fedora23-x86` * `fedora24-amd64` * `fedora24-x86` * `opensuse13-amd64` * `opensuse13-x86` * `sles11-amd64` * `sles11-x86` * `sles12-amd64` * `sles12-ppc64le` ``` # Place this code block in a file at /etc/yum.repos.d/galera.repo [galera-test] name = galera-test baseurl = http://yum.mariadb.org/galera/repo/rpm/${dist} gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 ``` Galera Test Repositories for APT -------------------------------- Replace `${dist}` in the code below for the APT-based distribution you are testing. Valid ones are: * `wheezy` * `jessie` * `sid` * `precise` * `trusty` * `xenial` ``` # run the following command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db 0xF1656F24C74CD1D8 # Add the following line to your /etc/apt/sources.list file: deb http://yum.mariadb.org/galera/repo/deb ${dist} main ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mariadb-dump/mysqldump mariadb-dump/mysqldump ====================== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-dump` is a symlink to `mysqldump`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-dump` is the name of the command-line client, with `mysqldump` a symlink . The `mysqldump` client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another database server (not necessarily MariaDB or MySQL). The dump typically contains SQL statements to create the table, populate it, or both. However, `mysqldump` can also be used to generate files in CSV, other delimited text, or XML format. If you are doing a backup on the server and your tables all are [MyISAM](../myisam/index) tables, consider using [mysqlhotcopy](../mysqlhotcopy/index) instead because it can accomplish faster backups and faster restores. mysqldump dumps triggers along with tables, as these are part of the table definition. However, [stored procedures](../stored-procedures/index), [views](../views/index), and [events](../events/index) are not, and need extra parameters to be recreated explicitly (for example, `--routines` and `--events`). [Procedures](../stored-procedures/index) and <functions> are however also part of the system tables (for example [mysql.proc](../mysqlproc-table/index)). `mysqldump` supports the [enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT](../enhancements-for-start-transaction-with-consistent-snapshot/index#mysqldump). Performance ----------- mysqldump doesn't usually consume much CPU resources on modern hardware as by default it uses a single thread. This method is good for a heavily loaded server. Disk input/outputs per second (IOPS), can however increase for multiple reasons. When you back-up on the same device as the database, this produces unnecessary random IOPS. The dump is done sequentially, on a per table basis, causing a full-table scan and many buffer page misses on tables that are not fully cached in memory. It's recommended that you back-up from a network location to remove disk IOPS on the database server, but it is vital to use a separate network card to keep network bandwidth available for regular traffic. Although mysqldump will by default preserve your resources for regular spindle disks and low-core hardware, this doesn't mean that concurrent dumps cannot benefit from hardware architecture like SAN, flash storage, low write workload. The back-up time would benefit from a tool such as MyDumper. Usage ----- There are four general ways to invoke `mysqldump`: ``` shell> mysqldump [options] db_name [tbl_name ...] shell> mysqldump [options] --databases db_name ... shell> mysqldump [options] --all-databases shell> mysqldump [options] --system=[option_list] ``` If you do not name any tables following db\_name or if you use the `--databases` or `--all-databases` option, entire databases are dumped. `mysqldump` does not dump the INFORMATION\_SCHEMA (or PERFORMANCE\_SCHEMA, if enabled) database by default. MariaDB dumps the `INFORMATION_SCHEMA` if you name it explicitly on the command line, although currently you must also use the `--skip-lock-tables` option. To see a list of the options your version of `mysqldump` supports, execute `mysqldump --help`. ### Row by Row vs. Buffering `mysqldump` can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it. Buffering in memory can be a problem if you are dumping large tables. To dump tables row by row, use the `--quick` option (or `--opt`, which enables `--quick`). The `--opt` option (and hence `--quick`) is enabled by default, so to enable memory buffering, use `--skip-quick`. ### mysqldump in [MariaDB 10.3](../what-is-mariadb-103/index) and Higher `mysqldump` in [MariaDB 10.3](../what-is-mariadb-103/index) includes logic to cater for the [mysql.transaction\_registry table](../mysqltransaction_registry-table/index). `mysqldump` from an earlier MariaDB release cannot be used on [MariaDB 10.3](../what-is-mariadb-103/index) and beyond. ### mysqldump and Old Versions of MySQL If you are using a recent version of `mysqldump` to generate a dump to be reloaded into a very old MySQL server, you should not use the `--opt` or `--extended-insert` option. Use `--skip-opt` instead. ### Options `mysqldump` supports the following options: | Option | Description | | --- | --- | | `--all` | Deprecated. Use `--create-options` instead. | | `-A`, `--all-databases` | Dump all the databases. This will be same as `--databases` with all databases selected. | | `-Y`, `--all-tablespaces` | Dump all the tablespaces. | | `-y`, `--no-tablespaces` | Do not dump any tablespace information. | | `--add-drop-database` | Add a [DROP DATABASE](../drop-database/index) before each create. Typically used in conjunction with the `--all-databases` or `--databases` option because no [CREATE DATABASE](../create-database/index) statements are written unless one of those options is specified. | | `--add-drop-table` | Add a [DROP TABLE](../drop-table/index) before each create. | | `--add-drop-trigger` | Add a [DROP TRIGGER](../drop-trigger/index) statement before each [CREATE TRIGGER](../create-trigger/index). From [MariaDB 10.2.6](https://mariadb.com/kb/en/mariadb-1026-release-notes/). | | `--add-locks` | Add locks around [INSERT](../insert/index) statements, which results in faster inserts when the dump file is reloaded. Use `--skip-add-locks` to disable. | | `--allow-keywords` | Allow creation of column names that are keywords. This works by prefixing each column name with the table name. | | `--apply-slave-statements` | Adds [STOP SLAVE](../stop-slave/index) prior to [CHANGE MASTER](../change-master-to/index) and [START SLAVE](../start-slave/index) to bottom of dump. | | `--as-of` | Dump [system versioned table](../system-versioned-tables/index) as of specified timestamp. From [MariaDB 10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/). | | `--character-sets-dir=name` | Directory for [character set](../data-types-character-sets-and-collations/index) files. | | `-i`, `--comments` | Write additional information in the dump file such as program version, server version, and host. Disable with `--skip-comments`. | | `--compact` | Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables the `--skip-add-drop-table`, `--skip-add-locks`, `--skip-comments`, `--skip-disable-keys`, and `--skip-set-charset` options. | | `--compatible=name` | Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MariaDB and MySQL. Legal modes are: `ansi`, `mysql323`, `mysql40`, `postgresql`, `oracle`, `mssql`, `db2`, `maxdb`, `no_key_options`, `no_table_options`, and `no_field_options`. One can use several modes separated by commas.This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump output more compatible. For example, `--compatible=oracle` does not map data types to Oracle types or use Oracle comment syntax. | | `-c`, `--complete-insert` | Use complete [INSERT](../insert/index) statements that include column names. | | `-C`, `--compress` | Use compression in server/client protocol. Both client and server must support compression for this to work. | | `--copy-s3-tables` | By default [S3](../s3-storage-engine/index) tables are ignored. With this option set, the result file will contain a CREATE statement for a similar [Aria](../aria-storage-engine/index) table, followed by the table data and ending with an `ALTER TABLE xxx ENGINE=S3`. From [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/). | | `-a`, `--create-options` | Include all MariaDB and/or MySQL specific create options in `CREATE TABLE` statements. Use `--skip-create-options` to disable. | | `-B`, `--databases` | Dump several databases. Normally, `mysqldump` treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names. [CREATE DATABASE](../create-database/index) and [USE](../use/index) statements are included in the output before each new database. | | `-#, --debug[=#]` | If using a debug version of MariaDB, write a debugging log. A typical debug\_options string is ´d:t:o,file\_name´. The default value is ´d:t:o,/tmp/mysqldump.trace´. If using a non-debug version, `mysqldump` will catch this and exit. | | `--debug-check` | Check memory and open file usage at exit. | | `--debug-info` | Print some debug info at exit. | | `--default-auth=name` | Default authentication client-side plugin to use. | | `--default-character-set=name` | Set the default [character set](../data-types-character-sets-and-collations/index) to *name*. If no character set is specified, until [MariaDB 10.3.11](https://mariadb.com/kb/en/mariadb-10311-release-notes/), *mysqldump* uses utf8, and from [MariaDB 10.3.11](https://mariadb.com/kb/en/mariadb-10311-release-notes/), uses utf8mb4. | | `--defaults-extra-file=name` | Read the file *name* after the global files are read. Must be given as the first argument. | | `--defaults-file=name` | Only read default options from the given file *name*. Must be given as the first argument. | | `--defaults-group-suffix=str` | Also read groups with a suffix of *str*. For example, since *mysqldump* normally reads the [client] and [mysqldump] groups, --defaults-group-suffix=x would cause it to also read the groups [mysqldump\_x] and [client\_x]. | | `--delayed-insert` | Insert rows with [INSERT DELAYED](../insert-delayed/index) instead of [INSERT](../insert/index). | | `--delete-master-logs` | On a primary replication server, delete the binary logs by sending a [PURGE BINARY LOGS](../sql-commands-purge-logs/index) statement to the server after performing the dump operation. This option automatically enables `--master-data`. | | `-K`, `--disable-keys` | `'/*!40000 ALTER TABLE tb_name DISABLE KEYS */;` and `'/*!40000 ALTER TABLE tb_name ENABLE KEYS */;` will be put in the output. This makes loading the dump file faster because the indexes are created after all rows are inserted. This option is effective only for non-unique indexes of MyISAM tables. Disable with `--skip-disable-keys`. | | `--dump-date` | If the `--comments` option and this option are given, `mysqldump` produces a comment at the end of the dump of the following form:`-- Dump completed on DATE` However, the date causes dump files taken at different times to appear to be different, even if the data are otherwise identical. `--dump-date` and `--skip-dump-date` control whether the date is added to the comment. The default is `--dump-date` (include the date in the comment). `--skip-dump-date` suppresses date printing. | | `--dump-slave[=value]` | Used for producing a dump file from a replica server that can be used to set up another replica server with the same primary. Causes the [binary log](../binary-log/index) position and filename of the primary to be appended to the dumped data output. Setting the value to `1` (the default) will print it as a [CHANGE MASTER](../change-master-to/index) command in the dumped data output; if set to `2`, that command will be prefixed with a comment symbol. This option will turn `--lock-all-tables` on, unless `--single-transaction` is specified too (in which case a global read lock is only taken a short time at the beginning of the dump - don't forget to read about `--single-transaction` below). In all cases any action on logs will happen at the exact moment of the dump. Option automatically turns `--lock-tables` off. Using this option causes mysqldump to stop the replica SQL thread before beginning the dump, and restart it again after completion. | | `-E, --events` | Include [Event Scheduler events](../stored-programs-and-views-events/index) for the dumped databases in the output. | | `-e`, `--extended-insert` | Use multiple-row [INSERT](../insert/index) syntax that include several `VALUES` lists. This results in a smaller dump file and speeds up inserts when the file is reloaded. Defaults to on; use `--skip-extended-insert` to disable. | | `--fields-terminated-by=name` | Fields in the output file are terminated by the given string. Used with the `--tab` option and has the same meaning as the corresponding `FIELDS` clause for [LOAD DATA INFILE](../load-data-infile/index). | | `--fields-enclosed-by=name` | Fields in the output file are enclosed by the given character. Used with the `--tab` option and has the same meaning as the corresponding `FIELDS` clause for [LOAD DATA INFILE](../load-data-infile/index). | | `--fields-optionally-enclosed-by=name` | Fields in the output file are optionally enclosed by the given character. Used with the `--tab` option and has the same meaning as the corresponding `FIELDS` clause for [LOAD DATA INFILE](../load-data-infile/index). | | `--fields-escaped-by=name` | Fields in the output file are escaped by the given character. Used with the `--tab` option and has the same meaning as the corresponding `FIELDS` clause for [LOAD DATA INFILE](../load-data-infile/index). | | `--first-slave` | Removed in [MariaDB 5.5](../what-is-mariadb-55/index). Use `--lock-all-tables` instead. | | `-F`, `--flush-logs` | Flush the MariaDB server log files before starting the dump. This option requires the `RELOAD` privilege. If you use this option in combination with the `--databases=` or `--all-databases` option, the logs are flushed for each database dumped. The exception is when using `--lock-all-tables`or `--master-data`: In this case, the logs are flushed only once, corresponding to the moment all tables are locked. If you want your dump and the log flush to happen at the same exact moment, you should use `--flush-logs` together with either `--lock-all-tables` or `--master-data`. | | `--flush-privileges` | Send a [FLUSH PRIVILEGES](../flush/index) statement to the server after dumping the [mysql database](../the-mysql-database-tables/index). This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration. | | `-f`, ``--force`` | Continue even if an SQL error occurs during a table dump.One use for this option is to cause *mysqldump* to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped. Without `--force` in this example, `mysqldump` exits with an error message. With `--force`, *mysqldump* prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing. | | `--gtid` | Used together with `--master-data` and `--dump-slave` to more conveniently set up a new [GTID](../gtid/index) replica. It causes those options to output SQL statements that configure the replica to use the [global transaction ID](../global-transaction-id/index) to connect to the primary instead of old-style filename/offset positions. The old-style positions are still included in comments when `--gtid` is used; likewise the GTID position is included in comments even if `--gtid` is not used. | | `-?`, `--help` | Display a help message and exit. | | `--hex-blob` | Dump binary strings in hexadecimal format (for example, `´abc´` becomes `0x616263`). The affected data types are [BINARY](../binary/index), [VARBINARY](../varbinary/index), the [BLOB](../blob/index) types, and [BIT](../bit/index). | | `-h name`, `--host=name` | Connect to and dump data from the MariaDB or MySQL server on the given host. The default host is `localhost`. | | `--ignore-database=name` | Do not dump the specified database. To specify more than one database to ignore, use the directive multiple times, once for each database. Only takes effect when used together with `--all-databases` or `-A`. Added in [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/). | | `--ignore-table=name` | Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g., `--ignore-table=database.table`. This option also can be used to ignore views. | | `--ignore-table-data=name` | Do not dump the specified table data (only the structure). To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names. From [MariaDB 10.1.46](https://mariadb.com/kb/en/mariadb-10146-release-notes/), [MariaDB 10.2.33](https://mariadb.com/kb/en/mariadb-10233-release-notes/), [MariaDB 10.3.24](https://mariadb.com/kb/en/mariadb-10324-release-notes/), [MariaDB 10.4.14](https://mariadb.com/kb/en/mariadb-10414-release-notes/) and [MariaDB 10.5.3](https://mariadb.com/kb/en/mariadb-1053-release-notes/). See also `--no-data`. | | `--include-master-host-port` | Add the `MASTER_HOST` and `MASTER_PORT` options for the [CHANGE MASTER TO](../change-master-to/index) statement when using the `--dump-slave` option for a replica dump. | | `--insert-ignore` | Insert rows with `INSERT IGNORE` instead of `INSERT`. | | `--lines-terminated-by=name` | Lines in the output file are terminated by the given string. This option is used with the `--tab` option and has the same meaning as the corresponding `LINES` clause for [LOAD DATA INFILE](../load-data-infile/index). | | `-x`, `--lock-all-tables` | Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump by executing [FLUSH TABLES WITH READ LOCK](../flush/index). This option automatically turns off `--single-transaction` and `--lock-tables`. | | `-l`, `--lock-tables` | For each dumped database, lock all tables to be dumped before dumping them. The tables are locked with `READ LOCAL` to allow concurrent inserts in the case of [MyISAM](../myisam/index) tables. For transactional tables such as [InnoDB](../innodb/index), `--single-transaction` is a much better option than `--lock-tables` because it does not need to lock the tables at all.Because `--lock-tables` locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states. Use `--skip-lock-tables` to disable. | | `--log-error=name` | Log warnings and errors by appending them to the named file. The default is to do no logging. | | `--log-queries` | When restoring the dump, the server will, if logging is turned on, log the queries to the general and [slow query log](../slow-query-log/index). Defaults to on; use --skip-log-queries to disable. Added in [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/). | | `--master-data[=#]` | Causes the [binary log](../binary-log/index) position and filename to be appended to the output, useful for dumping a primary replication server to produce a dump file that can be used to set up another server as a replica of the primary. These are the primary server coordinates from which the replica should start replicating after you load the dump file into the replica. If the option is set to 1 (the default), will print it as a [CHANGE MASTER](../change-master-to/index) command; if set to 2, that command will be prefixed with a comment symbol. This `--master-data` option will turn `--lock-all-tables` on, unless `--single-transaction` is specified too. Before [MariaDB 5.3](../what-is-mariadb-53/index) this would take a global read lock for a short time at the beginning of the dump - see [Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT](../enhancements-for-start-transaction-with-consistent-snapshot/index) and the `--single-transaction` option below). In all cases, any action on logs will happen at the exact moment of the dump. This option automatically turns `--lock-tables` off. In all cases, any action on logs happens at the exact moment of the dump. It is also possible to set up a replica by dumping an existing replica of the primary. To do this, use the following procedure on the existing replica:1. Stop the replica's SQL thread and get its current status:`mysql> STOP SLAVE SQL_THREAD;``mysql> SHOW SLAVE STATUS;`2. From the output of the SHOW SLAVE STATUS statement, the binary log coordinates of the primary server from which the new replica should start replicating are the values of the Relay\_Master\_Log\_File and Exec\_Master\_Log\_Pos fields. Denote those values as file\_name and file\_pos.2. Dump the replica server:`shell> mysqldump --master-data=2 --all-databases > dumpfile`3. Restart the replica:`mysql> START SLAVE;`4. On the new replica, load the dump file:`shell> mysql < dumpfile`5. On the new replica, set the replication coordinates to those of the primary server obtained earlier:`mysql> CHANGE MASTER TO MASTER_LOG_FILE = ´file_name´, MASTER_LOG_POS = file_pos;` The `CHANGE MASTER` TO statement might also need other parameters, such as MASTER\_HOST to point the replica to the correct primary server host. Add any such parameters as necessary. | | `--max-allowed-packet=#` | The maximum packet length to send to or receive from server. The maximum is 1GB. | | `--max-statement-time=#` | Sets the maximum time any statement can run before being timed out by the server. (Default value is 0 (no limit)) | | `--net-buffer-length=#` | The initial buffer size for client/server TCP/IP and socket communication. This can be used to limit the size of rows in the dump. When creating multiple-row `INSERT` statements (as with the `--extended-insert` or `--opt` option), `mysqldump` creates rows up to `net_buffer_length` length. | | `--no-autocommit` | Enclose the [INSERT](../insert/index) statements for each dumped table within [SET autocommit = 0](../server-system-variables/index#autocommit) and [COMMIT](../commit/index) statements. | | `-n`, `--no-create-db` | This option suppresses the [CREATE DATABASE ... IF EXISTS](../create-database/index) statement that normally is output for each dumped database if `--all-databases` or `--databases` is given. | | `-t`, `--no-create-info` | Do not write [CREATE TABLE](create-tablle) statements which re-create each dumped table. | | `-d`, `--no-data` | Do not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the [CREATE TABLE](../create-table/index) statement for the table (for example, to create an empty copy of the table by loading the dump file). See also --ignore-table-data . | | `--no-data-med` | Do not dump rows for engines that manage external data (i.e. [MRG\_MyISAM](../merge/index), MRG\_ISAM, [CONNECT](../connect/index), [OQGRAPH](../oqgraph-storage-engine/index), [Spider](../spider/index), VP, [Federated](../federatedx-storage-engine/index)). This option is enabled by default. If you want to dump data for these engines, then you would need to set `--no-data-med=0`. | | `--no-defaults` | Don't read default options from any option file. Must be given as the first argument. | | `-N`, `--no-set-names` | Suppress the `SET NAMES` statement. This has the same effect as `--skip-set-charset`. | | `--opt` | This option is shorthand. It is the same as specifying `--add-drop-table`, `--add-locks`, `--create-options`, `--quick`, `--extended-insert`, `--lock-tables`, `--set-charset`, and `--disable-keys`. Enabled by default, disable with `--skip-opt`. It should give you a fast dump operation and produce a dump file that can be reloaded into a MariaDB server quickly.The `--opt` option is enabled by default. Use `--skip-opt` to disable it. See the discussion at the beginning of this section for information about selectively enabling or disabling a subset of the options affected by `--opt`. | | `--order-by-primary` | Sorts each table's rows by primary key, or first unique key, if such a key exists. This is useful when dumping a [MyISAM](../myisam/index) table to be loaded into an [InnoDB](../innodb/index) table, but will make the dump itself take considerably longer. | | `--order-by-size` | Dump each table according to their size, smallest first. Useful when using `--single-transaction` on tables which get truncated/altered often. The assumption here is that smaller tables get truncated more often, and by dumping those first, this reduces the chance that a `--single-transaction` dump will fail with with 'Table definition has changed, please retry transaction'. From [MariaDB 10.9.1](https://mariadb.com/kb/en/mariadb-1091-release-notes/). | | `-p[passwd]`, `--password[=passwd` | The password to use when connecting to the server. If you use the short option form (`-p`), you cannot have a space between the option and the password. If you omit the password value following the `--password` or `-p` option on the command line, *mysqldump* prompts for one.Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. | | `-W`, `--pipe` | On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections. | | `--plugin-dir` | Directory for client-side plugins. | | `-P num`, `--port=num` | The TCP/IP port number to use for the connection. | | `--print-defaults` | Print the program argument list and exit. Must be given as the first argument. | | `--protocol=name` | The connection protocol to use for connecting to the server (TCP, SOCKET, PIPE, MEMORY). It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. | | `-q`, `--quick` | This option is useful for dumping large tables. It forces *mysqldump* to retrieve rows for a table from the server a row at a time and to then dump the results directly to stdout rather than retrieving the entire row set and buffering it in memory before writing it out. Defaults to on, use `--skip-quick` to disable. | | `-Q`, `--quote-names` | Quote identifiers (such as database, table, and column names) within backtick (```) characters. If the `ANSI_QUOTES` SQL mode is enabled, identifiers are quoted within (`"`) characters. This option is enabled by default. It can be disabled with `--skip-quote-names`, but this option should be given after any option such as `--compatible` that may enable `--quote-names`. | | `--replace` | Use [REPLACE INTO](../replace/index) statements instead of [INSERT INTO](../insert/index) statements. | | `-r`, `--result-file=name` | Direct output to a given file. This option should be used on Windows to prevent newline `"\n"` characters from being converted to `"\r\n"` carriage return/newline sequences. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump. | | `-R`, `--routines` | Include stored routines ([procedures](../stored-procedures/index) and [functions](../stored-functions/index)) for the dumped databases in the output. Use of this option requires the `SELECT` privilege for the [mysql.proc](../mysqlproc-table/index) table. The output generated using `--routines` contains [CREATE PROCEDURE](../create-procedure/index) and [CREATE FUNCTION](../create-function/index) statements to re-create the routines. However, these statements do not include attributes such as the routine creation and modification timestamps. This means that when the routines are reloaded, they will be created with the timestamps equal to the reload time.If you require routines to be re-created with their original timestamp attributes, do not use `--routines`. Instead, dump and reload the contents of the [mysql.proc](../mysqlproc-table/index) table directly, using a MariaDB account which has appropriate privileges for the mysql database. | | `set-charset` | Add `'SET NAMES default_character_set'` to the output in order to set the [character set](../data-types-character-sets-and-collations/index). Enabled by default; suppress with `--skip-set-charset`. | | `-O, --set-variable=name` | Change the value of a variable. Please note that this option is deprecated; you can set variables directly with `--variable-name=value`. | | `--shared-memory-base-name` | Shared-memory name to use for Windows connections using shared memory to a local server (started with the `--shared-memory` option). Case-sensitive. Defaults to `MYSQL`. | | `--single-transaction` | This option sends a [START TRANSACTION](../start-transaction/index) SQL statement to the server before dumping data. It is useful only with transactional tables such as [InnoDB](../innodb/index), because then it dumps the consistent state of the database at the time when `BEGIN` was issued without blocking any applications.When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. The single-transaction feature depends not only on the engine being transactional and capable of REPEATABLE-READ, but also on START TRANSACTION WITH CONSISTENT SNAPSHOT. The dump is **not** guaranteed to be consistent for other storage engines. For example, any [TokuDB](../tokudb/index), [MyISAM](../myisam/index) or [MEMORY](../memory-storage-engine/index) tables dumped while using this option may still change state.While a `--single-transaction` dump is in process, to ensure a valid dump file (correct table contents and binary log coordinates), no other connection should use the following statements: [ALTER TABLE](../alter-table/index), [CREATE TABLE](../create-table/index), [DROP TABLE](../drop-table/index), [RENAME TABLE](../rename-table/index), or [TRUNCATE TABLE](../truncate-table/index). A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the `SELECT` (performed by *mysqldump* to retrieve the table contents) to obtain incorrect contents or fail.The `--single-transaction` option and the `--lock-tables` option are mutually exclusive because [LOCK TABLES](../lock-tables-and-unlock-tables/index) causes any pending transactions to be committed implicitly. So this option automatically turns off `--lock-tables`To dump large tables, you should combine the `--single-transaction` option with `--quick`. | | `--skip-add-locks` | Disable the `--add-locks` option. | | `--skip-comments` | Disable the `--comments` option. | | `--skip-disable-keys` | Disable the `--disable-keys` option. | | `--skip-extended-insert` | Disable the `--extended-insert` option. | | `--skip-opt` | Disable the `--opt` option (disables `--add-drop-table`, `--add-locks`, `--create-options`, `--quick`, `--extended-insert`, `--lock-tables`, `--set-charset`, and `--disable-keys`). | | `--skip-quick` | Disable the `--quick` option. | | `--skip-quote-name` | Disable the `--quote-names` option. | | `--skip-set-charset` | Disable the `--set-charset` option. | | `--skip-triggers` | Disable the `--triggers` option. | | `--skip-tz-utc` | Disable the `--tz-utc` option. | | `-S name`, `--socket=name` | For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. | | `--ssl` | Enables [TLS](../data-in-transit-encryption/index). TLS is also enabled even without setting this option when certain other TLS options are set. Starting with [MariaDB 10.2](../what-is-mariadb-102/index), the `--ssl` option will not enable [verifying the server certificate](../secure-connections-overview/index#server-certificate-verification) by default. In order to verify the server certificate, the user must specify the `--ssl-verify-server-cert` option. | | `--ssl-ca=name` | Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option implies the `--ssl` option. | | `--ssl-capath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option is only supported if the client was built with OpenSSL or yaSSL. If the client was built with GnuTLS or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. This option implies the `--ssl` option. | | `--ssl-cert=name` | Defines a path to the X509 certificate file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | `--ssl-cipher=name` | List of permitted ciphers or cipher suites to use for [TLS](../data-in-transit-encryption/index). This option implies the `--ssl` option. | | `--ssl-crl=name` | Defines a path to a PEM file that should contain one or more revoked X509 certificates to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | `--ssl-crlpath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | `--ssl-key=name` | Defines a path to a private key file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | `--ssl-verify-server-cert` | Enables [server certificate verification](../secure-connections-overview/index#server-certificate-verification). This option is disabled by default. | | `--system=option[,option]]` | Dump the database's system tables in a logical form. With this option, the [mysql database](../the-mysql-database-tables/index) tables are dumped as [CREATE USER](../create-user/index), [CREATE SERVER](../create-server/index) and other forms of logical portable SQL statements. The option values here are from the set of `all`, `users`, `plugins`, `udfs`, `servers`, `stats`, `timezones`. From [MariaDB 10.2.37](https://mariadb.com/kb/en/mariadb-10237-release-notes/), [MariaDB 10.3.28](https://mariadb.com/kb/en/mariadb-10328-release-notes/), [MariaDB 10.4.18](https://mariadb.com/kb/en/mariadb-10418-release-notes/) and [MariaDB 10.5.9](https://mariadb.com/kb/en/mariadb-1059-release-notes/). | | `-T`, `--tab=name` | Produce tab-separated text-format data files. With this option, for each dumped table `mysqldump` will create a `tbl_name.sql` file containing the `CREATE TABLE` statement that creates the table, and a `tbl_name.txt` file containing the table's data. The option value is the directory in which to write the files.**Note:** *This option can only be used when* mysqldump/ is run on the same machine as the mysqld server. You must have the `FILE` privilege, and the server must have permission to write files in the directory that you specify.*By default, the `.txt` data files are formatted using tab characters between column values and a newline at the end of each line. The format can be specified explicitly using the `--fields-xxx` and `--lines-terminated-by` options. Column values are converted to the character set specified by the `--default-character-set` option.* | | `--tables` | This option overrides the `--databases` (`-B`) option. *mysqldump* regards all name arguments following the option as table names. | | `--tls-version=name` | This option accepts a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. See [Secure Connections Overview: TLS Protocol Versions](../secure-connections-overview/index#tls-protocol-versions) for more information. This option was added in [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `--triggers` | Include [triggers](../triggers/index) for each dumped table in the output. This option is enabled by default; disable it with `--skip-triggers`. | | `--tz-utc` | This option enables [TIMESTAMP](../timestamp/index) columns to be dumped and reloaded between servers in different time zones. *mysqldump* sets its connection time zone to UTC and adds `SET TIME_ZONE=´+00:00´` to the dump file. Without this option, TIMESTAMP columns are dumped and reloaded in the time zones local to the source and destination servers, which can cause the values to change if the servers are in different time zones. `--tz-utc` also protects against changes due to daylight saving time. `--tz-utc` is enabled by default. To disable it, use `--skip-tz-utc`. | | `-u name`, `--user=name` | The MariaDB user name to use when connecting to the server. | | `-v`, `--verbose` | Verbose mode. Print more information about what the program is doing during various stages. | | `-V`, `--version` | Output version information and exit. | | `-w cond`, `--where=cond` | Dump only rows selected by the given `WHERE` condition *cond*. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.Examples:`--where="user=´jimf´"` `-w"userid>1"` `-w"userid<1"` | | `-X`, `--xml` | Dump a database as well formed XML. | #### Group Options Some `mysqldump` options are shorthand for groups of other options: * Use of `--opt` is the same as specifying `--add-drop-table`, `--add-locks`, `--create-options`, `--disable-keys`, `--extended-insert`, `--lock-tables`, `--quick`, and `--set-charset`. All of the options that `--opt` stands for also are on by default because `--opt` is on by default. * Use of `--compact` is the same as specifying `--skip-add-drop-table`, `--skip-add-locks`, `--skip-comments`, `--skip-disable-keys`, and `--skip-set-charset` options. To reverse the effect of a group option, uses its `--skip-xxx` form (`--skip-opt` or `--skip-compact`). It is also possible to select only part of the effect of a group option by following it with options that enable or disable specific features. Here are some examples: * To select the effect of `--opt` except for some features, use the `--skip` option for each feature. To disable extended inserts and memory buffering, use `--opt` `--skip-extended-insert` `--skip-quick`. (Actually, `--skip-extended-insert` `--skip-quick` is sufficient because `--opt` is on by default.) * To reverse `--opt` for all features except index disabling and table locking, use `--skip-opt` `--disable-keys` `--lock-tables`. When you selectively enable or disable the effect of a group option, order is important because options are processed first to last. For example, `--disable-keys` `--lock-tables` `--skip-opt` would not have the intended effect; it is the same as `--skip-opt` by itself. #### Special Characters in Option Values Some options, like `--lines-terminated-by`, accept a string. The string can be quoted, if necessary. For example, on Unix systems this is the option to enclose fields within double quotes: ``` --fields-enclosed-by='"' ``` An alternative to specify the hexadecimal value of a character. For example, the following syntax works on any platform: ``` --fields-enclosed-by=0x22 ``` ### Option Files In addition to reading options from the command-line, `mysqldump` can also read options from [option files](../configuring-mariadb-with-option-files/index). If an unknown option is provided to `mysqldump` in an option file, then it is ignored. The following options relate to how MariaDB command-line tools handles option files. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | | `--defaults-group-suffix=#` | In addition to the default option groups, also read option groups with this suffix. | In [MariaDB 10.2](../what-is-mariadb-102/index) and later, `mysqldump` is linked with [MariaDB Connector/C](../about-mariadb-connector-c/index). However, MariaDB Connector/C does not yet handle the parsing of option files for this client. That is still performed by the server option file parsing code. See [MDEV-19035](https://jira.mariadb.org/browse/MDEV-19035) for more information. #### Option Groups `mysqldump` reads options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysqldump]` | Options read by `mysqldump`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-dump]` | Options read by `[mysqldump](../mysqldump/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[client]` | Options read by all MariaDB and MySQL [client programs](../clients-utilities/index), which includes both MariaDB and MySQL clients. For example, `mysqldump`. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[client-mariadb]` | Options read by all MariaDB [client programs](../clients-utilities/index). | ### NULL, ´NULL´, and Empty Values in XML For a column named `column_name`, the `NULL` value, an empty string, and the string value `´NULL´` are distinguished from one another in the output generated by this option as follows. | Value | XML Representation | | --- | --- | | NULL (unknown value) | `<field name="column\_name" xsi:nil="true" />` | | ´´ (empty string) | `<field name="column\_name"></field>` | | ´NULL´ (string value) | `<field name="column\_name">NULL</field>` | The output from the mysql client when run using the `--xml` option also follows the preceding rules. XML output from mysqldump includes the XML namespace, as shown here : ``` shell> mysqldump --xml -u root world City <?xml version="1.0"?> <mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <database name="world"> <table_structure name="City"> <field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" /> <field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" /> <field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" /> <field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" /> <field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" /> <key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID" Collation="A" Cardinality="4079" Null="" Index_type="BTREE" Comment="" /> <options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079" Avg_row_length="67" Data_length="273293" Max_data_length="18858823439613951" Index_length="43008" Data_free="0" Auto_increment="4080" Create_time="2007-03-31 01:47:01" Update_time="2007-03-31 01:47:02" Collation="latin1_swedish_ci" Create_options="" Comment="" /> </table_structure> <table_data name="City"> <row> <field name="ID">1</field> <field name="Name">Kabul</field> <field name="CountryCode">AFG</field> <field name="District">Kabol</field> <field name="Population">1780000</field> </row> ... <row> <field name="ID">4079</field> <field name="Name">Rafah</field> <field name="CountryCode">PSE</field> <field name="District">Rafah</field> <field name="Population">92020</field> </row> </table_data> </database> </mysqldump> ``` ### Restoring To restore a backup created with mysqldump, use the [mysql client](../mysql-command-line-client/index) to import the dump, for example: ``` mysql db_name < backup-file.sql ``` Variables --------- You can also set the following variables (`--variable-name=value`) and boolean options `{FALSE|TRUE}` by using: | Name | Default Values | | --- | --- | | `all` | `TRUE` | | `all-databases` | `FALSE` | | `all-tablespaces` | `FALSE` | | `no-tablespaces` | `FALSE` | | `add-drop-database` | `FALSE` | | `add-drop-table` | `TRUE` | | `add-drop-trigger` | `FALSE` | | `add-locks` | `TRUE` | | `allow-keywords` | `FALSE` | | `apply-slave-statements` | FALSE | | `as-of` | *(No default value)* | | `character-sets-dir` | *(No default value)* | | `comments` | `TRUE` | | `compatible` | *(No default value)* | | `compact` | `FALSE` | | `complete-insert` | `FALSE` | | `compress` | `FALSE` | | `copy-s3-tables` | FALSE | | `create-options` | `TRUE` | | `databases` | `FALSE` | | `debug-check` | `FALSE` | | `debug-info` | `FALSE` | | `default-character-set` | `utf8mb4` | | `delayed-insert` | `FALSE` | | `delete-master-logs` | `FALSE` | | `disable-keys` | `TRUE` | | `events` | `FALSE` | | `extended-insert` | `TRUE` | | `fields-terminated-by` | *(No default value)* | | `fields-enclosed-by` | *(No default value)* | | `fields-optionally-enclosed-by` | *(No default value)* | | `fields-escaped-by` | *(No default value)* | | `flush-logs` | `FALSE` | | `flush-privileges` | `FALSE` | | `force` | `FALSE` | | `hex-blob` | `FALSE` | | `host` | *(No default value)* | | `include-master-host-port` | `FALSE` | | `insert-ignore` | `FALSE` | | `lines-terminated-by` | *(No default value)* | | `lock-all-tables` | `FALSE` | | `lock-tables` | `TRUE` | | `log-error` | *(No default value)* | | `log-queries` | `TRUE` | | `master-data` | `0` | | `max_allowed_packet` | `16777216` | | `net-buffer-length` | `1046528` | | `no-autocommit` | `FALSE` | | `no-create-db` | `FALSE` | | `no-create-info` | `FALSE` | | `no-data` | `FALSE` | | `no-data-med` | `TRUE` | | `order-by-primary` | `FALSE` | | `port` | `0` | | `quick` | `TRUE` | | `quote-names` | `TRUE` | | `replace` | `FALSE` | | `routines` | `FALSE` | | `set-charset` | `TRUE` | | `single-transaction` | `FALSE` | | `dump-date` | `TRUE` | | `socket` | *No default value)* | | `ssl` | `FALSE` | | `ssl-ca` | *(No default value)* | | `ssl-capath` | *(No default value)* | | `ssl-cert` | *(No default value)* | | `ssl-cipher` | *(No default value)* | | `ssl-key` | *(No default value)* | | `ssl-verify-server-cert` | `FALSE` | | `system` | *(No default value)* | | `tab` | *(No default value)* | | `triggers` | `TRUE` | | `tz-utc` | `TRUE` | | `user` | *(No default value)* | | `verbose` | `FALSE` | | `where` | *(No default value)* | | `plugin-dir` | *(No default value)* | | `default-auth` | *(No default value)* | Examples -------- A common use of `mysqldump` is for making a backup of an entire database: ``` shell> mysqldump db_name > backup-file.sql ``` You can load the dump file back into the server like this: ``` shell> mysql db_name < backup-file.sql ``` Or like this: ``` shell> mysql -e "source /path-to-backup/backup-file.sql" db_name ``` `mysqldump` is also very useful for populating databases by copying data from one MariaDB server to another: ``` shell> mysqldump --opt db_name | mysql --host=remote_host -C db_name ``` It is possible to dump several databases with one command: ``` shell> mysqldump --databases db_name1 [db_name2 ...] > my_databases.sql ``` To dump all databases, use the `--all-databases` option: ``` shell> mysqldump --all-databases > all_databases.sql ``` For InnoDB tables, `mysqldump` provides a way of making an online backup: ``` shell> mysqldump --all-databases --single-transaction all_databases.sql ``` This backup acquires a global read lock on all tables (using `FLUSH TABLES WITH READ LOCK`) at the beginning of the dump. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released. If long updating statements are running when the FLUSH statement is issued, the MariaDB server may get stalled until those statements finish. After that, the dump becomes lock free and does not disturb reads and writes on the tables. If the update statements that the MariaDB server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates. For point-in-time recovery (also known as “roll-forward,” when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the [binary log](../binary-log/index) or at least know the binary log coordinates to which the dump corresponds: ``` shell> mysqldump --all-databases --master-data=2 > all_databases.sql ``` Or: ``` shell> mysqldump --all-databases --flush-logs --master-data=2 > all_databases.sql ``` The `--master-data` and `--single-transaction` options can be used simultaneously, which provides a convenient way to make an online backup suitable for use prior to point-in-time recovery if tables are stored using the InnoDB storage engine. See Also -------- * [Mariabackup](../mariabackup/index) * [MariaDB point-in-time recovery](https://www.youtube.com/watch?v=ezHmnNmmcDo) (video) * [MariaDB Enterprise Backup](https://mariadb.com/docs/usage/mariadb-enterprise-backup/) * [Upgrading to a newer major version of MariaDB](https://www.youtube.com/watch?v=1kLIXN2DoEo) (video) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb NumInteriorRings NumInteriorRings ================ A synonym for [ST\_NumInteriorRings](../st_numinteriorrings/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP PROCEDURE DROP PROCEDURE ============== Syntax ------ ``` DROP PROCEDURE [IF EXISTS] sp_name ``` Description ----------- This statement is used to drop a [stored procedure](../stored-procedures/index). That is, the specified routine is removed from the server along with all privileges specific to the [procedure](../grant/index). You must have the `ALTER ROUTINE` privilege for the routine. If the `[automatic\_sp\_privileges](../server-system-variables/index#automatic_sp_privileges)` server system variable is set, that privilege and `EXECUTE` are granted automatically to the routine creator - see [Stored Routine Privileges](../stored-routine-privileges/index). The `IF EXISTS` clause is a MySQL/MariaDB extension. It prevents an error from occurring if the procedure or function does not exist. A `NOTE` is produced that can be viewed with `[SHOW WARNINGS](../show-warnings/index)`. While this statement takes effect immediately, threads which are executing a procedure can continue execution. Examples -------- ``` DROP PROCEDURE simpleproc; ``` IF EXISTS: ``` DROP PROCEDURE simpleproc; ERROR 1305 (42000): PROCEDURE test.simpleproc does not exist DROP PROCEDURE IF EXISTS simpleproc; Query OK, 0 rows affected, 1 warning (0.00 sec) SHOW WARNINGS; +-------+------+------------------------------------------+ | Level | Code | Message | +-------+------+------------------------------------------+ | Note | 1305 | PROCEDURE test.simpleproc does not exist | +-------+------+------------------------------------------+ ``` See Also -------- * [DROP FUNCTION](../drop-function/index) * [Stored Procedure Overview](../stored-procedure-overview/index) * [CREATE PROCEDURE](../create-procedure/index) * [ALTER PROCEDURE](index) * [SHOW CREATE PROCEDURE](../show-create-procedure/index) * [SHOW PROCEDURE STATUS](../show-procedure-status/index) * [Information Schema ROUTINES Table](../information-schema-routines-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECTION_ID CONNECTION\_ID ============== Syntax ------ ``` CONNECTION_ID() ``` Description ----------- Returns the connection ID (thread ID) for the connection. Every thread (including events) has an ID that is unique among the set of currently connected clients. Until [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), returns `MYSQL_TYPE_LONGLONG`, or [bigint(10)](../bigint/index), in all cases. From [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), returns `MYSQL_TYPE_LONG`, or [int(10)](../int/index), when the result would fit within 32-bits. Examples -------- ``` SELECT CONNECTION_ID(); +-----------------+ | CONNECTION_ID() | +-----------------+ | 3 | +-----------------+ ``` See Also -------- * [SHOW PROCESSLIST](../show-processlist/index) * [INFORMATION\_SCHEMA.PROCESSLIST](../information-schema-processlist-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Restricting Speed of Reading Binlog from Primary by a Replica Restricting Speed of Reading Binlog from Primary by a Replica ============================================================= When a replica starts after being stopped for some time, or a new replica starts that was created from a backup from some time back, a lot of old binlog events may need to be downloaded from the primary. If this happens from many replicas simultaneously, it can put a lot of load on the primary. The **read\_binlog\_speed\_limit** option can be used to reduce such load, by limiting the speed at which events are downloaded. The limit is given as maximum kilobytes per second to download on one replica connection. With this option set, the replication I/O thread will limit the rate of download. Since the I/O thread is often much faster to download events than the SQL thread is at applying them, an appropriate value for **read\_binlog\_speed\_limit** may reduce load spikes on the primary without much limit in the speed of the replica. The option **read\_binlog\_speed\_limit** is available starting from [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). #### `read_binlog_speed_limit` * **Description:** Maximum speed(KB/s) to read binlog from primary. * **Commandline:** `--read-binlog-speed-limit[=#]` * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `0` * **Range:** `0` to `4294967295` * **Introduced:** [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Puppet and MariaDB Puppet and MariaDB ================== See the [Puppet and MariaDB](../automated-mariadb-deployment-and-administration-puppet-and-mariadb/index) category. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb msql2mysql msql2mysql ========== Description ----------- Initially, the MySQL C API was developed to be very similar to that of the mSQL database system. Because of this, mSQL programs often can be converted relatively easily for use with MySQL by changing the names of their C API functions. The `msql2mysql` utility performs the conversion of mSQL C API function calls to their MySQL equivalents. **Warning:** `msql2mysql` converts the input file in place, so make a copy of the original before converting it. Example ------- ``` shell> cp client-prog.c client-prog.c.orig shell> msql2mysql client-prog.c client-prog.c converted ``` After conversion, examine `client-prog.c` and make any necessary post-conversion revisions. `msql2mysql` uses the `[replace](../replace-utility/index)` utility to make the function name substitutions. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb 10.3.4-beta Release Upgrade Tests 10.3.4-beta Release Upgrade Tests ================================= ### Tested revision 8f102b584d4e8f02da924f9be094014136eb453f ### Test date 2018-01-19 17:39:10 ### Summary All major upgrades fail with [MDEV-14990](https://jira.mariadb.org/browse/MDEV-14990) (non-InnoDB issue, general server). Also known bugs [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103), [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094) ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | recovery | 16 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 16 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 4 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 4 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 32 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 32 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 8 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 8 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | recovery | 16 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 16 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 4 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 4 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 8 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 8 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 16 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 4 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 32 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 64 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 8 | 10.3.4 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 16 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 4 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 32 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 64 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 8 | 10.3.4 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 16 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 4 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 32 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 64 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 8 | 10.3.4 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | undo-recovery | 16 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 4 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 32 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 64 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 8 | 10.3.4 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 16 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 32 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 32 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 16 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 16 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 32 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 32 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 64 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 8 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | crash | 16 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 4 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 8 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 16 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.3.3 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.3.3 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.3.3 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.3.3 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 4 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 8 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 16 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.12 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.12 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.12 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.12 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13103](https://jira.mariadb.org/browse/MDEV-13103)(1) | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.30 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.3.4 (inbuilt) | Barracuda | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.3.4 (inbuilt) | Barracuda | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.3.4 (inbuilt) | Barracuda | on | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.3.4 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.0.33 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 64 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 32 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 32 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 64 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 5.7.21 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | normal | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | on | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 16 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 4 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | | undo | 8 | 5.6.39 (inbuilt) | | - | - | => | 10.3.4 (inbuilt) | | - | - | - | **FAIL** | UPGRADE\_FAILURE | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb UTC_DATE UTC\_DATE ========= Syntax ------ ``` UTC_DATE, UTC_DATE() ``` Description ----------- Returns the current [UTC date](../coordinated-universal-time/index) as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context. Examples -------- ``` SELECT UTC_DATE(), UTC_DATE() + 0; +------------+----------------+ | UTC_DATE() | UTC_DATE() + 0 | +------------+----------------+ | 2010-03-27 | 20100327 | +------------+----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Authentication Plugin - Named Pipe Authentication Plugin - Named Pipe ================================== The `named_pipe` authentication plugin allows the user to use operating system credentials when connecting to MariaDB via named pipe on Windows. Named pipe connections are enabled by the `[named\_pipe](../server-system-variables/index#named_pipe)` system variable. The `named_pipe` authentication plugin works by using [named pipe impersonation](https://msdn.microsoft.com/en-us/library/windows/desktop/aa378618%28v=vs.85%29.aspx) and calling `GetUserName()` to retrieve the user name of the process that is connected to the named pipe. Once it has the user name, it authenticates the connecting user as the MariaDB account that has the same user name. Installing the Plugin --------------------- Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing `[INSTALL SONAME](../install-soname/index)` or `[INSTALL PLUGIN](../install-plugin/index)`. For example: ``` INSTALL SONAME 'auth_named_pipe'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options. This can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = auth_named_pipe ``` Uninstalling the Plugin ----------------------- You can uninstall the plugin dynamically by executing `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)`. For example: ``` UNINSTALL SONAME 'auth_named_pipe'; ``` If you installed the plugin by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Creating Users -------------- To create a user account via `[CREATE USER](../create-user/index)`, specify the name of the plugin in the `[IDENTIFIED VIA](../create-user/index#identified-viawith-authentication_plugin)` clause. For example: ``` CREATE USER username@hostname IDENTIFIED VIA named_pipe; ``` If `[SQL\_MODE](../sql-mode/index)` does not have `NO_AUTO_CREATE_USER` set, then you can also create the user account via `[GRANT](../grant/index)`. For example: ``` GRANT SELECT ON db.* TO username@hostname IDENTIFIED VIA named_pipe; ``` Client Authentication Plugins ----------------------------- The `named_pipe` authentication plugin does not require any specific client authentication plugins. It should work with all clients. Support in Client Libraries --------------------------- The `named_pipe` authentication plugin does not require any special support in client libraries. It should work with all client libraries. Example ------- ``` CREATE USER wlad IDENTIFIED VIA named_pipe; CREATE USER monty IDENTIFIED VIA named_pipe; quit C:\>echo %USERNAME% wlad C:\> mysql --user=wlad --protocol=PIPE Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.1.12-MariaDB-debug Source distribution Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye C:\> mysql --user=monty --protocol=PIPE ERROR 1698 (28000): Access denied for user 'monty'@'localhost' ``` In this example, a user `wlad` is already logged into the system. Because he has identified himself to the operating system, he does not need to do it again for the database — MariaDB trusts the operating system credentials. However, he cannot connect to the database as another user. Versions -------- | Version | Status | Introduced | | --- | --- | --- | | 1.0 | Stable | [MariaDB 10.1.11](https://mariadb.com/kb/en/mariadb-10111-release-notes/) | Options ------- ### `named_pipe` * **Description:** Controls how the server should treat the plugin when the server starts up. + Valid values are: - `OFF` - Disables the plugin without removing it from the `[mysql.plugins](../mysqlplugin-table/index)` table. - `ON` - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. - `FORCE` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. - `FORCE_PLUS_PERMANENT` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)` while the server is running. + See [Plugin Overview: Configuring Plugin Activation at Server Startup](../plugin-overview/index#configuring-plugin-activation-at-server-startup) for more information. + There may be ambiguity between this option and the `[named\_pipe](../server-system-variables/index#named_pipe)` system variable. See [MDEV-19625](https://jira.mariadb.org/browse/MDEV-19625) about that. * **Commandline:** `--named-pipe=value` * **Data Type:** `enumerated` * **Default Value:** `ON` * **Valid Values:** `OFF`, `ON`, `FORCE`, `FORCE_PLUS_PERMANENT` * **Introduced:** [MariaDB 10.1.11](https://mariadb.com/kb/en/mariadb-10111-release-notes/) --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Persistent Statistics InnoDB Persistent Statistics ============================ Before [MariaDB 10.0](../what-is-mariadb-100/index), InnoDB statistics were not stored on disk, meaning that on server restarts the statistics would need to be recalculated, which is both needless computation, as well as leading to inconsistent query plans. There are a number of variables that control persistent statistics: * [innodb\_stats\_persistent](../xtradbinnodb-server-system-variables/index#innodb_stats_persistent) - when set (the default) enables InnoDB persistent statistics. * [innodb\_stats\_auto\_recalc](../xtradbinnodb-server-system-variables/index#innodb_stats_auto_recalc) - when set (the default), persistent statistics are automatically recalculated when the table changes significantly (more than 10% of the rows) * [innodb\_stats\_persistent\_sample\_pages](../xtradbinnodb-server-system-variables/index#innodb_stats_persistent_sample_pages) - Number of index pages sampled (default 20) when estimating cardinality and statistics for indexed columns. Increasing this value will increases index statistics accuracy, but use more I/O resources when running [ANALYZE TABLE](../analyze-table/index). These settings can be overwritten on a per-table basis by use of the [STATS\_PERSISTENT](../create-table/index#stats_persistent), [STATS\_AUTO\_RECALC](../create-table/index#stats_auto_recalc) and [STATS\_SAMPLE\_PAGES](../create-table/index#stats_sample_pages) clauses in a [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index) statement. Details of the statistics are stored in two system tables in the [mysql database](the-mysql-database-table): * [innodb\_table\_stats](../mysqlinnodb_table_stats/index) * [innodb\_index\_stats](../mysqlinnodb_index_stats/index) See Also -------- * [Index Statistics](../index-statistics/index) * [Engine-independent Statistics](../engine-independent-table-statistics/index) * [Histogram-based Statistics](../histogram-based-statistics/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Pivoting in MariaDB Pivoting in MariaDB =================== The problem ----------- You want to "pivot" the data so that a linear list of values with two keys becomes a spreadsheet-like array. See examples, below. A solution ---------- The best solution is probably to do it in some form of client code (PHP, etc). MySQL and MariaDB do not have a syntax for SELECT that will do the work for you. The code provided here uses a [stored procedure](../stored-procedures/index) to generate code to pivot the data, and then runs the code. You can edit the SQL generated by the stored procedure to tweak the output in a variety of ways. Or you can tweak the stored procedure to generate what you would prefer. Reference code for solution --------------------------- 'Source' this into the mysql commandline tool: ``` DELIMITER // DROP PROCEDURE IF EXISTS Pivot // CREATE PROCEDURE Pivot( IN tbl_name VARCHAR(99), -- table name (or db.tbl) IN base_cols VARCHAR(99), -- column(s) on the left, separated by commas IN pivot_col VARCHAR(64), -- name of column to put across the top IN tally_col VARCHAR(64), -- name of column to SUM up IN where_clause VARCHAR(99), -- empty string or "WHERE ..." IN order_by VARCHAR(99) -- empty string or "ORDER BY ..."; usually the base_cols ) DETERMINISTIC SQL SECURITY INVOKER BEGIN -- Find the distinct values -- Build the SUM()s SET @subq = CONCAT('SELECT DISTINCT ', pivot_col, ' AS val ', ' FROM ', tbl_name, ' ', where_clause, ' ORDER BY 1'); -- select @subq; SET @cc1 = "CONCAT('SUM(IF(&p = ', &v, ', &t, 0)) AS ', &v)"; SET @cc2 = REPLACE(@cc1, '&p', pivot_col); SET @cc3 = REPLACE(@cc2, '&t', tally_col); -- select @cc2, @cc3; SET @qval = CONCAT("'\"', val, '\"'"); -- select @qval; SET @cc4 = REPLACE(@cc3, '&v', @qval); -- select @cc4; SET SESSION group_concat_max_len = 10000; -- just in case SET @stmt = CONCAT( 'SELECT GROUP_CONCAT(', @cc4, ' SEPARATOR ",\n") INTO @sums', ' FROM ( ', @subq, ' ) AS top'); select @stmt; PREPARE _sql FROM @stmt; EXECUTE _sql; -- Intermediate step: build SQL for columns DEALLOCATE PREPARE _sql; -- Construct the query and perform it SET @stmt2 = CONCAT( 'SELECT ', base_cols, ',\n', @sums, ',\n SUM(', tally_col, ') AS Total' '\n FROM ', tbl_name, ' ', where_clause, ' GROUP BY ', base_cols, '\n WITH ROLLUP', '\n', order_by ); select @stmt2; -- The statement that generates the result PREPARE _sql FROM @stmt2; EXECUTE _sql; -- The resulting pivot table ouput DEALLOCATE PREPARE _sql; -- For debugging / tweaking, SELECT the various @variables after CALLing. END; // DELIMITER ; ``` Then do a CALL, like in the examples, below. Variants -------- I thought about having several extra options for variations, but decided that would be too messy. Instead, here are instructions for implementing the variations, either by capturing the SELECT that was output by the Stored Procedure, or by modifying the SP, itself. * The data is strings (not numeric) -- Remove "SUM" (but keep the expression); remove the SUM...AS TOTAL line. * If you want blank output instead of 0 -- Currently the code says "SUM(IF(... 0))"; change the 0 to NULL, then wrap the SUM: IFNULL(SUM(...), ''). Note that this will distinguish between a zero total (showing '0') and no data (blank). * Fancier output -- Use PHP/VB/Java/etc. * No Totals at the bottom -- Remove the WITH ROLLUP line from the SELECT. * No Total for each row -- Remove the SUM...AS Total line from the SELECT. * Change the order of the columns -- Modify the ORDER BY 1 ('1' meaning first column) in the SELECT DISTINCT in the SP. * Example: ORDER BY FIND\_IN\_SET(DAYOFWEEK(...), 'Sun,Mon,Tue,Wed,Thu,Fri,Sat') Notes about "base\_cols": * Multiple columns on the left, such as an ID and its meaning -- This is already handled by allowing base\_cols to be a commalist like 'id, meaning' * You cannot call the SP with "foo AS 'blah'" in hopes of changing the labels, but you could edit the SELECT to achieve that goal. Notes about the "Totals": * If "base\_cols" is more than one column, WITH ROLLUP will be subtotals as well as a grand total. * NULL shows up in the Totals row in the "base\_cols" column; this can be changed via something like IFNULL(..., 'Totals'). Example 1 - Population vs Latitude in US ``` -- Sample input: +-------+----------------------+---------+------------+ | state | city | lat | population | +-------+----------------------+---------+------------+ | AK | Anchorage | 61.2181 | 276263 | | AK | Juneau | 58.3019 | 31796 | | WA | Monroe | 47.8556 | 15554 | | WA | Spanaway | 47.1042 | 25045 | | PR | Arecibo | 18.4744 | 49189 | | MT | Kalispell | 48.1958 | 18018 | | AL | Anniston | 33.6597 | 23423 | | AL | Scottsboro | 34.6722 | 14737 | | HI | Kaneohe | 21.4181 | 35424 | | PR | Candelaria | 18.4061 | 17632 | ... -- Call the Stored Procedure: CALL Pivot('World.US', 'state', '5*FLOOR(lat/5)', 'population', '', ''); -- SQL generated by the SP: SELECT state, SUM(IF(5*FLOOR(lat/5) = "15", population, 0)) AS "15", SUM(IF(5*FLOOR(lat/5) = "20", population, 0)) AS "20", SUM(IF(5*FLOOR(lat/5) = "25", population, 0)) AS "25", SUM(IF(5*FLOOR(lat/5) = "30", population, 0)) AS "30", SUM(IF(5*FLOOR(lat/5) = "35", population, 0)) AS "35", SUM(IF(5*FLOOR(lat/5) = "40", population, 0)) AS "40", SUM(IF(5*FLOOR(lat/5) = "45", population, 0)) AS "45", SUM(IF(5*FLOOR(lat/5) = "55", population, 0)) AS "55", SUM(IF(5*FLOOR(lat/5) = "60", population, 0)) AS "60", SUM(IF(5*FLOOR(lat/5) = "70", population, 0)) AS "70", SUM(population) AS Total FROM World.US GROUP BY state WITH ROLLUP -- Output from that SQL (also comes out of the SP): +-------+---------+--------+----------+----------+----------+----------+---------+-------+--------+------+-----------+ | state | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 55 | 60 | 70 | Total | +-------+---------+--------+----------+----------+----------+----------+---------+-------+--------+------+-----------+ | AK | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 60607 | 360765 | 4336 | 425708 | | AL | 0 | 0 | 0 | 1995225 | 0 | 0 | 0 | 0 | 0 | 0 | 1995225 | | AR | 0 | 0 | 0 | 595537 | 617361 | 0 | 0 | 0 | 0 | 0 | 1212898 | | AZ | 0 | 0 | 0 | 4708346 | 129989 | 0 | 0 | 0 | 0 | 0 | 4838335 | ... | FL | 0 | 34706 | 9096223 | 1440916 | 0 | 0 | 0 | 0 | 0 | 0 | 10571845 | | GA | 0 | 0 | 0 | 2823939 | 0 | 0 | 0 | 0 | 0 | 0 | 2823939 | | HI | 43050 | 752983 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 796033 | ... | WY | 0 | 0 | 0 | 0 | 0 | 277480 | 0 | 0 | 0 | 0 | 277480 | | NULL | 1792991 | 787689 | 16227033 | 44213344 | 47460670 | 61110822 | 7105143 | 60607 | 360765 | 4336 | 179123400 | +-------+---------+--------+----------+----------+----------+----------+---------+-------+--------+------+-----------+ ``` Notice how Alaska (AK) has populations in high latitudes and Hawaii (HI) in low latitudes. Example 2 - Home Solar Power Generation This give the power (KWh) generated by hour and month for 2012. ``` -- Sample input: +---------------------+------+ | ts | enwh | +---------------------+------+ | 2012-06-06 11:00:00 | 523 | | 2012-06-06 11:05:00 | 526 | | 2012-06-06 11:10:00 | 529 | | 2012-06-06 11:15:00 | 533 | | 2012-06-06 11:20:00 | 537 | | 2012-06-06 11:25:00 | 540 | | 2012-06-06 11:30:00 | 542 | | 2012-06-06 11:35:00 | 543 | Note that it is a reading in watts for each 5 minutes. So, summing is needed to get the breakdown by month and hour. -- Invoke the SP: CALL Pivot('details', -- Table 'MONTH(ts)', -- `base_cols`, to put on left; SUM up over the month 'HOUR(ts)', -- `pivot_col` to put across the top; SUM up entries across the hour 'enwh/1000', -- The data -- watts converted to KWh "WHERE ts >= '2012-01-01' AND ts < '2012-01-01' + INTERVAL 1 year", -- Limit to one year ''); -- assumes that the months stay in order -- The SQL generated: SELECT MONTH(ts), SUM(IF(HOUR(ts) = "5", enwh/1000, 0)) AS "5", SUM(IF(HOUR(ts) = "6", enwh/1000, 0)) AS "6", SUM(IF(HOUR(ts) = "7", enwh/1000, 0)) AS "7", SUM(IF(HOUR(ts) = "8", enwh/1000, 0)) AS "8", SUM(IF(HOUR(ts) = "9", enwh/1000, 0)) AS "9", SUM(IF(HOUR(ts) = "10", enwh/1000, 0)) AS "10", SUM(IF(HOUR(ts) = "11", enwh/1000, 0)) AS "11", SUM(IF(HOUR(ts) = "12", enwh/1000, 0)) AS "12", SUM(IF(HOUR(ts) = "13", enwh/1000, 0)) AS "13", SUM(IF(HOUR(ts) = "14", enwh/1000, 0)) AS "14", SUM(IF(HOUR(ts) = "15", enwh/1000, 0)) AS "15", SUM(IF(HOUR(ts) = "16", enwh/1000, 0)) AS "16", SUM(IF(HOUR(ts) = "17", enwh/1000, 0)) AS "17", SUM(IF(HOUR(ts) = "18", enwh/1000, 0)) AS "18", SUM(IF(HOUR(ts) = "19", enwh/1000, 0)) AS "19", SUM(IF(HOUR(ts) = "20", enwh/1000, 0)) AS "20", SUM(enwh/1000) AS Total FROM details WHERE ts >= '2012-01-01' AND ts < '2012-01-01' + INTERVAL 1 year GROUP BY MONTH(ts) WITH ROLLUP -- That generated decimal places that I did like: | MONTH(ts) | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Total | +-----------+--------+---------+----------+----------+-----------+-----------+-----------+-----------+-----------+------ -----+-----------+----------+----------+----------+---------+--------+------------+ | 1 | 0.0000 | 0.0000 | 1.8510 | 21.1620 | 52.3190 | 73.0420 | 89.3220 | 97.0190 | 88.9720 | 75. 4970 | 50.9270 | 12.5130 | 0.5990 | 0.0000 | 0.0000 | 0.0000 | 563.2230 | | 2 | 0.0000 | 0.0460 | 5.9560 | 35.6330 | 72.4710 | 96.5130 | 112.7770 | 126.0850 | 117.1540 | 96. 7160 | 72.5900 | 33.6230 | 4.7650 | 0.0040 | 0.0000 | 0.0000 | 774.3330 | ``` Other variations made the math go wrong. (Note that there is no CAST to FLOAT.) While I was at it, I gave an alias to change "MONTH(ts)" to just "Month". So, I edited the SQL to this and ran it: ``` SELECT MONTH(ts) AS 'Month', ROUND(SUM(IF(HOUR(ts) = "5", enwh, 0))/1000) AS "5", ... ROUND(SUM(IF(HOUR(ts) = "20", enwh, 0))/1000) AS "20", ROUND(SUM(enwh)/1000) AS Total FROM details WHERE ts >= '2012-01-01' AND ts < '2012-01-01' + INTERVAL 1 year GROUP BY MONTH(ts) WITH ROLLUP; ``` -- Which gave cleaner output: ``` +-------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------+ | Month | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Total | +-------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------+ | 1 | 0 | 0 | 2 | 21 | 52 | 73 | 89 | 97 | 89 | 75 | 51 | 13 | 1 | 0 | 0 | 0 | 563 | | 2 | 0 | 0 | 6 | 36 | 72 | 97 | 113 | 126 | 117 | 97 | 73 | 34 | 5 | 0 | 0 | 0 | 774 | | 3 | 0 | 0 | 9 | 46 | 75 | 105 | 121 | 122 | 128 | 126 | 105 | 71 | 33 | 10 | 0 | 0 | 952 | | 4 | 0 | 1 | 14 | 63 | 111 | 146 | 171 | 179 | 177 | 158 | 141 | 105 | 65 | 26 | 3 | 0 | 1360 | | 5 | 0 | 4 | 21 | 78 | 128 | 162 | 185 | 199 | 196 | 187 | 166 | 130 | 81 | 36 | 8 | 0 | 1581 | | 6 | 0 | 4 | 17 | 71 | 132 | 163 | 182 | 191 | 193 | 182 | 161 | 132 | 89 | 43 | 10 | 1 | 1572 | | 7 | 0 | 3 | 17 | 57 | 121 | 160 | 185 | 197 | 199 | 189 | 168 | 137 | 92 | 44 | 11 | 1 | 1581 | | 8 | 0 | 1 | 11 | 48 | 104 | 149 | 171 | 183 | 187 | 179 | 156 | 121 | 76 | 32 | 5 | 0 | 1421 | | 9 | 0 | 0 | 6 | 32 | 77 | 127 | 151 | 160 | 159 | 148 | 124 | 93 | 47 | 12 | 1 | 0 | 1137 | | 10 | 0 | 0 | 1 | 16 | 54 | 85 | 107 | 115 | 119 | 106 | 85 | 56 | 17 | 2 | 0 | 0 | 763 | | 11 | 0 | 0 | 5 | 30 | 57 | 70 | 84 | 83 | 76 | 64 | 35 | 8 | 1 | 0 | 0 | 0 | 512 | | 12 | 0 | 0 | 2 | 17 | 39 | 54 | 67 | 75 | 64 | 58 | 31 | 4 | 0 | 0 | 0 | 0 | 411 | | NULL | 0 | 13 | 112 | 516 | 1023 | 1392 | 1628 | 1728 | 1703 | 1570 | 1294 | 902 | 506 | 203 | 38 | 2 | 12629 | +-------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------+ ``` Midday in the summer is the best time for solar panels, as you would expect. 1-2pm in July was the best. Postlog ------- Posted, Feb. 2015 See Also -------- * [Dynamic pivot tables](http://buysql.com/mysql/14-how-to-automate-pivot-tables.html) * [Brawley's notes](http://www.artfulsoftware.com/queries.php) Rick James graciously allowed us to use this article in the Knowledge Base. [Rick James' site](http://mysql.rjweb.org/) has other useful tips, how-tos, optimizations, and debugging tips. Original source: <http://mysql.rjweb.org/doc.php/pivot> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb MIN MIN === Syntax ------ ``` MIN([DISTINCT] expr) ``` Description ----------- Returns the minimum value of *`expr`*. `MIN()` may take a string argument, in which case it returns the minimum string value. The `DISTINCT` keyword can be used to find the minimum of the distinct values of *`expr`*, however, this produces the same result as omitting `DISTINCT`. Note that [SET](../set/index) and [ENUM](../enum/index) fields are currently compared by their string value rather than their relative position in the set, so MIN() may produce a different lowest result than ORDER BY ASC. It is an [aggregate function](../aggregate-functions/index), and so can be used with the [GROUP BY](../group-by/index) clause. From [MariaDB 10.2.2](https://mariadb.com/kb/en/mariadb-1022-release-notes/), MIN() can be used as a [window function](../window-functions/index). `MIN()` returns `NULL` if there were no matching rows. Examples -------- ``` CREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87), ('Tatiana', 'Tuning', 83); SELECT name, MIN(score) FROM student GROUP BY name; +---------+------------+ | name | MIN(score) | +---------+------------+ | Chun | 73 | | Esben | 31 | | Kaolin | 56 | | Tatiana | 83 | +---------+------------+ ``` MIN() with a string: ``` SELECT MIN(name) FROM student; +-----------+ | MIN(name) | +-----------+ | Chun | +-----------+ ``` Be careful to avoid this common mistake, not grouping correctly and returning mismatched data: ``` SELECT name,test,MIN(score) FROM student; +------+------+------------+ | name | test | MIN(score) | +------+------+------------+ | Chun | SQL | 31 | +------+------+------------+ ``` Difference between ORDER BY ASC and MIN(): ``` CREATE TABLE student2(name CHAR(10),grade ENUM('b','c','a')); INSERT INTO student2 VALUES('Chun','b'),('Esben','c'),('Kaolin','a'); SELECT MIN(grade) FROM student2; +------------+ | MIN(grade) | +------------+ | a | +------------+ SELECT grade FROM student2 ORDER BY grade ASC LIMIT 1; +-------+ | grade | +-------+ | b | +-------+ ``` As a [window function](../window-functions/index): ``` CREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT); INSERT INTO student_test VALUES ('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), ('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), ('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), ('Tatiana', 'SQL', 87); SELECT name, test, score, MIN(score) OVER (PARTITION BY name) AS lowest_score FROM student_test; +---------+--------+-------+--------------+ | name | test | score | lowest_score | +---------+--------+-------+--------------+ | Chun | SQL | 75 | 73 | | Chun | Tuning | 73 | 73 | | Esben | SQL | 43 | 31 | | Esben | Tuning | 31 | 31 | | Kaolin | SQL | 56 | 56 | | Kaolin | Tuning | 88 | 56 | | Tatiana | SQL | 87 | 87 | +---------+--------+-------+--------------+ ``` See Also -------- * [AVG](../avg/index) (average) * [MAX](../max/index) (maximum) * [SUM](../sum/index) (sum total) * [MIN/MAX optimization](../minmax-optimization/index) used by the optimizer * [LEAST()](../least/index) returns the smallest value from a list. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Security-Enhanced Linux with MariaDB Security-Enhanced Linux with MariaDB ==================================== [Security-Enhanced Linux (SELinux)](https://selinuxproject.org/page/Main_Page) is a Linux kernel module that provides a framework for configuring [mandatory access control (MAC)](https://en.wikipedia.org/wiki/Mandatory_access_control) system for many resources on the system. It is enabled by default on some Linux distributions, including RHEL, CentOS, Fedora, and other similar Linux distribution. SELinux prevents programs from accessing files, directories or ports unless it is configured to access those resources. Verifying Whether SELinux Is Enabled ------------------------------------ To verify whether SELinux is enabled, execute the `[getenforce](https://linux.die.net/man/8/getenforce)` command. For example: ``` getenforce ``` ### Temporarily Putting mysqld Into Permissive Mode When you are troubleshooting issues that you think SELinux might be causing, it can help to temporarily put `mysqld_t` into permissive mode. This can be done by executing the `[semanage](https://linux.die.net/man/8/semanage)` command. For example: ``` sudo semanage permissive -a mysqld_t ``` If that solved the problem, then it means that the current SELinux policy is the culprit. You need to adjust the SELinux policy or labels for MariaDB. Configuring a MariaDB Server SELinux Policy ------------------------------------------- MariaDB Server should work with your default distribution policy (which is usually part of the `selinux-policy` or `selinux-policy-targeted` system package). If you use `mysqld_safe`, you will need an additional policy file, `mariadb.pp`, which is installed together with the MariaDB Server. It will be loaded automatically if you have `/usr/sbin/semodule` installed, but you can load it manually anytime with ``` /usr/sbin/semodule -i /usr/share/mysql/policy/selinux/mariadb.pp ``` Note that this policy file extends, but not replaces the system policy. Setting File Contexts --------------------- SELinux uses [file contexts](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files) as a way to determine who should be able to access that file. File contexts are managed with the `[semanage fcontext](##%5B%5Bhttps%3A//linux.die.net/man/8/semanage)` and `[restorecon](https://linux.die.net/man/8/restorecon)` commands. On many systems, the `[semanage](##%5B%5Bhttps%3A//linux.die.net/man/8/semanage)` utility is installed by the `policycoreutils-python` package, and the `[restorecon](https://linux.die.net/man/8/restorecon)` utility is installed by the `policycoreutils` package. You can install these with the following command: ``` sudo yum install policycoreutils policycoreutils-python ``` A file or directory's current context can be checked by executing `ls` with the `--context` or `--scontext` options. ### Setting the File Context for the Data Directory If you use a custom directory for `[datadir](../server-system-variables/index#datadir)`, then you may need to set the file context for that directory. The SELinux file context for MariaDB data files is `mysqld_db_t`. You can determine if this file context is present on your system and which files or directories it is associated with by executing the following command: ``` sudo semanage fcontext --list | grep mysqld_db_t ``` If you would like to set the file context for your custom directory for your `[datadir](../server-system-variables/index#datadir)`, then that can be done by executing the `[semanage fcontext](https://linux.die.net/man/8/semanage)` and `[restorecon](https://linux.die.net/man/8/restorecon)` commands. For example: ``` sudo semanage fcontext -a -t mysqld_db_t "/mariadb/data(/.*)?" sudo restorecon -Rv /mariadb/data ``` If you would like to check the current file context, you can do so by by executing `ls` with the `--context` or `--scontext` options. For example: ``` ls --directory --scontext /mariadb/data ``` ### Setting the File Context for Log Files If you use a custom directory for [log files](../server-monitoring-logs/index), then you may need to set the file context for that directory. The SELinux file context for MariaDB [log files](../server-monitoring-logs/index) is `mysqld_log_t`. You can determine if this file context is present on your system and which files or directories it is associated with by executing the following command: ``` sudo semanage fcontext --list | grep mysqld_log_t ``` If you would like to set the file context for your custom directory for [log files](../server-monitoring-logs/index), then that can be done by executing the `[semanage fcontext](https://linux.die.net/man/8/semanage)` and `[restorecon](https://linux.die.net/man/8/restorecon)` commands. For example: ``` sudo semanage fcontext -a -t mysqld_log_t "/var/log/mysql(/.*)?" sudo restorecon -Rv /var/log/mysql ``` If you would like to check the current file context, you can do so by by executing `ls` with the `--context` or `--scontext` options. For example: ``` ls --directory --scontext /var/log/mysql ``` ### Setting the File Context for Option Files If you use a custom directory for [option files](../configuring-mariadb-with-option-files/index), then you may need to set the file context for that directory. The SELinux file context for MariaDB [option files](../configuring-mariadb-with-option-files/index) is `mysqld_etc_t`. You can determine if this file context is present on your system and which files or directories it is associated with by executing the following command: ``` sudo semanage fcontext --list | grep mysqld_etc_t ``` If you would like to set the file context for your custom directory for [option files](../configuring-mariadb-with-option-files/index), then that can be done by executing the `[semanage fcontext](https://linux.die.net/man/8/semanage)` and `[restorecon](https://linux.die.net/man/8/restorecon)` commands. For example: ``` sudo semanage fcontext -a -t mysqld_etc_t "/etc/mariadb(/.*)?" sudo restorecon -Rv /etc/mariadb ``` If you would like to check the current file context, you can do so by by executing `ls` with the `--context` or `--scontext` options. For example: ``` ls --directory --scontext /etc/mariadb ``` ### Allowing Access to the Tmpfs File Context If you wanted to mount your `[tmpdir](../server-system-variables/index#tmpdir)` on a `tmpfs` file system or wanted to use a `tmpfs` file system on `/run/shm`, then you might need to allow `mysqld_t` to have access to a couple tmpfs-related file contexts. For example: ``` cd /usr/share/mysql/policy/selinux/ tee ./mysqld_tmpfs.te <<EOF module mysqld_tmpfs 1.0; require { type tmpfs_t; type mysqld_t; class dir { write search read remove_name open getattr add_name }; class file { write getattr read lock create unlink open }; } allow mysqld_t tmpfs_t:dir { write search read remove_name open getattr add_name }; allow mysqld_t tmpfs_t:file { write getattr read lock create unlink open } EOF sudo checkmodule -M -m mysqld_tmpfs.te -o mysqld_tmpfs.mod sudo semodule_package -m mysqld_tmpfs.mod -o mysqld_tmpfs.pp sudo semodule -i mysqld_tmpfs.pp ``` Troubleshooting SELinux Issues ------------------------------ You might need to troubleshoot SELinux-related issues in cases, such as: * MariaDB is using a non-default port. * MariaDB is reading from or writing to some files (datadir, log files, option files, etc.) located at non-default paths. * MariaDB is using a plugin that requires access to resources that default installations do not use. ### File System Permission Errors If the file system permissions for some MariaDB directory look fine, but the MariaDB [error log](../error-log/index) still has errors that look similar to the following: ``` 130321 11:50:51 mysqld_safe Starting mysqld daemon with databases from /datadir ... 2013-03-21 11:50:52 2119 [Warning] Can't create test file /datadir/ 2013-03-21 11:50:52 2119 [Warning] Can't create test file /datadir/ ... 2013-03-21 11:50:52 2119 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/datadir/boxy.pid' (Errcode: 13 - Permission denied) 2013-03-21 11:50:52 2119 [ERROR] Can't start server: can't create PID file: Permission denied 130321 11:50:52 mysqld_safe mysqld from pid file /datadir/boxy.pid ended ``` Then check SELinux's `/var/log/audit/audit.log` for log entries that look similar to the following: ``` type=AVC msg=audit(1363866652.030:24): avc: denied { write } for pid=2119 comm="mysqld" name="datadir" dev=dm-0 ino=394 scontext=unconfined_u:system_r:mysqld_t:s0 tcontext=unconfined_u:object_r:default_t:s0 tclass=dir ``` If you see any entries that look similar to this, then you most likely need to adjust the file contexts for some files or directories. See [Setting File Contexts](#setting-file-contexts) for more information on how to do that. ### SELinux and MariaDB On a Different Port TCP and UDP ports are enabled for permission to bind too. If you are using a different port, or some Galera ports, configure SELinux to be able to use those ports: ``` sudo semanage port -a -t mysqld_port_t -p tcp 3307 ``` ### Generating SELinux Policies with audit2allow In some cases, a MariaDB system might need non-standard policies. It is possible to create these policies from the SELinux audit log using the `[audit2allow](https://linux.die.net/man/1/audit2allow)` utility. The `[semanage](https://linux.die.net/man/8/semanage)` and `[semodule](https://linux.die.net/man/8/semodule)` utilities will also be needed. On many systems, the `[audit2allow](https://linux.die.net/man/1/audit2allow)` and `[semanage](https://linux.die.net/man/8/semanage)` utilities are installed by the `policycoreutils-python` package, and the `[semodule](https://linux.die.net/man/8/semodule)` utility is installed by the `policycoreutils` package. You can install these with the following command: ``` sudo yum install policycoreutils policycoreutils-python ``` The following process can be used to generate a policy from the audit log: * Remove dontaudits from the policy: ``` sudo semodule -DB ``` * Temporarily put `mysqld_t` into permissive mode. For example: ``` sudo semanage permissive -a mysqld_t ``` * [Start MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). * Do whatever was causing SELinux errors. * Use the generated audit log to create a policy: ``` sudo grep mysqld /var/log/audit/audit.log | audit2allow -M mariadb_local sudo semodule -i mariadb_local.pp ``` * Pull `mysqld_t` out of permissive mode. For example: ``` sudo semanage permissive -d mysqld_t ``` * Restore dontaudits for the policy: ``` sudo setmodule -B ``` The same procedure can be used if MariaDB starts but SELinux prevents it from functioning correctly. For example, SELinux may prevent [PAM plugin](../pam-authentication-plugin/index) from authenticating users. The solution is the same — enable auditing, switch to permissive, do, whatever SELinux didn't allow you to, create a policy from the audit log. When you discover any needed SELinux permissions, please report the needed permissions to your operating system bug tracking so all users can benefit from your work (e.g. Red Hat Bugzilla <https://bugzilla.redhat.com/>). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Numeric Data Type Overview Numeric Data Type Overview ========================== There are a number of numeric data types: * [TINYINT](../tinyint/index) * [BOOLEAN](../boolean/index) - Synonym for TINYINT(1) * [INT1](../int1/index) - Synonym for TINYINT * [SMALLINT](../smallint/index) * [INT2](../int2/index) - Synonym for SMALLINT * [MEDIUMINT](../mediumint/index) * [INT3](../int3/index) - Synonym for MEDIUMINT * [INT](../int/index), INTEGER * [INT4](../int4/index) - Synonym for INT * [BIGINT](../bigint/index) * [INT8](../int8/index) - Synonym for BIGINT * [DECIMAL](../decimal/index), DEC, NUMERIC, FIXED * [FLOAT](../float/index) * [DOUBLE](../double/index), DOUBLE PRECISION, REAL * [BIT](../bit/index) See the specific articles for detailed information on each. SIGNED, UNSIGNED and ZEROFILL ----------------------------- Most numeric types can be defined as `SIGNED`, `UNSIGNED` or `ZEROFILL`, for example: ``` TINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL] ``` If `SIGNED`, or no attribute, is specified, a portion of the numeric type will be reserved for the sign (plus or minus). For example, a TINYINT SIGNED can range from -128 to 127. If `UNSIGNED` is specified, no portion of the numeric type is reserved for the sign, so for integer types range can be larger. For example, a TINYINT UNSIGNED can range from 0 to 255. Floating point and fixed-point types also can be `UNSIGNED`, but this only prevents negative values from being stored and doesn't alter the range. If `ZEROFILL` is specified, the column will be set to UNSIGNED and the spaces used by default to pad the field are replaced with zeros. `ZEROFILL` is ignored in expressions or as part of a [UNION](../union/index). `ZEROFILL` is a non-standard MySQL and MariaDB enhancement. Note that although the preferred syntax indicates that the attributes are exclusive, more than one attribute can be specified. Until [MariaDB 10.2.7](https://mariadb.com/kb/en/mariadb-1027-release-notes/) ([MDEV-8659](https://jira.mariadb.org/browse/MDEV-8659)), any combination of the attributes could be used in any order, with duplicates. In this case: * the presence of `ZEROFILL` makes the column `UNSIGNED ZEROFILL`. * the presence of `UNSIGNED` makes the column `UNSIGNED`. From [MariaDB 10.2.8](https://mariadb.com/kb/en/mariadb-1028-release-notes/), only the following combinations are supported: * `SIGNED` * `UNSIGNED` * `ZEROFILL` * `UNSIGNED ZEROFILL` * `ZEROFILL UNSIGNED` The latter two should be replaced with simply `ZEROFILL`, but are still accepted by the parser. ### Examples ``` CREATE TABLE zf ( i1 TINYINT SIGNED, i2 TINYINT UNSIGNED, i3 TINYINT ZEROFILL ); INSERT INTO zf VALUES (2,2,2); SELECT * FROM zf; +------+------+------+ | i1 | i2 | i3 | +------+------+------+ | 2 | 2 | 002 | +------+------+------+ ``` Range ----- When attempting to add a value that is out of the valid range for the numeric type, MariaDB will react depending on the [strict SQL\_MODE](../sql-mode/index#strict-mode) setting. If [strict\_mode](../sql-mode/index#strict-mode) has been set (the default from [MariaDB 10.2.4](https://mariadb.com/kb/en/mariadb-1024-release-notes/)), MariaDB will return an error. If [strict\_mode](../sql-mode/index#strict-mode) has not been set (the default until [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)), MariaDB will adjust the number to fit in the field, returning a warning. ### Examples With strict\_mode set: ``` SHOW VARIABLES LIKE 'sql_mode'; +---------------+-------------------------------------------------------------------------------------------+ | Variable_name | Value | +---------------+-------------------------------------------------------------------------------------------+ | sql_mode | STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +---------------+-------------------------------------------------------------------------------------------+ CREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED); INSERT INTO ranges VALUES (257,257,257); ERROR 1264 (22003): Out of range value for column 'i1' at row 1 SELECT * FROM ranges; Empty set (0.10 sec) ``` With strict\_mode unset: ``` SHOW VARIABLES LIKE 'sql_mode%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | sql_mode | | +---------------+-------+ CREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED); INSERT INTO ranges VALUES (257,257,257); Query OK, 1 row affected, 2 warnings (0.00 sec) SHOW WARNINGS; +---------+------+---------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------+ | Warning | 1264 | Out of range value for column 'i1' at row 1 | | Warning | 1264 | Out of range value for column 'i3' at row 1 | +---------+------+---------------------------------------------+ 2 rows in set (0.00 sec) SELECT * FROM ranges; +------+------+------+ | i1 | i2 | i3 | +------+------+------+ | 127 | 257 | 255 | +------+------+------+ ``` Auto\_increment --------------- The `AUTO_INCREMENT` attribute can be used to generate a unique identity for new rows. For more details, see [auto\_increment](../auto_increment/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb MEDIUMTEXT MEDIUMTEXT ========== Syntax ------ ``` MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name] ``` Description ----------- A [TEXT](../text/index) column with a maximum length of 16,777,215 (`224 - 1`) characters. The effective maximum length is less if the value contains multi-byte characters. Each MEDIUMTEXT value is stored using a three-byte length prefix that indicates the number of bytes in the value. See Also -------- * [TEXT](../text/index) * [BLOB and TEXT Data Types](../blob-and-text-data-types/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Setup Guide Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Setup Guide ==================================================================================== Overview -------- MariaDB contains a robust, full instance, at-rest encryption. This feature uses a flexible plugin interface to allow actual encryption to be done using a key management approach that meets the customer's needs. MariaDB Server, starting with [MariaDB 10.2](../what-is-mariadb-102/index), includes a plugin that uses the Amazon Web Services (AWS) Key Management Service (KMS) to facilitate separation of responsibilities and remote logging & auditing of key access requests. Rather than storing the encryption key in a local file, this plugin keeps the master key in AWS KMS. When you first start MariaDB, the AWS KMS plugin will connect to the AWS Key Management Service and ask it to generate a new key. MariaDB will store that key on-disk in an encrypted form. The key stored on-disk cannot be used to decrypt the data; rather, on each startup, MariaDB connects to AWS KMS and has the service decrypt the locally-stored key(s). The decrypted key is stored in-memory as long as the MariaDB server process is running, and that in-memory decrypted key is used to encrypt the local data. This guide is based on CentOS 7, using systemd with SELinux enabled. Some steps will differ if you use other operating systems or configurations. Installing the Plugin's Package ------------------------------- The AWS Key Management plugin depends on the [AWS SDK for C++](https://github.com/aws/aws-sdk-cpp), which uses the [Apache License, Version 2.0](https://github.com/aws/aws-sdk-cpp/blob/master/LICENSE). This license is not compatible with MariaDB Server's [GPL 2.0 license](../mariadb-license/index), so we are not able to distribute packages that contain the AWS Key Management plugin. Therefore, the only way to currently obtain the plugin is to install it from source. ### Installing from Source When [compiling MariaDB from source](../compiling-mariadb-from-source/index), the AWS Key Management plugin is not built by default in [MariaDB 10.1](../what-is-mariadb-101/index), but it is built by default in [MariaDB 10.2](../what-is-mariadb-102/index) and later, on systems that support it. Compilation is controlled by the `-DPLUGIN_AWS_KEY_MANAGEMENT=DYNAMIC -DAWS_SDK_EXTERNAL_PROJECT=1` [cmake](../generic-build-instructions/index#using-cmake) arguments. The plugin uses [AWS C++ SDK](https://github.com/awslabs/aws-sdk-cpp), which introduces the following restrictions: * The plugin can only be built on Windows, Linux and macOS. * The plugin requires that one of the following compilers is used: `gcc` 4.8 or later, `clang` 3.3 or later, Visual Studio 2013 or later. * On Unix, the `libcurl` development package (e.g. `libcurl3-dev` on Debian Jessie), `uuid` development package and `openssl` need to be installed. * You may need to use a newer version of [cmake](../generic-build-instructions/index#using-cmake) than is provided by default in your OS. Installing the Plugin --------------------- Even after the package that contains the plugin's shared library is installed on the operating system, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing [INSTALL SONAME](../install-soname/index) or [INSTALL PLUGIN](../install-plugin/index). For example: ``` INSTALL SONAME 'aws_key_management'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the [--plugin-load](../mysqld-options/index#-plugin-load) or the [--plugin-load-add](../mysqld-options/index#-plugin-load-add) options. This can be specified as a command-line argument to [mysqld](../mysqld-options/index) or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = aws_key_management ``` Sign up for Amazon Web Services ------------------------------- If you already have an AWS account, you can skip this section. 1. Load <http://aws.amazon.com/>. 2. Click "Create a Free Account" and complete the steps. 3. You'll need to enter credit card information. Charges related only to your use of the AWS KMS service should be limited to about $1/month for the single master key we will create. If you use other services, additional charges may apply. Consult AWS Cloud Pricing Principles <https://aws.amazon.com/pricing/> for more information about pricing of AWS services. 4. You'll need to complete the AWS identify verification process. Create an IAM User and/or Role ------------------------------ After creating an account or logging in to an existing account, follow these steps to create an IAM User or Role with restricted privileges that will use (but not administer) your master encryption key. If you intend to run MariaDB Server on an EC2 instance, you should create a Role (or modify an existing Role already attached to your instance). If you intent to run MariaDB Server outside of AWS, you may want to create a User. ### Creating an IAM Role 1. Load the Identity and Access Management Console at <https://console.aws.amazon.com/iam/>. 2. Click "Roles" in the left-hand sidebar 3. Click "Create new role" 4. Select "AWS Service Role" 5. Click the "Select" button next to "Amazon EC2 / Allows EC2 instances to call AWS services on your behalf." 6. Do not select any policies on the "Attach Policy" screen. Click "Next Step" 7. Click "Next Step" 8. Give your Role a "Role name" 9. Click "Create role" ### Creating an IAM User 1. Load the Identity and Access Management Console at <https://console.aws.amazon.com/iam/>. 2. Click "Users" in the left-hand sidebar. [![](https://mariadb.com/kb/en/key-management-and-encryption-plugins-amazon-web-services-aws-key-managemen/+image/aws-kms-create-new-user)](https://mariadb.com/kb/en/mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/+image/aws-kms-create-new-user) 3. Click the "Create New Users" button 4. Enter a single User Name of your choosing. We'll use "MDBEnc" for this demonstration. Keep the "Generate an access key for each user" box checked. 5. Click "Create". 6. Click "Show User Security Credentials". 7. Copy the Access Key ID and Secret Access Key. Optionally, you can click "Download Credentials". We will need these in order for local programs to interact with AWS using its API. [![](https://mariadb.com/kb/en/key-management-and-encryption-plugins-amazon-web-services-aws-key-managemen/+image/aws-kms-copy-security-credentials)](https://mariadb.com/kb/en/mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/+image/aws-kms-copy-security-credentials) 8. Create a file on your computer to hold the credentials for this user. We'll use this file later. It should have this structure: ``` [default] aws_access_key_id = AKIAIG6IZ6TKF52FVV5A aws_secret_access_key = o7CEf7KhZfsVF9cS0a2roqqZNmuzXtIR869zpSBT ``` 9. Click "Close". If prompted because you did not Download Credentials, ensure that you've saved them somewhere, and click "Close". Create a Master Encryption Key ------------------------------ Now, we'll create a master encryption key. This key can *never* be retrieved by *any* application or user. This key is used remotely to encrypt (and decrypt) the actual encryption keys that will be used by MariaDB. If this key is deleted or you lose access to it, you will be unable to use the contents of your MariaDB data directory. 1. Click "Encryption Keys" in the left-hand sidebar. 2. Click the "Get Started Now" button. 3. Use the "Filter" dropdown to choose the region where you'd like to create your master key. 4. Click the "Create Key" button. [![](https://mariadb.com/kb/en/key-management-and-encryption-plugins-amazon-web-services-aws-key-managemen/+image/aws-kms-create-key)](https://mariadb.com/kb/en/mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/+image/aws-kms-create-key) 5. Enter an Alias and Description of your choosing. 6. Click "Next Step". 7. Do **not** check the box to make your IAM Role or IAM User user a Key Administrator. 8. Click "Next Step" again. 9. Check the boxes to give your IAM Role and/or IAM User permissions to use this key. [![](https://mariadb.com/kb/en/key-management-and-encryption-plugins-amazon-web-services-aws-key-managemen/+image/aws-kms-key-usage-permissions)](https://mariadb.com/kb/en/mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/+image/aws-kms-key-usage-permissions) 10. Click "Next Step". 11. Click "Finish". You should now see your key listed in the console: [![](https://mariadb.com/kb/en/key-management-and-encryption-plugins-amazon-web-services-aws-key-managemen/+image/aws-kms-key-list-console)](https://mariadb.com/kb/en/mariadb-enterprise-aws-kms-encryption-plugin-setup-guide/+image/aws-kms-key-list-console) You'll use the "Alias" you provided when you configure MariaDB later. We now have a Customer Master Key and an IAM user that has privileges to access it using access credentials. This is enough to begin using the AWS KMS plugin. Configure AWS Credentials ------------------------- There are a number of ways to give the IAM credentials to the AWS KMS plugin. The plugin supports reading credentials from all standard locations used across the various AWS API clients. The easiest approach is to run MariaDB Server in an EC2 instance that has an IAM Role with User access to the CMK you wish to use. You can give key access privileges to a Role already attached to your EC2 instance, or you can create a new IAM Role and attach it to an already-running EC2 instance. If you've done that, no further credentials management is required and you do not need to create a `credentials` file. If you're not running MariaDB Server on an EC2 instance, you can also place the credentials in the MariaDB data directory. The AWS API client looks for a `credentials` file in the `.aws` subdirectory of the home directory of the user running the client process. In the case of MariaDB, its home directory is its `datadir`. 1. Create a `credentials` file that MariaDB can read. Use the region you selected when creating the key. Master keys cannot be used across regions. For example: ``` $ cat /var/lib/mysql/.aws/credentials [default] aws_access_key_id = AKIAIG6IZ6TKF52FVV5A aws_secret_access_key = o7CEf7KhZfsVF9cS0a2roqqZNmuzXtIR869zpSBT region = us-east-1 ``` 2. Change the permissions of the file so that it it is owned by, and can only be read by, the `mysql` user: ``` chown mysql /var/lib/mysql/.aws/credentials chmod 600 /var/lib/mysql/.aws/credentials ``` Configure MariaDB ----------------- 1. Create a new option file to tell MariaDB to enable encryption functionality and to use the AWS KMS plugin. Create a new file under `/etc/my.cnf.d/` (or wherever your OS may have you create such files) with contents like this: ``` [mariadb] plugin_load_add = aws_key_management aws-key-management = FORCE_PLUS_PERMANENT aws-key-management-master-key-id = alias/mariadb-encryption aws-key-management-region = us-east-1 !include /etc/my.cnf.d/enable_encryption.preset ``` 1. Append the "Alias" value you copied above to `alias/` to use as the value for the `aws-key-management-master-key-id` option. Note that you **must** include `aws-key-management-region` in your .cnf file if you are not using the us-east-1 region. Now, you have told MariaDB to use the AWS KMS plugin and you've put credentials for the plugin in a location where the plugin will find them. The /etc/my.cnf.d/enable\_encryption.preset file contains a set of options that enable all available encryption functionality. When you start MariaDB, the AWS KMS plugin will connect to the AWS Key Management Service and ask it to generate a new key. MariaDB will store that key on-disk in an encrypted form. The key stored on-disk cannot be used to decrypt the data; rather, on each startup, MariaDB must connect to AWS KMS and have the service decrypt the locally-stored key. The decrypted version is stored in-memory as long as the MariaDB server process is running, and that in-memory decrypted key is used to encrypt the local data. ### SELinux and Outbound Connections from MariaDB Because MariaDB needs to connect to the AWS KMS service, you must ensure that the host has outbound network connectivity over port 443 to AWS and you must ensure that local policies allow the MariaDB server process to make those outbound connections. By default, SELinux restricts MariaDB from making such connections. The most simple way to cause SELinux to allow outbound HTTPS connections from MariaDB is to enable to mysql\_connect\_any boolean, like this: ``` setsebool -P mysql_connect_any 1 ``` There are more complex alternatives that have a more granular effect, but those are beyond the scope of this document. Start MariaDB ------------- Start MariaDB using the `systemctl` tool: ``` systemctl start mariadb ``` If you do not use systemd, you may have to start MariaDB using some other mechanism. You should see journal output similar to this: ``` # journalctl --no-pager -o cat -u mariadb.service [Note] /usr/sbin/mysqld (mysqld 10.1.9-MariaDB-enterprise-log) starting as process 19831 ... [Note] AWS KMS plugin: generated encrypted datakey for key id=1, version=1 [Note] AWS KMS plugin: loaded key 1, version 1, key length 128 bit [Note] InnoDB: Using mutexes to ref count buffer pool pages [Note] InnoDB: The InnoDB memory heap is disabled [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins [Note] InnoDB: Memory barrier is not used [Note] InnoDB: Compressed tables use zlib 1.2.7 [Note] InnoDB: Using CPU crc32 instructions [Note] InnoDB: Initializing buffer pool, size = 2.0G [Note] InnoDB: Completed initialization of buffer pool [Note] InnoDB: Highest supported file format is Barracuda. [Note] InnoDB: 128 rollback segment(s) are active. [Note] InnoDB: Waiting for purge to start [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 1616819 [Note] InnoDB: Dumping buffer pool(s) not yet started [Note] Plugin 'FEEDBACK' is disabled. [Note] AWS KMS plugin: generated encrypted datakey for key id=2, version=1 [Note] AWS KMS plugin: loaded key 2, version 1, key length 128 bit [Note] Using encryption key id 2 for temporary files [Note] Server socket created on IP: '::'. [Note] Reading of all Master_info entries succeded [Note] Added new Master_info '' to hash table [Note] /usr/sbin/mysqld: ready for connections. ``` Note the several lines of output that refer explicitly to the "AWS KMS plugin". You can see that the plugin generates a "datakey", loads that data key, and then later generates and loads a second data key. The 2nd data key is used to encrypt temporary files and temporary tables. You can see the encrypted keys stored on-disk in the datadir: ``` # ls -l /var/lib/mysql/aws* -rw-rw----. 1 mysql mysql 188 Feb 25 18:55 /var/lib/mysql/aws-kms-key.1.1 -rw-rw----. 1 mysql mysql 188 Feb 25 18:55 /var/lib/mysql/aws-kms-key.2.1 ``` Note that those keys are not useful alone. They are encrypted. When MariaDB starts up, the AWS KMS plugin decrypts those keys by interacting with AWS KMS. For maximum security, you should start from an empty datadir and run `mysql_install_db` after configuring encryption. Then you should re-import your data so that it is fully encrypted. Use `sudo` to run `mysql_install_db` so that it finds your credentials file: ``` # sudo -u mysql mysql_install_db Installing MariaDB/MySQL system tables in '/var/lib/mysql' ... 2016-02-25 23:16:06 139731553998976 [Note] /usr/sbin/mysqld (mysqld 10.1.11-MariaDB-enterprise-log) starting as process 39551 ... 2016-02-25 23:16:07 139731553998976 [Note] AWS KMS plugin: generated encrypted datakey for key id=1, version=1 2016-02-25 23:16:07 139731553998976 [Note] AWS KMS plugin: loaded key 1, version 1, key length 128 bit ... ``` Create Encrypted Tables ----------------------- With `innodb-encrypt-tables=ON`, new InnoDB tables will be encrypted by default, using the key ID set in `innodb_default_encryption_key_id` (default 1). With `innodb-encrypt-tables=FORCE` enabled, it is not possible to manually bypass encryption when creating a table. You can cause the AWS KMS plugin to create new encryption keys at-will by specifying a new ENCRYPTION\_KEY\_ID when creating a table: ``` MariaDB [test]> create table t1 (id serial, v varchar(32)) ENCRYPTION_KEY_ID=3; Query OK, 0 rows affected (0.91 sec) ``` ``` [Note] AWS KMS plugin: generated encrypted datakey for key id=3, version=1 [Note] AWS KMS plugin: loaded key 3, version 1, key length 128 bit ``` ``` # ls -l /var/lib/mysql/aws* -rw-rw----. 1 mysql mysql 188 Feb 25 18:55 /var/lib/mysql/aws-kms-key.1.1 -rw-rw----. 1 mysql mysql 188 Feb 25 18:55 /var/lib/mysql/aws-kms-key.2.1 -rw-rw----. 1 mysql mysql 188 Feb 25 19:10 /var/lib/mysql/aws-kms-key.3.1 ``` Read more about encrypting data in the [Data at Rest Encryption](../data-at-rest-encryption/index#encrypting-data) section of the MariaDB Documentation. AWS KMS Plugin Option Reference ------------------------------- * `aws_key_management_master_key_id`: AWS KMS Customer Master Key ID (ARN or alias prefixed by `alias/`) for master encryption key. Used to create new data keys. If not set, no new data keys will be created. * `aws_key_management_rotate_key`: Set this variable to a data key ID to perform rotation of the key to the master key given in `aws_key_management_master_key_id`. Specify -1 to rotate all keys. * `aws_key_management_key_spec`: Encryption algorithm used to create new keys. Allowed values are AES\_128 (default) or AES\_256. * `aws_key_management_log_level`: Logging for AWS API. Allowed values, in increasing verbosity, are "Off" (default), "Fatal", "Error", "Warn", "Info", "Debug", and "Trace". Next Steps ---------- For more information about advanced usage, including strategies to manage credentials, enforce separation of responsibilities, and even require 2-factor authentication to start your MariaDB server, please review [Amazon Web Services (AWS) Key Management Service (KMS) Encryption Plugin Advanced Usage](../aws-key-management-encryption-plugin-advanced-usage/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Getting Started with MyRocks Getting Started with MyRocks ============================ **MariaDB starting with [10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/)**The MyRocks storage engine was first released in [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/). MyRocks is a storage engine that adds the RocksDB database to MariaDB. RocksDB is an LSM database with a great compression ratio that is optimized for flash storage. The storage engine must be installed before it can be used. Installing the Plugin's Package ------------------------------- The MyRocks storage engine's shared library is included in MariaDB packages as the `ha_rocksdb.so` or `ha_rocksdb.dll` shared library on systems where it can be built. The plugin was first included in [MariaDB 10.2.5](https://mariadb.com/kb/en/mariadb-1025-release-notes/). ### Installing on Linux The MyRocks storage engine is included in [binary tarballs](../installing-mariadb-binary-tarballs/index) on Linux. #### Installing with a Package Manager The MyRocks storage engine can also be installed via a package manager on Linux. In order to do so, your system needs to be configured to install from one of the MariaDB repositories. You can configure your package manager to install it from MariaDB Corporation's MariaDB Package Repository by using the [MariaDB Package Repository setup script](../mariadb-package-repository-setup-and-usage/index). You can also configure your package manager to install it from MariaDB Foundation's MariaDB Repository by using the [MariaDB Repository Configuration Tool](https://downloads.mariadb.org/mariadb/repositories/). ##### Installing with yum/dnf On RHEL, CentOS, Fedora, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[yum](../yum/index)` or `[dnf](https://en.wikipedia.org/wiki/DNF_(software))`. Starting with RHEL 8 and Fedora 22, `yum` has been replaced by `dnf`, which is the next major version of `yum`. However, `yum` commands still work on many systems that use `dnf`. For example: ``` sudo yum install MariaDB-rocksdb-engine ``` ##### Installing with apt-get On Debian, Ubuntu, and other similar Linux distributions, it is highly recommended to install the relevant [DEB package](../installing-mariadb-deb-files/index) from MariaDB's repository using `[apt-get](https://wiki.debian.org/apt-get)`. For example: ``` sudo apt-get install mariadb-plugin-rocksdb ``` ##### Installing with zypper On SLES, OpenSUSE, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[zypper](../installing-mariadb-with-zypper/index)`. For example: ``` sudo zypper install MariaDB-rocksdb-engine ``` ### Installing on Windows The MyRocks storage engine is included in [MSI](../installing-mariadb-msi-packages-on-windows/index) and [ZIP](../installing-mariadb-windows-zip-packages/index) packages on Windows. Installing the Plugin --------------------- Once the shared library is in place, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing `[INSTALL SONAME](../install-soname/index)` or `[INSTALL PLUGIN](../install-plugin/index)`. For example: ``` INSTALL SONAME 'ha_rocksdb'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options. This can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = ha_rocksdb ``` Note: When installed with a package manager, an option file that contains the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` option may also be installed. The RPM package installs it as `/etc/my.cnf.d/rocksdb.cnf`, and the DEB package installs it as `/etc/mysql/mariadb.conf.d/rocksdb.cnf` Uninstalling the Plugin ----------------------- You can uninstall the plugin dynamically by executing `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)`. For example: ``` UNINSTALL SONAME 'ha_rocksdb'; ``` If you installed the plugin by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Verifying the Installation -------------------------- After installing MyRocks you will see RocksDB in the list of plugins: ``` SHOW PLUGINS; +-------------------------------+----------+--------------------+---------------+---------+ | Name | Status | Type | Library | License | +-------------------------------+----------+--------------------+---------------+---------+ ... | ROCKSDB | ACTIVE | STORAGE ENGINE | ha_rocksdb.so | GPL | | ROCKSDB_CFSTATS | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_DBSTATS | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_PERF_CONTEXT | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_PERF_CONTEXT_GLOBAL | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_CF_OPTIONS | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_COMPACTION_STATS | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_GLOBAL_INFO | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_DDL | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_INDEX_FILE_MAP | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_LOCKS | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | | ROCKSDB_TRX | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL | ... +-------------------------------+----------+--------------------+---------------+---------+ ``` Compression ----------- Supported compression types are listed in the [rocksdb\_supported\_compression\_types](../myrocks-system-variables/index#rocksdb_supported_compression_types) variable. For example: ``` SHOW VARIABLES LIKE 'rocksdb_supported_compression_types'; +-------------------------------------+-------------+ | Variable_name | Value | +-------------------------------------+-------------+ | rocksdb_supported_compression_types | Snappy,Zlib | +-------------------------------------+-------------+ ``` See [MyRocks and Data Compression](../myrocks-and-data-compression/index) for more. System and Status Variables --------------------------- All MyRocks [system variables](../myrocks-system-variables/index) and [status variables](../myrocks-status-variables/index) are prefaced with "rocksdb", so you can query them with, for example: ``` SHOW VARIABLES LIKE 'rocksdb%'; SHOW STATUS LIKE 'rocksdb%'; ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb INSTALL SONAME INSTALL SONAME ============== Syntax ------ ``` INSTALL SONAME 'plugin_library' ``` Description ----------- This statement is a variant of [INSTALL PLUGIN](../install-plugin/index). It installs **all** [plugins](../mariadb-plugins/index) from a given `plugin_library`. See [INSTALL PLUGIN](../install-plugin/index) for details. `plugin_library` is the name of the shared library that contains the plugin code. The file name extension (for example, `libmyplugin.so` or `libmyplugin.dll`) can be omitted (which makes the statement look the same on all architectures). The shared library must be located in the plugin directory (that is, the directory named by the `[plugin\_dir](../server-system-variables/index#plugin_dir)` system variable). The library must be in the plugin directory itself, not in a subdirectory. By default, `plugin_dir` is plugin directory under the directory named by the `pkglibdir` configuration variable, but it can be changed by setting the value of `plugin_dir` at server startup. For example, set its value in a `my.cnf` file: ``` [mysqld] plugin_dir=/path/to/plugin/directory ``` If the value of [plugin\_dir](../server-system-variables/index#plugin_dir) is a relative path name, it is taken to be relative to the MySQL base directory (the value of the `basedir` system variable). `INSTALL SONAME` adds one or more lines to the `mysql.plugin` table that describes the plugin. This table contains the plugin name and library file name. `INSTALL SONAME` causes the server to read option (`my.cnf`) files just as during server startup. This enables the plugin to pick up any relevant options from those files. It is possible to add plugin options to an option file even before loading a plugin (if the loose prefix is used). It is also possible to uninstall a plugin, edit `my.cnf`, and install the plugin again. Restarting the plugin this way enables it to the new option values without a server restart. `INSTALL SONAME` also loads and initializes the plugin code to make the plugin available for use. A plugin is initialized by executing its initialization function, which handles any setup that the plugin must perform before it can be used. To use `INSTALL SONAME`, you must have the [INSERT privilege](../grant/index) for the `mysql.plugin` table. At server startup, the server loads and initializes any plugin that is listed in the `mysql.plugin` table. This means that a plugin is installed with `INSTALL SONAME` only once, not every time the server starts. Plugin loading at startup does not occur if the server is started with the `--skip-grant-tables` option. When the server shuts down, it executes the de-initialization function for each plugin that is loaded so that the plugin has a chance to perform any final cleanup. If you need to load plugins for a single server startup when the `--skip-grant-tables` option is given (which tells the server not to read system tables), use the `--plugin-load` [mysqld option](../mysqld-options-full-list/index). If you need to install only one plugin from a library, use the [INSTALL PLUGIN](../install-plugin/index) statement. Examples -------- To load the XtraDB storage engine and all of its `information_schema` tables with one statement, use ``` INSTALL SONAME 'ha_xtradb'; ``` This statement can be used instead of `INSTALL PLUGIN` even when the library contains only one plugin: ``` INSTALL SONAME 'ha_sequence'; ``` See Also -------- * [List of Plugins](../list-of-plugins/index) * [Plugin Overview](../plugin-overview/index) * [SHOW PLUGINS](../show-plugins/index) * [INSTALL PLUGIN](../install-plugin/index) * [UNINSTALL PLUGIN](../uninstall-plugin/index) * [UNINSTALL SONAME](../uninstall-soname/index) * [SHOW PLUGINS](../show-plugins/index) * [INFORMATION\_SCHEMA.PLUGINS Table](../plugins-table-information-schema/index) * [mysql\_plugin](../mysql_plugin/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_INSERT JSON\_INSERT ============ **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**JSON functions were added in [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/). Syntax ------ ``` JSON_INSERT(json_doc, path, val[, path, val] ...) ``` Description ----------- Inserts data into a JSON document, returning the resulting document or NULL if any argument is null. An error will occur if the JSON document is not invalid, or if any of the paths are invalid or contain a `*` or `**` wildcard. JSON\_INSERT can only insert data while [JSON\_REPLACE](../json_replace/index) can only update. [JSON\_SET](../json_set/index) can update or insert data. Examples -------- ``` SET @json = '{ "A": 0, "B": [1, 2]}'; SELECT JSON_INSERT(@json, '$.C', '[3, 4]'); +--------------------------------------+ | JSON_INSERT(@json, '$.C', '[3, 4]') | +--------------------------------------+ | { "A": 0, "B": [1, 2], "C":"[3, 4]"} | +--------------------------------------+ ``` See Also -------- * [JSON video tutorial](https://www.youtube.com/watch?v=sLE7jPETp8g) covering JSON\_INSERT. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb UNCOMPRESS UNCOMPRESS ========== Syntax ------ ``` UNCOMPRESS(string_to_uncompress) ``` Description ----------- Uncompresses a string compressed by the `[COMPRESS()](../compress/index)` function. If the argument is not a compressed value, the result is `NULL`. This function requires MariaDB to have been compiled with a compression library such as zlib. Otherwise, the return value is always `NULL`. The [have\_compress](../server-system-variables/index#have_compress) server system variable indicates whether a compression library is present. Examples -------- ``` SELECT UNCOMPRESS(COMPRESS('a string')); +----------------------------------+ | UNCOMPRESS(COMPRESS('a string')) | +----------------------------------+ | a string | +----------------------------------+ SELECT UNCOMPRESS('a string'); +------------------------+ | UNCOMPRESS('a string') | +------------------------+ | NULL | +------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT - Compiling JSON UDFs in a Separate Library CONNECT - Compiling JSON UDFs in a Separate Library =================================================== Although the JSON UDFs can be nicely included in the CONNECT library module, there are cases when you may need to have them in a separate library. This is when CONNECT is compiled embedded, or if you want to test or use these UDFs with other MariaDB versions not including them. To make it, you need to have access to the most recent MariaDB source code. Then, make a project containing these files: 1. jsonudf.cpp 2. json.cpp 3. value.cpp 4. osutil.c 5. plugutil.cpp 6. maputil.cpp 7. jsonutil.cpp `jsonutil.cpp` is not distributed with the source code, you will have to make it from the following: ``` #include "my_global.h" #include "mysqld.h" #include "plugin.h" #include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> #include "global.h" extern "C" int GetTraceValue(void) { return 0; } uint GetJsonGrpSize(void) { return 100; } /***********************************************************************/ /* These replace missing function of the (not used) DTVAL class. */ /***********************************************************************/ typedef struct _datpar *PDTP; PDTP MakeDateFormat(PGLOBAL, PSZ, bool, bool, int) { return NULL; } int ExtractDate(char*, PDTP, int, int val[6]) { return 0; } #ifdef __WIN__ my_bool CloseFileHandle(HANDLE h) { return !CloseHandle(h); } /* end of CloseFileHandle */ #else /* UNIX */ my_bool CloseFileHandle(HANDLE h) { return (close(h)) ? TRUE : FALSE; } /* end of CloseFileHandle */ int GetLastError() { return errno; } /* end of GetLastError */ #endif // UNIX /***********************************************************************/ /* Program for sub-allocating one item in a storage area. */ /* Note: This function is equivalent to PlugSubAlloc except that in */ /* case of insufficient memory, it returns NULL instead of doing a */ /* long jump. The caller must test the return value for error. */ /***********************************************************************/ void *PlgDBSubAlloc(PGLOBAL g, void *memp, size_t size) { PPOOLHEADER pph; // Points on area header. if (!memp) // Allocation is to be done in the Sarea memp = g->Sarea; size = ((size + 7) / 8) * 8; /* Round up size to multiple of 8 */ pph = (PPOOLHEADER)memp; if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */ sprintf(g->Message, "Not enough memory in Work area for request of %d (used=%d free=%d)", (int)size, pph->To_Free, pph->FreeBlk); return NULL; } // endif size // Do the suballocation the simplest way memp = MakePtr(memp, pph->To_Free); // Points to sub_allocated block pph->To_Free += size; // New offset of pool free block pph->FreeBlk -= size; // New size of pool free block return (memp); } // end of PlgDBSubAlloc ``` You can create the file by copy/paste from the above. Set all the additional include directories to the MariaDB include directories used in plugin compiling plus the reference of the storage/connect directories, and compile like any other UDF giving any name to the made library module (I used `jsonudf.dll` on Windows). Then you can create the functions using this name as the soname parameter. There are some restrictions when using the UDFs this way: * The [connect\_json\_grp\_size](../connect-system-variables/index#connect_json_grp_size) variable cannot be accessed. The group size is set and retrieved using the [jsonset\_grp\_size](../connect-json-table-type/index#jsonset_grp_size) and [jsonget\_grp\_size](../connect-json-table-type/index#jsonget_grp_size) functions (previously 100). * In case of error, warnings are replaced by messages sent to stderr. * No trace. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Non-Blocking Client Library Non-Blocking Client Library ============================ MariaDB client library (starting with version 5.5.21) and MySQL Connector/C (starting with version 2.1.0) supports *non-blocking* operations. | Title | Description | | --- | --- | | [About Non-blocking Operation in the Client Library](../about-non-blocking-operation-in-the-client-library/index) | An introduction to the non-blocking features of the client library. | | [Using the Non-blocking Library](../using-the-non-blocking-library/index) | How to use the non-blocking client library | | [Non-blocking API Reference](../non-blocking-api-reference/index) | A list of all functions in the non-blocking client API, and their parameters | | [JavaScript - mariasql for node.js](../javascript-mariasql-for-nodejs/index) | Using mariasql, a node.js to Bind to Non-Blocking MariaDB Client Library. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WHILE WHILE ===== Syntax ------ ``` [begin_label:] WHILE search_condition DO statement_list END WHILE [end_label] ``` Description ----------- The statement list within a `WHILE` statement is repeated as long as the `search_condition` is true. statement\_list consists of one or more statements. If the loop must be executed at least once, `[REPEAT ... LOOP](../repeat-loop/index)` can be used instead. A `WHILE` statement can be [labeled](../labels/index). end\_label cannot be given unless begin\_label also is present. If both are present, they must be the same. Examples -------- ``` CREATE PROCEDURE dowhile() BEGIN DECLARE v1 INT DEFAULT 5; WHILE v1 > 0 DO ... SET v1 = v1 - 1; END WHILE; END ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Percona XtraBackup Percona XtraBackup =================== In [MariaDB 10.1](../what-is-mariadb-101/index) and later, [Mariabackup](../mariabackup/index) is the recommended backup method to use instead of Percona XtraBackup. In [MariaDB 10.3](../what-is-mariadb-103/index), Percona XtraBackup is **not supported**. See [Percona XtraBackup Overview: Compatibility with MariaDB](../percona-xtrabackup-overview/index#compatibility-with-mariadb) for more information. In [MariaDB 10.2](../what-is-mariadb-102/index) and [MariaDB 10.1](../what-is-mariadb-101/index), Percona XtraBackup is only **partially supported**. See [Percona XtraBackup Overview: Compatibility with MariaDB](../percona-xtrabackup-overview/index#compatibility-with-mariadb) for more information. Open source tool for performing hot backups of MariaDB, MySQL and Percona Server databases. | Title | Description | | --- | --- | | [Percona XtraBackup Overview](../percona-xtrabackup-overview/index) | Open source tool for performing hot backups of MariaDB, MySQL and Percona Server databases. | | [xtrabackup-v2 SST Method](../xtrabackup-v2-sst-method/index) | The xtrabackup-v2 SST method uses the Percona XtraBackup utility for performing SSTs. | | [Manual SST of Galera Cluster Node With Percona XtraBackup](../manual-sst-of-galera-cluster-node-with-percona-xtrabackup/index) | It can be helpful to perform a "manual SST" with Xtrabackup when Galera's normal SSTs fail. | | [Percona XtraBackup Build Instructions](../percona-xtrabackup-build-instructions/index) | Build instructions for Xtrabackup | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Microseconds in MariaDB Microseconds in MariaDB ======================= The [TIME](../time/index), [DATETIME](../datetime/index), and [TIMESTAMP](../timestamp/index) types, along with the temporal functions, [CAST](../cast/index) and [dynamic columns](../dynamic-columns/index), support microseconds. The datetime precision of a column can be specified when creating the table with [CREATE TABLE](../create-table/index), for example: ``` CREATE TABLE example( col_microsec DATETIME(6), col_millisec TIME(3) ); ``` Generally, the precision can be specified for any `TIME`, `DATETIME`, or `TIMESTAMP` column, in parentheses, after the type name. The datetime precision specifies number of digits after the decimal dot and can be any integer number from 0 to 6. If no precision is specified it is assumed to be 0, for backward compatibility reasons. A datetime precision can be specified wherever a type name is used. For example: * when declaring arguments of stored routines. * when specifying a return type of a stored function. * when declaring variables. * in a `CAST` function: ``` create function example(x datetime(5)) returns time(4) begin declare y timestamp(6); return cast(x as time(2)); end; ``` `%f` is used as the formatting option for microseconds in the [STR\_TO\_DATE](../str_to_date/index), [DATE\_FORMAT](../date_format/index) and [FROM\_UNIXTIME](../from_unixtime/index) functions, for example: ``` SELECT STR_TO_DATE('20200809 020917076','%Y%m%d %H%i%s%f'); +-----------------------------------------------------+ | STR_TO_DATE('20200809 020917076','%Y%m%d %H%i%s%f') | +-----------------------------------------------------+ | 2020-08-09 02:09:17.076000 | +-----------------------------------------------------+ ``` Additional Information ---------------------- * when comparing anything to a temporal value (`DATETIME`, `TIME`, `[DATE](../date/index)`, or `TIMESTAMP`), both values are compared as temporal values, not as strings. * The [INFORMATION\_SCHEMA.COLUMNS table](../information-schema-columns-table/index) has a new column `DATETIME_PRECISION` * [NOW()](../now/index), [CURTIME()](../curtime/index), [UTC\_TIMESTAMP()](../utc_timestamp/index), [UTC\_TIME()](../utc_time/index), [CURRENT\_TIME()](../current_time/index), [CURRENT\_TIMESTAMP()](../current_timestamp/index), [LOCALTIME()](../localtime/index) and [LOCALTIMESTAMP()](../localtimestamp/index) now accept datetime precision as an optional argument. For example: ``` SELECT CURTIME(4); --> 10:11:12.3456 ``` * [TIME\_TO\_SEC()](../time_to_sec/index) and [UNIX\_TIMESTAMP()](../unix_timestamp/index) preserve microseconds of the argument. These functions will return a [decimal](../decimal/index) number if the result non-zero datetime precision and an [integer](../int/index) otherwise (for backward compatibility). ``` SELECT TIME_TO_SEC('10:10:10.12345'); --> 36610.12345 ``` * Current versions of this patch fix a bug in the following optimization: in certain queries with `DISTINCT` MariaDB can ignore this clause if it can prove that all result rows are unique anyway, for example, when a primary key is compared with a constant. Sometimes this optimization was applied incorrectly, though — for example, when comparing a string with a date constant. This is now fixed. * `DATE_ADD()` and `DATE_SUB()` functions can now take a `TIME` expression as an argument (not just `DATETIME` as before). ``` SELECT TIME('10:10:10') + INTERVAL 100 MICROSECOND; --> 10:10:10.000100 ``` * The `event_time` field in the [mysql.general\_log](../mysqlgeneral_log-table/index) table and the `start_time`, `query_time`, and `lock_time` fields in the [mysql.slow\_log](../mysqlslow_log-table/index) table now store values with microsecond precision. * This patch fixed a bug when comparing a temporal value using the `BETWEEN` operator and one of the operands is `NULL`. * The old syntax `TIMESTAMP(N)`, where `N` is the display width, is no longer supported. It was deprecated in MySQL 4.1.0 (released on 2003-04-03). * when a `DATETIME` value is compared to a `TIME` value, the latter is treated as a full datetime with a zero date part, similar to comparing `DATE` to a `DATETIME`, or to comparing `DECIMAL` numbers. Earlier versions of MariaDB used to compare only the time part of both operands in such a case. * In MariaDB, an extra column `[TIME\_MS](../time_ms-column-in-information_schemaprocesslist/index)` has been added to the `[INFORMATION\_SCHEMA.PROCESSLIST](../information-schema-processlist-table/index)` table, as well as to the output of `[SHOW FULL PROCESSLIST](../show-processlist/index)`. **Note:** When you convert a temporal value to a value with a smaller precision, it will be truncated, not rounded. This is done to guarantee that the date part is not changed. For example: ``` SELECT CAST('2009-12-31 23:59:59.998877' as DATETIME(3)); -> 2009-12-31 23:59:59.998 ``` MySQL 5.6 Microseconds ---------------------- MySQL 5.6 introduced microseconds using a slightly different implementation to [MariaDB 5.3](../what-is-mariadb-53/index). Since [MariaDB 10.1](../what-is-mariadb-101/index), MariaDB has defaulted to the MySQL format, by means of the [--mysql56-temporal-format](../server-system-variables/index#mysql56_temporal_format) variable. The MySQL version requires slightly [more storage](../data-type-storage-requirements/index) but has some advantages in permitting the eventual support of negative dates, and in replication. See Also -------- * [Data Type Storage Requirements](../data-type-storage-requirements/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ps_is_instrument_default_timed ps\_is\_instrument\_default\_timed ================================== Syntax ------ ``` sys.ps_is_instrument_default_timed(instrument) ``` Description ----------- `ps_is_instrument_default_timed` is a [stored function](../stored-functions/index) available with the [Sys Schema](../sys-schema/index). It returns `YES` if the given Performance Schema *instrument* is timed by default, and `NO` if it is not, does not exist, or is a NULL value. Examples -------- ``` SELECT sys.ps_is_instrument_default_timed('statement/sql/select'); +------------------------------------------------------------+ | sys.ps_is_instrument_default_timed('statement/sql/select') | +------------------------------------------------------------+ | YES | +------------------------------------------------------------+ SELECT sys.ps_is_instrument_default_timed('memory/sql/udf_mem'); +----------------------------------------------------------+ | sys.ps_is_instrument_default_timed('memory/sql/udf_mem') | +----------------------------------------------------------+ | NO | +----------------------------------------------------------+ SELECT sys.ps_is_instrument_default_timed('memory/sql/nonexistent'); +-------------------------------------------------------------+ | sys.ps_is_instrument_default_timed('memory/sql/udf_memsds') | +-------------------------------------------------------------+ | NO | +-------------------------------------------------------------+ SELECT sys.ps_is_instrument_default_timed(NULL); +------------------------------------------+ | sys.ps_is_instrument_default_timed(NULL) | +------------------------------------------+ | NO | +------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_IsRing ST\_IsRing ========== **MariaDB starting with [10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/)**The ST\_IsRing function was introduced in [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/) Syntax ------ ``` ST_IsRing(g) IsRing(g) ``` Description ----------- Returns true if a given [LINESTRING](../linestring/index) is a ring, that is, both [ST\_IsClosed](../st_isclosed/index) and [ST\_IsSimple](../st_issimple/index). A simple curve does not pass through the same point more than once. However, see [MDEV-7510](https://jira.mariadb.org/browse/MDEV-7510). `St_IsRing()` and `IsRing()` are synonyms. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT - NoSQL Table Types CONNECT - NoSQL Table Types =========================== They are based on files that do not match the relational format but often represent hierarchical data. CONNECT can handle [JSON](../connect-json-table-type/index), [INI-CFG](../connect-ini-table-type/index), [XML](../connect-xml-table-type/index), and some HTML files. The way it is done is different from what MySQL or PostgreSQL does. In addition to including in a table some column values of a specific data format (JSON, XML) to be handled by specific functions, CONNECT can directly use JSON, XML or INI files that are produced by other applications, and this is the table definition that describes where and how the contained information must be retrieved. This is also different from what MariaDB does with dynamic columns, which is close to what MySQL and PostgreSQL do with the JSON column type. Note: The LEVEL option used with these tables should, from Connect 1.07.0002, be specified as DEPTH. Also, what was specified with the FIELD\_FORMAT column option should now also be specified using JPATH or XPATH. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Installing MariaDB Binary Tarballs Installing MariaDB Binary Tarballs ================================== MariaDB Binary tarballs are named following the pattern: mariadb-VERSION-OS.tar.gz. Be sure to [download](http://downloads.mariadb.org) the correct version for your machine. **Note:** Some binary tarballs are marked *'(GLIBC\_2.14)'* or *'(requires GLIBC\_2.14+)'*. These binaries are built the same as the others, but on a newer build host, and they require GLIBC 2.14 or higher. Use the other binaries for machines with older versions of GLIBC installed. Run `ldd --version` to see which version is running on your distribution. Others are marked *'systemd'*, which are for systems with `systemd` and GLIBC 2.19 or higher. To install the [binaries](http://downloads.mariadb.org), unpack the distribution into the directory of your choice and run the `[mysql\_install\_db](../installing-system-tables-mysql_install_db/index)` script. In the example below we install MariaDB in the `/usr/local/mysql` directory (this is the default location for MariaDB for many platforms). However any other directory should work too. We install the binary with a symlink to the original name. This is done so that you can easily change MariaDB versions just by moving the symlink to point to another directory. **NOTE:** For [MariaDB 5.1.32](https://mariadb.com/kb/en/mariadb-5132-release-notes/) ***only*** the line "`./scripts/mysql_install_db --user=mysql`" should be changed to "`./bin/mysql_install_db --user=mysql`" ### Ensure You Use the Correct my.cnf Files MariaDB searches for the configuration files '`/etc/my.cnf`' (on some systems '`/etc/mysql/my.cnf`') and '`~/.my.cnf`'. If you have an old `my.cnf` file (maybe from a system installation of MariaDB or MySQL) you need to take care that you don't accidentally use the old one with your new binary .tar installation. The normal solution for this is to ignore the `my.cnf` file in `/etc` when you use the programs in the tar file. This is done by [creating your own .my.cnf file](../mysqld-startup-options/index) in your home directory and telling `mysql_install_db`, [mysqld\_safe](../mysqld_safe/index) and possibly [mysql (the command-line client utility)](../mysql-client/index) to **only** use this one with the option '`--defaults-file=~/.my.cnf`'. Note that this has to be first option for the above commands! ### Installing MariaDB as root in /usr/local/mysql If you have root access to the system, you probably want to install MariaDB under the user and group 'mysql' (to keep compatibility with MySQL installations): ``` groupadd mysql useradd -g mysql mysql cd /usr/local tar -zxvpf /path-to/mariadb-VERSION-OS.tar.gz ln -s mariadb-VERSION-OS mysql cd mysql ./scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data ``` The symlinking with `ln -s` is recommended as it makes it easy to install many MariaDB version at the same time (for easy testing, upgrading, downgrading etc). If you are installing MariaDB to replace MySQL, then you can leave out the call to `mysql_install_db`. Instead shut down MySQL. MariaDB should find the path to the data directory from your old `/etc/my.cnf` file (path may vary depending on your system). To start mysqld you should now do: ``` ./bin/mysqld_safe --user=mysql & or ./bin/mysqld_safe --defaults-file=~/.my.cnf --user=mysql & ``` To test connection, modify your $PATH so you can invoke client such as [mysql](../mysql-client/index), [mysqldump](../mysqldump/index), etc. ``` export PATH=$PATH:/usr/local/mysql/bin/ ``` You may want to modify your .bashrc or .bash\_profile to make it permanent. ### Installing MariaDB as Not root in Any Directory Below, change /usr/local to the directory of your choice. ``` cd /usr/local gunzip < /path-to/mariadb-VERSION-OS.tar.gz | tar xf - ln -s mariadb-VERSION-OS mysql cd mysql ./scripts/mysql_install_db --defaults-file=~/.my.cnf ``` If you have problems with the above gunzip command line, you can instead, if you have gnu tar, do: ``` tar xfz /path-to/mariadb-VERSION-OS.tar.gz ``` To start mysqld you should now do: ``` ./bin/mysqld_safe --defaults-file=~/.my.cnf & ``` ### Auto Start of mysqld You can get mysqld (the MariaDB server) to autostart by copying the file `mysql.server` file to the right place. ``` cp support-files/mysql.server /etc/init.d/mysql.server ``` The exact place depends on your system. The `mysql.server` file contains instructions of how to use and fine tune it. For systemd installation the mariadb.service file will need to be copied from the support-files/systemd folder to the /usr/lib/systemd/system/ folder. ``` cp support-files/systemd/mariadb.service /usr/lib/systemd/system/mariadb.service ``` Note that by default the /usr/ directory is write protected by systemd though, so when having the data directory in /usr/local/mysql/data as per the instructions above you also need to make that directory writable. You can do so by adding an extra service include file: ``` mkdir /etc/systemd/system/mariadb.service.d/ cat > /etc/systemd/system/mariadb.service.d/datadir.conf <<EOF [Service] ReadWritePaths=/usr/local/mysql/data EOF systemctl daemon-reload ``` After this you can start and stop the service using ``` systenctl start mariadb.service ``` and ``` systemctl stop mariadb.service ``` respectively. Please refer to the [systemd](../systemd/index) page for further information. ### Post Installation After this, remember to set proper passwords for all accounts accessible from untrusted sources, to avoid exposing the host to security risks! Also consider using the [mysql.server](../mysqlserver/index) to [start MariaDB automatically](../starting-and-stopping-mariadb-automatically/index) when your system boots. On systems using systemd you can instead enable automatic startup during system boot with ``` systemctl enable mariadb.service ``` instead. Our MariaDB binaries are similar to the Generic binaries available for the MySQL binary distribution. So for more options on using these binaries, the MySQL 5.5 manual entry on [installing generic binaries](http://docs.oracle.com/cd/E17952_01/refman-5.5-en/binary-installation.html) can be consulted. For details on the exact steps used to build the binaries, see the [compiling MariaDB section](../compiling-mariadb-from-source/index) of the KB. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB ColumnStore software upgrade 1.0.10 to 1.0.11 MariaDB ColumnStore software upgrade 1.0.10 to 1.0.11 ===================================================== MariaDB ColumnStore software upgrade 1.0.10 to 1.0.11 ----------------------------------------------------- Note: Columnstore.xml modifications you manually made are not automatically carried forward on an upgrade. These modifications will need to be incorporated back into .XML once the upgrade has occurred. The previous configuration file will be saved as /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave. If you have specified a root database password (which is good practice), then you must configure a .my.cnf file with user credentials for the upgrade process to use. Create a .my.cnf file in the user home directory with 600 file permissions with the following content (updating PASSWORD as appropriate): ``` [mysqladmin] user = root password = PASSWORD ``` ### Choosing the type of upgrade As noted on the Preparing guide, you can installing MariaDB ColumnStore with the use of soft-links. If you have the softlinks be setup at the Data Directory Levels, like mariadb/columnstore/data and mariadb/columnstore/dataX, then your upgrade will happen without any issues. In the case where you have a softlink at the top directory, like /usr/local/mariadb, you will need to upgrade using the binary package. If you updating using the rpm package and tool, this softlink will be deleted when you perform the upgrade process and the upgrade will fail. #### Root User Installs #### Upgrading MariaDB ColumnStore using RPMs Upgrade MariaDB ColumnStore as user root on the server designated as PM1: **Download the package mariadb-columnstore-1.0.11-1-centos#.x86\_64.rpm.tar.gz to the PM1 server where you are installing MariaDB ColumnStore.** Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate a set of RPMs that will reside in the /root/ directory. ``` # tar -zxf mariadb-columnstore-1.0.11-1-centos#.x86_64.rpm.tar.gz ``` * Upgrade the RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` # rpm -e --nodeps $(rpm -qa | grep '^mariadb-columnstore') # rpm -ivh mariadb-columnstore-*1.0.11*rpm ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml.rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` For RPM Upgrade, the previous configuration file will be saved as: /usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /usr/local directory -mariadb-columnstore-1.0.11-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # /usr/local/mariadb/columnstore/bin/pre-uninstall ``` * Unpack the tarball, in the /usr/local/ directory. ``` # tar -zxvf -mariadb-columnstore-1.0.11-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # /usr/local/mariadb/columnstore/bin/post-install ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` ### Upgrading MariaDB ColumnStore using the DEB package A DEB upgrade would be done on a system that supports DEBs like Debian or Ubuntu systems. Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /root directory mariadb-columnstore-1.0.11-1.amd64.deb.tar.gz (DEB 64-BIT) to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Unpack the tarball, which will generate DEBs. ``` # tar -zxf mariadb-columnstore-1.0.11-1.amd64.deb.tar.gz ``` * Remove, purge and install all MariaDB ColumnStore debs ``` # cd /root/ # dpkg -r $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg -P $(dpkg --list | grep 'mariadb-columnstore' | awk '{print $2}') # dpkg --install mariadb-columnstore-*1.0.11-1*deb ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # /usr/local/mariadb/columnstore/bin/postConfigure -u ``` #### Non-Root User Installs ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /home/'non-root-user" directory mariadb-columnstore-1.0.11-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Shutdown the MariaDB ColumnStore system: ``` # mcsadmin shutdownsystem y ``` * Run pre-uninstall script ``` # $HOME/mariadb/columnstore/bin/pre-uninstall --installdir= /home/guest/mariadb/columnstore ``` * Unpack the tarball, which will generate the $HOME/ directory. ``` # tar -zxvf -mariadb-columnstore-1.0.11-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # $HOME/mariadb/columnstore/bin/post-install --installdir=/home/guest/mariadb/columnstore ``` * Run postConfigure using the upgrade option, which will utilize the configuration from the Columnstore.xml,rpmsave ``` # $HOME/mariadb/columnstore/bin/postConfigure -u -i /home/guest/mariadb/columnstore ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW PACKAGE STATUS SHOW PACKAGE STATUS =================== **MariaDB starting with [10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/)**Oracle-style packages were introduced in [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/). Syntax ------ ``` SHOW PACKAGE STATUS [LIKE 'pattern' | WHERE expr] ``` Description ----------- The `SHOW PACKAGE STATUS` statement returns characteristics of stored package specifications, such as the database, name, type, creator, creation and modification dates, and character set information. A similar statement, `[SHOW PACKAGE BODY STATUS](../show-package-body-status/index)`, displays information about stored package bodies (i.e. implementations). The `LIKE` clause, if present, indicates which package names to match. The `WHERE` and `LIKE` clauses can be given to select rows using more general conditions, as discussed in [Extended SHOW](../extended-show/index). The [ROUTINES table](../information-schema-routines-table/index) in the INFORMATION\_SCHEMA database contains more detailed information. Examples -------- ``` SHOW PACKAGE STATUS LIKE 'pkg1'\G *************************** 1. row *************************** Db: test Name: pkg1 Type: PACKAGE Definer: root@localhost Modified: 2018-02-27 14:38:15 Created: 2018-02-27 14:38:15 Security_type: DEFINER Comment: This is my first package character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci ``` See Also -------- * [SHOW PACKAGE BODY](../show-package-body-status/index) * [SHOW CREATE PACKAGE](../show-create-package/index) * [CREATE PACKAGE](../create-package/index) * [DROP PACKAGE](../drop-package/index) * [Oracle SQL\_MODE](../sql_modeoracle-from-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Worklog Quality Checklist Template Worklog Quality Checklist Template ================================== The purpose of this template is to produce individual checklists for testing individual Worklogs. Using a checklist ensures that all WLs are treated equally and that all important points are addressed and tested, or at least considered when clearing the WL for merging into a stable release. Inputs ------ *This section lists all sources of information which can be used as inputs to the testing process. The goal is to gather comprehensive information before creating a testing plan* ### Usage scenario *Summarize here the intended use for the feature* ### Design, architecture and specification * **WorkLog number and title:** + *If there is no Worklog, create one or ask one to be created* * **Are HLS and LLS present?** + *If the HLS or LLS sections are missing, add them or ask that they are created* * **Reviewer name:** + *Testing suggestions and concerns should be obtained by the reviewer* * **Customer requirements:** + *Make yourself familiar with any requirements or documents supplied by the customer* * **Other implementations:** + *Make yourself familiar with other implementations of the feature in other database products or flavors of MySQL* ### Testability and observability * **Does the feature have an on/off switch?** + *An on/off switch is required in at least the following situations:* - *A RQG comparison test will be performed in order to validate the feature;* - *The feature may cause a performance degradation for certain queries or usage scenarios;* - *The feature is experimental or of interest to a small number of users;* * **Is the operation of the feature observable?** + *Does the feature leave any traces in SHOW STATUS or EXPLAIN, or in the logs?* ### The patch * **List of modified files:** + *Obtain a list of all modified files from the version control system, to serve as a starting point for identifying areas of risk within the server or potential interactions with other features. A larger number of modified files may indicate larger risk of unforseen interactions;* * **Review comments:** + *Paste a link to the review and read it for any concerns that the reviewer may have raised* * **MTR tests:** + *Does the patch include enough MTR tests?* * **DGCov output:** + *Generate a report or obtain it from a developer and make sure it is acceptable for all parties* ### Feedback from interested parties * **Feedback from developer:** + *Paste here any useful information provided by the developer in informal discussions, emails or chat* + *Make sure any concerns raised by the developer are recorded in this document* * **Feedback from reviewer:** + *Paste here any discussions with the reviewer related to concerns, risks or testing, if not included in the formal review comments for the patch itself* * **Feedback from customer:** + *Summarize here any relevant discussions with the customer* ### Query Patterns *If the feature relates to the optimization of a particular set of queries, provide here examples that were extracted from the sources of information listed above, in particular the Worklog and any MTR test cases provided with the patch* Risks ----- *This section lists any risks inherent to the Worklog, as identified by reviewing the inputs mentioned* ### Refactoring * **Areas that have been refactored:** + *List areas that have been refactored in order to accommodate the new functionality* ### Interactions * **Areas of potential interaction:** + *List areas in the server that may have an interaction with the feature* * **Does the feature contain engine-specific code, hooks or hacks?** + *List any engine-specific considerations there may be* * **Does the feature define a new API?** * **Does the feature relate to transactions or transactional integrity?** + *If yes, is testing required on all storage engines, or using cross-engine transactions or binlog involvement?* * **Does the feature relate to any of the core server features?** + *Do we need to test with views, triggers, stored procedures, functions, events, partitions, foreign keys, time zones* ### Upgrade/Downgrade * **Does the feature change any on-disk formats?** + *If yes, testing would be required that upgrading to the new format works properly* * **Does the feature change the format of the system tables in the `mysql` database?** + *If yes, testing would be required to make sure that any upgrade/downgrade scripts are able to handle the change gracefully* * **Does the feature change or retire or deprecate any mysqld configuration options?** + *List options here* * **Is downgrade to be supported?** + *If using the new feature makes the database non-downgradable, this must be a conscious design decision* ### User-visible changes * **Does the feature change the mysql protocol?** + *If yes, full connectors testing is required to make sure the change is compatible* * **Does the feature change any result formatting or data types?** + *If yes, testing via the `mysql` client is required to verify that the new format or data type properly arrives at the client* * **Does the feature change the syntax or the output of a `SHOW` command?** + *If yes, clients, connectors and tools that issue that `SHOW` command and process its output should be tested* * **Does the feature change anything with respect to `INFORMATION_SCHEMA` and `PERFORMANCE_SCHEMA` ?** ### Performance and Optimizer * **Does the feature have any performance implications?** + *Is the feature expected to deliver any performance improvement?* + *Is the feature feared to have a performance impact?* * **Does the feature interact with the Optimizer or indexes?** + *Does the feature change anything related to indexes or data stored in them?* + *Does the feature change anything with respect to any optimizations?* ### Replication *Does the feature generate or transmit data that may be sent or processed by the slave or tools such as `mysqlbinlog`?* * **Which binary log formats should be tested?** + *Certain optimizations or scenarios may only trigger for a particular binary log mode* * **Are existing replication RQG grammars sufficient to trigger the new code?** * **Do we need to test DDL in replication, log rotation and such?** * **Does the change affect the master as well, or just the slave? Is a transactional integrity test indicated?** * **Do we need to simulate replication failures, server restarts and such?** * **Do we need to test cloning new slaves from scratch, binary log replay and other replication maintenance activities?** * **Do we need to cover exotic data types, overly large records, statements that are only safe in a particular binlog mode, etc?** ### Extreme conditions and corner case * **Does the feature deal with extreme conditions and corner cases?** + *e.g. huge values, huge tables, huge row lengths, blobs, high concurrencies* * **Is any form of stress testing indicated for the feature?** + *Does the feature have any thread interactions, locking or concurrency mechanisms?* Testing Plan ------------ *This section identifies the testing that will be performed based on the risks identified above* ### Additional MTR tests *Describe any MTR tests that will be implemented in addition to the ones already present in the patch* ### RQG tests * **Are new Random Query Generator grammars required?** + *If existing grammars do not cover the new feature* * **Are new Validators or Reporters required?** + *If the existing RQG validation code can not verify the proper operation of the feature* * **RQG tests lines to run:** + *provide actual RQG command lines, along with a description of the desired effect* ### Manual testing *Describe any manual testing that will be performed involving connectors, clients or installers* ### Benchmarks and stress tests *Describe any benchmarks and stress tests that will be performed. Include the exact parameters and command lines that will be used* Hand-off -------- *This section identifies final checks to be performed on the test content when it is delivered* ### Requirements for MTR tests * Are all new mysqld options, SHOW STATUS variables, I\_S tables and such covered with an MTR test? * Are all new error messages covered with a test? * Is code coverage acceptable to all parties involved? ### Requirements for Random Query Generator tests * Has the proper set of RQG grammars been chosen or created? * Do we have a .CC file listing all interesting mysqld options and RQG variants, in order to run a combinations test? Was the CC file pushed into RQG's LP repository? * Has an at least 24-hour combination test been run? * Was code coverage run on the RQG test? * Were all new grammars and Perl modules pushed into the RQG LP repository? * Were the RQG tests prepared to be buildbot-ready, as opposed to manually-monitored? * Does the test include any safeguards against false negatives? + *e.g. all queries generated are bad, which causes no actual replication, which is still reported as test success* * Are the tests running stably and green in the feature tree's BuildBot? * Are any bug reports missing reproducible test cases, core files, RQG command lines and the like? ### Requirements for Code Coverage *This makes it much faster to review code as one knows what it tested and what one needs to review more carefully* * Ideally all code should be tested by MTR; * If code can only be reproduced by an RQG test or other external test, sufficient information must be provided in the Worklog for the test to be reproducible; * All code should either be tested or reviewed and marked with `/\* purecov inspected \*/` * Code that is suspected to be unreachable should have an DBUG\_ASSERT(0) and be marked with /\* purecov: deadcode \*/. * Was an MTR code coverage report for the feature tree generated by i7.stoev.org/lcov? * Has the dgcov coverage tool been run? * Are there any notable regressions in the code coverage? * Was code coverage run on the RQG tests alone, along with an effort to increase it? * Is the code covered by comments? ### Requirements for the code trees * Was the stable tree merged **into** the feature tree recently? * Were all RQG tests pushed into lp:randgen and documented on the RQG manual pages? * Were all RQG or other automatable tests installed in BuildBot? * Is the feature tree BuildBot green? ### Requirements for closing the Worklog as complete * Was the Worklog updated with information on the testing performed? * Was the QA check box in the Worklog ticked? * Were all related bugs on Launchpad closed? This includes A) bugs that were tagged to belong to the feature tree, B) bugs assigned to the developer regardless of tree, C) bugs assigned to the tester and D) and orphan bugs just hanging around the same theme or time frame; * Did the WL complete the entire review procedure, including any back-and-forth emails? * Has the new feature been documented? See also -------- * [RQG Documentation](http://github.com/RQG/RQG-Documentation/wiki/Category:RandomQueryGenerator) * [RQG Performance Comparisons](../rqg-performance-comparisons/index) * [RQG Extensions for MariaDB Features](../rqg-extensions-for-mariadb-features/index) * [Optimizer Quality](../optimizer-quality/index) * [QA Tools](../qa-tools/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb SIGNAL SIGNAL ====== Syntax ------ ``` SIGNAL error_condition [SET error_property [, error_property] ...] error_condition: SQLSTATE [VALUE] 'sqlstate_value' | condition_name error_property: error_property_name = <error_property_value> error_property_name: CLASS_ORIGIN | SUBCLASS_ORIGIN | MESSAGE_TEXT | MYSQL_ERRNO | CONSTRAINT_CATALOG | CONSTRAINT_SCHEMA | CONSTRAINT_NAME | CATALOG_NAME | SCHEMA_NAME | TABLE_NAME | COLUMN_NAME | CURSOR_NAME ``` `SIGNAL` empties the [diagnostics area](../diagnostics-area/index) and produces a custom error. This statement can be used anywhere, but is generally useful when used inside a [stored program](../stored-programs-and-views/index). When the error is produced, it can be caught by a [HANDLER](../handler/index). If not, the current stored program, or the current statement, will terminate with the specified error. Sometimes an error [HANDLER](../handler/index) just needs to [SIGNAL](index) the same error it received, optionally with some changes. Usually the [RESIGNAL](../resignal/index) statement is the most convenient way to do this. `error_condition` can be an [SQLSTATE](../sqlstate/index) value or a named error condition defined via [DECLARE CONDITION](../declare-condition/index). [SQLSTATE](../sqlstate/index) must be a constant string consisting of five characters. These codes are standard to ODBC and ANSI SQL. For customized errors, the recommended [SQLSTATE](../sqlstate/index) is '45000'. For a list of SQLSTATE values used by MariaDB, see the [MariaDB Error Codes](../mariadb-error-codes/index) page. The [SQLSTATE](../sqlstate/index) can be read via the API method `mysql_sqlstate( )`. To specify error properties user-defined variables and [local variables](../declare-variable/index) can be used, as well as [character set conversions](../setting-character-sets-and-collations/index#literals) (but you can't set a collation). The error properties, their type and their default values are explained in the [diagnostics area](../diagnostics-area/index) page. Errors ------ If the SQLSTATE is not valid, the following error like this will be produced: ``` ERROR 1407 (42000): Bad SQLSTATE: '123456' ``` If a property is specified more than once, an error like this will be produced: ``` ERROR 1641 (42000): Duplicate condition information item 'MESSAGE_TEXT' ``` If you specify a condition name which is not declared, an error like this will be produced: ``` ERROR 1319 (42000): Undefined CONDITION: cond_name ``` If MYSQL\_ERRNO is out of range, you will get an error like this: ``` ERROR 1231 (42000): Variable 'MYSQL_ERRNO' can't be set to the value of '0' ``` Examples -------- Here's what happens if [SIGNAL](index) is used in the client to generate errors: ``` SIGNAL SQLSTATE '01000'; Query OK, 0 rows affected, 1 warning (0.00 sec) SHOW WARNINGS; +---------+------+------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------+ | Warning | 1642 | Unhandled user-defined warning condition | +---------+------+------------------------------------------+ 1 row in set (0.06 sec) SIGNAL SQLSTATE '02000'; ERROR 1643 (02000): Unhandled user-defined not found condition ``` How to specify MYSQL\_ERRNO and MESSAGE\_TEXT properties: ``` SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT='H ello, world!'; ERROR 30001 (45000): Hello, world! ``` The following code shows how to use user variables, local variables and character set conversion with SIGNAL: ``` CREATE PROCEDURE test_error(x INT) BEGIN DECLARE errno SMALLINT UNSIGNED DEFAULT 31001; SET @errmsg = 'Hello, world!'; IF x = 1 THEN SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO = errno, MESSAGE_TEXT = @errmsg; ELSE SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO = errno, MESSAGE_TEXT = _utf8'Hello, world!'; END IF; END; ``` How to use named error conditions: ``` CREATE PROCEDURE test_error(n INT) BEGIN DECLARE `too_big` CONDITION FOR SQLSTATE '45000'; IF n > 10 THEN SIGNAL `too_big`; END IF; END; ``` In this example, we'll define a [HANDLER](../handler/index) for an error code. When the error occurs, we [SIGNAL](index) a more informative error which makes sense for our procedure: ``` CREATE PROCEDURE test_error() BEGIN DECLARE EXIT HANDLER FOR 1146 BEGIN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Temporary tables not found; did you call init() procedure?'; END; -- this will produce a 1146 error SELECT `c` FROM `temptab`; END; ``` See Also -------- * [Diagnostics Area](../diagnostics-area/index) * [RESIGNAL](../resignal/index) * [HANDLER](../handler/index) * [Stored Routines](../stored-programs-and-views/index) * [MariaDB Error Codes](../mariadb-error-codes/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Engine-Independent Table Statistics Engine-Independent Table Statistics =================================== **MariaDB starting with [10.4](../what-is-mariadb-104/index)**The engine-independent table statistics feature was first implemented in [MariaDB 10.0.1](https://mariadb.com/kb/en/mariadb-1001-release-notes/) and was first enabled for queries by default in [MariaDB 10.4](../what-is-mariadb-104/index). Introduction ------------ Before [MariaDB 10.0](../what-is-mariadb-100/index), the MySQL/MariaDB optimizer relied on storage engines (e.g. InnoDB) to provide statistics for the query optimizer. This approach worked; however it had some deficiencies: * Storage engines provided poor statistics (this was fixed to some degree with the introduction of [Persistent Statistics](../innodb-persistent-statistics/index)). * The statistics were supplied through the MySQL Storage Engine Interface, which puts a lot of restrictions on what kind of data is supplied (for example, there is no way to get any data about value distribution in a non-indexed column) * There was little control of the statistics. There was no way to "pin" current statistic values, or provide some values on your own, etc. Engine-independent table statistics lift these limitations. * Statistics are stored in regular tables in the `mysql` database. + it is possible for a DBA to read and update the values. * More data is collected/used. Statistics are stored in three tables, [mysql.table\_stats](../mysqltable_stats-table/index), [mysql.column\_stats](../mysqlcolumn_stats-table/index) and [mysql.index\_stats](../mysqlindex_stats-table/index). Use or update of data from these tables is controlled by [use\_stat\_tables](../server-system-variables/index#use_stat_tables) variable. Possible values are listed below: | Value | Meaning | | --- | --- | | 'never' | The optimizer doesn't use data from statistics tables. Default for [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/) and below. | | 'complementary' | The optimizer uses data from statistics tables if the same kind of data is not provided by the storage engine. | | 'preferably' | Prefer the data from statistics tables, if it's not available there, use the data from the storage engine. | | 'complementary\_for\_queries' | Same as `complementary`, but for queries only (to avoid needlessly collecting for [ANALYZE TABLE](../analyze-table/index)). From [MariaDB 10.4.1](https://mariadb.com/kb/en/mariadb-1041-release-notes/). | | 'preferably\_for\_queries' | Same as `preferably`, but for queries only (to avoid needlessly collecting for [ANALYZE TABLE](../analyze-table/index)). Available and default from [MariaDB 10.4.1](https://mariadb.com/kb/en/mariadb-1041-release-notes/). | Collecting Statistics with the ANALYZE TABLE Statement ------------------------------------------------------ The [ANALYZE TABLE](../analyze-table/index) statement can be used to collect table statistics. For example: ``` ANALYZE TABLE table_name; ``` When the [ANALYZE TABLE](../analyze-table/index) statement is executed, MariaDB makes a call to the table's storage engine, and the storage engine collects its own statistics for the table. The specific behavior depends on the storage engine. For [InnoDB](../innodb/index), see [InnoDB Persistent Statistics](../innodb-persistent-statistics/index) for more information. When the [ANALYZE TABLE](../analyze-table/index) statement is executed, MariaDB may also collect engine-independent statistics for the table. The specific behavior depends on the value of the [use\_stat\_tables](../server-system-variables/index#use_stat_tables) system variable. Engine-independent statistics will only be collected by the [ANALYZE TABLE](../analyze-table/index) statement if one of the following is true: * The [use\_stat\_tables](../server-system-variables/index#use_stat_tables) system variable is set to `complementary` or `preferably`. * The [ANALYZE TABLE](../analyze-table/index) statement includes the `PERSISTENT FOR` clause. **MariaDB starting with [10.4](../what-is-mariadb-104/index)**In [MariaDB 10.4](../what-is-mariadb-104/index) and later, the [use\_stat\_tables](../server-system-variables/index#use_stat_tables) system variable is set to `preferably_for_queries` by default. With this value, engine-independent statistics are used by default, but they are not collected by default. If you want to use engine-independent statistics with the default configuration, then you will have to collect them by executing the [ANALYZE TABLE](../analyze-table/index) statement and by specifying the `PERSISTENT FOR` clause. It is recommended to collect engine-independent statistics on as-needed basis, so typically one will not have engine-independent statistics for all indexes/all columns. Engine-independent statistics are collected by doing full table and full index scans, and this process can be quite expensive. ### Collecting Statistics for Specific Columns or Indexes The syntax for the [ANALYZE TABLE](../analyze-table/index) statement has been extended with the `PERSISTENT FOR` clause. This clause allows one to collect engine-independent statistics only for particular columns or indexes. This clause also allows one to collect engine-independent statistics, regardless of the value of the [use\_stat\_tables](../server-system-variables/index#use_stat_tables) system variable. For example: ``` ANALYZE TABLE table_name PERSISTENT FOR ALL; ``` Statistics for columns using the [BLOB](../blob/index) and [TEXT](../text/index) data types are not collected. If a column using one of these types is explicitly specified, then a warning is returned. ### Examples of Statistics Collection ``` -- update all engine-independent statistics for all columns and indexes ANALYZE TABLE tbl PERSISTENT FOR ALL; -- update specific columns and indexes: ANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...) INDEXES (idx1,idx2,...); -- empty lists are allowed: ANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...) INDEXES (); ANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES (idx1,idx2,...); -- the following will only update mysql.table_stats fields: ANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES (); -- when use_stat_tables is set to 'COMPLEMENTARY' or 'PREFERABLY', -- a simple ANALYZE TABLE collects engine-independent statistics for all columns and indexes. SET SESSION use_stat_tables='COMPLEMENTARY'; ANALYZE TABLE tbl; ``` Manual Updates to Statistics Tables ----------------------------------- Statistics are stored in three tables, [mysql.table\_stats](../mysqltable_stats-table/index), [mysql.column\_stats](../mysqlcolumn_stats-table/index) and [mysql.index\_stats](../mysqlindex_stats-table/index). It is possible to update statistics tables manually. One should modify the table(s) with regular [INSERT](../insert/index)/[UPDATE](../update/index)/[DELETE](../delete/index) statements. Statistics data will be re-read when the tables are re-opened. One way to force all tables to be re-opened is to issue [FLUSH TABLES](../flush/index) command. A few scenarios where one might need to update statistics tables manually: * Deleting the statistics. Currently, the [ANALYZE TABLE](../analyze-table/index) command will collect the statistics, but there is no special command to delete statistics. * Running ANALYZE on a different server. ANALYZE TABLE does a full table scan, which can put too much load on the server. It is possible to run ANALYZE on the slave, and then take the data from statistics tables on the slave and apply it on the master. * In some cases, knowledge of the database allows one to compute statistics manually in a more efficient way than ANALYZE does. One can compute the statistics manually and put it into the database. See Also -------- * [Index Statistics](../index-statistics/index) * [InnoDB Persistent Statistics](../innodb-persistent-statistics/index) * [Histogram-based Statistics](../histogram-based-statistics/index) * [JSON histograms](https://mariadb.org/10-7-preview-feature-json-histograms/) (mariadb.org blog) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LPAD LPAD ==== Syntax ------ ``` LPAD(str, len [,padstr]) ``` Description ----------- Returns the string `str`, left-padded with the string `padstr` to a length of `len` characters. If `str` is longer than `len`, the return value is shortened to `len` characters. If `padstr` is omitted, the LPAD function pads spaces. Prior to [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), the `padstr` parameter was mandatory. Returns NULL if given a NULL argument. If the result is empty (zero length), returns either an empty string or, from [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) with [SQL\_MODE=Oracle](../sql_modeoracle-from-mariadb-103/index), NULL. The Oracle mode version of the function can be accessed outside of Oracle mode by using `LPAD_ORACLE` as the function name. Examples -------- ``` SELECT LPAD('hello',10,'.'); +----------------------+ | LPAD('hello',10,'.') | +----------------------+ | .....hello | +----------------------+ SELECT LPAD('hello',2,'.'); +---------------------+ | LPAD('hello',2,'.') | +---------------------+ | he | +---------------------+ ``` From [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/), with the pad string defaulting to space. ``` SELECT LPAD('hello',10); +------------------+ | LPAD('hello',10) | +------------------+ | hello | +------------------+ ``` Oracle mode version from [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/): ``` SELECT LPAD('',0),LPAD_ORACLE('',0); +------------+-------------------+ | LPAD('',0) | LPAD_ORACLE('',0) | +------------+-------------------+ | | NULL | +------------+-------------------+ ``` See Also -------- * [RPAD](../rpad/index) - Right-padding instead of left-padding. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb 10.2.17 Release Upgrade Tests 10.2.17 Release Upgrade Tests ============================= ### Tested revision 5553d3f1f691a374124686946bd1f1cc4ef9fb45 ### Test date 2018-08-30 01:21:02 ### Summary Known bug [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094). A few upgrades from MySQL and old MariaDB fail because the old versions hang on shutdown. ### Details | type | pagesize | OLD version | file format | encrypted | compressed | | NEW version | file format | encrypted | compressed | readonly | result | notes | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | recovery | 16 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 16 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 4 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 4 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 32 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 64 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 8 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | recovery | 8 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | recovery | 16 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 16 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 4 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 4 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 32 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 64 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | recovery | 8 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | recovery | 8 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 16 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 4 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 32 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 64 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 8 | 10.2.17 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo-recovery | 16 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 4 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 32 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 64 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 8 | 10.2.17 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo-recovery | 16 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 4 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 32 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 64 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 8 | 10.2.17 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo-recovery | 16 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 4 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 32 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 64 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo-recovery | 8 | 10.2.17 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 16 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.16 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.16 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.16 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.16 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | **FAIL** | KNOWN\_BUGS [MDEV-13094](https://jira.mariadb.org/browse/MDEV-13094)(1) | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | crash | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.2.6 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.35 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 16 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 4 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 32 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 64 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | normal | 8 | 10.1.13 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 16 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 4 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 32 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 64 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | normal | 8 | 10.1.10 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | - | => | 10.2.17 (inbuilt) | Barracuda | on | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | - | => | 10.2.17 (inbuilt) | Barracuda | - | - | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | on | zlib | => | 10.2.17 (inbuilt) | Barracuda | on | zlib | - | OK | | | undo | 16 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 4 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 32 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 64 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | undo | 8 | 10.1.22 (inbuilt) | Barracuda | - | zlib | => | 10.2.17 (inbuilt) | Barracuda | - | zlib | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 4 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 8 | 10.0.36 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 4 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 8 | 10.0.14 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 16 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 8 | 10.0.18 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | crash | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | crash | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | crash | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | crash | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | crash | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | crash | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | crash | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | crash | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | crash | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | crash | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 4 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 32 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 64 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.7.23 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | normal | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | normal | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | OK | | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | on | - | - | **FAIL** | TEST\_FAILURE | | undo | 16 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | | undo | 4 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | OK | | | undo | 8 | 5.6.41 (inbuilt) | | - | - | => | 10.2.17 (inbuilt) | | - | - | - | **FAIL** | TEST\_FAILURE | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb MBRTouches MBRTouches ========== Syntax ------ ``` MBRTouches(g1,g2) ``` Description ----------- Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries `g1` and `g2` touch. Two geometries spatially touch if the interiors of the geometries do not intersect, but the boundary of one of the geometries intersects either the boundary or the interior of the other. Examples -------- ``` SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'); SET @g2 = GeomFromText('Polygon((4 4,4 7,7 7,7 4,4 4))'); SELECT mbrtouches(@g1,@g2); +---------------------+ | mbrtouches(@g1,@g2) | +---------------------+ | 0 | +---------------------+ SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'); SET @g2 = GeomFromText('Polygon((3 3,3 6,6 6,6 3,3 3))'); SELECT mbrtouches(@g1,@g2); +---------------------+ | mbrtouches(@g1,@g2) | +---------------------+ | 1 | +---------------------+ SET @g1 = GeomFromText('Polygon((0 0,0 4,4 4,4 0,0 0))'); SET @g2 = GeomFromText('Polygon((3 3,3 6,6 6,6 3,3 3))'); SELECT mbrtouches(@g1,@g2); +---------------------+ | mbrtouches(@g1,@g2) | +---------------------+ | 0 | +---------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysqlhotcopy mysqlhotcopy ============ mysqlhotcopy is currently deprecated. **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-hotcopy` is a symlink to `mysqlhotcopy`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadb-hotcopy` is the name of the script, with `mysqlhotcopy` a symlink . `mysqlhotcopy` is a Perl script that was originally written and contributed by Tim Bunce. It uses [FLUSH TABLES](../flush/index), [LOCK TABLES](../lock-tables/index), and cp or scp to make a database backup. It is a fast way to make a backup of the database or single tables, but it can be run only on the same machine where the database directories are located. `mysqlhotcopy`> works only for backing up [MyISAM](../myisam/index) and [ARCHIVE](../archive/index) tables. It runs on Unix and NetWare. To use `mysqlhotcopy`, you must have read access to the files for the tables that you are backing up, the SELECT [privilege](../grant/index) for those tables, the RELOAD privilege (to be able to execute FLUSH TABLES), and the LOCK TABLES privilege (to be able to lock the tables). ``` shell> mysqlhotcopy db_name [/path/to/new_directory] shell> mysqlhotcopy db_name_1 ... db_name_n /path/to/new_directory ``` Back up tables in the given database that match a regular expression: ``` shell> mysqlhotcopy db_name./regex/ ``` The regular expression for the table name can be negated by prefixing it with a tilde (“`~`”): ``` shell> mysqlhotcopy db_name./~regex/ ``` `mysqlhotcopy` supports the following options, which can be specified on the command line or in the [`mysqlhotcopy`] and [`client`] option file groups. | Option | Description | | --- | --- | | `--help`, `-?` | Display a help message and exit. | | `--addtodest` | Do not rename target directory (if it exists); merely add files to it. | | `--allowold` | Do not abort if a target exists; rename it by adding an \_old suffix. | | `--checkpoint=db_name.tbl_name` | Insert checkpoint entries into the specified database `db_name` and table `tbl_name`. | | `--chroot=path` | Base directory of the chroot jail in which mysqld operates. The path value should match that of the `--chroot` option given to mysqld. | | `--debug` | Enable debug output. | | `--dryrun`, `-n` | Report actions without performing them. | | `--flushlog` | Flush logs after all tables are locked. | | `--host=host_name`, `-h host_name` | The host name of the local host to use for making a TCP/IP connection to the local server. By default, the connection is made to localhost using a Unix socket file. | | `--keepold` | Do not delete previous (renamed) target when done. | | `--method=command` | The method for copying files (cp or scp). The default is cp. | | `--noindices` | Do not include full index files for MyISAM tables in the backup. This makes the backup smaller and faster. The indexes for reloaded tables can be reconstructed later with [myisamchk -rq](../myisamchk/index). | | `--old-server` | Connect to old MySQL-server (before v5.5) which doesn't have [FLUSH TABLES WITH READ LOCK](../flush/index) fully implemented. | | `--password=password`, `-ppassword` | The password to use when connecting to the server. The password value is not optional for this option, unlike for other MariaDB programs. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. | | `--port=port_num`, `-P port_num` | The TCP/IP port number to use when connecting to the local server. | | `--quiet`, `-q` | Be silent except for errors. | | `--record_log_pos=db_name.tbl_name` | Record master and slave status in the specified database db\_name and table tbl\_name. | | `--regexp=expr` | Copy all databases with names that match the given regular expression. | | `--resetmaster` | Reset the binary log after locking all the tables. | | `--resetslave` | Reset the master.info file after locking all the tables. | | `--socket=path`, `-S path` | The Unix socket file to use for connections to localhost. | | `--suffix=str` | The suffix to use for names of copied databases. | | `--tmpdir=path` | The temporary directory. The default is /tmp. | | `--user=username`, `-u username` | The MariaDB username to use when connecting to the server. | Use perldoc for additional `mysqlhotcopy` documentation, including information about the structure of the tables needed for the `--checkpoint` and `--record_log_pos` options: ``` shell> perldoc mysqlhotcopy ``` See Also -------- * [mysqldump](../mysqldump/index) * [Mariabackup](../mariabackup/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Geographic Functions Geographic Functions ===================== Geographic and geometry functions. See [Geographic Features](../gis-functionality/index) for a full discussion of MariaDB's spatial extensions. | Title | Description | | --- | --- | | [Geometry Constructors](../geometry-constructors/index) | Geometry constructors | | [Geometry Properties](../geometry-properties/index) | Geometry properties | | [Geometry Relations](../geometry-relations/index) | Geometry relations | | [LineString Properties](../linestring-properties/index) | LineString properties | | [MBR (Minimum Bounding Rectangle)](../mbr-minimum-bounding-rectangle/index) | | | [Point Properties](../point-properties/index) | Point properties | | [Polygon Properties](../polygon-properties/index) | Polygon properties | | [WKB](../wkb/index) | Well-Known Binary format for geometric data | | [WKT](../wkt/index) | Well-Known Text geometry representation | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb run-sql-bench.pl run-sql-bench.pl ================ `run-sql-bench.pl` is a perl script for automating runs of sql-bench (You can find sql-bench in the [MariaDB source code](../getting-the-mariadb-source-code/index).) `run-sql-bench.pl` can be found in the [mariadb-tools](../mariadb-tools/index) project on Launchpad. Once you have a copy of mariadb-tools, you'll find the script, and its configuration directories, in the `sql-bench` directory. For the purposes of this article, wherever you located your local branch of `mariadb-tools` will be called `${BASE_DIR}`. The `run-sql-bench.pl` script is located at '`${BASE_DIR}/sql-bench/run-sql-bench.pl`'. Example configuration scripts used for different runs can be found in the various subdirectories of `${BASE_DIR}/sql-bench/`. To run the `run-sql-bench.pl` script, do the following: 1. [Branch a MariaDB or MySQL tree](../getting-the-mariadb-source-code/index) 2. Optionally do some code changes in that tree and commit your changes 3. Edit `run-sql-bench.pl` to set internal options, especially the "`my $path`" variable. 4. Create a `${BASE_DIR}/sql-bench/conf/host.cnf` file for your system. An easy way to do this is by duplicating one of the example `host.cnf` files: ``` cp -avi ${BASE_DIR}/sql-bench/conf/pitbull.cnf ${BASE_DIR}/sql-bench/conf/${HOSTNAME}.cnf ``` Edit the file to customize it for your system. 5. Create `${HOSTNAME}.cnf` files under the `${BASE_DIR}/sql-bench/basic`, `${BASE_DIR}/sql-bench/debug`, `${BASE_DIR}/sql-bench/debug-full`, and `${BASE_DIR}/sql-bench/O2` directories, depending on which automated tests you want to run. Use the example files as a base and customize them for your system. 6. Run the `run-sql-bench.pl` script: ``` cd ${BASE_DIR}/sql-bench/; ./run-sql-bench.pl --repository=[/path/to/bzr/repository] --sql-bench-options=[additional sql-bench-options] --debug=[yes|no] ``` * *``--`repository`* is the MariaDB tree to use and compile, the script will also look here for sql-bench. * *``--`sql-bench-options`* is mostly used in testing and debugging cases where we want to have short run times. For instance, using ``--`small-test` or ``--`small-table`. * You can separate several sql-bench options with spaces like so: ``` --sql-bench-options="--small-test --small-table" ``` The results ----------- Results are stored at the location specified by the `$sql\_bench\_results` variable in the `${BASE_DIR}/sql-bench/conf/hostname.cnf` file for your host. Results are organized in sub directories with the following schema: ``` sql-bench-results-dir/${HOSTNAME}/YYYY-MM-DD ``` Future plans ------------ * Crash and error detection and reporting. * One should be able to specify a test name for each file (`run-all-tests` ``--`suffix='_xxxx'`) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Old Plans Old Plans ========== This category contains plans that are no longer in active use, for older and current versions of MariaDB. For future plans, see [Plans](../development-plans/index). | Title | Description | | --- | --- | | [Plans for MariaDB 10.8](../plans-for-mariadb-108/index) | Roadmap for MariaDB 10.8. | | [Plans for MariaDB 10.7](../plans-for-mariadb-107/index) | Roadmap for MariaDB 10.7. | | [Plans for MariaDB 10.6](../plans-for-mariadb-106/index) | Roadmap for MariaDB 10.6. | | [Plans for MariaDB 10.5](../plans-for-mariadb-105/index) | Roadmap for MariaDB 10.5. | | [Plans for MariaDB 10.4](../plans-for-mariadb-104/index) | Roadmap for MariaDB 10.4. | | [Plans for 10.3](../plans-for-103/index) | Plans for MariaDB 10.3. | | [Plans for 10.1](../plans-for-101/index) | Plans for MariaDB 10.1 | | [Plans for 5.6](../plans-for-56/index) | The information on this page is obsolete. Current information can be found... | | [MariaDB 5.3 TODO not](../mariadb-53-todo-not/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | | [MariaDB 5.3 TODO](../mariadb-53-todo/index) | Older version of this page can be found at mariadb-53-todo-not. Shortly b... | | [MariaDB 5.2 TODO](../mariadb-52-todo/index) | MariaDB 5.2 is an old release, and is no longer unsupported. | | [MariaDB Developer Meeting - Athens](../mariadb-developer-meeting-athens/index) | 11-13 Nov 2011 - Notes and Plans from the Athens Developer meeting. | | [Plugins & Storage Engines Summit for MySQL/MariaDB/Drizzle 2011](../plugins-storage-engines-summit-for-mysqlmariadbdrizzle-2011/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | | [MariaDB Development Meeting - Lisbon](../mariadb-development-meeting-lisbon/index) | 11-13 Mar 2011 - Notes and Plans from the Lisbon Developer meeting. | | [MariaDB Feature Backport](../mariadb-feature-backport/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | | [MariaDB Online Backup](../mariadb-online-backup/index) | MariaDB Online Backup | | [Storage Engine Summit 2010](../storage-engine-summit-2010/index) | Note: This page is obsolete. The information is old, outdated, or otherwise... | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Optimization and Indexes Optimization and Indexes ========================= A critical way to improve table performance is by creating indexes on key columns. | Title | Description | | --- | --- | | [The Essentials of an Index](../the-essentials-of-an-index/index) | Explains the basics of a table index. | | [Getting Started with Indexes](../getting-started-with-indexes/index) | Extensive tutorial on creating indexes for tables. | | [Full-Text Indexes](../full-text-indexes/index) | MariaDB has support for full-text indexing and searching. | | [ANALYZE TABLE](../analyze-table/index) | Store key distributions for a table. | | [Building the best INDEX for a given SELECT](../building-the-best-index-for-a-given-select/index) | Cookbook for Creating Indexes | | [Compound (Composite) Indexes](../compound-composite-indexes/index) | Compound indexes plus other insights into the mysteries of indexing | | [EXPLAIN](../explain/index) | EXPLAIN returns information about index usage, as well as being a synonym for DESCRIBE. | | [Foreign Keys](../foreign-keys/index) | Foreign keys can be used to enforce data integrity. | | [Ignored Indexes](../ignored-indexes/index) | Indexes that are not used by the optimizer. | | [Index Statistics](../index-statistics/index) | Index statistics and the query optimizer. | | [Latitude/Longitude Indexing](../latitudelongitude-indexing/index) | Efficiently finding the nearest 10 pizza parlors in a huge database | | [Primary Keys with Nullable Columns](../primary-keys-with-nullable-columns/index) | SQL standards in dealing with multi-part primary keys with nullable columns. | | [SHOW EXPLAIN](../show-explain/index) | Shows an execution plan for a running query. | | [SPATIAL INDEX](../spatial-index/index) | An index type used for geometric columns. | | [Storage Engine Index Types](../storage-engine-index-types/index) | The permitted index\_types for each storage engine. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT BIN Table Type CONNECT BIN Table Type ====================== Overview -------- A table of type BIN is physically a binary file in which each row is a logical record of fixed length[[1](#_note-0)]. Within a record, column fields are of a fixed offset and length as with [FIX tables](../connect-dos-and-fix-table-types/index). Specific to BIN tables is that numerical values are internally encoded using native platform representation, so no conversion is needed to handle numerical values in expressions. It is not required that the lines of a BIN file be separated by characters such as CR and/or LF but this is possible. In such an event, the *lrecl* option must be specified accordingly. **Note:** Unlike for the [DOS and FIX types](../connect-dos-and-fix-table-types/index), the width of the fields is the length of their internal representation in the file. For instance for a column declared as: ``` number int(5) not null, ``` The field width in the file is 4 characters, the size of a binary integer. This is the value used to calculate the offset of the next field if it is not specified. Therefore, if the next field is placed 5 characters after this one, this declaration is not enough, and the flag option will have to be used on the next field. Type Conversion in BIN Tables ----------------------------- Here are the correspondences between the column type and field format provided by default: | Column type | File default format | | --- | --- | | Char(*n*) | Text of *n* characters. | | Date | Integer (4 bytes) | | Int(*n*) | Integer (4 bytes) | | Smallint(*n*) | Short integer (2 bytes) | | TinyInt(*n*) | Char (1 Byte) | | Bigint(*n*) | Large integer (8 bytes) | | Double(*n,d*) | Double floating point (8 bytes) | However, the column type need not necessarily match the field format within the table file. In particular, this occurs for field formats that correspond to numeric types that are not handled by CONNECT[[2](#_note-1)]. Indeed, BIN table files may internally contain float numbers or binary numbers of any byte length in big-endian or little-endian representation[[3](#_note-2)]. Also, as in [DOS or FIX types](../connect-dos-and-fix-table-types/index) tables, you may want to handle some character fields as numeric or vice versa. This is why it is possible to specify the field format when it does not correspond to the column type default using the *field\_format* column option in the [CREATE TABLE](../create-table/index) statement. Here are the available field formats for BIN tables: | Field\_format | Internal representation | | --- | --- | | **[n]{L or B or H}[n]** | n bytes binary number in little endian, big endian or host endian representation. | | **C** | Characters string (*n* bytes) | | **I** | integer (4 bytes) | | **D** | Double float (8 bytes) | | **S** | Short integer (2 bytes) | | **T** | Tiny integer (1 byte) | | **G** | Big integer (8 bytes) | | **F** or **R** | Real or float (Floating point number on 4 bytes) | | **X** | Use the default format field for the column type | All field formats (except the first one) are a one-character specification[[4](#_note-3)]. 'X' is equivalent to not specifying the field format. For the 'C' character specification, *n* is the column width as specified with the column type. For one-column formats, the number of bytes of the numeric fields corresponds to what it is on most platforms. However, it could vary for some. The G, I, S and T formats are deprecated because they correspond to supported data types and may not be supported in future versions. Example ------- Here is an example of a BIN table. The file record layout is supposed to be: ``` NNNNCCCCCCCCCCIIIISSFFFFSS ``` Here N represents numeric characters, C any characters, I integer bytes, S short integer bytes, and F float number bytes. The `IIII` field contains a date in numeric format. The table could be created by: ``` create table testbal ( fig int(4) not null field_format='C', name char(10) not null, birth date not null field_format='L', id char(5) not null field_format='L2', salary double(9,2) not null default 0.00 field_format='F', dept int(4) not null field_format='L2') engine=CONNECT table_type=BIN block_size=5 file_name='Testbal.dat'; ``` Specifying the little-endian representation for binary values is not useful on most machines, but makes the create table statement portable on a machine using big endian, as well as the table file. The field offsets and the file record length are calculated according the column internal format and eventually modified by the field format. It is not necessary to specify them for a packed binary file without line endings. If a line ending is desired, specify the ending option or specify the `lrecl` option adding the ending width. The table can be filled by: ``` insert into testbal values (5500,'ARCHIBALD','1980-01-25','3789',4380.50,318), (123,'OLIVER','1953-08-10','23456',3400.68,2158), (3123,'FOO','2002-07-23','888',default,318); ``` Note that the types of the inserted values must match the column type, not the field format type. The query: ``` select * from testbal; ``` returns: | fig | name | birth | id | salary | dept | | --- | --- | --- | --- | --- | --- | | 5500 | ARCHIBALD | 1980-01-25 | 3789 | 4380.50 | 318 | | 123 | OLIVER | 1953-08-10 | 23456 | 3400.68 | 2158 | | 3123 | FOO | 2002-07-23 | 888 | 0.00 | 318 | Numeric fields alignment ------------------------ In binary files, numeric fields and record length can be aligned on 4-or-8-byte boundaries to optimize performance on certain processors. This can be modified in the OPTION\_LIST with an "align" option ("packed" meaning `align=1` is the default). --- 1. [↑](#_ref-0) Sometimes it can be a physical record if LF or CRLF have been written in the file. 2. [↑](#_ref-1) Most of these are obsolete because CONNECT supports all column types except float 3. [↑](#_ref-2) The default endian representation used in the table file can be specified by setting the ENDIAN option as ‘L’ or ‘B’ in the option list. 4. [↑](#_ref-3) It can be specified with more than one character, but only the first one is significant. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Extended Show Extended Show ============= The following `[SHOW](../show/index)` statements can be extended by using a `WHERE` clause and a `LIKE` clause to refine the results: * [SHOW CHARACTER SET](../show-character-set/index) * [SHOW COLLATION](../show-collation/index) * [SHOW COLUMNS](../show-columns/index) * [SHOW DATABASES](../show-databases/index) * [SHOW FUNCTION STATUS](../show-function-status/index) * [SHOW INDEX](../show-index/index) * [SHOW OPEN TABLES](../show-open-tables/index) * [SHOW PACKAGE STATUS](../show-package-status/index) * [SHOW PACKAGE BODY STATUS](../show-package-body-status/index) * [SHOW INDEX](../show-index/index) * [SHOW PROCEDURE STATUS](../show-procedure-status/index) * [SHOW STATUS](../show-status/index) * [SHOW TABLE STATUS](../show-table-status/index) * [SHOW TABLES](../show-tables/index) * [SHOW TRIGGERS](../show-triggers/index) * [SHOW VARIABLES](../show-variables/index) As with a regular `[SELECT](../select/index)`, the `WHERE` clause can be used for the specific columns returned, and the `[LIKE](../like/index)` clause with the regular wildcards. Examples -------- ``` SHOW TABLES; +----------------------+ | Tables_in_test | +----------------------+ | animal_count | | animals | | are_the_mooses_loose | | aria_test2 | | t1 | | view1 | +----------------------+ ``` Showing the tables beginning with *a* only. ``` SHOW TABLES WHERE Tables_in_test LIKE 'a%'; +----------------------+ | Tables_in_test | +----------------------+ | animal_count | | animals | | are_the_mooses_loose | | aria_test2 | +----------------------+ ``` Variables whose name starts with *aria* and with a valued of greater than 8192: ``` SHOW VARIABLES WHERE Variable_name LIKE 'aria%' AND Value >8192; +------------------------------+---------------------+ | Variable_name | Value | +------------------------------+---------------------+ | aria_checkpoint_log_activity | 1048576 | | aria_log_file_size | 1073741824 | | aria_max_sort_file_size | 9223372036853727232 | | aria_pagecache_buffer_size | 134217728 | | aria_sort_buffer_size | 134217728 | +------------------------------+---------------------+ ``` Shortcut, just returning variables whose name begins with *aria*. ``` SHOW VARIABLES LIKE 'aria%'; +------------------------------------------+---------------------+ | Variable_name | Value | +------------------------------------------+---------------------+ | aria_block_size | 8192 | | aria_checkpoint_interval | 30 | | aria_checkpoint_log_activity | 1048576 | | aria_force_start_after_recovery_failures | 0 | | aria_group_commit | none | | aria_group_commit_interval | 0 | | aria_log_file_size | 1073741824 | | aria_log_purge_type | immediate | | aria_max_sort_file_size | 9223372036853727232 | | aria_page_checksum | ON | | aria_pagecache_age_threshold | 300 | | aria_pagecache_buffer_size | 134217728 | | aria_pagecache_division_limit | 100 | | aria_recover | NORMAL | | aria_repair_threads | 1 | | aria_sort_buffer_size | 134217728 | | aria_stats_method | nulls_unequal | | aria_sync_log_dir | NEWFILE | | aria_used_for_temp_tables | ON | +------------------------------------------+---------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql-test-run.pl Options mysql-test-run.pl Options ========================= Syntax ------ ``` ./mysql-test-run.pl [ OPTIONS ] [ TESTCASE ] ``` Where the test case can be specified as: `testcase[.test]` Runs the test case named 'testcase' from all suits ``` path-to-testcase [suite.]testcase[,combination] ``` ### Examples `alias` `main.alias` 'main' is the name of the suite for the 't' directory. ``` rpl.rpl_invoked_features,mix,xtradb_plugin suite/rpl/t/rpl.rpl_invoked_features ``` Options ------- ### Options to Control What Engine/Variation to Run | Option | Description | | --- | --- | | `--embedded-server` | Use the embedded server, i.e. no mysqld daemons. | | `--ps-protocol` | Use the binary protocol between client and server. | | `--cursor-protocol` | Use the cursor protocol between client and server (implies `--ps-protocol`). | | `--view-protocol` | Create a view to execute all non updating queries. | | `--sp-protocol` | Create a stored procedure to execute all queries. | | `--compress` | Use the compressed protocol between client and server if both support it. | | `--ssl` | If mysql-test-run.pl is started with the `--ssl` option, it sets up a [secure connection](../secure-connections-overview/index) for all test cases. In this case, if mysqld does not support TLS, mysql-test-run.pl exits with an error message: `Couldn´t find support for SSL`. | | `--skip-ssl` | Dont start server with support for TLS connections. | | `--vs-config` | Visual Studio configuration used to create executables (default: MTR\_VS\_CONFIG environment variable). | | `--parallel=num` | How many parallel tests should be run. Default is `1`, use `--parallel=auto` for auto-setting of *num*. | | `--defaults-file=<config template>` | Use fixed config template for all tests. | | `--defaults_extra_file=<config template>` | Extra config template to add to all generated configs. | | `--combination=<opt>` | Extra options to pass to mysqld. The value should consist of one or more comma-separated mysqld options. This option is similar to `--mysqld` but should be given two or more times. mysql-test-run.pl executes multiple test runs, using the options for each instance of `--combination` in successive runs. If `--combination` is given only once, it has no effect. For test runs specific to a given test suite, an alternative to the use of `--combination` is to create a combinations file in the suite directory. The file should contain a section of options for each test run. | | `--dry-run` | Don't run any tests, print the list of tests that were selected for execution. | ### Options to Control Directories to Use | Option | Description | | --- | --- | | `--tmpdir=DIR` | The directory where temporary files are stored (default: ./var/tmp). The environment variable MYSQL\_TMP\_DIR will be set to the path for this directory, whether it has the default value or has been set explicitly. This may be referred to in tests. | | `--vardir=DIR` | The directory where files generated from the test run is stored (default: ./var). Specifying a ramdisk or tmpfs will speed up tests. The environment variable MYSQLTEST\_VARDIR will be set to the path for this directory, whether it has the default value or has been set explicitly. This may be referred to in tests. | | `--mem` | Run testsuite in "memory" using tmpfs or ramdisk. This can decrease test times significantly, in particular if you would otherwise be running over a remote file system. Attempts to find a suitable location using a builtin list of standard locations for tmpfs (/dev/shm). The option can also be set using environment variable MTR\_MEM=[DIR]. If DIR is given, it is added to the beginning of the list of locations to search, so it takes precedence over any built-in locations. Once you have run tests with --mem within a mysql-testdirectory, a soflink var will have been set up to the temporary directory, and this will be re-used the next time, until the soflink is deleted. Thus, you do not have to repeat the `--mem` option next time. | | `--client-bindir=PATH` | Path to the directory where client binaries are located. | | `--client-libdir=PATH` | Path to the directory where client libraries are located. | ### Options to Control What Test Suites or Cases to Run | Option | Description | | --- | --- | | `--force` | Normally, mysql-test-run.pl exits if a test case fails. `--force` causes execution to continue regardless of test case failure. | | `--with-ndbcluster-only` | Run only tests that include "ndb" in the filename. | | `--skip-ndb[cluster]` | Skip all tests that need cluster. Default. | | `--do-test=PREFIX or REGEX` | Run test cases with names prefixed with PREFIX or which fulfil the REGEX. For example, `--do-test=testa` matches tests that begin with *testa*, `--do-test=main.testa` matches tests in the main test suite that begin with *testa*, and `--do-test=main.*testa` matches test names that contain *main* followed by *testa* with anything in between. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as *xmainytestz*. | | `--skip-test=PREFIX or REGEX` | Skip test cases with names prefixed with PREFIX or which fulfil the REGEX. See `-do-test` for examples. | | `--start-from=PREFIX` | Sorts the list of names of the test cases to be run, and then starts with the test prefixed with PREFIX, where the prefix may be *suite.testname* or just *testname*. | | `--suite[s]=NAME1,..,NAMEN` | Comma separated list of suite names to run. The default, as of [MariaDB 10.4.5](https://mariadb.com/kb/en/mariadb-1045-release-notes/), is:"main-, archive-, binlog-, binlog\_encryption-, csv-, compat/oracle-, encryption-, federated-, funcs\_1-, funcs\_2-, gcol-, handler-, heap-, innodb-, innodb\_fts-, innodb\_gis-, innodb\_zip-, json-, maria-, mariabackup-, multi\_source-, optimizer\_unfixed\_bugs-, parts-, perfschema-, plugins-, roles-, rpl-, sys\_vars-, sql\_sequence-, unit-, vcol-, versioning-,period-". | | `--skip-rpl` | Skip the replication test cases. | | `--big-test` | Allow tests marked as "big" to run. Tests can be thus marked by including the line `--source include/big_test.inc`, and they will only be run if this option is given, or if the environment variable BIG\_TEST is set to 1. Repeat this option twice to run only "big" tests. This is typically used for tests that take a very long to run, or that use many resources, so that they are not suitable for running as part of a normal test suite run | | `--staging-run` | Run a limited number of tests (no slow tests). Used for running staging trees with valgrind. | | `--enable-disabled` | Ignore any *disabled.def* file, and also run tests marked as disabled. Success or failure of those tests will be reported the same way as other tests. | | `--print-testcases` | Don't run the tests but print details about all the selected tests, in the order they would be run. | | `--skip-test-list=FILE` | Skip the tests listed in FILE. Each line in the file is an entry and should be formatted as: <TESTNAME> : <COMMENT> | ### Options That Specify Ports | Option | Description | | --- | --- | | `--[mtr-]port-base=num` | Base for port numbers. Ports from this number to number+9 are reserved. Should be divisible by 10; if not it will be rounded down. May be set with environment variable MTR\_PORT\_BASE. If this value is set and is not "auto", it overrides build-thread. | | `--[mtr-]build-thread=num` | Specify unique number to calculate port number(s) from. Can be set in environment variable MTR\_BUILD\_THREAD. Set MTR\_BUILD\_THREAD="auto" to automatically acquire a build thread id that is unique to current host. The more logical `--port-base` is supported as an alternative. | ### Options For Test Case Authoring | Option | Description | | --- | --- | | `--record TESTNAME` | (Re)generate the result file for TESTNAME. | | `--check-testcases` | Check testcases for side-effects. This is done by checking system state before and after each test case; if there is any difference, a warning to that effect will be written, but the test case will not be marked as failed because of it. This check is enabled by default. Use `--nocheck-testcases` to disable. | | `mark-progress` | Log line number and elapsed time to <testname>.progress | ### Options That Pass On Options | Option | Description | | --- | --- | | `--mysqld=ARGS` | Specify additional arguments to "mysqld" | | `--mysqltest=ARGS` | Specify additional arguments to "mysqltest". Use additional `--mysqld-env` options to set more than one variable. | ### Options to Run Test On Running Server | Option | Description | | --- | --- | | `extern option=value` | Use an already running server. The option/value pair is what is needed by the mysql client to connect to the server. Each `--extern` option can only take one option/value pair as an argument, so you need to repeat `--extern` for each pair needed. Example: `./mysql-test-run.pl --extern socket=var/tmp/mysqld.1.sock alias`. Note: If a test case has an .opt file that requires the server to be restarted with specific options, the file will not be used. The test case likely will fail as a result. | ### Options For Debugging the Product In `mysql-test-run.pl` there is a concept of a "debugger". A "debugger" is a tool that `mysql-test-run.pl` will execute instead of `mariadbd`. This tool will then start `mariadbd` and can control its execution as it wants. The following "debuggers" are supported: | name | Description | | --- | --- | | `gdb` | [GNU debugger](https://www.gnu.org/software/gdb/) | | `ddd` | [GUI frontend for gdb](https://www.gnu.org/software/ddd/) | | `dbx` | <https://en.wikipedia.org/wiki/Dbx_(debugger)> | | `devenv` | [Visual Studio debugger](https://docs.microsoft.com/en-us/visualstudio/debugger/?view=vs-2019) | | `windbg` | <https://en.wikipedia.org/wiki/WinDbg> | | `lldb` | [Debugger from LLVM project](https://lldb.llvm.org/) | | `valgrind` | [Detects memory management problems and more](https://www.valgrind.org/) | | `strace` | [syscall tracer](https://strace.io/) | | `rr` | ["record and replay" — record the program execution and then replay it forward, backward, or in any other direction](https://rr-project.org/) | Every "debugger" from the list above supports the following set of options (replace XXX below with a debugger name) | Option | Description | | --- | --- | | `--XXX` | Start `mariadbd` process under a debugger | | `--client-XXX` | Start `mysqltest` process under a debugger | | `--boot-XXX` | Before running tests `mysql-test-run` executes `mariadbd` to bootstrap, prepare the datadir. This options causes this bootstrapping `mariadbd` process to be run under a debugger. | | `--manual-XXX` | Don't start anything, instead print the command that the user needs to run to start `mariadbd` under a debugger. Then wait. | Every option from the above accepts an optional argument. It can be used to specify additional command line options to pass to the tool. Or additional commands that the tool will run on startup. Or both. Commands are separated from each other and from options with a semicolon. For example: ``` ./mtr 1st --strace ./mtr 1st --client-rr=--chaos ./mtr 1st --manual-gdb='b mysql_parse;r' ./mtr 1st --boot-gdb='--quiet --tui;b mysql_parse;r' ``` ### Misc Debugging Related Options | Option | Description | | --- | --- | | `--debug` | Dump trace output for all servers and client programs. | | `--debug-common` | Same as `--debug`, but sets the 'd' debug flags to "query,info,error,enter,exit" | | `--debug-server` | Use debug version of server, but without turning on tracing. | | `--max-save-core` | Limit the number of core files saved (to avoid filling up disks for heavily crashing server). Defaults to 5, set to 0 for no limit. Set its default with MTR\_MAX\_SAVE\_CORE. | | `--max-save-datadir` | Limit the number of datadir saved (to avoid filling up disks for heavily crashing server). Defaults to 20, set to 0 for no limit. Set its default with MTR\_MAX\_SAVE\_DATDIR. | | `--max-test-fail` | Limit the number of test failurs before aborting the current test run. Defaults to 10, set to 0 for no limit. Set its default with MTR\_MAX\_TEST\_FAIL. | ### Misc Options | Option | Description | | --- | --- | | `--user=USER` | User for connecting to mysqld (default: root) | | `--comment=STR` | Write STR to the output within lines filled with #, as a form of banner. | | `--timer` | Show test case execution time. Use `no-timer` to disable. | | `--verbose` | More verbose output(use multiple times for even more) | | `--verbose-restart` | Write when and why servers are restarted between test cases. | | `--start` | Only initialize and start the servers, using the startup settings for the first specified test case Example: `./mysql-test-run.pl --start alias & start-dirty` Only start the servers (without initialization) for the first specified test case | | `--start-and-exit` | Same as `--start`, but *mysql-test-run* terminates and leaves just the server running. | | `--start-dirty` | This is similar to `--start`, but will skip the database initialization phase and assume that database files are already available. Usually this means you must have run another test first. | | `--user-args` | In combination with start\* and no test name, drops arguments to mysqld except those specified with `--mysqld` (if any). | | `--wait-all` | If `--start` or `--start-dirty` option is used, wait for all servers to exit before finishing the process. Otherwise, it will terminate if one (of several) servers is restarted. | | `--fast` | Do not perform controlled shutdown when servers need to be restarted or at the end of the test run. This is equivalent to using `--shutdown-timeout=0`. | | `--force-restart` | Always restart servers between tests. | | `--parallel=N` | Run tests in N parallel threads (default 1) Use parallel=auto for auto-setting of N. | | `--repeat=N` | Run each test N number of times. | | `--retry=N` | If a test fails, it is retried up to a maximum of N runs (default 1). Retries are also limited by the maximum number of failures before stopping, set with the `--retry-failure` option. This option has no effect unless `--force` is also used; without it, test execution will terminate after the first failure. The `--retry` and `--retry-failure` options do not affect how many times a test repeated with `--repeat` may fail in total, as each repetition is considered a new test case, which may in turn be retried if it fails. | | `--retry-failure=N` | When using the --retry option to retry failed tests, stop when N failures have occured (default 2). Setting it to 0 or 1 effectively turns off retries. | | `--reorder` | Reorder tests to get fewer server restarts. This is the default behavior. There is no guarantee that a particular set of tests will always end up in the same order. Use `-no-reorder` to disable. | | `--help` | Display help text. | | `--testcase-timeout=MINUTES` | Max test case run time in minutes (default 15). | | `--suite-timeout=MINUTES` | Max test suite run time in minutes (default 360). | | `--shutdown-timeout=SECONDS` | Max number of seconds to wait for server shutdown before killing servers (default 10). | | `--warnings` | Scan the log files for warnings and report any suspicious ones; if any are found, the test will be marked as failed. Use `--nowarnings` to turn off. | | `--stop-file=file` | If this file is detected, [mysqltest](../mysqltest/index) will not start new tests until the file is removed (also MTR\_STOP\_FILE environment variable). | | `--stop-keep-alive=sec` | Works with `--stop-file`, print messages every *sec* seconds when mysqltest is waiting to remove the file (for buildbot) (also MTR\_STOP\_KEEP\_ALIVE environment variable). | | `--sleep=SECONDS` | Passed to [mysqltest](../mysqltest/index); will be used as fixed sleep time. | | `--debug-sync-timeout=NUM` | Set default timeout for WAIT\_FOR debug sync actions. Disable facility with NUM=0. | | `--gcov` | Collect coverage information after the test. The result is a [dgcov](../dgcov/index) file per source and header file and a `last_changes.dgcov` file in the vardir with the coverage for the uncommitted changes if any (or the last commit). | | `--gprof` | Collect profiling information using the gprof profiling tool. | | `--experimental=<file>` | Specify a file that contains a list of test cases that should be displayed with the [ exp-fail ] code rather than [ fail ] if they fail. For an example of a file that might be specified via this option, see *mysql-test/collections/default.experimental*. | | `--report-features` | First run a "test" that reports MariaDB features, displaying the output of [SHOW ENGINES](../show-engines/index) and [SHOW VARIABLES](../show-variables/index). This can be used to verify that binaries are built with all required features. | | `--timestamp` | Print timestamp before each test report line, showing when the test ended. | | `--timediff` | Used with `--timestamp`, also print time passed since the previous test started. | | `--max-connections=N` | Maximum number of simultaneous server connections that may be used per test. Default is 128. Minimum is 8, maximum is 5120. Corresponds to the same option for [mysqltest](../mysqltest-and-mysqltest-embedded/index). | | `--default-myisam` | Set default storage engine to [MyISAM](../myisam/index) for non-innodb tests. This is needed after switching default storage engine to [InnoDB](../innodb/index). | | `--report-times` | Report how much time has been spent on different phases of test execution. | | `--stress=ARGS` | Run stress test, providing options to [mysql-stress-test.pl](../mysql-stress-test/index). Options are separated by comma. | | `xml-report=<file>` | Output jUnit xml file of the results. From [MariaDB 10.1.45](https://mariadb.com/kb/en/mariadb-10145-release-notes/), [MariaDB 10.2.32](https://mariadb.com/kb/en/mariadb-10232-release-notes/), [MariaDB 10.3.23](https://mariadb.com/kb/en/mariadb-10323-release-notes/), [MariaDB 10.4.13](https://mariadb.com/kb/en/mariadb-10413-release-notes/), [MariaDB 10.5.3](https://mariadb.com/kb/en/mariadb-1053-release-notes/) | | `tail-lines=N` | Number of lines of the result to include in a failure report. From [MariaDB 10.3.4](https://mariadb.com/kb/en/mariadb-1034-release-notes/). | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb JSON Functions JSON Functions =============== **MariaDB starting with [10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/)**Functions relating to JSON, such as JSON\_VALUE, JSON\_ARRAY etc. | Title | Description | | --- | --- | | [Differences between JSON\_QUERY and JSON\_VALUE](../differences-between-json_query-and-json_value/index) | Comparison between and examples with JSON\_QUERY and JSON\_VALUE. | | [JSONPath Expressions](../jsonpath-expressions/index) | MariaDB JSONPath description and definition. | | [JSON\_ARRAY](../json_array/index) | Returns a JSON array containing the listed values. | | [JSON\_ARRAYAGG](../json_arrayagg/index) | Returns a JSON array containing an element for each value in a given set of JSON or SQL values. | | [JSON\_ARRAY\_APPEND](../json_array_append/index) | Appends values to the end of the given arrays within a JSON document. | | [JSON\_ARRAY\_INSERT](../json_array_insert/index) | Inserts a value into a JSON document. | | [JSON\_COMPACT](../json_compact/index) | Removes all unnecessary spaces so the json document is as short as possible. | | [JSON\_CONTAINS](../json_contains/index) | Whether a value is found in a given JSON document or at a specified path within the document. | | [JSON\_CONTAINS\_PATH](../json_contains_path/index) | Indicates whether the given JSON document contains data at the specified path or paths. | | [JSON\_DEPTH](../json_depth/index) | Maximum depth of a JSON document. | | [JSON\_DETAILED](../json_detailed/index) | Represents JSON in the most understandable way emphasizing nested structures. | | [JSON\_EQUALS](../json_equals/index) | Checks if there is equality between two json objects. | | [JSON\_EXISTS](../json_exists/index) | Determines whether a specified JSON value exists in the given data. | | [JSON\_EXTRACT](../json_extract/index) | Extracts data from a JSON document. | | [JSON\_INSERT](../json_insert/index) | Inserts data into a JSON document. | | [JSON\_KEYS](../json_keys/index) | Returns keys from top-level value of a JSON object or top-level keys from the path. | | [JSON\_LENGTH](../json_length/index) | Returns the length of a JSON document, or the length of a value within the document. | | [JSON\_LOOSE](../json_loose/index) | Adds spaces to a JSON document to make it look more readable. | | [JSON\_MERGE](../json_merge/index) | Merges the given JSON documents. | | [JSON\_MERGE\_PATCH](../json_merge_patch/index) | RFC 7396-compliant merge of the given JSON documents. | | [JSON\_MERGE\_PRESERVE](../json_merge_preserve/index) | Synonym for JSON\_MERGE. | | [JSON\_NORMALIZE](../json_normalize/index) | Recursively sorts keys and removes spaces, allowing comparison of json documents for equality. | | [JSON\_OBJECT](../json_object/index) | Returns a JSON object containing the given key/value pairs. | | [JSON\_OBJECTAGG](../json_objectagg/index) | Returns a JSON object containing key-value pairs. | | [JSON\_OVERLAPS](../json_overlaps/index) | Returns true if two json documents have at least one key-value pair or array element in common. | | [JSON\_QUERY](../json_query/index) | Given a JSON document, returns an object or array specified by the path. | | [JSON\_QUOTE](../json_quote/index) | Quotes a string as a JSON value. | | [JSON\_REMOVE](../json_remove/index) | Removes data from a JSON document. | | [JSON\_REPLACE](../json_replace/index) | Replaces existing values in a JSON document. | | [JSON\_SEARCH](../json_search/index) | Returns the path to the given string within a JSON document. | | [JSON\_SET](../json_set/index) | Updates or inserts data into a JSON document. | | [JSON\_TABLE](../json_table/index) | Given data from a JSON document, returns a representation of it as a relational table. | | [JSON\_TYPE](../json_type/index) | Returns the type of a JSON value. | | [JSON\_UNQUOTE](../json_unquote/index) | Unquotes a JSON value, returning a string. | | [JSON\_VALID](../json_valid/index) | Whether a value is a valid JSON document or not. | | [JSON\_VALUE](../json_value/index) | Given a JSON document, returns the specified scalar. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CHARSET CHARSET ======= Syntax ------ ``` CHARSET(str) ``` Description ----------- Returns the [character set](../data-types-character-sets-and-collations/index) of the string argument. If `str` is not a string, it is considered as a binary string (so the function returns 'binary'). This applies to `NULL`, too. The return value is a string in the utf8 [character set](../data-types-character-sets-and-collations/index). Examples -------- ``` SELECT CHARSET('abc'); +----------------+ | CHARSET('abc') | +----------------+ | latin1 | +----------------+ SELECT CHARSET(CONVERT('abc' USING utf8)); +------------------------------------+ | CHARSET(CONVERT('abc' USING utf8)) | +------------------------------------+ | utf8 | +------------------------------------+ SELECT CHARSET(USER()); +-----------------+ | CHARSET(USER()) | +-----------------+ | utf8 | +-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema INNODB_FT_INDEX_TABLE Table Information Schema INNODB\_FT\_INDEX\_TABLE Table ================================================= The [Information Schema](../information_schema/index) `INNODB_FT_INDEX_TABLE` table contains information about InnoDB [fulltext indexes](../full-text-indexes/index). To avoid re-organizing the fulltext index each time a change is made, which would be very expensive, new changes are stored separately and only integrated when an [OPTIMIZE TABLE](../optimize-table/index) is run. See the [INNODB\_FT\_INDEX\_CACHE](../information-schema-innodb_ft_index_cache-table/index) table. The `SUPER` [privilege](../grant/index) is required to view the table, and it also requires the [innodb\_ft\_aux\_table](../innodb-system-variables/index#innodb_ft_aux_table) system variable to be set. It has the following columns: | Column | Description | | --- | --- | | `WORD` | Word from the text of a column with a fulltext index. Words can appear multiple times in the table, once per `DOC_ID` and `POSITION` combination. | | `FIRST_DOC_ID` | First document ID where this word appears in the index. | | `LAST_DOC_ID` | Last document ID where this word appears in the index. | | `DOC_COUNT` | Number of rows containing this word in the index. | | `DOC_ID` | Document ID of the newly added row, either an appropriate ID column or an internal InnoDB value. | | `POSITION` | Position of this word instance within the `DOC_ID`, as an offset added to the previous `POSITION` instance. | Note that for `OPTIMIZE TABLE` to process InnoDB fulltext index data, the [innodb\_optimize\_fulltext\_only](innodb-server-system-variables#innodb_optimize_fulltext_only) system variable needs to be set to `1`. When this is done, and an `OPTIMIZE TABLE` statement run, the [INNODB\_FT\_INDEX\_CACHE](../information-schema-innodb_ft_index_cache-table/index) table will be emptied, and the `INNODB_FT_INDEX_TABLE` table will be updated. Examples -------- ``` SELECT * FROM INNODB_FT_INDEX_TABLE; Empty set (0.00 sec) SET GLOBAL innodb_optimize_fulltext_only =1; OPTIMIZE TABLE test.ft_innodb; +----------------+----------+----------+----------+ | Table | Op | Msg_type | Msg_text | +----------------+----------+----------+----------+ | test.ft_innodb | optimize | status | OK | +----------------+----------+----------+----------+ SELECT * FROM INNODB_FT_INDEX_TABLE; +------------+--------------+-------------+-----------+--------+----------+ | WORD | FIRST_DOC_ID | LAST_DOC_ID | DOC_COUNT | DOC_ID | POSITION | +------------+--------------+-------------+-----------+--------+----------+ | and | 4 | 5 | 2 | 4 | 0 | | and | 4 | 5 | 2 | 5 | 0 | | arrived | 4 | 4 | 1 | 4 | 20 | | ate | 1 | 5 | 2 | 1 | 4 | | ate | 1 | 5 | 2 | 5 | 8 | | everybody | 1 | 1 | 1 | 1 | 8 | | goldilocks | 4 | 4 | 1 | 4 | 9 | | hungry | 3 | 3 | 1 | 3 | 8 | | pear | 5 | 5 | 1 | 5 | 14 | | she | 5 | 5 | 1 | 5 | 4 | | then | 4 | 4 | 1 | 4 | 4 | | wicked | 2 | 2 | 1 | 2 | 4 | | witch | 2 | 2 | 1 | 2 | 11 | +------------+--------------+-------------+-----------+--------+----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INSERT...RETURNING INSERT...RETURNING ================== **MariaDB starting with [10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/)**INSERT ... RETURNING was added in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/), and returns a resultset of the [inserted](../insert/index) rows. Syntax ------ ``` INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [PARTITION (partition_list)] [(col,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),... [ ON DUPLICATE KEY UPDATE col=expr [, col=expr] ... ] [RETURNING select_expr [, select_expr ...]] ``` Or: ``` INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [PARTITION (partition_list)] SET col={expr | DEFAULT}, ... [ ON DUPLICATE KEY UPDATE col=expr [, col=expr] ... ] [RETURNING select_expr [, select_expr ...]] ``` Or: ``` INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [PARTITION (partition_list)] [(col,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col=expr [, col=expr] ... ] [RETURNING select_expr [, select_expr ...]] ``` Description ----------- `INSERT ... RETURNING` returns a resultset of the [inserted](../insert/index) rows. This returns the listed columns for all the rows that are inserted, or alternatively, the specified SELECT expression. Any SQL expressions which can be calculated can be used in the select expression for the RETURNING clause, including virtual columns and aliases, expressions which use various operators such as bitwise, logical and arithmetic operators, string functions, date-time functions, numeric functions, control flow functions, secondary functions and stored functions. Along with this, statements which have subqueries and prepared statements can also be used. Examples -------- Simple INSERT statements: ``` CREATE OR REPLACE TABLE t2 (id INT, animal VARCHAR(20), t TIMESTAMP); INSERT INTO t2 (id) VALUES (2),(3) RETURNING id,t; +------+---------------------+ | id | t | +------+---------------------+ | 2 | 2021-04-28 00:59:32 | | 3 | 2021-04-28 00:59:32 | +------+---------------------+ ``` ``` INSERT INTO t2(id,animal) VALUES (1,'Dog'),(2,'Lion'),(3,'Tiger'),(4,'Leopard') RETURNING id,id+id,id&id,id||id; +------+-------+-------+--------+ | id | id+id | id&id | id||id | +------+-------+-------+--------+ | 1 | 2 | 1 | 1 | | 2 | 4 | 2 | 1 | | 3 | 6 | 3 | 1 | | 4 | 8 | 4 | 1 | +------+-------+-------+--------+ ``` Using stored functions in RETURNING ``` DELIMITER | CREATE FUNCTION f(arg INT) RETURNS INT BEGIN RETURN (SELECT arg+arg); END| DELIMITER ; PREPARE stmt FROM "INSERT INTO t1 SET id1=1, animal1='Bear' RETURNING f(id1), UPPER(animal1)"; EXECUTE stmt; +---------+----------------+ | f(id1) | UPPER(animal1) | +---------+----------------+ | 2 | BEAR | +---------+----------------+ ``` Subqueries in the RETURNING clause that return more than one row or column cannot be used. Aggregate functions cannot be used in the RETURNING clause. Since aggregate functions work on a set of values, and if the purpose is to get the row count, ROW\_COUNT() with SELECT can be used or it can be used in INSERT...SELECT...RETURNING if the table in the RETURNING clause is not the same as the INSERT table. See Also -------- * [INSERT](../insert/index) * [REPLACE ... RETURNING](../replacereturning/index) * [DELETE ... RETURNING](../delete/index#returning) * [Returning clause](https://www.youtube.com/watch?v=n-LTdEBeAT4) (video) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Random Query Generator Tests Random Query Generator Tests ============================ [PQuery](https://github.com/mariadb-corporation/mariadb-qa/tree/master/pquery) is currently in development that does random query generation. The documentation for the Random Query Generator is available [here](http://github.com/RQG/RQG-Documentation/wiki/Category:RandomQueryGenerator). The latest RQG used by MariaDB can be found at: * <https://github.com/elenst/rqg/tree/master> * <https://github.com/MariaDB/randgen/tree/master> The list of automatic tests is located in the `buildbot.conf` file in the `[mariadb.org-tools](../mariadb-tools/index)` repository. See Also -------- * [RQG Performance Comparisons](../rqg-performance-comparisons/index) * [RQG Extensions for MariaDB Features](../rqg-extensions-for-mariadb-features/index) * [Optimizer Quality](../optimizer-quality/index) * [QA Tools](../qa-tools/index) * [Worklog Quality Checklist Template](../worklog-quality-checklist-template/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema COLLATIONS Table Information Schema COLLATIONS Table =================================== The [Information Schema](../information_schema/index) `COLLATIONS` table contains a list of supported [collations](../data-types-character-sets-and-collations/index). It contains the following columns: | Column | Description | | --- | --- | | `COLLATION_NAME` | Name of the collation. | | `CHARACTER_SET_NAME` | Associated character set. | | `ID` | Collation id. | | `IS_DEFAULT` | Whether the collation is the character set's default. | | `IS_COMPILED` | Whether the collation is compiled into the server. | | `SORTLEN` | Sort length, used for determining the memory used to sort strings in this collation. | The [SHOW COLLATION](../show-collation/index) statement returns the same results and both can be reduced in a similar way. For example, in MariaDB Server 10.6, the following two statements return the same results: ``` SHOW COLLATION WHERE Charset LIKE 'utf8mb3'; ``` and ``` SELECT * FROM information_schema.COLLATIONS WHERE CHARACTER_SET_NAME LIKE 'utf8mb3'; ``` In MariaDB Server 10.5 and before, `utf8` should be specified instead of `utf8mb3`. NO PAD collations ----------------- **MariaDB starting with [10.2](../what-is-mariadb-102/index)**`NO PAD` collations regard trailing spaces as normal characters. You can get a list of all `NO PAD` collations as follows: ``` SELECT collation_name FROM information_schema.COLLATIONS WHERE collation_name LIKE "%nopad%"; +------------------------------+ | collation_name | +------------------------------+ | big5_chinese_nopad_ci | | big5_nopad_bin | ... ``` Example ------- ``` SELECT * FROM information_schema.COLLATIONS; +------------------------------+--------------------+------+------------+-------------+---------+ | COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN | +------------------------------+--------------------+------+------------+-------------+---------+ | big5_chinese_ci | big5 | 1 | Yes | Yes | 1 | | big5_bin | big5 | 84 | | Yes | 1 | | big5_chinese_nopad_ci | big5 | 1025 | | Yes | 1 | | big5_nopad_bin | big5 | 1108 | | Yes | 1 | | dec8_swedish_ci | dec8 | 3 | Yes | Yes | 1 | | dec8_bin | dec8 | 69 | | Yes | 1 | | dec8_swedish_nopad_ci | dec8 | 1027 | | Yes | 1 | | dec8_nopad_bin | dec8 | 1093 | | Yes | 1 | | cp850_general_ci | cp850 | 4 | Yes | Yes | 1 | | cp850_bin | cp850 | 80 | | Yes | 1 | ... ``` See Also -------- * [Setting Character Sets and Collations](../setting-character-sets-and-collations/index) - specifying the character set at the server, database, table and column levels * [Supported Character Sets and Collations](../supported-character-sets-and-collations/index) - full list of supported characters sets and collations. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql_setpermission mysql\_setpermission ==================== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-setpermission` is a symlink to `mysql_setpermission`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mysql_setpermission` is the symlink, and `mariadb-setpermission` the binary name. Syntax ------ ``` mysql_setpermission [options] ``` Description ----------- *mysql\_setpermission* is a Perl script that was originally written and contributed by Luuk de Boer. It requires the DBI and DBD::mysql Perl modules to be installed. *mysql\_setpermission* can help you add users or databases or change passwords in MariaDB. It interactively sets permissions in the MariaDB grant tables, but does not check permissions which have already been set in MariaDB. So if you can't connect to MariaDB using the permission you just added, take a look at the permissions which have already been set in MariaDB. The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables. *mysql\_setpermission* also reads options from the [client] and [perl] groups in the .my.cnf file in your home directory, if the file exists. The following options are available: Options ------- | Option | Description | | --- | --- | | | | | --- | --- | | `--help` | Display a help message and exit. | | `--host=host_name` | Connect to the MariaDB server on the given host. | | `--password=password` | The password to use when connecting to the server. Note that the password value is not optional for this option, unlike for other MariaDB programs **Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.** | | `--port=port_num` | The TCP/IP port number to use for the connection. | | `--socket=path` | For connections to localhost, the Unix socket file to use. | | `--user=user_name` | The MariaDB user name to use when connecting to the server. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Using the S3 Storage Engine Using the S3 Storage Engine =========================== **MariaDB starting with [10.5](../what-is-mariadb-105/index)**The [S3 storage engine](../s3-storage-engine/index) has been available since [MariaDB 10.5.4](https://mariadb.com/kb/en/mariadb-1054-release-notes/). The [S3 storage engine](../s3-storage-engine/index) is read only and allows one to archive MariaDB tables in Amazon S3, or any third-party public or private cloud that implements S3 API (of which there are many), but still have them accessible for reading in MariaDB. Installing the Plugin --------------------- As of [MariaDB 10.5.7](https://mariadb.com/kb/en/mariadb-1057-release-notes/), the S3 storage engine is currently [gamma maturity](../release-criteria/index), so the following step can be omitted. On earlier releases, when it was [alpha maturity](../release-criteria/index), it will not load by default on a stable release of the server due to the default value of the [plugin\_maturity](../server-system-variables/index#plugin_maturity) variable. Set to `alpha` (or below) in your config file to permit installation of the plugin: ``` [mysqld] plugin-maturity = alpha ``` and restart the server. Now [install the plugin library](../plugin-overview/index#installing-a-plugin), for example: ``` INSTALL SONAME 'ha_s3'; ``` If the library is not available, for example: ``` INSTALL SONAME 'ha_s3'; ERROR 1126 (HY000): Can't open shared library '/var/lib/mysql/lib64/mysql/plugin/ha_s3.so' (errno: 13, cannot open shared object file: No such file or directory) ``` you may need to install a separate package for the S3 storage engine, for example: ``` shell> yum install MariaDB-s3-engine ``` Moving Data to S3 ----------------- To move data from an existing table to S3, one can run: ``` ALTER TABLE old_table ENGINE=S3 COMPRESSION_ALGORITHM=zlib ``` To get data back to a 'normal' table one can do: ``` ALTER TABLE s3_table ENGINE=INNODB ``` New Options for [ALTER TABLE](../alter-table/index) --------------------------------------------------- * **`S3_BLOCK_SIZE` :** Set to 4M as default. This is the block size for all index and data pages stored in S3. * **`COMPRESSION_ALGORITHM` :** Set to 'none' as default. Which compression algorithm to use for block stored in S3. Options are: `none` or `zlib`. [ALTER TABLE](../alter-table/index) can be used on S3 tables as normal to add columns or change column definitions. mysqld Startup Options for S3 ----------------------------- To be able to use S3 for storage one **\*must**\* define how to access S3 and where data are stored in S3: * **[s3\_access\_key](../s3-storage-engine-system-variables/index#s3_access_key):** The AWS access key to access your data * **[s3\_secret\_key](../s3-storage-engine-system-variables/index#s3_secret_key):** The AWS secret key to access your data * **[s3\_bucket](../s3-storage-engine-system-variables/index#s3_bucket):** The AWS bucket where your data should be stored. All MariaDB table data is stored in this bucket. * **[s3\_region](../s3-storage-engine-system-variables/index#s3_region):** The AWS region where your data should be stored. If you are using an S3 service that is using HTTP to connect (like <https://min.io/>) you also need the set the following variables: * **[s3\_port](../s3-storage-engine-system-variables/index#s3_port):** Port number to connect to (0 means use default) * **[s3\_use\_http](../s3-storage-engine-system-variables/index#s3_use_http):** If true, force use of HTTP protocol If you are going to use a primary-replica setup, you should look at the following variables: * **[s3\_replicate\_alter\_as\_create\_select](../s3-storage-engine-system-variables/index#s3-replicate-alter-as-create-select):** When converting an S3 table to local table, log all rows in binary log. Defaults to `TRUE`. This allows the replica to replicate `CREATE TABLE .. SELECT FROM s3_table` even it the replica doesn't have access to the original `s3_table`. * **[s3\_slave\_ignore\_updates](../s3-storage-engine-system-variables/index#s3-slave-ignore-updates):** Should be set if primary and replica share the same S3 instance. This tells the replica that it can ignore any updates to the S3 tables as they are already applied on the primary. Defaults to `FALSE`. The above defaults assume that the primary and replica don't share the same S3 instance. Other, less critical options, are: * **[s3\_host\_name](../s3-storage-engine-system-variables/index#s3_host_name):** Hostname for the S3 service. "s3.amazonaws.com", Amazon S3 service, by default. * **[s3\_protocol\_version](../s3-storage-engine-system-variables/index#s3_protocol_version):** Protocol used to communication with S3. One of "Auto", "Amazon" or "Original" where "Auto" is the default. If you get errors like "8 Access Denied" when you are connecting to another service provider, then try to change this option. The reason for this variable is that Amazon has changed some parts of the S3 protocol since they originally introduced it but other service providers are still using the original protocol. * **[s3\_block\_size](../s3-storage-engine-system-variables/index#s3_block_size):** Set to 4M as default. This is the default block size for a table, if not specified in [CREATE TABLE](../create-table/index). * **[s3\_pagecache\_buffer\_size](../s3-storage-engine-system-variables/index#s3_pagecache_buffer_size):** Default 128M. The size of the buffer used for data and index blocks for S3 tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford. Last some options you probably don't have to ever touch: * **[s3\_pagecache\_age\_threshold](../s3-storage-engine-system-variables/index#s3_pagecache_age_threshold) :** Default 300: This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in the page cache. * **[s3\_pagecache\_division\_limit](../s3-storage-engine-system-variables/index#s3_pagecache_division_limit):** Default 100. The minimum percentage of warm blocks in key cache. * **[s3\_pagecache\_file\_hash\_size](../s3-storage-engine-system-variables/index#s3_pagecache_file_hash_size):** Default 512. Number of hash buckets for open files. If you have a lot of S3 files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open S3 files. * **[s3\_debug](../s3-storage-engine-system-variables/index#s3_debug):** Default 0. Generates a trace file from libmarias3 on stderr (mysqld.err) for debugging the S3 protocol. Typical my.cnf Entry for connecting to Amazon S3 service -------------------------------------------------------- ``` [mariadb] s3=ON s3-bucket=mariadb s3-access-key=xxxx s3-secret-key=xxx s3-region=eu-north-1 s3-host-name=s3.amazonaws.com # The following is useful if you want to use minio as a S3 server. (https://min.io/) #s3-port=9000 #s3-use-http=ON # Primary and replica share same S3 tables. s3-slave-ignore-updates=1 [aria_s3_copy] s3-bucket=mariadb s3-access-key=xxxx s3-secret-key=xxx s3-region=eu-north-1 s3-host-name=s3.amazonaws.com # The following is useful if you want to use minio as a S3 server. (https://min.io/) #s3-port=9000 #s3-use-http=ON ``` Typical my.cnf entry for connecting to a [minio](https://min.io) S3 server -------------------------------------------------------------------------- ``` [mariadb] s3=ON s3-host-name="127.0.0.1" s3-bucket=storage-engine s3-access-key=minio s3-secret-key=minioadmin s3-port=9000 s3-use-http=ON [aria_s3_copy] s3=ON s3-host-name="127.0.0.1" s3-bucket=storage-engine s3-access-key=minio s3-secret-key=minioadmin s3-port=9000 s3-use-http=ON ``` Typical Usage Case for S3 Tables -------------------------------- The typical use case would be that there exists tables that after some time would become fairly inactive, but are still important so that they can not be removed. In that case, an option is to move such a table to an archiving service, which is accessible through an S3 API. Notice that S3 means the Cloud Object Storage API defined by Amazon AWS. Often the whole of Amazon’s Cloud Object Storage is referred to as S3. In the context of the S3 archive storage engine, it refers to the API itself that defines how to store objects in a cloud service, being it Amazon’s or someone else’s. OpenStack for example provides an S3 API for storing objects. The main benefit of storing things in an S3 compatible storage is that the cost of storage is much cheaper than many other alternatives. Many S3 implementations also provide reliable long-term storage. Operations Allowed on S3 Tables ------------------------------- * [ALTER TABLE](../alter-table/index) S3 supports all types, keys and other options that are supported by the [Aria](../aria-storage-engine/index) engine. One can also perform [ALTER TABLE](../alter-table/index) on an S3 table to add or modify columns etc. * [DROP TABLE](../drop-table/index) * [SELECT](../select/index) Any SELECT operations you can perform on a normal table should work with an S3 table. * [SHOW TABLES](../show-tables/index) will show all tables that exist in the current defined S3 location. * S3 tables can be part of [partitions](../partitions-files/index). See Discovery below. Discovery --------- The S3 storage engine supports full [MariaDB discovery](../table-discovery/index). This means that if you have the S3 storage engine enabled and properly configured, the table stored in S3 will automatically be discovered when it's accessed with [SHOW TABLES](../show-tables/index), [SELECT](../select/index) or any other operation that tries to access it. In the case of SELECT, the .frm file from S3 will be copied to the local storage to speed up future accesses. When an S3 table is opened for the first time (it's not in the table cache) and there is a local .frm file, the S3 engine will check if it's still relevant, and if not, update or delete the .frm file. This means that if the table definition changes on S3 and it's in the local cache, one has to execute `[FLUSH TABLES](../flush/index)` to get MariaDB to notice the change and update the .frm file. If partitioning S3 tables are used, the partition definitions will also be stored on S3 storage and will be discovered by other servers. Discovery of S3 tables is not done for tables in the [mysql databases](../the-mysql-database-tables/index) to make mysqld boot faster and more securely. Replication ----------- S3 works with [replication](../replication-overview/index). One can use replication in two different scenarios: * The primary and replica share the same S3 storage. In this case the primary will make all changes to the S3 data and the replica will ignore any changes in the replication stream to S3 data . This scenario is achieved by setting [s3\_slave\_ignore\_updates](../s3-storage-engine-system-variables/index#s3-slave-ignore-updates) to 1. * The primary and replica don't share the same S3 storage or the replica uses another storage engine for the S3 tables. This scenario is achieved by setting [s3\_slave\_ignore\_updates](../s3-storage-engine-system-variables/index#s3-slave-ignore-updates) to 0. aria\_s3\_copy -------------- [aria\_s3\_copy](../aria_s3_copy/index) is an external tool that one can use to copy [Aria](../aria-storage-engine/index) tables to and from S3. Use `aria_s3_copy --help` to get the options of how to use it. mysqldump --------- * [mysqldump](../mysqldump/index) will by default ignore S3 tables. If `mysqldump` is run with the `--copy-s3-tables` option, the resulting file will contain a CREATE statement for a similar [Aria](../aria-storage-engine/index) table, followed by the table data and ending with an `ALTER TABLE xxx ENGINE=S3`. ANALYZE TABLE ------------- As of [MariaDB 10.5.14](https://mariadb.com/kb/en/mariadb-10514-release-notes/), `[ANALYZE TABLE](../analyze-table/index)` is supported for S3 tables. As the S3 tables are read-only, a normal `ANALYZE TABLE` will not do anything. However using `ANALYZE TABLE table_name PERSISTENT FOR...` will now work. CHECK TABLE ----------- As of [MariaDB 10.5.14](https://mariadb.com/kb/en/mariadb-10514-release-notes/), `[CHECK TABLE](../check-table/index)` will work. As S3 tables are read only it is very unlikely that they can become corrupted. The only known way an S3 table could be corrupted if either the original table copied to S3 was corrupted or the process of copying the original table to S3 was somehow interrupted. Current Limitations ------------------- * [mysql-test-run](../mysql-test-run/index) doesn't by default test the S3 engine as we can't embed AWS keys into mysql-test-run. * Replicas should not access S3 tables while they are ALTERed! This is because there is no locking implemented to S3 between servers. However, after a table (either the original S3 table or the partitioned S3 table) is changed on the primary, the replica will notice this on the next access and update its local definition. ### Limitations in [ALTER .. PARTITION](../alter-table/index) All [ALTER PARTITION](../alter-table/index) operations are supported on S3 partitioning tables except: * REBUILD PARTITION * TRUNCATE PARTITION * REORGANIZE PARTITION Performance Considerations -------------------------- Depending on your connection speed to your S3 provider, there can be some notable slowdowns in some operations. ### Discovery As S3 is supporting discovery (automatically making tables available that are in S3) this can cause some small performance problems if the S3 engine is enabled. Partitioning S3 tables also support discovery. * CREATE TABLE is a bit slower as the S3 engine has to check if the to-be-created table is already S3. * Queries on information\_schema tables are slower as S3 has to check if there is new tables in S3. * DROP of non existing tables are slower as S3 has to check if the table is in S3. There are no performance degradation's when accessing existing tables on the server. Accessing the S3 table the first time will copy the .frm file from S3 to the local disk, speeding up future accesses to the table. ### Caching * Accessing a table on S3 can take some time , especially if you are using big packets ([s3\_block\_size](../s3-storage-engine-system-variables/index#s3_block_size)). However the second access to the same data should be fast as it's then cached in the S3 page cache. ### Things to Try to Increase Performance If you have performance problems with the S3 engine, here are some things you can try: * Decreasing [s3\_block\_size](../s3-storage-engine-system-variables/index#s3_block_size). This can be done both globally and per table. * Use COMPRESSION\_ALGORITHM=zlib when creating the table. This will decrease the amount of data transferred from S3 to the local cache. * Increasing the size of the s3 page cache: [s3\_pagecache\_buffer\_size](../s3-storage-engine-system-variables/index#s3_pagecache_buffer_size) Try also to execute the query twice to check if the problem is that the data was not properly cached. When data is cached locally the performance should be excellent. Future Development Ideas ------------------------ * Store aws keys and region in the mysql.servers table (as [Spider](../spider/index) and [FederatedX](../federatedx/index)). This will allow one to have different tables on different S3 servers. * Store s3 bucket, access\_key and secret key in a cache to better be able to better to reuse connections. This would save some memory and make some S3 accesses a bit faster as we could reuse old connections. Troubleshooting S3 on SELinux ----------------------------- If you get errors such as: ``` ERROR 3 (HY000): Got error from put_object(bubu/produkt/frm): 5 Couldn't connect to server ``` one reason could be that your system doesn't allow MariaDB to connect to ports other than 3306. To procedure to enable other ports is the following: Search for the ports allowed for MariaDB: ``` $ sudo semanage port -l | grep mysqd_port_t mysqld_port_t tcp 1186, 3306, 63132-63164 ``` Say you want to allow MariaDB to connect to port 32768: ``` $ sudo semanage port -a -t mysqld_port_t -p tcp 32768 ``` You can verify that the new port, 32768, is now allowed for MariaDB: ``` $ sudo semanage port -l | grep mysqd_port_t mysqld_port_t tcp 32768,1186, 3306, 63132-63164 ``` See Also -------- * [S3 storage engine internals](../s3-storage-engine-internals/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema INNODB_FT_CONFIG Table Information Schema INNODB\_FT\_CONFIG Table =========================================== The [Information Schema](../information_schema/index) `INNODB_FT_CONFIG` table contains InnoDB [fulltext index](../full-text-indexes/index) metadata. The `SUPER` [privilege](../grant/index) is required to view the table, and it also requires the [innodb\_ft\_aux\_table](../xtradbinnodb-server-system-variables/index#innodb_ft_aux_table) system variable to be set. It has the following columns: | Column | Description | | --- | --- | | `KEY` | Metadata item name. | | `VALUE` | Associated value. | Example ------- ``` SELECT * FROM INNODB_FT_CONFIG; +---------------------------+-------+ | KEY | VALUE | +---------------------------+-------+ | optimize_checkpoint_limit | 180 | | synced_doc_id | 6 | | last_optimized_word | | | deleted_doc_count | 0 | | total_word_count | | | optimize_start_time | | | optimize_end_time | | | stopword_table_name | | | use_stopword | 1 | | table_state | 0 | +---------------------------+-------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INSTR INSTR ===== Syntax ------ ``` INSTR(str,substr) ``` Description ----------- Returns the position of the first occurrence of substring *substr* in string *str*. This is the same as the two-argument form of [LOCATE()](../locate/index), except that the order of the arguments is reversed. `INSTR()` performs a case-insensitive search. If any argument is `NULL`, returns `NULL`. Examples -------- ``` SELECT INSTR('foobarbar', 'bar'); +---------------------------+ | INSTR('foobarbar', 'bar') | +---------------------------+ | 4 | +---------------------------+ SELECT INSTR('My', 'Maria'); +----------------------+ | INSTR('My', 'Maria') | +----------------------+ | 0 | +----------------------+ ``` See Also -------- * [LOCATE()](../locate/index) ; Returns the position of a string within a string * [SUBSTRING\_INDEX()](../substring_index/index) ; Returns the substring from string before count occurrences of a delimiter Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Compiling MariaDB for Debugging Compiling MariaDB for Debugging =============================== Compiling MariaDB with full debug information includes all code symbols and also new code to do internal testing of structures and allow one to trace MariaDB execution. A full debug binary will be notably slower than a normal binary (30%). Compiling MariaDB for Debugging Using the `CMAKE_BUILD_TYPE` Option ------------------------------------------------------------------- On Unix systems, you can build a debug build by executing `cmake` and by setting the `CMAKE_BUILD_TYPE` option to `Debug`. For example: ``` cmake -DCMAKE_BUILD_TYPE=Debug . ``` Compiling MariaDB for Debugging Using Build Scripts --------------------------------------------------- The other option is to use the scripts in the BUILD directory that will compile MariaDB with most common debug options and plugins: ``` ./BUILD/compile-pentium64-debug-max ``` or alternatively if you want to use the [Valgrind](http://www.valgrind.org) memory checking tool with the [MariaDB test system](../mysqltest/index): ``` ./BUILD/compile-pentium64-valgrind-max ``` There are separate build scripts for different configurations in the BUILD directory. You can find a list of the needed packages/libraries for building on Linux [here](../build_environment_setup_for_linux/index). ### Example of Compiling MariaDB for Debugging Using Build Scripts * Scripts containing "debug" in the name are for developers that want to build, develop and test MariaDB. * Scripts containing "valgrind" in the name are for running mysqld under [[|http://valgrind.org|valgrind]]. Compiling for valgrind means that we are using another implementation of MEM\_ROOT to allow valgrind to better detect memory overruns. In addition, some memory areas are marked as used/not used to remove some false positives. * Scripts containing "max" in the name include all normal plugins. Here is an example of how to compile MariaDB for debugging in your home directory with [MariaDB 5.2.9](https://mariadb.com/kb/en/mariadb-529-release-notes/) as an example: ``` cd ~ mkdir mariadb cd mariadb tar xvf mariadb-5.2.9.tar.gz ln -s mariadb-5.2.9 current cd current ./BUILD/compile-pentium64-debug-max ``` The last command will produce a debug version of `sql/mysqld`. If you have a system other than 64 bit Intel/AMD on Linux you can use a different `BUILD/...-debug-max` file. If this fails, you can try with: ``` cmake --build . --config Debug make -j4 ``` Building Optimized Build With Debug Symbols ------------------------------------------- To build MariaDB with symbols, to get better stack traces and to be able to debug the binary with `gdb`, you need to supply the `-g3` option to the `gcc` compiler. Just compiling with `-g3` will make the binary much bigger but the slowdown of the server should be negligible. One way to do this is to edit the script ``` BUILD/compile-pentium64-max ``` and add the -g3 last on the line with `extra_flags`, like this: ``` extra_flags="$pentium64_cflags $fast_cflags -g3" ``` After that you can compile MariaDB with debugging symbols by just execution the above script. Doing a Debug Build on Debian/Ubuntu ------------------------------------ To build a "mysqld" binary with debugging enabled that uses the same parameters as the ones used in Debian/Ubuntu binary packages, you must do as follows (you must have a deb-src line of one of the MariaDB repositories on your /etc/apt/sources.list in order to do that): ``` apt-get build-dep mariadb-10.2 apt-get install cmake libaio1 libaio-dev apt-get source mariadb-10.2 cd mariadb-10.2* ./debian/rules configure ./BUILD/compile-pentuim64-debug-all ``` Then you will have your "debugging enabled" mysqld binary in the sql/ directory. This binary can directly replace the one provided by the binary package that is placed on "/usr/bin/mysqld". ### Temporarily Installing your Debug Build The commands shown below replace the release `mysqld` binary with the debug `mysqld` binary that you compiled. Most importantly, they replace the binary in a way which makes it trivial to revert back to the original release `mysqld` binary. First, [stop MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). Then, use the `mv` utility to rename the release `mysqld` binary: ``` sudo mv /usr/sbin/mysqld /usr/sbin/mysqld-orig ``` Note: Do not use the `cp` utility because that will change the file modification timestamp. Then, install the debug `mysqld` binary from your source tree: ``` sudo install ~/mariadb-10.3.14/sql/mysqld /usr/sbin/mysqld-debug ``` Then, link the `mysqld` path to the path of your debug `mysqld` binary: ``` sudo ln -s /usr/sbin/mysqld-debug /usr/sbin/mysqld ``` Then, [start MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). Be sure to replace `/usr/sbin/mysqld` with the path to your `mysqld` binary and to also replace ``~`/mariadb-10.3.14/sql/mysqld` with the path to your debug `mysqld` binary. ### Reinstalling your Release Build If you want to restore your original `mysqld` binary, you can do it with the following process:: First, [stop MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). Then, execute the following command to delete the symbolic link: ``` sudo rm /usr/sbin/mysqld ``` Then, execute the following command to move the original `mysqld` release binary back into place: ``` sudo mv /usr/sbin/mysqld-orig /usr/sbin/mysqld ``` Then, [start MariaDB](../starting-and-stopping-mariadb-starting-and-stopping-mariadb/index). Be sure to replace `/usr/sbin/mysqld` with the path to your `mysqld` binary Notice that the debug `mysqld` binary located at `/usr/sbin/mysqld-debug` was not deleted. Only the symbolic link to this file was deleted. The debug `mysqld` binary is still present if it is needed again in the future. Different Compilation Options ----------------------------- ### Changing DBUG\_ASSERT to Print to Error Log A debug binary has lots of code checks and asserts, that are not checked in production. This is done to get more performance when running in production. In some cases, when one is trying to find a hard-to-repeat bug, it could be beneficial to have these checks in production builds too. Compiling with `-DDBUG_ASSERT_AS_PRINTF` will change DBUG\_ASSERT() to print any failed check to the [error log](../error-log/index). ``` cmake . -DDBUG_ASSERT_AS_PRINTF ``` Enabling the above option should not have any notable impact on performance (probably < 1% slowdown). This is achieved by grouping asserts in MariaDB server code into two groups: * Fast checks, using `DBUG_ASSERT()`: These are converted to printing to error log. * Slow checks, using `DBUG_SLOW_ASSERT()`. These will always be removed in production builds. See Also -------- * [Build environment setup for Linux](../build_environment_setup_for_linux/index) * [Debugging MariaDB with a debugger](../debugging-mariadb-with-a-debugger/index) * [Creating a trace file](../creating-a-trace-file/index) * [Using ASAN with MariaDB](../how-to-compile-and-use-mariadb-with-addresssanitizer-asan/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Administrative SQL Statements Administrative SQL Statements ============================== SQL statements for administering MariaDB. | Title | Description | | --- | --- | | [Table Statements](../table-statements/index) | Documentation on creating, altering, analyzing and maintaining tables. | | [ANALYZE and EXPLAIN Statements](../analyze-and-explain-statements/index) | Articles on the ANALYZE and EXPLAIN statements | | [BACKUP Commands](../backup-commands/index) | Commands used by backup tools. | | [FLUSH Commands](../flush-commands/index) | Commands to flush or reset various caches in MariaDB. | | [Replication Commands](../replication-commands/index) | List of replication-related commands. | | [Plugin SQL Statements](../plugin-sql-statements/index) | List of SQL statements related to plugins. | | [SET Commands](../set-commands/index) | The SET commands | | [SHOW](../show/index) | Articles on the various SHOW commands. | | [System Tables](../system-tables/index) | | | [BINLOG](../binlog/index) | Generated by mysqlbinlog | | [PURGE BINARY LOGS](../purge-binary-logs/index) | PURGE BINARY LOGS removes all binary logs from the server, prior to the provided date or log file. | | [CACHE INDEX](../cache-index/index) | Caches MyISAM or Aria indexes | | [DESCRIBE](../describe/index) | Information about columns in a table. | | [EXECUTE Statement](../execute-statement/index) | Executes a previously PREPAREd statement | | [HELP Command](../help-command/index) | The HELP command will retrieve syntax and help within the mysql client. | | [KILL [CONNECTION | QUERY]](../kill/index) | Kill connection by query or thread id. | | [LOAD INDEX](../load-index/index) | Loads one or more indexes from one or more MyISAM/Aria tables into a key buffer. | | [RESET](../reset/index) | Overall description of the different RESET commands | | [SHUTDOWN](../shutdown/index) | Shuts down the server. | | [USE](../use/index) | Set the current default database. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP PACKAGE BODY DROP PACKAGE BODY ================= **MariaDB starting with [10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/)**Oracle-style packages were introduced in [MariaDB 10.3.5](https://mariadb.com/kb/en/mariadb-1035-release-notes/). Syntax ------ ``` DROP PACKAGE BODY [IF EXISTS] [ db_name . ] package_name ``` Description ----------- The `DROP PACKAGE BODY` statement can be used when [Oracle SQL\_MODE](../sql_modeoracle-from-mariadb-103/index) is set. The `DROP PACKAGE BODY` statement drops the package body (i.e the implementation), previously created using the [CREATE PACKAGE BODY](../create-package-body/index) statement. Note, `DROP PACKAGE BODY` drops only the package implementation, but does not drop the package specification. Use [DROP PACKAGE](../drop-package/index) to drop the package entirely (i.e. both implementation and specification). See also -------- * [CREATE PACKAGE](../create-package/index) * [SHOW CREATE PACKAGE](../show-create-package/index) * [DROP PACKAGE](../drop-package/index) * [CREATE PACKAGE BODY](../create-package-body/index) * [SHOW CREATE PACKAGE BODY](../show-create-package-body/index) * [Oracle SQL\_MODE](../sql_modeoracle-from-mariadb-103/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SphinxSE SphinxSE ========= SphinxSE is a storage engine that talks to searchd (Sphinx daemon) to enable text searching. | Title | Description | | --- | --- | | [About SphinxSE](../about-sphinxse/index) | About the Sphinx Storage Engine | | [Installing Sphinx](../installing-sphinx/index) | Installing the Sphinx daemon | | [Configuring Sphinx](../configuring-sphinx/index) | Before you can get Sphinx working with the Sphinx Storage Engine on MariaDB... | | [Installing and Testing SphinxSE with MariaDB](../installing-and-testing-sphinxse-with-mariadb/index) | How to install and test SphinxSE | | [Sphinx Status Variables](../sphinx-status-variables/index) | Sphinx status variables. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Upgrade from InfiniDB 4.x to MariaDB ColumnStore Upgrade from InfiniDB 4.x to MariaDB ColumnStore ================================================ Upgrade from InfiniDB 4.x to MariaDB ColumnStore ------------------------------------------------ Overview -------- The columnar disk storage format is unchanged between InfiniDB 4.X and MariaDB ColumnStore allowing for a software upgrade on the same system. This document outlines an approach to perform the upgrade. If you are wanted to migrate the data from an InfiniDB system to a separate MariaDB ColumnStore system, then please follow the Migration Guide: [https://mariadb.com/kb/en/mariadb/migrating-from-infinidb-4x-to-mariadb-columnstore](../mariadb/migrating-from-infinidb-4x-to-mariadb-columnstore) **NOTE: the MySQL engine type of 'infinidb' is still supported in the MariaDB ColumnStore, so tables created as 'infinidb' will continue to work. But it is recommend that all new tables use be created using the engine type of 'columnstore'. If you do not recreate the tables you will get warnings in the MariaDB server log file that the FRM file is inconsistent and the typecode is incorrect. These warnings can be ignored.** Procedure --------- During the install of the MariaDB Columnstore packages, make sure you following the steps show in the prepare guide, like installing the dependency packages. [https://mariadb.com/kb/en/mariadb/preparing-for-columnstore-installation/](../mariadb/preparing-for-columnstore-installation/index) Note: Calpont.xml and my.cnf modifications you manually made are not automatically carried forward on an upgrade. These modifications will need to be incorporated back into Columnstore.xml and my.cnf once the upgrade has occurred. The previous configuration file will be saved as /usr/local/Calpont/etc/Calpont.xml.rpmsave. If you have specified a root database password (which is good practice), then you must configure a .my.cnf file with user credentials for the upgrade process to use. Create a .my.cnf file in the user home directory with 600 file permissions with the following content (updating PASSWORD as appropriate): ``` [mysqladmin] user = root password = PASSWORD ``` This file can be removed after the upgrade is complete. ### Choosing the type of upgrade #### Root User Installs #### Upgrading MariaDB ColumnStore using RPMs Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package mariadb-columnstore-1.x.x-1-centos#.x86\_64.rpm.tar.gz to the PM1 server where you are installing MariaDB ColumnStore. * Get a copy of the InfiniDB system and storage configuration, this will be used to configure the MariaDB ColumnStore. ``` # cc getsystemnetwork # cc getstorageconfig ``` * Shutdown the InfiniDB system: ``` # cc shutdownsystem y ``` * Unpack the tarball, which will generate a set of RPMs that will reside in the /root/ directory. ``` # tar -zxf mariadb-columnstore-1.x.x-1-centos#.x86_64.rpm.tar.gz ``` * Uninstall the InfiniDB RPMs on all servers in the system. ``` # rpm -e --nodeps $(rpm -qa | grep '^infinidb') ``` This step should remove the InfiniDB alias's from the /root/.bashrc file. But double check that file and if the alais still exist, edit the file manually to remove them. * Rename the install directory on all servers ``` # mkdir -p /usr/local/mariadb/columnstore # mv /usr/local/Calpont/* /usr/local/mariadb/columnstore/. ``` * Edit DBRM file on pm1 ``` # sed -i 's/Calpont/mariadb\/columnstore/' /usr/local/mariadb/columnstore/data1/systemFiles/dbrm/BRM_saves_current ``` * Install the MariaDB ColumnStore RPMs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` # rpm -ivh mariadb-columnstore-*1.x.x*rpm ``` * Run postConfigure following the either the Single Server Or Multi Server install guides, based on the type of system being upgraded. Provide the same module and storage configuration settings that were display from the InfiniDB system. [https://mariadb.com/kb/en/mariadb/installing-and-configuring-mariadb-columnstore/](../mariadb/installing-and-configuring-mariadb-columnstore/index) [https://mariadb.com/kb/en/mariadb/installing-and-configuring-a-multi-server-columnstore-system/](../mariadb/installing-and-configuring-a-multi-server-columnstore-system/index) ``` # /usr/local/mariadb/columnstore/bin/postConfigure ``` ### Initial download/install of MariaDB ColumnStore binary package Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /usr/local directory -mariadb-columnstore-1.x.x-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Get a copy of the InfiniDB system and storage configuration, this will be used to configure the MariaDB ColumnStore. ``` # cc getsystemnetwork # cc getstorageconfig ``` * Shutdown the InfiniDB system: ``` # cc shutdownsystem y ``` * Run pre-uninstall script on all servers ``` # /usr/local/mariadb/columnstore/bin/pre-uninstall ``` This step should remove the InfiniDB alias's from the /root/.bashrc file. But double check that file and if the alais still exist, edit the file manually to remove them. * Rename the install directory on all servers ``` # mkdir -p /usr/local/mariadb/columnstore # mv /usr/local/Calpont/* /usr/local/mariadb/columnstore/. ``` * Edit DBRM file on pm1 ``` # sed -i 's/Calpont/mariadb\/columnstore/' /usr/local/mariadb/columnstore/data1/systemFiles/dbrm/BRM_saves_current ``` * Unpack the tarball, in the /usr/local/ directory. ``` # tar -zxvf -mariadb-columnstore-1.x.x-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # /usr/local/mariadb/columnstore/bin/post-install ``` * Run postConfigure following the either the Single Server Or Multi Server install guides, based on the type of system being upgraded. Provide the same module and storage configuration settings that were display from the InfiniDB system. [https://mariadb.com/kb/en/mariadb/installing-and-configuring-mariadb-columnstore/](../mariadb/installing-and-configuring-mariadb-columnstore/index) [https://mariadb.com/kb/en/mariadb/installing-and-configuring-a-multi-server-columnstore-system/](../mariadb/installing-and-configuring-a-multi-server-columnstore-system/index) ``` # /usr/local/mariadb/columnstore/bin/postConfigure ``` ### Upgrading MariaDB ColumnStore using the DEB package A DEB upgrade would be done on a system that supports DEBs like Debian or Ubuntu systems. Upgrade MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /root directory mariadb-columnstore-1.x.x-1.amd64.deb.tar.gz (DEB 64-BIT) to the server where you are installing MariaDB ColumnStore. * Get a copy of the InfiniDB system and storage configuration, this will be used to configure the MariaDB ColumnStore. ``` # cc getsystemnetwork # cc getstorageconfig ``` * Shutdown the InfiniDB system: ``` # cc shutdownsystem y ``` * Unpack the tarball, which will generate DEBs. ``` # tar -zxf mariadb-columnstore-1.x.x-1.amd64.deb.tar.gz ``` * Remove, purge and install all InfiniDB debs ``` # cd /root/ # dpkg -r infinidb*deb # dpkg -P infinidb*deb ``` This step should remove the InfiniDB alias's from the /root/.bashrc file. But double check that file and if the alais still exist, edit the file manually to remove them. * Rename the install directory on all servers ``` # mkdir -p /usr/local/mariadb/columnstore # mv /usr/local/Calpont/* /usr/local/mariadb/columnstore/. ``` * Edit DBRM file on pm1 ``` # sed -i 's/Calpont/mariadb\/columnstore/' /usr/local/mariadb/columnstore/data1/systemFiles/dbrm/BRM_saves_current ``` * Install the MariaDB ColumnStore DEBs. The MariaDB ColumnStore software will be installed in /usr/local/. ``` # cd /root/ # dpkg -i mariadb-columnstore*.deb ``` * Run postConfigure following the either the Single Server Or Multi Server install guides, based on the type of system being upgraded. Provide the same module and storage configuration settings that were display from the InfiniDB system. [https://mariadb.com/kb/en/mariadb/installing-and-configuring-mariadb-columnstore/](../mariadb/installing-and-configuring-mariadb-columnstore/index) [https://mariadb.com/kb/en/mariadb/installing-and-configuring-a-multi-server-columnstore-system/](../mariadb/installing-and-configuring-a-multi-server-columnstore-system/index) ``` # /usr/local/mariadb/columnstore/bin/postConfigure ``` #### Non-Root User Installs ### Initial download/install of MariaDB ColumnStore binary package Install MariaDB ColumnStore as user root on the server designated as PM1: * Download the package into the /home/'non-root-user" directory mariadb-columnstore-1.x.x-1.x86\_64.bin.tar.gz (Binary 64-BIT)to the server where you are installing MariaDB ColumnStore. * Get a copy of the InfiniDB system and storage configuration, this will be used to configure the MariaDB ColumnStore. ``` # cc getsystemnetwork # cc getstorageconfig ``` * Shutdown the InfiniDB system: ``` # cc shutdownsystem y ``` * Run pre-uninstall script on all servers ``` # $HOME/Calpont/bin/pre-uninstall -i /$HOME/Calpont ``` This step should remove the InfiniDB alias's from the /root/.bashrc file. But double check that file and if the alais still exist, edit the file manually to remove them. * Rename the install directory on all servers ``` # mkdir -p $HOME/mariadb/columnstore # mv $HOME/Calpont/* $HOME/mariadb/columnstore/. ``` * Edit DBRM file on pm1 ``` # sed -i 's/Calpont/mariadb\/columnstore/' $HOME/mariadb/columnstore/data1/systemFiles/dbrm/BRM_saves_current ``` * Unpack the tarball, which will generate the $HOME/ directory. ``` # tar -zxvf -mariadb-columnstore-1.x.x-1.x86_64.bin.tar.gz ``` * Run post-install scripts ``` # $HOME/mariadb/columnstore/bin/post-install -i /home/guest/mariadb/columnstore ``` * Run postConfigure following the either the Single Server Or Multi Server install guides, based on the type of system being upgraded. Provide the same module and storage configuration settings that were display from the InfiniDB system. [https://mariadb.com/kb/en/mariadb/installing-and-configuring-mariadb-columnstore/](../mariadb/installing-and-configuring-mariadb-columnstore/index) [https://mariadb.com/kb/en/mariadb/installing-and-configuring-a-multi-server-columnstore-system/](../mariadb/installing-and-configuring-a-multi-server-columnstore-system/index) ``` # $HOME/mariadb/columnstore/bin/postConfigure -i /home/guest/mariadb/columnstore ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW PROCEDURE STATUS SHOW PROCEDURE STATUS ===================== Syntax ------ ``` SHOW PROCEDURE STATUS [LIKE 'pattern' | WHERE expr] ``` Description ----------- This statement is a MariaDB extension. It returns characteristics of a stored procedure, such as the database, name, type, creator, creation and modification dates, and character set information. A similar statement, `[SHOW FUNCTION STATUS](../show-function-status/index)`, displays information about stored functions. The `LIKE` clause, if present, indicates which procedure or function names to match. The `WHERE` and `LIKE` clauses can be given to select rows using more general conditions, as discussed in [Extended SHOW](../extended-show/index). The [ROUTINES table](../information-schema-routines-table/index) in the INFORMATION\_SCHEMA database contains more detailed information. Examples -------- ``` SHOW PROCEDURE STATUS LIKE 'p1'\G *************************** 1. row *************************** Db: test Name: p1 Type: PROCEDURE Definer: root@localhost Modified: 2010-08-23 13:23:03 Created: 2010-08-23 13:23:03 Security_type: DEFINER Comment: character_set_client: latin1 collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci ``` See Also -------- * [Stored Procedure Overview](../stored-procedure-overview/index) * [CREATE PROCEDURE](../create-procedure/index) * [ALTER PROCEDURE](../alter-procedure/index) * [DROP PROCEDURE](../drop-procedure/index) * [SHOW CREATE PROCEDURE](../show-create-procedure/index) * [Stored Routine Privileges](../stored-routine-privileges/index) * [Information Schema ROUTINES Table](../information-schema-routines-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb IsEmpty IsEmpty ======= A synonym for [ST\_IsEmpty](../st_isempty/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Installing the CONNECT Storage Engine Installing the CONNECT Storage Engine ===================================== The `CONNECT` storage engine enables MariaDB to access external local or remote data (MED). This is done by defining tables based on different data types, in particular files in various formats, data extracted from other DBMS or products (such as Excel or MongoDB) via ODBC or JDBC, or data retrieved from the environment (for example DIR, WMI, and MAC tables) This storage engine supports table partitioning, MariaDB virtual columns and permits defining special columns such as ROWID, FILEID, and SERVID. The storage engine must be installed before it can be used. Installing the Plugin's Package ------------------------------- The `CONNECT` storage engine's shared library is included in MariaDB packages as the `ha_connect.so` or `ha_connect.so` shared library on systems where it can be built. ### Installing on Linux The `CONNECT` storage engine is included in [binary tarballs](../installing-mariadb-binary-tarballs/index) on Linux. #### Installing with a Package Manager The `CONNECT` storage engine can also be installed via a package manager on Linux. In order to do so, your system needs to be configured to install from one of the MariaDB repositories. You can configure your package manager to install it from MariaDB Corporation's MariaDB Package Repository by using the [MariaDB Package Repository setup script](../mariadb-package-repository-setup-and-usage/index). You can also configure your package manager to install it from MariaDB Foundation's MariaDB Repository by using the [MariaDB Repository Configuration Tool](https://downloads.mariadb.org/mariadb/repositories/). ##### Installing with yum/dnf On RHEL, CentOS, Fedora, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[yum](../yum/index)` or `[dnf](https://en.wikipedia.org/wiki/DNF_(software))`. Starting with RHEL 8 and Fedora 22, `yum` has been replaced by `dnf`, which is the next major version of `yum`. However, `yum` commands still work on many systems that use `dnf`. For example: ``` sudo yum install MariaDB-connect-engine ``` ##### Installing with apt-get On Debian, Ubuntu, and other similar Linux distributions, it is highly recommended to install the relevant [DEB package](../installing-mariadb-deb-files/index) from MariaDB's repository using `[apt-get](https://wiki.debian.org/apt-get)`. For example: ``` sudo apt-get install mariadb-plugin-connect ``` ##### Installing with zypper On SLES, OpenSUSE, and other similar Linux distributions, it is highly recommended to install the relevant [RPM package](../rpm/index) from MariaDB's repository using `[zypper](../installing-mariadb-with-zypper/index)`. For example: ``` sudo zypper install MariaDB-connect-engine ``` Installing the Plugin --------------------- Once the shared library is in place, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing `[INSTALL SONAME](../install-soname/index)` or `[INSTALL PLUGIN](../install-plugin/index)`. For example: ``` INSTALL SONAME 'ha_connect'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options. This can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = ha_connect ``` Uninstalling the Plugin ----------------------- You can uninstall the plugin dynamically by executing `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)`. For example: ``` UNINSTALL SONAME 'ha_connect'; ``` If you installed the plugin by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Installing Dependencies ----------------------- The `CONNECT` storage engine has some external dependencies. ### Installing unixODBC The `CONNECT` storage engine requires an ODBC library. On Unix-like systems, that usually means installing [unixODBC](http://www.unixodbc.org/). On some systems, this is installed as the `unixODBC` package. For example: ``` sudo yum install unixODBC ``` On other systems, this is installed as the `libodbc1` package. For example: ``` sudo apt-get install libodbc1 ``` If you do not have the ODBC library installed, then you may get an error about a missing library when you attempt to install the plugin. For example: ``` INSTALL SONAME 'ha_connect'; ERROR 1126 (HY000): Can't open shared library '/home/ian/MariaDB_Downloads/10.1.17/lib/plugin/ha_connect.so' (errno: 2, libodbc.so.1: cannot open shared object file: No such file or directory) ``` See Also -------- * [PLUGIN OVERVIEW](../plugin-overview/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Bitemporal Tables Bitemporal Tables ================= **MariaDB starting with [10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)**Bitemporal tables are tables that use versioning both at the [system](../system-versioned-tables/index) and [application-time period](../application-time-periods/index) levels. Using Bitemporal Tables ----------------------- To create a bitemporal table, use: ``` CREATE TABLE test.t3 ( date_1 DATE, date_2 DATE, row_start TIMESTAMP(6) AS ROW START INVISIBLE, row_end TIMESTAMP(6) AS ROW END INVISIBLE, PERIOD FOR application_time(date_1, date_2), PERIOD FOR system_time(row_start, row_end)) WITH SYSTEM VERSIONING; ``` Note that, while `system_time` here is also a time period, it cannot be used in `DELETE FOR PORTION` or `UPDATE FOR PORTION` statements. ``` DELETE FROM test.t3 FOR PORTION OF system_time FROM '2000-01-01' TO '2018-01-01'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of system_time from '2000-01-01' to '2018-01-01'' at line 1 ``` See Also -------- * [System-versioned Tables](../system-versioned-tables/index) * [Application-time Periods](../application-time-periods/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSON_TABLE JSON\_TABLE =========== **MariaDB starting with [10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/)**JSON\_TABLE was added in [MariaDB 10.6.0](https://mariadb.com/kb/en/mariadb-1060-release-notes/). JSON\_TABLE is a table function that converts JSON data into a relational form. Syntax ------ ``` JSON_TABLE(json_doc, context_path COLUMNS (column_list) ) [AS] alias ``` ``` column_list: column[, column][, ...] ``` ``` column: name FOR ORDINALITY | name type PATH path_str [on_empty] [on_error] | name type EXISTS PATH path_str | NESTED PATH path_str COLUMNS (column_list) ``` ``` on_empty: {NULL | DEFAULT string | ERROR} ON EMPTY ``` ``` on_error: {NULL | DEFAULT string | ERROR} ON ERROR ``` Description ----------- JSON\_TABLE can be used in contexts where a table reference can be used; in the FROM clause of a [SELECT](../select/index) statement, and in multi-table [UPDATE](../update/index)/[DELETE](../delete/index) statements. `json_doc` is the JSON document to extract data from. In the simplest case, it is a string literal containing JSON. In more complex cases it can be an arbitrary expression returning JSON. The expression may have references to columns of other tables. However, one can only refer to tables that precede this JSON\_TABLE invocation. For RIGHT JOIN, it is assumed that its outer side precedes the inner. All tables in outer selects are also considered preceding. `context_path` is a [JSON Path](../jsonpath-expressions/index) expression pointing to a collection of nodes in `json_doc` that will be used as the source of rows. The `COLUMNS` clause declares the names and types of the columns that JSON\_TABLE returns, as well as how the values of the columns are produced. ### Column Definitions The following types of columns are supported: #### Path Columns ``` name type PATH path_str [on_empty] [on_error] ``` Locates the JSON node pointed to by `path_str` and returns its value. The path\_str is evaluated using the current row source node as the context node. ``` set @json=' [ {"name":"Laptop", "color":"black", "price":"1000"}, {"name":"Jeans", "color":"blue"} ]'; select * from json_table(@json, '$[*]' columns( name varchar(10) path '$.name', color varchar(10) path '$.color', price decimal(8,2) path '$.price' ) ) as jt; +--------+-------+---------+ | name | color | price | +--------+-------+---------+ | Laptop | black | 1000.00 | | Jeans | blue | NULL | +--------+-------+---------+ ``` The `on_empty` and `on_error` clauses specify the actions to be performed when the value was not found or there was an error condition. See the ON EMPTY and ON ERROR clauses section for details. #### ORDINALITY Columns ``` name FOR ORDINALITY ``` Counts the rows, starting from 1. Example: ``` set @json=' [ {"name":"Laptop", "color":"black"}, {"name":"Jeans", "color":"blue"} ]'; select * from json_table(@json, '$[*]' columns( id for ordinality, name varchar(10) path '$.name') ) as jt; +------+--------+ | id | name | +------+--------+ | 1 | Laptop | | 2 | Jeans | +------+--------+ ``` #### EXISTS PATH Columns ``` name type EXISTS PATH path_str ``` Checks whether the node pointed to by `value_path` exists. The `value_path` is evaluated using the current row source node as the context node. ``` set @json=' [ {"name":"Laptop", "color":"black", "price":1000}, {"name":"Jeans", "color":"blue"} ]'; select * from json_table(@json, '$[*]' columns( name varchar(10) path '$.name', has_price integer exists path '$.price') ) as jt; +--------+-----------+ | name | has_price | +--------+-----------+ | Laptop | 1 | | Jeans | 0 | +--------+-----------+ ``` #### NESTED PATHs NESTED PATH converts nested JSON structures into multiple rows. ``` NESTED PATH path COLUMNS (column_list) ``` It finds the sequence of JSON nodes pointed to by `path` and uses it to produce rows. For each found node, a row is generated with column values as specified by the NESTED PATH's COLUMNS clause. If `path` finds no nodes, only one row is generated with all columns having NULL values. For example, consider a JSON document that contains an array of items, and each item, in turn, is expected to have an array of its available sizes: ``` set @json=' [ {"name":"Jeans", "sizes": [32, 34, 36]}, {"name":"T-Shirt", "sizes":["Medium", "Large"]}, {"name":"Cellphone"} ]'; ``` NESTED PATH allows one to produce a separate row for each size each item has: ``` select * from json_table(@json, '$[*]' columns( name varchar(10) path '$.name', nested path '$.sizes[*]' columns ( size varchar(32) path '$' ) ) ) as jt; +-----------+--------+ | name | size | +-----------+--------+ | Jeans | 32 | | Jeans | 34 | | Jeans | 36 | | T-Shirt | Medium | | T-Shirt | Large | | Cellphone | NULL | +-----------+--------+ ``` NESTED PATH clauses can be nested within one another. They can also be located next to each other. In that case, the nested path clauses will produce records one at a time. The ones that are not producing records will have all columns set to NULL. Example: ``` set @json=' [ {"name":"Jeans", "sizes": [32, 34, 36], "colors":["black", "blue"]} ]'; select * from json_table(@json, '$[*]' columns( name varchar(10) path '$.name', nested path '$.sizes[*]' columns ( size varchar(32) path '$' ), nested path '$.colors[*]' columns ( color varchar(32) path '$' ) ) ) as jt; +-------+------+-------+ | name | size | color | +-------+------+-------+ | Jeans | 32 | NULL | | Jeans | 34 | NULL | | Jeans | 36 | NULL | | Jeans | NULL | black | | Jeans | NULL | blue | +-------+------+-------+ ``` ### ON EMPTY and ON ERROR Clauses The ON EMPTY clause specifies what will be done when the element specified by the search path is missing in the JSON document. ``` on_empty: {NULL | DEFAULT string | ERROR} ON EMPTY ``` When `ON EMPTY` clause is not present, `NULL ON EMPTY` is implied. ``` on_error: {NULL | DEFAULT string | ERROR} ON ERROR ``` The ON ERROR clause specifies what should be done if a JSON structure error occurs when trying to extract the value pointed to by the path expression. A JSON structure error here occurs only when one attempts to convert a JSON non-scalar (array or object) into a scalar value. When the `ON ERROR` clause is not present, `NULL ON ERROR` is implied. **Note**: A datatype conversion error (e.g. attempt to store a non-integer value into an [integer](../int/index) field, or a [varchar](../varchar/index) column being truncated) is not considered a JSON error and so will not trigger the `ON ERROR` behavior. It will produce warnings, in the same way as [CAST(value AS datatype)](../cast/index) would. ### Replication In the current code, evaluation of JSON\_TABLE is deterministic, that is, for a given input string JSON\_TABLE will always produce the same set of rows in the same order. However, one can think of JSON documents that one can consider identical which will produce different output. In order to be future-proof and withstand changes like: * sorting JSON object members by name (like MySQL does) * changing the way duplicate object members are handled the function is marked as [unsafe for statement-based replication](../unsafe-statements-for-statement-based-replication/index). ### Extracting a Subdocument into a Column **MariaDB starting with [10.6.9](https://mariadb.com/kb/en/mariadb-1069-release-notes/)**Prior to [MariaDB 10.6.9](https://mariadb.com/kb/en/mariadb-1069-release-notes/), JSON\_TABLE did not allow one to extract a JSON "subdocument" into a JSON column. ``` SELECT * FROM JSON_TABLE('{"foo": [1,2,3,4]}','$' columns( jscol json path '$.foo') ) AS T; +-------+ | jscol | +-------+ | NULL | +-------+ ``` This is supported from [MariaDB 10.6.9](https://mariadb.com/kb/en/mariadb-1069-release-notes/): ``` SELECT * FROM JSON_TABLE('{"foo": [1,2,3,4]}','$' columns( jscol json path '$.foo') ) AS T; +-----------+ | jscol | +-----------+ | [1,2,3,4] | +-----------+ ``` See Also -------- * [JSON Support](https://www.youtube.com/watch?v=ZkmwHPqA790) (video) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema USER_PRIVILEGES Table Information Schema USER\_PRIVILEGES Table ========================================= The [Information Schema](../information_schema/index) `USER_PRIVILEGES` table contains global user privilege information derived from the `[mysql.user](../mysqluser-table/index)` grant table. It contains the following columns: | Column | Description | | --- | --- | | `GRANTEE` | In the format `user_name@host_name`. | | `TABLE_CATALOG` | Always `def`. | | `PRIVILEGE_TYPE` | The specific privilege, for example `SELECT`, `INSERT`, `UPDATE` or `REFERENCES`. | | `IS_GRANTABLE` | Whether the user has the `[GRANT OPTION](../grant/index#the-grant-option-privilege)` for this privilege. | Similar information can be accessed with the `[SHOW GRANTS](../show-grants/index)` statement. See the `[GRANT](../grant/index)` article for more about privileges. This information is also stored in the [user](../mysqluser-table/index) table, in the `mysql` system database. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb IBMDB2I Storage Engine IBMDB2I Storage Engine ====================== The IBMDB2I storage engine was designed to allow MySQL to store data on IBM DB2 tables running IBM i. **MySQL 5.1.33 - 5.1.53**The IBMDB2I storage engine was introduced in MySQL 5.1.33, considered production-ready in MySQL 5.1.35, and was removed in MySQL 5.1.54. It is not supported in MariaDB. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Addition Operator (+) Addition Operator (+) ===================== Syntax ------ ``` + ``` Description ----------- Addition. If both operands are integers, the result is calculated with [BIGINT](../bigint/index) precision. If either integer is unsigned, the result is also an unsigned integer. For real or string operands, the operand with the highest precision determines the result precision. Examples -------- ``` SELECT 3+5; +-----+ | 3+5 | +-----+ | 8 | +-----+ ``` See Also -------- * [Type Conversion](../type-conversion/index) * [Subtraction Operator (-)](../subtraction-operator-/index) * [Multiplication Operator (\*)](../multiplication-operator/index) * [Division Operator (/)](../division-operator/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP VIEW DROP VIEW ========= Syntax ------ ``` DROP VIEW [IF EXISTS] view_name [, view_name] ... [RESTRICT | CASCADE] ``` Description ----------- `DROP VIEW` removes one or more [views](../views/index). You must have the DROP privilege for each view. If any of the views named in the argument list do not exist, MariaDB returns an error indicating by name which non-existing views it was unable to drop, but it also drops all of the views in the list that do exist. The `IF EXISTS` clause prevents an error from occurring for views that don't exist. When this clause is given, a `NOTE` is generated for each non-existent view. See [SHOW WARNINGS](../show-warnings/index). `RESTRICT` and `CASCADE`, if given, are parsed and ignored. It is possible to specify view names as `db_name`.`view_name`. This is useful to delete views from multiple databases with one statement. See [Identifier Qualifiers](../identifier-qualifiers/index) for details. The [DROP privilege](../grant/index#table-privileges) is required to use `DROP TABLE` on non-temporary tables. For temporary tables, no privilege is required, because such tables are only visible for the current session. If a view references another view, it will be possible to drop the referenced view. However, the other view will reference a view which does not exist any more. Thus, querying it will produce an error similar to the following: ``` ERROR 1356 (HY000): View 'db_name.view_name' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ``` This problem is reported in the output of [CHECK TABLE](../check-table/index). Note that it is not necessary to use `DROP VIEW` to replace an existing view, because `[CREATE VIEW](../create-view/index)` has an `OR REPLACE` clause. ### Atomic DDL **MariaDB starting with [10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/)**[MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/) supports [Atomic DDL](../atomic-ddl/index) and `DROP VIEW` for a singular view is atomic. Dropping multiple views is crash-safe. Examples -------- ``` DROP VIEW v,v2; ``` Given views `v` and `v2`, but no view `v3` ``` DROP VIEW v,v2,v3; ERROR 1051 (42S02): Unknown table 'v3' ``` ``` DROP VIEW IF EXISTS v,v2,v3; Query OK, 0 rows affected, 1 warning (0.01 sec) SHOW WARNINGS; +-------+------+-------------------------+ | Level | Code | Message | +-------+------+-------------------------+ | Note | 1051 | Unknown table 'test.v3' | +-------+------+-------------------------+ ``` See Also -------- * [CREATE VIEW](../create-view/index) * [ALTER VIEW](../alter-view/index) * [SHOW CREATE VIEWS](show-create-views) * [INFORMATION SCHEMA VIEWS Table](../information-schema-views-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ROUND ROUND ===== Syntax ------ ``` ROUND(X), ROUND(X,D) ``` Description ----------- Rounds the argument `X` to `D` decimal places. The rounding algorithm depends on the data type of `X`. `D` defaults to `0` if not specified. `D` can be negative to cause `D` digits left of the decimal point of the value `X` to become zero. Examples -------- ``` SELECT ROUND(-1.23); +--------------+ | ROUND(-1.23) | +--------------+ | -1 | +--------------+ SELECT ROUND(-1.58); +--------------+ | ROUND(-1.58) | +--------------+ | -2 | +--------------+ SELECT ROUND(1.58); +-------------+ | ROUND(1.58) | +-------------+ | 2 | +-------------+ SELECT ROUND(1.298, 1); +-----------------+ | ROUND(1.298, 1) | +-----------------+ | 1.3 | +-----------------+ SELECT ROUND(1.298, 0); +-----------------+ | ROUND(1.298, 0) | +-----------------+ | 1 | +-----------------+ SELECT ROUND(23.298, -1); +-------------------+ | ROUND(23.298, -1) | +-------------------+ | 20 | +-------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb JSONPath Expressions JSONPath Expressions ==================== A number of [JSON functions](../json-functions/index) accept JSON Path expressions. MariaDB defines this path as follows: JSON Path Syntax ---------------- ``` path : ['lax'] '$' [step]* ``` The path starts with an optional *path mode*. At the moment, MariaDB supports only the "lax" mode, which is also the mode that is used when it is not explicitly specified. The `$` symbol represents the context item. The search always starts from the context item; because of that, the path always starts with `$`. Then, it is followed by zero or more steps, which select element(s) in the JSON document. A step may be one of the following: * Object member selector * Array element selector * Wildcard selector ### Object Member Selector To select member(s) in a JSON object, one can use one of the following: * `.memberName` selects the value of the member with name memberName. * `."memberName"` - the same as above but allows one to select a member with a name that's not a valid identifier (that is, has space, dot, and/or other characters) * `.*` - selects the values of all members of the object. If the current item is an array (instead of an object), nothing will be selected. ### Array Element Selector To select elements of an array, one can use one of the following: * `[N]` selects element number N in the array. The elements are counted from zero. * `[*]` selects all elements in the array. If the current item is an object (instead of an array), nothing will be selected. Starting from MariaDB server 10.9, JSON path also supports negative index in array, 'last' keyword and range notation ('to' keyword) for accessing array elements. Negative index starts from -1. * `[-N]` selects n th element from end. * `[last-N]` selects n th element from the last element. * `[M to N]` selects range of elements starting from index M to N. Example: ``` SET @json='{ "A": [0, [1, 2, 3], [4, 5, 6], "seven", 0.8, true, false, "eleven", [12, [13, 14], {"key1":"value1"},[15]], true], "B": {"C": 1}, "D": 2 }'; SELECT JSON_EXTRACT(@json, '$.A[-8][1]'); +--------------------------------------------------+ | JSON_EXTRACT(@json, '$.A[-8][1]') | +--------------------------------------------------+ | 5 | +--------------------------------------------------+ SELECT JSON_EXTRACT(@json, '$.A[last-7][1]'); +-----------------------------------------------+ | SELECT JSON_EXTRACT(@json, '$.A[last-7][1]'); | +-----------------------------------------------+ | 5 | +-----------------------------------------------+ SET @json= '[ [1, {"key1": "value1"}, 3], [false, 5, 6], [7, 8, [9, {"key2": 2}, 11]], [15, 1.34, [14], ["string1", [16, {"key1":[1,2,3,[4,5,6]]}, 18]]], [19, 20], 21, 22 ]'; SELECT JSON_EXTRACT(@json, '$[0 to 3][2]'); +-----------------------------------------------+ | JSON_EXTRACT(@json, '$[0 to 3][2]') | +-----------------------------------------------+ | [3, 6, [9, {"key2": 2}, 11], [14]] | +-----------------------------------------------+ ``` This will produce output for first index of eighth from last element of a two dimensional array. Note: In range notation, when M > N ( when M,N are greater than or equal to 0) or (size of array - M or size of array - N when M, N are less than 0), then it is treated as an impossible range and NULL is returned. ``` SET @json= '[1, 2, 3, 4, 5]'; SELECT JSON_EXTRACT(@json, '$[4 to 2]'); +-----------------------------------+ | JSON_EXTRACT(@json, '$[4 to 2]') | +-----------------------------------+ | NULL | +-----------------------------------+ ``` ### Wildcard The wildcard step, `**`, recursively selects all child elements of the current element. Both array elements and object members are selected. The wildcard step must not be the last step in the JSONPath expression. It must be followed by an array or object member selector step. For example: ``` select json_extract(@json_doc, '$**.price'); ``` will select all object members in the document that are named `price`, while ``` select json_extract(@json_doc, '$**[2]'); ``` will select the second element in each of the arrays present in the document. Compatibility ------------- MariaDB's JSONPath syntax supports a subset of JSON Path's definition in the SQL Standard. The most notable things not supported are the `strict` mode and filters. MariaDB's JSONPath is close to MySQL's JSONPath. The wildcard step ( `**` ) is a non-standard extension that has the same meaning as in MySQL. The differences between MariaDB and MySQL's JSONPath are: MySQL supports `[last]` and `[M to N]` as array element selectors; MySQL doesn't allow one to specify the mode explicitly (but uses `lax` mode implicitly). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Master Thread States Master Thread States ==================== This article documents thread states that are related to [replication](../replication/index) master threads. These correspond to the `STATE` values listed by the [SHOW PROCESSLIST](../show-processlist/index) statement or in the [Information Schema PROCESSLIST Table](../information-schema-processlist-table/index) as well as the `PROCESSLIST_STATE` value listed in the [Performance Schema threads Table](../performance-schema-threads-table/index). | Value | Description | | --- | --- | | Finished reading one binlog; switching to next binlog | After completing one [binary log](../binary-log/index), the next is being opened for sending to the slave. | | Master has sent all binlog to slave; waiting for binlog to be updated | All events have been read from the binary logs and sent to the slave. Now waiting for the binary log to be updated with new events. | | Sending binlog event to slave | An event has been read from the [binary log](../binary-log/index), and is now being sent to the slave. | | Waiting to finalize termination | State that only occurs very briefly while the thread is terminating. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_LineStringFromWKB ST\_LineStringFromWKB ===================== A synonym for [ST\_LineFromWKB](../st_linefromwkb/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Ansible and MariaDB Ansible and MariaDB ==================== General information and hints on how to automate MariaDB deployments and configuration with Ansible. Ansible is an open source tool to automate deployment, configuration and operations. | Title | Description | | --- | --- | | [Ansible Overview for MariaDB Users](../ansible-overview-for-mariadb-users/index) | Overview of Ansible and how it works with MariaDB. | | [Deploying to Remote Servers with Ansible](../deploying-to-remote-servers-with-ansible/index) | How to invoke Ansible to run commands or apply roles on remote hosts. | | [Deploying Docker Containers with Ansible](../deploying-docker-containers-with-ansible/index) | How to deploy and manage Docker containers with Ansible. | | [Existing Ansible Modules and Roles for MariaDB](../existing-ansible-modules-and-roles-for-mariadb/index) | Links to existing Ansible modules and roles for MariaDB. | | [Installing MariaDB .deb Files with Ansible](../installing-mariadb-deb-files-with-ansible/index) | How to install MariaDB from .deb files using Ansible. | | [Running mariadb-tzinfo-to-sql with Ansible](../running-mariadb-tzinfo-to-sql-with-ansible/index) | Updating the timezone tables with mariadb-tzinfo-to-sql using Ansible. | | [Managing Secrets in Ansible](../managing-secrets-in-ansible/index) | How to store passwords as part of an Ansible repository. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Sys Schema Stored Functions Sys Schema Stored Functions ============================ The following [stored functions](../stored-functions/index) are available in the [Sys Schema](../sys-schema/index). | Title | Description | | --- | --- | | [extract\_schema\_from\_file\_name](../extract_schema_from_file_name/index) | Returns the schema (database) name. | | [extract\_table\_from\_file\_name](../extract_table_from_file_name/index) | Returns the table name from the provided path. | | [format\_bytes](../format_bytes/index) | Returns a string consisting of a value and the units in a human-readable format. | | [format\_path](../format_path/index) | Returns a modified path, replacing subpaths matching the values of various system variables. | | [format\_statement](../format_statement/index) | Returns a reduced length string. | | [format\_time](../format_time/index) | Given a time in picoseconds, returns a human-readable time and unit. | | [list\_add](../list_add/index) | Takes a list to be be modified and a value to be added to the list, returning the resulting value. | | [list\_drop](../list_drop/index) | Takes a list to be be modified and a value to be dropped, returning the resulting value. | | [ps\_is\_account\_enabled](../ps_is_account_enabled/index) | Whether or not Performance Schema instrumentation for a given account is enabled. | | [ps\_is\_consumer\_enabled](../ps_is_consumer_enabled/index) | Whether or not Performance Schema instrumentation for a given consumer is enabled. | | [ps\_is\_instrument\_default\_enabled](../ps_is_instrument_default_enabled/index) | Whether or not a Performance Schema instrument is enabled by default. | | [ps\_is\_instrument\_default\_timed](../ps_is_instrument_default_timed/index) | Whether or not a Performance Schema instrument is timed by default. | | [ps\_is\_thread\_instrumented](../ps_is_thread_instrumented/index) | Whether or not instrumentation for a given connection\_id is enabled. | | [ps\_thread\_account](../ps_thread_account/index) | Returns the account associated with the given thread\_id. | | [ps\_thread\_id](../ps_thread_id/index) | Returns the thread\_id associated with the given connection\_id. | | [ps\_thread\_stack](../ps_thread_stack/index) | Returns statements, stages, events within the Performance Schema for a given thread\_id. | | [ps\_thread\_trx\_info](../ps_thread_trx_info/index) | Returns a JSON object with information about the thread specified by the given thread\_id. | | [quote\_identifier](../quote_identifier/index) | Returns quoted, properly escaped identifier. | | [sys\_get\_config](../sys_get_config/index) | Returns a configuration option value from the sys\_config table. | | [version\_major](../version_major/index) | Returns the MariaDB Server major release version. | | [version\_minor](../version_minor/index) | Returns the MariaDB Server minor release version. | | [version\_patch](../version_patch/index) | MariaDB Server patch release version. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Building OQGRAPH Under Windows Building OQGRAPH Under Windows ============================== OQGRAPH v3 can be built on Windows. **MariaDB starting with [10.0.11](https://mariadb.com/kb/en/mariadb-10011-release-notes/)**This has been tested using Windows 7, Microsoft Visual Studio Express 2010 (32-bit), Microsoft Windows 64-bit Platform SDK 7.1 (64-bit), the Boost library >= 1.55 and Judy 1.0.5. Probably other recent versions of Boost, Judy or MSVC may work but these combinations have not been tested. * Download the source package for Boost 1.55 from the Boost project website, <http://www.boost.org> * Download the source package for Judy 1.05 via <http://judy.sourceforge.net/> * Follow the documented instructions for building under Windows from the command line: [Building\_MariaDB\_on\_Windows](../building_mariadb_on_windows/index) + Ensure that the following variable is set to CMAKE: `JUDY_ROOT=path\to\judy\unzipped` + See also comments in `storage/oqgraph/cmake/FindJudy.cmake` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Security Vulnerabilities Fixed in Oracle MySQL That Did Not Exist in MariaDB Security Vulnerabilities Fixed in Oracle MySQL That Did Not Exist in MariaDB ============================================================================ About ----- CVE stands for *"**C**ommon **V**ulnerabilities and **E**xposures"*. It is a publicly available and free to use database of known software vulnerabilities maintained at <https://cve.mitre.org/> CPU stands for *"**C**ritical **P**atch **U**pdate"*. Oracle publishes Critical Patch Update Advisories four times a year, [on the Tuesday closest to the 17th day of January, April, July and October](https://www.oracle.com/technetwork/topics/security/alerts-086861.html#CriticalPatchUpdates). MySQL vulnerabilities are included in these CPU Advisories. Some vulnerabilities found in MySQL apply to MariaDB as well, they are listed on the [Security](../security/index) page. Other vulnerabilities found in MySQL do not apply to MariaDB. This page lists all CVEs that were fixed in MySQL and mentioned in Oracle CPU Advisories, but that — to the best of our knowledge — were never present in MariaDB. Full List of CVEs Fixed in Oracle MySQL That Never Existed in MariaDB --------------------------------------------------------------------- ### [July 2022](https://www.oracle.com/security-alerts/cpujul2022.html#AppendixMSQL) * [CVE-2021-31805](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-31805) * [CVE-2022-1292](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-1292) * [CVE-2022-1292](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-1292) * [CVE-2022-21824](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21824) * [CVE-2022-27778](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27778) * [CVE-2021-22119](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22119) * [CVE-2022-23308](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23308) * [CVE-2020-26237](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26237) * [CVE-2022-21556](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21556) * [CVE-2022-21569](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21569) * [CVE-2022-21550](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21550) * [CVE-2022-21519](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21519) * [CVE-2022-21527](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21527) * [CVE-2022-21528](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21528) * [CVE-2022-21509](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21509) * [CVE-2022-22968](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-22968) * [CVE-2022-21539](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21539) * [CVE-2022-21517](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21517) * [CVE-2022-21537](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21537) * [CVE-2022-21547](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21547) * [CVE-2022-21525](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21525) * [CVE-2022-21526](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21526) * [CVE-2022-21529](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21529) * [CVE-2022-21530](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21530) * [CVE-2022-21531](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21531) * [CVE-2022-21553](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21553) * [CVE-2022-21515](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21515) * [CVE-2022-21455](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21455) * [CVE-2022-21534](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21534) * [CVE-2022-21522](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21522) * [CVE-2022-21555](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21555) * [CVE-2022-21538](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21538) * [CVE-2022-21535](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21535) ### [April 2022](https://www.oracle.com/security-alerts/cpuapr2022.html#AppendixMSQL) * [CVE-2021-22570](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22570) * [CVE-2021-41184](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41184) * [CVE-2021-42340](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42340) * [CVE-2021-44832](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832) * [CVE-2022-21412](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21412) * [CVE-2022-21413](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21413) * [CVE-2022-21414](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21414) * [CVE-2022-21415](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21415) * [CVE-2022-21417](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21417) * [CVE-2022-21418](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21418) * [CVE-2022-21423](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21423) * [CVE-2022-21425](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21425) * [CVE-2022-21435](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21435) * [CVE-2022-21436](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21436) * [CVE-2022-21437](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21437) * [CVE-2022-21438](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21438) * [CVE-2022-21440](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21440) * [CVE-2022-21444](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21444) * [CVE-2022-21452](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21452) * [CVE-2022-21454](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21454) * [CVE-2022-21457](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21457) * [CVE-2022-21459](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21459) * [CVE-2022-21460](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21460) * [CVE-2022-21462](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21462) * [CVE-2022-21478](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21478) * [CVE-2022-21479](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21479) * [CVE-2022-21482](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21482) * [CVE-2022-21483](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21483) * [CVE-2022-21484](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21484) * [CVE-2022-21485](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21485) * [CVE-2022-21486](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21486) * [CVE-2022-21489](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21489) * [CVE-2022-21490](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21490) * [CVE-2022-22965](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-22965) * [CVE-2022-23181](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23181) * [CVE-2022-23305](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23305) ### [January 2022](https://www.oracle.com/security-alerts/cpujan2022.html#AppendixMSQL) * [CVE-2021-22946](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22946) * [CVE-2021-3712](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3712) * [CVE-2022-21278](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21278) * [CVE-2022-21351](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21351) * [CVE-2022-21363](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21363) * [CVE-2022-21358](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21358) * [CVE-2021-3634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3634) * [CVE-2022-21279](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21279) * [CVE-2022-21280](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21280) * [CVE-2022-21284](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21284) * [CVE-2022-21285](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21285) * [CVE-2022-21286](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21286) * [CVE-2022-21287](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21287) * [CVE-2022-21288](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21288) * [CVE-2022-21289](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21289) * [CVE-2022-21290](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21290) * [CVE-2022-21307](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21307) * [CVE-2022-21308](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21308) * [CVE-2022-21309](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21309) * [CVE-2022-21310](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21310) * [CVE-2022-21314](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21314) * [CVE-2022-21315](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21315) * [CVE-2022-21316](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21316) * [CVE-2022-21318](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21318) * [CVE-2022-21320](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21320) * [CVE-2022-21322](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21322) * [CVE-2022-21326](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21326) * [CVE-2022-21327](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21327) * [CVE-2022-21328](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21328) * [CVE-2022-21329](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21329) * [CVE-2022-21330](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21330) * [CVE-2022-21332](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21332) * [CVE-2022-21334](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21334) * [CVE-2022-21335](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21335) * [CVE-2022-21336](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21336) * [CVE-2022-21337](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21337) * [CVE-2022-21356](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21356) * [CVE-2022-21380](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21380) * [CVE-2022-21352](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21352) * [CVE-2022-21367](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21367) * [CVE-2022-21301](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21301) * [CVE-2022-21378](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21378) * [CVE-2022-21302](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21302) * [CVE-2022-21254](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21254) * [CVE-2022-21348](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21348) * [CVE-2022-21270](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21270) * [CVE-2022-21256](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21256) * [CVE-2022-21379](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21379) * [CVE-2022-21362](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21362) * [CVE-2022-21374](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21374) * [CVE-2022-21253](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21253) * [CVE-2022-21264](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21264) * [CVE-2022-21297](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21297) * [CVE-2022-21339](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21339) * [CVE-2022-21342](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21342) * [CVE-2022-21370](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21370) * [CVE-2022-21304](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21304) * [CVE-2022-21344](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21344) * [CVE-2022-21303](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21303) * [CVE-2022-21368](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21368) * [CVE-2022-21245](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21245) * [CVE-2022-21265](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21265) * [CVE-2022-21311](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21311) * [CVE-2022-21312](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21312) * [CVE-2022-21313](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21313) * [CVE-2022-21317](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21317) * [CVE-2022-21319](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21319) * [CVE-2022-21321](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21321) * [CVE-2022-21323](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21323) * [CVE-2022-21324](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21324) * [CVE-2022-21325](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21325) * [CVE-2022-21331](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21331) * [CVE-2022-21333](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21333) * [CVE-2022-21355](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21355) * [CVE-2022-21357](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21357) * [CVE-2022-21249](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21249) * [CVE-2022-21372](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21372) ### [October 2021](https://www.oracle.com/security-alerts/cpuoct2021.html#AppendixMSQL) * [CVE-2021-22931](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22931) * [CVE-2021-3711](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3711) * [CVE-2021-22112](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22112) * [CVE-2021-3518](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3518) * [CVE-2021-22118](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22118) * [CVE-2021-22926](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22926) * [CVE-2021-36222](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-36222) * [CVE-2021-35583](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35583) * [CVE-2021-3712](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3712) * [CVE-2021-35610](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35610) * [CVE-2021-35597](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35597) * [CVE-2021-35607](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35607) * [CVE-2021-2481](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2481) * [CVE-2021-35590](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35590) * [CVE-2021-35592](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35592) * [CVE-2021-35593](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35593) * [CVE-2021-35594](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35594) * [CVE-2021-35598](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35598) * [CVE-2021-35621](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35621) * [CVE-2021-2471](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2471) * [CVE-2021-35612](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35612) * [CVE-2021-20227](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-20227) * [CVE-2021-33037](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-33037) * [CVE-2021-29425](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-29425) * [CVE-2021-35608](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35608) * [CVE-2021-35602](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35602) * [CVE-2021-35577](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35577) * [CVE-2021-2478](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2478) * [CVE-2021-2479](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2479) * [CVE-2021-35537](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35537) * [CVE-2021-35591](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35591) * [CVE-2021-35596](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35596) * [CVE-2021-35648](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35648) * [CVE-2021-35631](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35631) * [CVE-2021-35626](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35626) * [CVE-2021-35627](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35627) * [CVE-2021-35628](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35628) * [CVE-2021-35629](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35629) * [CVE-2021-35575](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35575) * [CVE-2021-35634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35634) * [CVE-2021-35635](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35635) * [CVE-2021-35636](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35636) * [CVE-2021-35638](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35638) * [CVE-2021-35641](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35641) * [CVE-2021-35642](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35642) * [CVE-2021-35643](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35643) * [CVE-2021-35644](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35644) * [CVE-2021-35645](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35645) * [CVE-2021-35646](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35646) * [CVE-2021-35647](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35647) * [CVE-2021-35630](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35630) * [CVE-2021-35637](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35637) * [CVE-2021-35546](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35546) * [CVE-2021-35622](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35622) * [CVE-2021-35624](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35624) * [CVE-2021-35639](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35639) * [CVE-2021-35632](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35632) * [CVE-2021-35584](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35584) * [CVE-2021-35613](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35613) * [CVE-2021-35640](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35640) * [CVE-2021-35633](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35633) * [CVE-2021-35625](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35625) * [CVE-2021-35623](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35623) * [CVE-2021-35618](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-35618) ### [July 2021](https://www.oracle.com/security-alerts/cpujul2021.html#AppendixMSQL) * [CVE-2021-22884](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22884) * [CVE-2021-22901](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22901) * [CVE-2021-25122](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-25122) * [CVE-2019-17543](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17543) * [CVE-2021-3450](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3450) * [CVE-2021-2417](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2417) * [CVE-2021-2390](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2390) * [CVE-2021-2429](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2429) * [CVE-2021-2356](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2356) * [CVE-2021-2385](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2385) * [CVE-2021-2339](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2339) * [CVE-2021-2352](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2352) * [CVE-2021-2399](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2399) * [CVE-2021-2370](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2370) * [CVE-2021-2440](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2440) * [CVE-2021-2354](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2354) * [CVE-2021-2402](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2402) * [CVE-2021-2342](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2342) * [CVE-2021-2357](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2357) * [CVE-2021-2367](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2367) * [CVE-2021-2412](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2412) * [CVE-2021-2383](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2383) * [CVE-2021-2384](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2384) * [CVE-2021-2387](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2387) * [CVE-2021-2444](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2444) * [CVE-2021-2410](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2410) * [CVE-2021-2418](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2418) * [CVE-2021-2425](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2425) * [CVE-2021-2426](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2426) * [CVE-2021-2427](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2427) * [CVE-2021-2437](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2437) * [CVE-2021-2441](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2441) * [CVE-2021-2422](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2422) * [CVE-2021-2424](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2424) * [CVE-2021-2374](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2374) * [CVE-2021-2411](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2411) * [CVE-2021-2340](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2340) ### [Apr 2021](https://www.oracle.com/security-alerts/cpuapr2021.html#AppendixMSQL) * [CVE-2019-7317](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7317) * [CVE-2020-1971](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1971) * [CVE-2020-8277](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8277) * [CVE-2020-17527](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-17527) * [CVE-2020-17530](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-17530) * [CVE-2020-28196](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28196) * [CVE-2021-2146](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2146) * [CVE-2021-2160](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2160) * [CVE-2021-2162](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2162) * [CVE-2021-2164](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2164) * [CVE-2021-2169](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2169) * [CVE-2021-2170](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2170) * [CVE-2021-2171](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2171) * [CVE-2021-2172](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2172) * [CVE-2021-2178](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2178) * [CVE-2021-2179](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2179) * [CVE-2021-2193](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2193) * [CVE-2021-2196](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2196) * [CVE-2021-2201](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2201) * [CVE-2021-2202](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2202) * [CVE-2021-2203](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2203) * [CVE-2021-2208](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2208) * [CVE-2021-2212](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2212) * [CVE-2021-2213](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2213) * [CVE-2021-2215](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2215) * [CVE-2021-2217](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2217) * [CVE-2021-2226](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2226) * [CVE-2021-2230](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2230) * [CVE-2021-2232](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2232) * [CVE-2021-2278](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2278) * [CVE-2021-2293](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2293) * [CVE-2021-2298](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2298) * [CVE-2021-2299](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2299) * [CVE-2021-2300](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2300) * [CVE-2021-2301](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2301) * [CVE-2021-2304](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2304) * [CVE-2021-2305](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2305) * [CVE-2021-2307](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2307) * [CVE-2021-2308](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2308) * [CVE-2021-3449](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3449) * [CVE-2021-3450](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3450) * [CVE-2021-23841](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23841) ### [Jan 2021](https://www.oracle.com/security-alerts/cpujan2021.html#AppendixMSQL) * [CVE-2019-10086](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10086) * [CVE-2020-1971](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1971) * [CVE-2020-5408](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-5408) * [CVE-2020-5421](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-5421) * [CVE-2020-13871](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871) * [CVE-2021-1998](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-1998) * [CVE-2021-2001](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2001) * [CVE-2021-2002](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2002) * [CVE-2021-2006](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2006) * [CVE-2021-2009](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2009) * [CVE-2021-2010](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2010) * [CVE-2021-2012](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2012) * [CVE-2021-2014](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2014) * [CVE-2021-2016](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2016) * [CVE-2021-2019](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2019) * [CVE-2021-2020](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2020) * [CVE-2021-2021](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2021) * [CVE-2021-2024](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2024) * [CVE-2021-2028](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2028) * [CVE-2021-2030](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2030) * [CVE-2021-2031](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2031) * [CVE-2021-2036](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2036) * [CVE-2021-2038](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2038) * [CVE-2021-2042](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2042) * [CVE-2021-2046](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2046) * [CVE-2021-2048](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2048) * [CVE-2021-2055](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2055) * [CVE-2021-2056](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2056) * [CVE-2021-2058](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2058) * [CVE-2021-2060](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2060) * [CVE-2021-2061](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2061) * [CVE-2021-2065](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2065) * [CVE-2021-2070](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2070) * [CVE-2021-2072](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2072) * [CVE-2021-2076](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2076) * [CVE-2021-2081](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2081) * [CVE-2021-2087](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2087) * [CVE-2021-2088](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2088) * [CVE-2021-2122](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-2122) ### [Oct 2020](https://www.oracle.com/security-alerts/cpuoct2020.html#AppendixMSQL) * [CVE-2020-1730](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1730) * [CVE-2020-1967](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1967) * [CVE-2020-8174](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8174) * [CVE-2020-13935](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13935) * [CVE-2020-14672](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14672) 2f35c37bacf0 * [CVE-2020-14760](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14760) * [CVE-2020-14769](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14769) 6a0e79b462e1 * [CVE-2020-14771](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14771) * [CVE-2020-14773](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14773) * [CVE-2020-14775](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14775) * [CVE-2020-14777](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14777) * [CVE-2020-14785](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14785) * [CVE-2020-14786](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14786) * [CVE-2020-14790](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14790) * [CVE-2020-14791](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14791) * [CVE-2020-14793](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14793) 9bb243a3fa25 * [CVE-2020-14794](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14794) * [CVE-2020-14799](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14799) * [CVE-2020-14800](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14800) * [CVE-2020-14804](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14804) * [CVE-2020-14809](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14809) * [CVE-2020-14814](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14814) * [CVE-2020-14821](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14821) * [CVE-2020-14827](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14827) * [CVE-2020-14828](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14828) * [CVE-2020-14829](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14829) * [CVE-2020-14830](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14830) * [CVE-2020-14836](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14836) * [CVE-2020-14837](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14837) * [CVE-2020-14838](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14838) * [CVE-2020-14839](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14839) * [CVE-2020-14844](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14844) * [CVE-2020-14845](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14845) * [CVE-2020-14846](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14846) * [CVE-2020-14848](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14848) * [CVE-2020-14852](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14852) * [CVE-2020-14853](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14853) * [CVE-2020-14860](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14860) * [CVE-2020-14861](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14861) * [CVE-2020-14866](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14866) * [CVE-2020-14867](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14867) 7e730bd604e1 * [CVE-2020-14868](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14868) * [CVE-2020-14869](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14869) * [CVE-2020-14870](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14870) * [CVE-2020-14873](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14873) * [CVE-2020-14878](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14878) * [CVE-2020-14888](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14888) * [CVE-2020-14891](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14891) * [CVE-2020-14893](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14893) ### [Jul 2020](https://www.oracle.com/security-alerts/cpujul2020.html#AppendixMSQL) * [CVE-2019-1551](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1551) * [CVE-2020-1938](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1938) * [CVE-2020-1967](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1967) * [CVE-2020-5258](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-5258) * [CVE-2020-5398](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-5398) * [CVE-2020-14539](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14539) * [CVE-2020-14540](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14540) * [CVE-2020-14547](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14547) * [CVE-2020-14553](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14553) * [CVE-2020-14559](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14559) * [CVE-2020-14567](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14567) * [CVE-2020-14568](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14568) * [CVE-2020-14575](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14575) * [CVE-2020-14576](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14576) * [CVE-2020-14586](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14586) * [CVE-2020-14591](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14591) * [CVE-2020-14597](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14597) * [CVE-2020-14614](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14614) * [CVE-2020-14619](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14619) * [CVE-2020-14620](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14620) * [CVE-2020-14623](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14623) * [CVE-2020-14624](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14624) * [CVE-2020-14631](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14631) * [CVE-2020-14632](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14632) * [CVE-2020-14633](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14633) * [CVE-2020-14634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14634) * [CVE-2020-14641](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14641) * [CVE-2020-14643](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14643) * [CVE-2020-14651](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14651) * [CVE-2020-14654](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14654) * [CVE-2020-14656](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14656) * [CVE-2020-14663](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14663) * [CVE-2020-14678](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14678) * [CVE-2020-14680](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14680) * [CVE-2020-14697](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14697) * [CVE-2020-14702](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14702) * [CVE-2020-14725](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14725) ### [Apr 2020](https://www.oracle.com/security-alerts/cpuapr2020.html#AppendixMSQL) * [CVE-2019-1547](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547) * [CVE-2019-5482](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5482) * [CVE-2019-14889](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-14889) * [CVE-2019-15601](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15601) * [CVE-2019-17563](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17563) * [CVE-2019-19646](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19646) * [CVE-2020-2759](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2759) * [CVE-2020-2761](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2761) * [CVE-2020-2762](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2762) * [CVE-2020-2763](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2763) * [CVE-2020-2765](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2765) * [CVE-2020-2768](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2768) * [CVE-2020-2770](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2770) * [CVE-2020-2774](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2774) * [CVE-2020-2779](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2779) * [CVE-2020-2790](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2790) * [CVE-2020-2804](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2804) * [CVE-2020-2806](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2806) * [CVE-2020-2853](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2853) * [CVE-2020-2875](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2875) * [CVE-2020-2892](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2892) * [CVE-2020-2893](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2893) * [CVE-2020-2895](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2895) * [CVE-2020-2896](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2896) * [CVE-2020-2897](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2897) * [CVE-2020-2898](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2898) * [CVE-2020-2901](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2901) * [CVE-2020-2903](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2903) * [CVE-2020-2904](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2904) * [CVE-2020-2921](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2921) * [CVE-2020-2923](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2923) * [CVE-2020-2924](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2924) * [CVE-2020-2925](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2925) * [CVE-2020-2926](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2926) * [CVE-2020-2928](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2928) * [CVE-2020-2930](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2930) * [CVE-2020-2933](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2933) * [CVE-2020-2934](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2934) ### [Jan 2020](https://www.oracle.com/security-alerts/cpujan2020.html#AppendixMSQL) * [CVE-2019-1547](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547) * [CVE-2019-1547](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1547) * [CVE-2019-8457](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8457) * [CVE-2019-16168](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16168) * [CVE-2020-2570](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2570) * [CVE-2020-2572](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2572) * [CVE-2020-2573](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2573) * [CVE-2020-2577](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2577) * [CVE-2020-2579](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2579) * [CVE-2020-2580](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2580) * [CVE-2020-2584](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2584) * [CVE-2020-2588](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2588) * [CVE-2020-2589](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2589) * [CVE-2020-2627](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2627) * [CVE-2020-2660](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2660) * [CVE-2020-2679](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2679) * [CVE-2020-2686](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2686) * [CVE-2020-2694](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-2694) ### [Oct 2019](https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html#AppendixMSQL) * [CVE-2019-1543](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1543) * [CVE-2019-1549](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1549) * [CVE-2019-2911](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2911) * [CVE-2019-2914](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2914) * [CVE-2019-2920](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2920) * [CVE-2019-2946](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2946) * [CVE-2019-2948](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2948) * [CVE-2019-2950](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2950) * [CVE-2019-2957](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2957) * [CVE-2019-2960](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2960) * [CVE-2019-2963](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2963) * [CVE-2019-2966](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2966) * [CVE-2019-2967](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2967) * [CVE-2019-2968](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2968) * [CVE-2019-2969](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2969) * [CVE-2019-2982](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2982) * [CVE-2019-2991](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2991) * [CVE-2019-2993](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2993) * [CVE-2019-2997](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2997) * [CVE-2019-2998](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2998) * [CVE-2019-3003](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3003) * [CVE-2019-3004](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3004) * [CVE-2019-3009](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3009) * [CVE-2019-3011](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3011) * [CVE-2019-3018](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3018) * [CVE-2019-5443](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5443) * [CVE-2019-8457](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8457) * [CVE-2019-10072](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10072) ### [July 2019](https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html) * [CVE-2018-15756](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15756) * [CVE-2019-1559](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1559) * [CVE-2019-2730](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2730) * [CVE-2019-2731](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2731) * [CVE-2019-2738](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2738) * [CVE-2019-2741](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2741) * [CVE-2019-2743](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2743) * [CVE-2019-2746](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2746) * [CVE-2019-2747](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2747) * [CVE-2019-2752](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2752) * [CVE-2019-2755](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2755) * [CVE-2019-2757](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2757) * [CVE-2019-2774](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2774) * [CVE-2019-2778](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2778) * [CVE-2019-2780](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2780) * [CVE-2019-2784](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2784) * [CVE-2019-2785](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2785) * [CVE-2019-2789](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2789) * [CVE-2019-2791](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2791) * [CVE-2019-2795](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2795) * [CVE-2019-2796](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2796) * [CVE-2019-2797](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2797) * [CVE-2019-2798](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2798) * [CVE-2019-2800](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2800) * [CVE-2019-2801](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2801) * [CVE-2019-2802](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2802) * [CVE-2019-2803](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2803) * [CVE-2019-2808](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2808) * [CVE-2019-2810](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2810) * [CVE-2019-2811](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2811) * [CVE-2019-2812](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2812) * [CVE-2019-2814](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2814) * [CVE-2019-2815](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2815) * [CVE-2019-2819](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2819) * [CVE-2019-2822](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2822) * [CVE-2019-2826](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2826) * [CVE-2019-2830](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2830) * [CVE-2019-2834](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2834) * [CVE-2019-2879](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2879) * [CVE-2019-3822](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3822) ### [April 2019](https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html) * [CVE-2018-0734](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0734) * [CVE-2018-3123](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3123) * [CVE-2019-1559](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1559) * [CVE-2019-1559](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-1559) * [CVE-2019-2566](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2566) * [CVE-2019-2580](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2580) * [CVE-2019-2581](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2581) * [CVE-2019-2584](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2584) * [CVE-2019-2585](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2585) * [CVE-2019-2587](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2587) * [CVE-2019-2589](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2589) * [CVE-2019-2592](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2592) * [CVE-2019-2593](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2593) * [CVE-2019-2596](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2596) * [CVE-2019-2606](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2606) * [CVE-2019-2607](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2607) * [CVE-2019-2617](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2617) * [CVE-2019-2620](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2620) * [CVE-2019-2623](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2623) * [CVE-2019-2624](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2624) * [CVE-2019-2625](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2625) * [CVE-2019-2626](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2626) * [CVE-2019-2630](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2630) * [CVE-2019-2631](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2631) * [CVE-2019-2632](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2632) * [CVE-2019-2634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2634) * [CVE-2019-2635](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2635) * [CVE-2019-2636](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2636) * [CVE-2019-2644](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2644) * [CVE-2019-2681](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2681) * [CVE-2019-2683](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2683) * [CVE-2019-2685](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2685) * [CVE-2019-2686](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2686) * [CVE-2019-2687](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2687) * [CVE-2019-2688](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2688) * [CVE-2019-2689](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2689) * [CVE-2019-2691](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2691) * [CVE-2019-2692](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2692) * [CVE-2019-2693](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2693) * [CVE-2019-2694](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2694) * [CVE-2019-2695](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2695) ### [January 2019](https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html) * [CVE-2018-0732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0732) * [CVE-2018-0732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0732) * [CVE-2018-0734](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0734) * [CVE-2018-10933](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-10933) * [CVE-2019-2420](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2420) * [CVE-2019-2434](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2434) * [CVE-2019-2435](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2435) * [CVE-2019-2436](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2436) * [CVE-2019-2482](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2482) * [CVE-2019-2486](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2486) * [CVE-2019-2494](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2494) * [CVE-2019-2495](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2495) * [CVE-2019-2502](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2502) * [CVE-2019-2507](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2507) * [CVE-2019-2513](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2513) * [CVE-2019-2528](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2528) * [CVE-2019-2530](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2530) * [CVE-2019-2531](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2531) * [CVE-2019-2532](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2532) * [CVE-2019-2533](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2533) * [CVE-2019-2534](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2534) * [CVE-2019-2535](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2535) * [CVE-2019-2536](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2536) * [CVE-2019-2539](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-2539) ### [October 2018](https://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html) * [CVE-2018-1258](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1258) * [CVE-2018-3137](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3137) * [CVE-2018-3144](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3144) * [CVE-2018-3145](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3145) * [CVE-2018-3155](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3155) * [CVE-2018-3161](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3161) * [CVE-2018-3170](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3170) * [CVE-2018-3171](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3171) * [CVE-2018-3182](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3182) * [CVE-2018-3186](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3186) * [CVE-2018-3187](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3187) * [CVE-2018-3195](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3195) * [CVE-2018-3203](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3203) * [CVE-2018-3212](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3212) * [CVE-2018-3247](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3247) * [CVE-2018-3258](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3258) * [CVE-2018-3276](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3276) * [CVE-2018-3278](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3278) * [CVE-2018-3279](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3279) * [CVE-2018-3280](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3280) * [CVE-2018-3283](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3283) * [CVE-2018-3285](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3285) * [CVE-2018-3286](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3286) * [CVE-2018-8014](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8014) * [CVE-2018-11776](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11776) ### [July 2018](http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html) * [CVE-2017-0379](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0379) * [CVE-2017-5645](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5645) * [CVE-2018-0739](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0739) * [CVE-2018-2598](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2598) * [CVE-2018-3054](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3054) * [CVE-2018-3056](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3056) * [CVE-2018-3061](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3061) * [CVE-2018-3062](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3062) * [CVE-2018-3065](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3065) * [CVE-2018-3067](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3067) * [CVE-2018-3070](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3070) * [CVE-2018-3071](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3071) * [CVE-2018-3073](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3073) * [CVE-2018-3074](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3074) * [CVE-2018-3075](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3075) * [CVE-2018-3077](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3077) * [CVE-2018-3078](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3078) * [CVE-2018-3079](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3079) * [CVE-2018-3080](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3080) * [CVE-2018-3082](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3082) * [CVE-2018-3084](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3084) ### [April 2018](http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html) * [CVE-2016-9878](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9878) * [CVE-2017-3737](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3737) * [CVE-2018-2758](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2758) * [CVE-2018-2762](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2762) * [CVE-2018-2769](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2769) * [CVE-2018-2773](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2773) — See [MDEV-13402](https://jira.mariadb.org/browse/MDEV-13402) * [CVE-2018-2775](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2775) * [CVE-2018-2776](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2776) * [CVE-2018-2778](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2778) * [CVE-2018-2779](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2779) * [CVE-2018-2780](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2780) * [CVE-2018-2805](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2805) * [CVE-2018-2812](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2812) * [CVE-2018-2816](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2816) * [CVE-2018-2818](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2818) * [CVE-2018-2839](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2839) * [CVE-2018-2846](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2846) * [CVE-2018-2877](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2877) ### [January 2018](http://www.oracle.com/technetwork/security-advisory/cpujan2018-3236628.html) * [CVE-2017-3736](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3736) * [CVE-2017-3736](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3736) * [CVE-2017-3737](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3737) * [CVE-2017-12617](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12617) * [CVE-2018-2565](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2565) * [CVE-2018-2573](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2573) * [CVE-2018-2576](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2576) * [CVE-2018-2583](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2583) * [CVE-2018-2585](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2585) * [CVE-2018-2586](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2586) * [CVE-2018-2590](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2590) * [CVE-2018-2591](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2591) * [CVE-2018-2600](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2600) * [CVE-2018-2645](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2645) * [CVE-2018-2646](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2646) * [CVE-2018-2647](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2647) * [CVE-2018-2667](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2667) * [CVE-2018-2696](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2696) * [CVE-2018-2703](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2703) ### [October 2017](http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html) * [CVE-2017-3731](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3731) * [CVE-2017-5664](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5664) * [CVE-2017-10155](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10155) * [CVE-2017-10165](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10165) * [CVE-2017-10167](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10167) * [CVE-2017-10203](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10203) * [CVE-2017-10227](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10227) * [CVE-2017-10276](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10276) * [CVE-2017-10277](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10277) * [CVE-2017-10279](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10279) * [CVE-2017-10283](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10283) * [CVE-2017-10284](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10284) * [CVE-2017-10294](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10294) * [CVE-2017-10296](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10296) * [CVE-2017-10311](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10311) * [CVE-2017-10313](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10313) * [CVE-2017-10314](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10314) * [CVE-2017-10424](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-10424) ### [July 2017](http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html) * [CVE-2014-1912](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-1912) * [CVE-2016-4436](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4436) * [CVE-2017-3529](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3529) * [CVE-2017-3633](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3633) * [CVE-2017-3634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3634) * [CVE-2017-3635](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3635) * [CVE-2017-3637](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3637) * [CVE-2017-3638](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3638) * [CVE-2017-3639](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3639) * [CVE-2017-3640](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3640) * [CVE-2017-3642](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3642) * [CVE-2017-3643](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3643) * [CVE-2017-3644](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3644) * [CVE-2017-3645](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3645) * [CVE-2017-3646](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3646) * [CVE-2017-3647](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3647) * [CVE-2017-3648](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3648) * [CVE-2017-3649](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3649) * [CVE-2017-3650](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3650) * [CVE-2017-3652](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3652) * [CVE-2017-3732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3732) * [CVE-2017-3732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3732) * [CVE-2017-3732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3732) * [CVE-2017-5647](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5647) * [CVE-2017-5651](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5651) ### [April 2017](http://www.oracle.com/technetwork/security-advisory/cpuapr2017-3236618.html) * [CVE-2016-2176](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2176) * [CVE-2016-2176](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2176) * [CVE-2016-3092](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3092) * [CVE-2016-6303](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6303) * [CVE-2017-3304](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3304) * [CVE-2017-3305](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3305) * [CVE-2017-3306](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3306) * [CVE-2017-3307](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3307) * [CVE-2017-3329](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3329) * [CVE-2017-3331](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3331) * [CVE-2017-3450](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3450) * [CVE-2017-3452](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3452) * [CVE-2017-3454](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3454) * [CVE-2017-3455](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3455) * [CVE-2017-3457](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3457) * [CVE-2017-3458](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3458) * [CVE-2017-3459](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3459) * [CVE-2017-3460](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3460) * [CVE-2017-3461](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3461) * [CVE-2017-3462](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3462) * [CVE-2017-3463](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3463) * [CVE-2017-3465](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3465) * [CVE-2017-3467](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3467) * [CVE-2017-3468](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3468) * [CVE-2017-3469](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3469) * [CVE-2017-3523](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3523) * [CVE-2017-3586](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3586) * [CVE-2017-3589](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3589) * [CVE-2017-3590](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3590) * [CVE-2017-3599](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3599) * [CVE-2017-3731](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3731) * [CVE-2017-3732](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3732) * [CVE-2017-5638](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5638) ### [January 2017](http://www.oracle.com/technetwork/security-advisory/cpujan2017-2881727.html) * [CVE-2015-7501](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7501) * [CVE-2016-0635](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0635) * [CVE-2016-0714](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0714) * [CVE-2016-5541](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5541) * [CVE-2016-5590](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5590) * [CVE-2016-6304](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6304) * [CVE-2016-8318](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8318) * [CVE-2016-8327](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8327) * [CVE-2017-3251](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3251) * [CVE-2017-3256](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3256) * [CVE-2017-3273](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3273) * [CVE-2017-3319](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3319) * [CVE-2017-3320](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3320) * [CVE-2017-3321](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3321) * [CVE-2017-3322](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3322) * [CVE-2017-3323](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-3323) ### [October 2016](http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html) * [CVE-2016-3495](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3495) * [CVE-2016-5507](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5507) * [CVE-2016-5598](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5598) * [CVE-2016-5609](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5609) * [CVE-2016-5617](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5617) * [CVE-2016-5625](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5625) * [CVE-2016-5627](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5627) * [CVE-2016-5628](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5628) * [CVE-2016-5631](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5631) * [CVE-2016-5632](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5632) * [CVE-2016-5633](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5633) * [CVE-2016-5634](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5634) * [CVE-2016-5635](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5635) * [CVE-2016-6304](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6304) * [CVE-2016-8284](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8284) * [CVE-2016-8286](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8286) * [CVE-2016-8287](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8287) * [CVE-2016-8288](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8288) * [CVE-2016-8289](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8289) * [CVE-2016-8290](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-8290) ### [July 2016](http://www.oracle.com/technetwork/security-advisory/cpujul2016-2881720.html) * [CVE-2016-2105](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2105) * [CVE-2016-3424](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3424) * [CVE-2016-3440](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3440) * [CVE-2016-3486](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3486) * [CVE-2016-3501](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3501) * [CVE-2016-3518](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3518) * [CVE-2016-3588](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3588) * [CVE-2016-3614](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3614) * [CVE-2016-5436](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5436) * [CVE-2016-5437](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5437) * [CVE-2016-5439](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5439) * [CVE-2016-5441](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5441) * [CVE-2016-5442](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5442) * [CVE-2016-5443](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5443) ### [April 2016](http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html) * [CVE-2015-3194](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3194) * [CVE-2016-0639](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0639) * [CVE-2016-0652](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0652) * [CVE-2016-0653](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0653) * [CVE-2016-0654](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0654) * [CVE-2016-0656](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0656) * [CVE-2016-0657](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0657) * [CVE-2016-0658](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0658) * [CVE-2016-0659](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0659) * [CVE-2016-0661](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0661) * [CVE-2016-0662](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0662) * [CVE-2016-0663](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0663) * [CVE-2016-0665](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0665) * [CVE-2016-0667](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0667) * [CVE-2016-0705](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0705) * [CVE-2016-3461](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3461) ### [January 2016](https://www.oracle.com/technetwork/topics/security/cpujan2016-2367955.html) * [CVE-2016-0503](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0503) * [CVE-2016-0504](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0504) * [CVE-2016-0594](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0594) * [CVE-2016-0595](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0595) * [CVE-2016-0599](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0599) * [CVE-2016-0601](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0601) * [CVE-2016-0605](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0605) * [CVE-2016-0607](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0607) * [CVE-2016-0611](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0611) ### [October 2015](https://www.oracle.com/technetwork/topics/security/cpuoct2015-2367953.html) * [CVE-2015-0286](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0286) * [CVE-2015-1793](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1793) * [CVE-2015-3144](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3144) * [CVE-2015-4730](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4730) * [CVE-2015-4766](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4766) * [CVE-2015-4791](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4791) * [CVE-2015-4800](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4800) * [CVE-2015-4833](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4833) * [CVE-2015-4862](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4862) * [CVE-2015-4890](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4890) * [CVE-2015-4904](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4904) * [CVE-2015-4905](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4905) * [CVE-2015-4910](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4910) ### [July 2015](https://www.oracle.com/technetwork/topics/security/cpujul2015-2367936.html) * [CVE-2015-2611](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2611) * [CVE-2015-2617](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2617) * [CVE-2015-2639](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2639) * [CVE-2015-2641](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2641) * [CVE-2015-2661](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2661) * [CVE-2015-4737](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4737) * [CVE-2015-4756](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4756) * [CVE-2015-4761](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4761) * [CVE-2015-4767](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4767) * [CVE-2015-4769](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4769) * [CVE-2015-4771](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4771) * [CVE-2015-4772](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4772) ### [April 2015](https://www.oracle.com/technetwork/topics/security/cpuapr2015-2365600.html) * [CVE-2014-0112](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0112) * [CVE-2014-3569](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3569) * [CVE-2014-7809](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-7809) * [CVE-2015-0405](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0405) * [CVE-2015-0423](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0423) * [CVE-2015-0438](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0438) * [CVE-2015-0439](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0439) * [CVE-2015-0498](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0498) * [CVE-2015-0500](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0500) * [CVE-2015-0503](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0503) * [CVE-2015-0506](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0506) * [CVE-2015-0507](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0507) * [CVE-2015-0508](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0508) * [CVE-2015-0511](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0511) * [CVE-2015-2566](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2566) * [CVE-2015-2567](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2567) * [CVE-2015-2575](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2575) * [CVE-2015-2576](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-2576) ### [October 2015](https://www.oracle.com/technetwork/topics/security/cpujan2015-1972971.html) * [CVE-2015-0385](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0385) * [CVE-2015-0409](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0409) ### [July 2014](https://www.oracle.com/technetwork/topics/security/cpujul2014-1972956.html) * [CVE-2014-2484](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2484) * [CVE-2014-4214](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4214) * [CVE-2014-4233](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4233) * [CVE-2014-4238](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4238) * [CVE-2014-4240](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4240) ### [April 2014](https://www.oracle.com/technetwork/topics/security/cpuapr2014-1972952.html) * [CVE-2014-2434](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2434) * [CVE-2014-2435](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2435) * [CVE-2014-2442](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2442) * [CVE-2014-2444](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2444) * [CVE-2014-2450](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2450) * [CVE-2014-2451](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2451) ### [January 2014](https://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html) * [CVE-2013-4316](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-4316) * [CVE-2013-5860](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5860) * [CVE-2013-5881](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5881) * [CVE-2013-5882](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5882) * [CVE-2013-5894](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5894) * [CVE-2014-0427](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0427) * [CVE-2014-0430](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0430) * [CVE-2014-0431](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0431) * [CVE-2014-0433](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0433) ### [October 2013](https://www.oracle.com/technetwork/topics/security/cpuoct2013-1899837.html) * [CVE-2013-2251](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2251) * [CVE-2013-5767](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5767) * [CVE-2013-5770](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5770) * [CVE-2013-5786](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5786) * [CVE-2013-5793](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5793) ### [July 2013](https://www.oracle.com/technetwork/topics/security/cpujuly2013-1899826.html) * [CVE-2013-3795](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3795) * [CVE-2013-3796](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3796) * [CVE-2013-3798](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3798) * [CVE-2013-3806](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3806) * [CVE-2013-3810](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3810) * [CVE-2013-3811](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-3811) ### [April 2013](https://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html) * [CVE-2013-1566](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1566) * [CVE-2013-1567](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1567) * [CVE-2013-1570](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1570) * [CVE-2013-2381](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2381) * [CVE-2013-2395](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2395) ### [October 2012](https://www.oracle.com/technetwork/topics/security/cpuoct2012-1515893.html) * [CVE-2012-3144](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3144) * [CVE-2012-3147](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3147) * [CVE-2012-3149](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3149) * [CVE-2012-3156](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3156) ### [April 2012](https://www.oracle.com/technetwork/topics/security/cpuapr2012-366314.html) * [CVE-2012-0583](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0583) * [CVE-2012-1696](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1696) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ExteriorRing ExteriorRing ============ A synonym for [ST\_ExteriorRing](../st_exteriorring/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Optimizing table_open_cache Optimizing table\_open\_cache ============================= *[table\_open\_cache](../server-system-variables/index#table_open_cache)* can be a useful variable to adjust to improve performance. Each concurrent session accessing the same table does so independently. This improves performance, although it comes at a cost of extra memory usage. *table\_open\_cache* indicates the maximum number of tables the server can keep open in any one table cache instance. Ideally, you'd like this set so as to re-open a table as infrequently as possible. However, note that this is not a hard limit. When the server needs to open a table, it evicts the least recently used closed table from the cache, and adds the new table. If all tables are used, the server adds the new table and does not evict any table. As soon as a table is not used anymore, it will be evicted from the list even if no table needs to be open, until the number of open tables will be equal to *table\_open\_cache* *table\_open\_cache* has defaulted to 2000 since [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/). Before that, the default was 400. You can view the current setting in the my.cnf file, or by running: ``` select @@table_open_cache; +--------------------+ | @@table_open_cache | +--------------------+ | 400 | +--------------------+ ``` To evaluate whether you could do with a higher table\_open\_cache, look at the number of opened tables, in conjunction with the server uptime ([Opened\_tables](../server-status-variables/index#opened_tables) and [Uptime](../server-status-variables/index#uptime) status variables): ``` show global status like 'opened_tables'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | Opened_tables | 354858 | +---------------+--------+ ``` If the number of opened tables is increasing rapidly, you should look at increasing the table\_open\_cache value. Try to find a value that sees a slow, or possibly even no, increase in the number of opened tables. Make sure that your operating system can cope with the number of open file descriptors required by the table\_open\_cache setting. If table\_open\_cache is set too high, MariaDB may start to refuse connections as the operating system runs out of file descriptors. Also note that the MyISAM (and Aria?) storage engines need two file descriptors per open table. It's possible that the open\_table\_cache can even be reduced. If your number of open\_tables has not yet reached the table\_open\_cache\_size, and the server has been up a while, you can look at decreasing the value. ``` show global status like 'open_tables'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Open_tables | 354 | +---------------+-------+ ``` The open table cache can be emptied with [FLUSH TABLES](../flush/index) or with the `flush-tables` or `refresh` [mysqladmin](../mysqladmin/index) commands. Automatic Creation of New Table Open Cache Instances ---------------------------------------------------- In [MariaDB 10.2](../what-is-mariadb-102/index) and later, MariaDB Server can create multiple instances of the table open cache. It initially creates just a single instance. However, whenever it detects contention on the existing instances, it will automatically create a new instance. When the number of instances has been increased due to contention, it does not decrease again. When MariaDB Server creates a new instance, it prints a message like the following to the [error log](../error-log/index): ``` [Note] Detected table cache mutex contention at instance 1: 25% waits. Additional table cache instance activated. Number of instances after activation: 2. ``` The maximum number of instances is defined by the `[table\_open\_cache\_instances](../server-system-variables/index#table_open_cache_instances)` system variable. The default value of the `[table\_open\_cache\_instances](../server-system-variables/index#table_open_cache_instances)` system variable is `8`, which is expected to handle up to 100 CPU cores. If your system is larger than this, then you may benefit from increasing the value of this system variable. Depending on the ratio of actual available file handles, and `[table\_open\_cache](../server-system-variables/index#table_open_cache)` size, the max. instance count may be auto adjusted to a lower value on server startup. The implementation and behavior of this feature is different than the same feature in MySQL 5.6. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WITHIN WITHIN ====== Syntax ------ ``` Within(g1,g2) ``` Description ----------- Returns `1` or `0` to indicate whether `g1` is spatially within `g2`. This tests the opposite relationship as `[Contains()](../contains/index)`. WITHIN() is based on the original MySQL implementation, and uses object bounding rectangles, while [ST\_WITHIN()](../st_within/index) uses object shapes. Examples -------- ``` SET @g1 = GEOMFROMTEXT('POINT(174 149)'); SET @g2 = GEOMFROMTEXT('POINT(176 151)'); SET @g3 = GEOMFROMTEXT('POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))'); SELECT within(@g1,@g3); +-----------------+ | within(@g1,@g3) | +-----------------+ | 1 | +-----------------+ SELECT within(@g2,@g3); +-----------------+ | within(@g2,@g3) | +-----------------+ | 0 | +-----------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb xtstat xtstat ====== `xtstat` can be used to monitor all internal activity of [PBXT](../pbxt/index). `xtstat` polls the `INFORMATION_SCHEMA.PBXT_STATISTICS` table. The poll interval can be set using the `--delay` option, and is 1 second by default. For most statistics, `xtstat` will display the difference in values between the current and previous polls. For example, if bytes written current value is 1000, and on the previous call it was 800, then `xtstat` will display 200. This means that 200 bytes were written to disk in the intervening period. Using `xtstat` -------------- Invoke xtstat as follows: ``` $ xtstat [ options ] ``` For example, to poll every 10 seconds: ``` xtstat -D10 ``` Note that statistic counters are never reset, even if a rollback occurs. For example, if an `UPDATE` statement is rolled back, `xtstat` will still indicate that one write statement (see stat-write below) was executed. If MariaDB shuts down or crashes, `xtstat` will attempt to reconnect. `xtstat` can be terminated any time using the `CTRL-C` key cimbination. Before [PBXT](../pbxt/index) has recovered, not all statistics are available. In particular, the statistics relating to PBXT background threads are not available (including the `sweep` and `chkpnt` statistics). ### Command line options `xtstat` options are as follows: | Option | Description | | --- | --- | | `-?, --help` | Prints help text. | | `-h, --host=value` | Connect to host. | | `-u, --user=value` | User for login if not current user. | | `-p, --password[=value]` | Password to use when connecting to server. If password is not given it's asked from the tty. | | `-d, --database=value` | Database to be used (`pbxt` or `information_schema` required), default is `information_schema` | | `-P, --port=value` | Port number to use for connection. | | `-S, --socket=value` | Socket file to use for connection. | | `-D, --delay=value` | Delay in seconds between polls of the database. | | `--protocol=value` | Connection protocol to use: `default/tcp/socket/pipe/memory` | | `--display=value` | Columns to display: use short names separated by `|` (the pipe character), partial match allowed. Use `--display=all` to display all columns available. | Connection options will also be taken from the MySQL config file if available. #### Size indicators Values displayed by `xtstat` are either a time in milliseconds, a value in bytes, or a counter. If these values are too large to be displayed then the value is rounded and a size indicator is added. The following size indicators are used: | | | | | --- | --- | --- | | `K` | : | Kilobytes *(1,024 bytes)* | | `M` | : | Megabytes *(1,048,576 bytes)* | | `G` | : | Gigabytes *(1,073,741,024 bytes)* | | `T` | : | Terabytes *(1,099,511,627,776 bytes)* | | `t` | : | thousands *(1,000s)* | | `m` | : | millions *(1,000,000s)* | | `b` | : | billions *(1,000,000,000s)* | ### Statistics The following is a list of the statistics displayed by `xtstat`. Each statistic as a two-part display name. The first part is the category and the second part is the type. You can select categories and types for display, as you require. For example `--display=read` will display all read activity, `--display=xact|stat` will display transaction and statement activity. Note, for diagnostics it is best to capture all statistics. The reason is because you never now where a problem might turn up, so without certain statistics you may not be able to identify the problem. | Displayname | Name | Description | | --- | --- | --- | | `time-curr` | Current Time | The current time in seconds | | `time-msec` | TimeSinceLastCall | Time passed in milliseconds since last statistics call | | `xact-commt` | Commit Count | Number of transactions committed | | `xact-rollb` | Rollback Count | Number of transactions rolled back | | `xact-waits` | Wait for Xact Count | Number of times waited for another transaction | | `xact-dirty` | Dirty Xact Count | Number of transactions still to be cleaned up. This also includes all the currently running transactions. Cleanup means that the Sweeper thread must still scan the transcation and collect/mark any "garbage" left by the transaction. Garbage is, for example, versions of rows that are no longer visiable by any transaction. | | `stat-read` | Read Statements | Number of SELECT statements | | `stat-write` | Write Statements | Number of UPDATE/INSERT/DELETE statements | | `rec-in` | Record Bytes Read | Bytes read from the record/row files | | `rec-out` | Record Bytes Written | Bytes written to the record/row files. This data is transfered from the transaction logs to the handle data (xtd) and the row index files (xtr). | | `rec-syncs/ms` | Record File Flushes | 2 values separated by a '/': the number of flushes to data handle (.xtd) and row index (.xtr) files and the time taken in milliseconds to perform the flush operations. | | `rec-hits` | Record Cache Hits | Hits when accessing the record cache. The record cache caches the data handle (.xtd) and row index (.xtr) files. | | `rec-miss` | Record Cache Misses | Misses when accessing the record cache | | `rec-frees` | Record Cache Frees | Number of record cache pages freed | | `rec-%use` | Record Cache Usage | Percentage of record cache in use. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT\_STATISTICS table is in bytes used. | | `ind-in` | Index Bytes Read | Bytes read from the index files | | `ind-out` | IndexBytesWritten | Bytes written to the index files. This data is transfered from the index log files (ilog) to the index files (xti), during a consistent flush of the index. | | `ind-syncs/ms` | Index File Flushes | 2 values separated by a '/': the number of flushes to index files and the time taken for the flush operations in milliseconds. | | `ind-hits` | Index Cache Hits | Hits when accessing the index cache | | `ind-miss` | Index Cache Misses | Misses when accessing the index cache | | `ind-%use` | Index Cache Usage | Percentage of index cache used. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT\_STATISTICS table is in bytes used. | | `ilog-in` | Index Log Bytes In | Bytes read from the index log files | | `ilog-out` | Index Log Bytes Out | Bytes written to the index log files. This data is transfered from the index cache in main memory to the index log files (ilog) during a consistent flush of the index. | | `ilog-syncs/ms` | Index Log File Syncs | 2 values separated by a '/': the number of flushes to index log files and the time taken for the flush operations in milliseconds | | `xlog-in` | Xact Log Bytes In | Bytes read from the transaction log files | | `xlog-out` | Xact Log Bytes Out | Bytes written to the transaction log files. This is data transfered from the transaction log buffer (pbxt\_transaction\_buffer\_size) to the transaction log files (.xlog). This transfer occurs on commit or when the transaction log buffer is full. | | `xlog-syncs` | Xact Log File Syncs | Number of flushes to transaction log files | | `xlog-msec` | Xact Log Sync Time | The time in milliseconds to flush transaction log files | | `xlog-hits` | Xact Log Cache Hits | Hits when accessing the transaction log cache | | `xlog-miss` | Xact Log Cache Misses | Misses when accessing the transaction log cache | | `xlog-%use` | Xact Log Cache Usage | Percentage of transaction log cache used. This value is displayed by xtstat as a percentage of the total cache available, but the value returned by PBXT\_STATISTICS table is in bytes used. | | `data-in` | Data Log Bytes In | Bytes read from the data log files | | `data-out` | Data Log Bytes Out | Bytes written to the data log files. This data is transfered from the data log buffer (pbxt\_log\_buffer\_size) to the data log files (.dlog), when the buffer is full, or on commit. | | `data-syncs` | Data Log File Syncs | Number of flushes to data log files | | `data-msec` | Data Log Sync Time | The time in milliseconds spent flushing data log files | | `to-chkpt` | Bytes to Checkpoint | Bytes written to the transaction log since the last checkpoint | | `to-write` | Log Bytes to Write | Bytes written to the transaction log, still to be written to the database | | `to-sweep` | Log Bytes to Sweep | Bytes written to the transaction log, still to be read by the Sweeper thread | | `sweep-waits` | SweeperWaitonXact | Attempts to cleanup a transaction | | `scan-index` | Index Scan Count | Number of index scans | | `scan-table` | Table Scan Count | Number of table scans | | `row-sel` | Select Row Count | Number of rows selected | | `row-ins` | Insert Row Count | Number of rows inserted | | `row-upd` | Update Row Count | Number of rows updated | | `row-del` | Delete Row Count | Number of rows deleted | More Information ---------------- Documentation on this page is based on the [xtstat documentation](http://primebase.org/documentation/index.php#xtstat) on the PrimeBase website. Paul McCullagh's presentation from the 2010 User's Conference has some usage examples: <http://www.primebase.org/download/pbxt-uc-2010.pdf> Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_SYMDIFFERENCE ST\_SYMDIFFERENCE ================= Syntax ------ ``` ST_SYMDIFFERENCE(g1,g2) ``` Description ----------- Returns a geometry that represents the portions of geometry *`g1`* and geometry *`g2`* that don't intersect. Examples -------- ``` SET @g1 = ST_GEOMFROMTEXT('LINESTRING(10 20, 10 40)'); SET @g2 = ST_GEOMFROMTEXT('LINESTRING(10 15, 10 25)'); SELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)); +----------------------------------------------+ | ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) | +----------------------------------------------+ | MULTILINESTRING((10 15,10 20),(10 25,10 40)) | +----------------------------------------------+ SET @g2 = ST_GeomFromText('LINESTRING(10 20, 10 41)'); SELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)); +-----------------------------------+ | ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) | +-----------------------------------+ | LINESTRING(10 40,10 41) | +-----------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SET Variable SET Variable ============ Syntax ------ ``` SET var_name = expr [, var_name = expr] ... ``` Description ----------- The `SET` statement in [stored programs](../stored-programs-and-views/index) is an extended version of the general `[SET](../set/index)` statement. Referenced variables may be ones declared inside a stored program, global system variables, or user-defined variables. The `SET` statement in stored programs is implemented as part of the pre-existing [SET](../set/index) syntax. This allows an extended syntax of `SET a=x, b=y, ...` where different variable types (locally declared variables, global and session server variables, user-defined variables) can be mixed. This also allows combinations of local variables and some options that make sense only for system variables; in that case, the options are recognized but ignored. `SET` can be used with both [local variables](../declare-variable/index) and [user-defined variables](../user-defined-variables/index). When setting several variables using the columns returned by a query, `[SELECT INTO](../select-into/index)` should be preferred. To set many variables to the same value, the `[LAST\_VALUE( )](../last_value/index)` function can be used. Below is an example of how a user-defined variable may be set: ``` SET @x = 1; ``` See Also -------- * [SET](../set/index) * [SET STATEMENT](../set-statement/index) * [DECLARE Variable](../declare-variable/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb InnoDB Encryption Troubleshooting InnoDB Encryption Troubleshooting ================================= ### Wrong Create Options With InnoDB tables using encryption, there are several cases where a [CREATE TABLE](../create-table/index) or [ALTER TABLE](../alter-table/index) statement can throw Error 1005, due to the InnoDB error 140, `Wrong create options`. For instance, ``` CREATE TABLE `test`.`table1` ( `id` int(4) primary key , `name` varchar(50)); ERROR 1005 (HY000): Can't create table `test`.`table1` (errno: 140 "Wrong create options") ``` When this occurs, you can usually get more information about the cause of the error by following it with a [SHOW WARNINGS](../show-warnings/index) statement. This error is known to occur in the following cases: * Encrypting a table by setting the [ENCRYPTED](../create-table/index#encrypted) table option to `YES` when the [innodb\_file\_per\_table](../innodb-system-variables/index#innodb_file_per_table) is set to `OFF`.In this case, [SHOW WARNINGS](../show-warnings/index) would return the following: ``` SHOW WARNINGS; +---------+------+---------------------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------------------+ | Warning | 140 | InnoDB: ENCRYPTED requires innodb_file_per_table | | Error | 1005 | Can't create table `db1`.`tab3` (errno: 140 "Wrong create options") | | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB | +---------+------+---------------------------------------------------------------------+ 3 rows in set (0.00 sec) ``` * Encrypting a table by setting the [ENCRYPTED](../create-table/index#encrypted) table option to `YES`, and the [innodb\_default\_encryption\_key\_id](../innodb-system-variables/index#innodb_default_encryption_key_id) system variable or the [ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id) table option refers to a non-existent key identifier. In this case, [SHOW WARNINGS](../show-warnings/index) would return the following: ``` SHOW WARNINGS; +---------+------+---------------------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------------------+ | Warning | 140 | InnoDB: ENCRYPTION_KEY_ID 500 not available | | Error | 1005 | Can't create table `db1`.`tab3` (errno: 140 "Wrong create options") | | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB | +---------+------+---------------------------------------------------------------------+ 3 rows in set (0.00 sec) ``` * In some versions, this could happen while creating a table with the [ENCRYPTED](../create-table/index#encrypted) table option set to `DEFAULT` while the [innodb\_encrypt\_tables](../innodb-system-variables/index#innodb_encrypt_tables) system variable is set to `OFF`, and the [innodb\_default\_encryption\_key\_id](../innodb-system-variables/index#innodb_default_encryption_key_id) system variable or the [ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id) table option are **not** set to `1`. In this case, [SHOW WARNINGS](../show-warnings/index) would return the following: ``` SHOW WARNINGS; +---------+------+---------------------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------------------+ | Warning | 140 | InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 | | Error | 1005 | Can't create table `db1`.`tab3` (errno: 140 "Wrong create options") | | Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB | +---------+------+---------------------------------------------------------------------+ 3 rows in set (0.00 sec) ``` Starting in [MariaDB 10.1.39](https://mariadb.com/kb/en/mariadb-10139-release-notes/), [MariaDB 10.2.23](https://mariadb.com/kb/en/mariadb-10223-release-notes/), and [MariaDB 10.3.14](https://mariadb.com/kb/en/mariadb-10314-release-notes/), creating a table with the [ENCRYPTED](../create-table/index#encrypted) table option set to `DEFAULT` while the [innodb\_encrypt\_tables](../innodb-system-variables/index#innodb_encrypt_tables) system variable is set to `OFF`, and the [innodb\_default\_encryption\_key\_id](../innodb-system-variables/index#innodb_default_encryption_key_id) system variable or the [ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id) table option are **not** set to `1` will no longer fail, and it will no longer throw a warning. For more information, see [MDEV-18601](https://jira.mariadb.org/browse/MDEV-18601). ### Setting Encryption Key ID For an Unencrypted Table If you set the [ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id) table option for a table that is unencrypted because the [innodb\_encrypt\_tables](../innodb-system-variables/index#innodb_encrypt_tables) system variable is set to `OFF` and the [ENCRYPTED](../create-table/index#encrypted) table option set to `DEFAULT`, then this encryption key ID will be saved in the table's `.frm` file, but the encryption key will not be saved to the table's `.ibd` file. As a side effect, with the current encryption design, if the [innodb\_encrypt\_tables](../innodb-system-variables/index#innodb_encrypt_tables) system variable is later set to `ON`, and InnoDB goes to encrypt the table, then the [InnoDB background encryption threads](../innodb-background-encryption-threads/index) will not read this encryption key ID from the `.frm` file. Instead, the threads may encrypt the table with the encryption key with ID `1`, which is internally considered the default encryption key when no key is specified. For example: ``` SET GLOBAL innodb_encrypt_tables=OFF; CREATE TABLE tab1 ( id INT PRIMARY KEY, str VARCHAR(50) ) ENCRYPTION_KEY_ID=100; SET GLOBAL innodb_encrypt_tables=ON; SELECT NAME, ENCRYPTION_SCHEME, CURRENT_KEY_ID FROM information_schema.INNODB_TABLESPACES_ENCRYPTION WHERE NAME='db1/tab1'; +----------+-------------------+----------------+ | NAME | ENCRYPTION_SCHEME | CURRENT_KEY_ID | +----------+-------------------+----------------+ | db1/tab1 | 1 | 1 | +----------+-------------------+----------------+ ``` A similar problem is that, if you set the [ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id) table option for a table that is unencrypted because the [ENCRYPTED](../create-table/index#encrypted) table option is set to `NO`, then this encryption key ID will be saved in the table's `.frm` file, but the encryption key will not be saved to the table's `.ibd` file. Recent versions of MariaDB will throw warnings in the case where the [ENCRYPTED](../create-table/index#encrypted) table option is set to `NO`, but they will allow the operation to succeed. For example: ``` CREATE TABLE tab1 ( id INT PRIMARY KEY, str VARCHAR(50) ) ENCRYPTED=NO ENCRYPTION_KEY_ID=100; Query OK, 0 rows affected, 1 warning (0.01 sec) SHOW WARNINGS; +---------+------+--------------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------------+ | Warning | 140 | InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 | +---------+------+--------------------------------------------------+ 1 row in set (0.00 sec) ``` However, in this case, if you change the [ENCRYPTED](../create-table/index#encrypted) table option to `YES` or `DEFAULT` with [ALTER TABLE](../alter-table/index), then it will actually use the proper key. For example: ``` SET GLOBAL innodb_encrypt_tables=ON; ALTER TABLE tab1 ENCRYPTED=DEFAULT; SELECT NAME, ENCRYPTION_SCHEME, CURRENT_KEY_ID FROM information_schema.INNODB_TABLESPACES_ENCRYPTION WHERE NAME = 'db1/tab1'; +----------+-------------------+----------------+ | NAME | ENCRYPTION_SCHEME | CURRENT_KEY_ID | +----------+-------------------+----------------+ | db1/tab1 | 1 | 100 | +----------+-------------------+----------------+ ``` For more information, see [MDEV-17230](https://jira.mariadb.org/browse/MDEV-17230), [MDEV-18601](https://jira.mariadb.org/browse/MDEV-18601), and [MDEV-19086](https://jira.mariadb.org/browse/MDEV-19086). ### Tablespaces Created on MySQL 5.1.47 or Earlier MariaDB's data-at-rest encryption implementation re-used previously unused fields in InnoDB's buffer pool pages to identify the encryption key version and the post-encryption checksum. Prior to MySQL 5.1.48, these unused fields were not initialized in memory due to performance concerns. These fields still had zero values most of the time, but since they were not explicitly initialized, that means that these fields could have occasionally had non-zero values that could have been written into InnoDB's tablespace files. If MariaDB were to encounter an unencrypted page from a tablespace file that was created on an early version of MySQL that also had non-zero values in these fields, then it would mistakenly think that the page was encrypted. The fix for [MDEV-12112](https://jira.mariadb.org/browse/MDEV-12112) that was included in [MariaDB 10.1.38](https://mariadb.com/kb/en/mariadb-10138-release-notes/), [MariaDB 10.2.20](https://mariadb.com/kb/en/mariadb-10220-release-notes/), and [MariaDB 10.3.12](https://mariadb.com/kb/en/mariadb-10312-release-notes/) changed the way that MariaDB distinguishes between encrypted and unencrypted pages, so that it is less likely to mistake an unencrypted page for an encrypted page. In [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/) and later, if [innodb\_checksum\_algorithm](../innodb-system-variables/index#innodb_checksum_algorithm) is set to `full_crc32` or `strict_full_crc32`, and if the table does not use [ROW\_FORMAT=COMPRESSED](../innodb-storage-formats/index), then data files will be guaranteed to be zero-initialized. For more information, see [MDEV-18097](https://jira.mariadb.org/browse/MDEV-18097). ### Spatial Indexes [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/) introduces support for encrypting [spatial indexes](../spatial-index/index). To enable, set the [innodb\_checksum\_algorithm](../innodb-system-variables/index#innodb_checksum_algorithm) to `full_crc32` or to `strict_full_crc32`. Note that MariaDB only encrypts spatial indexes when the [ROW\_FORMAT](../create-table/index#row_format) table option is **not** set to [COMPRESSED](../innodb-storage-formats/index#compressed). In older versions of MariaDB, spatial index encryption is unsupported. Tables that contain spatial indexes store them unencrypted. For more information, see [MDEV-12026](https://jira.mariadb.org/browse/MDEV-12026). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb TAN TAN === Syntax ------ ``` TAN(X) ``` Description ----------- Returns the tangent of X, where X is given in radians. Examples -------- ``` SELECT TAN(0.7853981633974483); +-------------------------+ | TAN(0.7853981633974483) | +-------------------------+ | 0.9999999999999999 | +-------------------------+ SELECT TAN(PI()); +-----------------------+ | TAN(PI()) | +-----------------------+ | -1.22460635382238e-16 | +-----------------------+ SELECT TAN(PI()+1); +-----------------+ | TAN(PI()+1) | +-----------------+ | 1.5574077246549 | +-----------------+ SELECT TAN(RADIANS(PI())); +--------------------+ | TAN(RADIANS(PI())) | +--------------------+ | 0.0548861508080033 | +--------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Buildbot Setup for Virtual Machines - Debian Buildbot Setup for Virtual Machines - Debian ============================================= | Title | Description | | --- | --- | | [Buildbot Setup for Virtual Machines - Debian 7 "wheezy"](../buildbot-setup-for-virtual-machines-debian-7-wheezy/index) | Base install qemu-img create -f qcow2 /kvm/vms/vm-wheezy-amd64-seri | | [Buildbot Setup for Virtual Machines - Debian 6 amd64](../buildbot-setup-for-virtual-machines-debian-6-amd64/index) | Create the VM: cd /kvm/vms qemu-img create -f qcow2 vm-debian6-amd64 | | [Buildbot Setup for Virtual Machines - Debian 6 i386](../buildbot-setup-for-virtual-machines-debian-6-i386/index) | Base Install cd /kvm/vms qemu-img create -f qcow2 vm-debian6-i386-se | | [Buildbot Setup for Virtual Machines - Debian 5 amd64](../buildbot-setup-for-virtual-machines-debian-5-amd64/index) | Download netinst CD image debian-503-amd64-netinst.iso cd /kvm/vms q | | [Buildbot Setup for Virtual Machines - Debian 5 i386](../buildbot-setup-for-virtual-machines-debian-5-i386/index) | Base install Download netinst CD image debian-503-i386-netinst.iso and inst... | | [Buildbot Setup for Virtual Machines - Debian 4 i386](../buildbot-setup-for-virtual-machines-debian-4-i386/index) | Create the VM: cd /kvm/vms qemu-img create -f qcow2 vm-debian4-i386- | | [Buildbot Setup for Virtual Machines - Debian 4 amd64](../buildbot-setup-for-virtual-machines-debian-4-amd64/index) | cd /kvm/vms qemu-img create -f qcow2 vm-debian4-amd64-serial.qcow2 8 | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Building MariaDB on Solaris and OpenSolaris Building MariaDB on Solaris and OpenSolaris =========================================== The following two articles should help you get your Solaris machine prepared to build MariaDB (just ignore the parts about installing buildbot): * [Buildbot Setup for Solaris Sparc](../buildbot-setup-for-solaris-sparc/index) * [Buildbot Setup for Solaris x86](../buildbot-setup-for-solaris-x86/index) Notes ----- * The BUILD dir contains various scripts for compiling MariaDB on Solaris. The `BUILD/compile-solaris-amd64` and `BUILD/compile-solaris-amd64-debug` are probably the most useful. * The scripts do not play nice with non-bash shells such as the Korn Shell (ksh). So if your /bin/sh is pointing at ksh or ksh93, you'll want to change it so that it points at bash. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Multi master replication and deadlock detection in Galera with Mariadbs Multi master replication and deadlock detection in Galera with Mariadbs ======================================================================= Hi, We have multi master Galera replication setup where three master mariadbs are continuously updated. 1. Because of which occasionally a transaction encounters deadlock. 2. The JDBC queries slow down their executions if we allow continuous table updates. Add to the mix an event that purges the tables and we noticed a deletion of more than 200000 entries held the lock for more than 15 seconds. How can we rectify this problem? Is there a way to improve DB performance in replication setup? We also used non replicated setup and the portal does not encounter any JDBC connection errors. Your insights are much appreciated. Thanks Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Creating and Dropping CONNECT Tables Creating and Dropping CONNECT Tables ==================================== Create Table statements for “CONNECT” tables are standard MariaDB create statements specifying `engine=CONNECT`. There are a few additional table and column options specific to CONNECT. ### Table Options | Table Option | Type | Description | | --- | --- | --- | | `AVG_ROW_LENGTH` | Integer | Can be specified to help CONNECT estimate the size of a variable record table length. | | `BLOCK_SIZE` | Integer | The number of rows each block of a [FIX](../connect-dos-and-fix-table-types/index), [BIN](../connect-bin-table-type/index), [DBF](../connect-dbf-table-type/index), or [VEC](../connect-vec-table-type/index) table contains. For an [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index) table this is the RowSet size option. For a [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index) table this is the fetch size. | | `CATFUNC` | String | The catalog function used by a [catalog table](../connect-table-types-catalog-tables/index). | | `COLIST` | String | The column list of [OCCUR](../connect-table-types-occur-table-type/index) tables or $project of [MONGO](../connect-mongo-table-type-accessing-collections-from-mongodb/index) tables. | | `COMPRESS` | Number | `1` or `2` if the data file is g-zip compressed. Defaults to 0. Before CONNECT 1.05.0001, this was boolean, and true if the data file is compressed. | | `CONNECTION` | String | Specifies the connection of an [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index), [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index) or [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index) table. | | `DATA_CHARSET` | String | The character set used in the external file or data source. | | `DBNAME` | String | The target database for [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index), [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index), [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index), [catalog](../connect-table-types-catalog-tables/index), and [PROXY](../connect-table-types-proxy-table-type/index) based tables. The database concept is sometimes known as a *schema*. | | `ENGINE` | String | Must be specfied as `CONNECT`. | | `ENDING` | Integer | End of line length. Defaults to `1` for Unix/Linux and `2` for Windows. | | `FILE_NAME` | String | The file (path) name for all table types based on files. Can be absolute or relative to the current data directory. If not specified, this is an [Inward table](../inward-and-outward-tables/index#inward-tables) and a default value is used. | | `FILTER` | String | To filter an external table. Currently MONGO tables only. | | `HEADER` | Integer | Applies to [CSV](../connect-csv-and-fmt-table-types/index), [VEC](../connect-vec-table-type/index), and HTML files. Its meaning depends on the table type. | | `HTTP` | String | The HTTP of the client of REST queries. From [Connect 1.06.0010](../connect/index). | | `HUGE` | Boolean | To specify that a table file can be larger than 2GB. For a [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index) table, prevents the result set from being stored in memory. | | `LRECL` | Integer | The file record size (often calculated by default). | | `MAPPED` | Boolean | Specifies whether *file mapping* is used to handle the table file. | | `MODULE` | String | The (path) name of the DLL or shared lib implementing the access of a non-standard ([OEM](../connect-table-types-oem/index)) table type. | | `MULTIPLE` | Integer | Used to specify multiple file tables. | | `OPTION_LIST` | String | Used to specify all other options not yet directly defined. | | `QCHAR` | String | Specifies the character used for quoting some fields of a [CSV](../connect-csv-and-fmt-table-types/index) table or the identifiers of an [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index)/[JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index) tables. | | `QUOTED` | Integer | The level of quoting used in [CSV](../connect-csv-and-fmt-table-types/index) table files. | | `READONLY` | Boolean | True if the data file must not be modified or erased. | | `SEP_CHAR` | String | Specifies the field separator character of a [CSV](../connect-csv-and-fmt-table-types/index) or [XCOL](../connect-table-types-xcol-table-type/index) table. Also, used to specify the Jpath separator for [JSON tables](../connect-json-table-type/index). | | `SEPINDEX` | Boolean | When true, indexes are saved in separate files. | | `SPLIT` | Boolean | True for a [VEC](../connect-vec-table-type/index) table when all columns are in separate files. | | `SRCDEF` | String | The source definition of a table retrieved via [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index), [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index) or the MySQL API or used by a [PIVOT](../connect-table-types-pivot-table-type/index) table. | | `SUBTYPE` | String | The subtype of an [OEM](../connect-table-types-oem/index) table type. | | `TABLE_LIST` | String | The comma separated list of TBL table sub-tables. | | `TABLE_TYPE` | String | The external table [type](../connect-table-types-overview/index): [DOS](../connect-dos-and-fix-table-types/index), [FIX](../connect-dos-and-fix-table-types/index), [BIN](../connect-bin-table-type/index), [CSV](../connect-csv-and-fmt-table-types/index), [FMT](../connect-csv-and-fmt-table-types/index), [XML](../connect-xml-table-type/index), [JSON](../connect-json-table-type/index), [INI](../connect-ini-table-type/index), [DBF](../connect-dbf-table-type/index), [VEC](../connect-vec-table-type/index), [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index), [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index), [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index), [TBL](../connect-table-types-tbl-table-type-table-list/index), [PROXY](../connect-table-types-proxy-table-type/index), [XCOL](../connect-table-types-xcol-table-type/index), [OCCUR](../connect-table-types-occur-table-type/index), [PIVOT](../connect-table-types-pivot-table-type/index), [ZIP](../connect-zipped-file-tables/index), [VIR](../connect-table-types-vir/index), [DIR](../connect-table-types-special-virtual-tables/index#dir-type), [WMI](../connect-table-types-special-virtual-tables/index#windows-management-instrumentation-table-type-wmi), [MAC](../connect-table-types-special-virtual-tables/index#mac-address-table-type-mac), and [OEM](../connect-table-types-oem/index). Defaults to [DOS](../connect-dos-and-fix-table-types/index), [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index), or [PROXY](../connect-table-types-proxy-table-type/index) depending on what options are used. | | `TABNAME` | String | The target table or node for [ODBC](../connect-table-types-odbc-table-type-accessing-tables-from-other-dbms/index), [JDBC](../connect-jdbc-table-type-accessing-tables-from-other-dbms/index), [MYSQL](../connect-table-types-mysql-table-type-accessing-mysqlmariadb-tables/index), [PROXY](../connect-table-types-proxy-table-type/index), or [catalog tables](../connect-table-types-catalog-tables/index); or the top node name for [XML](../connect-xml-table-type/index) tables. | | `URI` | String | The URI of a REST request.. From [Connect 1.06.0010](../connect/index). | | `XFILE_NAME` | String | The file (path) base name for table index files. Can be absolute or relative to the data directory. Defaults to the file name. | | `ZIPPED` | Boolean | True if the table file(s) is/are zipped in one or several zip files. | All integers in the above table are unsigned big integers. Because CONNECT handles many table types; many table type specific options are not in the above list and must be entered using the `OPTION_LIST` option. The syntax to use is: ``` ... option_list='opname1=opvalue1,opname2=opvalue2...' ``` Be aware that until Connect 1.5.5, no blanks should be inserted before or after the '`=`' and '`,`' characters. The option name is all that is between the start of the string or the last '`,`' character and the next '`=`' character, and the option value is all that is between this '`=`' character and the next '`,`' or end of string. For instance: ``` option_list='name=TABLE,coltype=HTML,attribute=border=1;cellpadding=5,headattr=bgcolor=yellow'; ``` This defines four options, '`name`', '`coltype`', '`attribute`', and '`headattr`'; with values '`TABLE`', '`HTML`', '`border=1;cellpadding=5`', and '`bgcolor=yellow`', respectively. The only restriction is that values cannot contain commas, but they can contain equal signs. ### Column Options | Column Option | Type | Description | | --- | --- | --- | | `DATE_FORMAT` | String | The format indicating how a date is stored in the file. | | `DISTRIB` | Enum | “scattered”, “clustered”, “sorted” (ascending). | | `FIELD_FORMAT` | String | The column format for some table types. | | `FIELD_LENGTH` | Integer | Set the internal field length for DATE columns. | | `FLAG` | Integer | An integer value whose meaning depends on the table type. | | `JPATH` | String | The Json path of JSON table columns. | | `MAX_DIST` | Integer | Maximum number of distinct values in this column. | | `SPECIAL` | String | The name of the SPECIAL column that set this column value. | | `XPATH` | String | The XML path of XML table columns. | * The `MAX_DIST` and `DISTRIB` column options are used for block indexing. * All integers in the above table are unsigned big integers. * JPATH and XPATH were added to make CREATE TABLE statements more readable, but they do the same thing as FIELD\_FORMAT and any of them can be used with the same result. ### Index Options | Index Option | Type | Description | | --- | --- | --- | | DYNAM | Boolean | Set the index as “dynamic”. | | MAPPED | Boolean | Use index file mapping. | **Note 1:** Creating a CONNECT table based on file does not erase or create the file if the file name is specified in the CREATE TABLE statement ([“outward”](../inward-and-outward-tables/index#outward-tables) table). If the file does not exist, it will be populated by subsequent INSERT or LOAD commands or by the “AS select statement” of the [CREATE TABLE](../create-table/index) command. Unlike the CSV engine, CONNECT easily permits the creation of tables based on already existing files, for instance files made by other applications. However, if the file name is not specified, a file with a name defaulting to `tablename.tabletype` will be created in the data directory ([“inward”](../inward-and-outward-tables/index#inward-tables) table). **Note 2:** Dropping a CONNECT table is done with a standard DROP statement. For [outward tables](../inward-and-outward-tables/index#inward-tables), this drops only the CONNECT table definition but does not erase the corresponding data file and index files. Use `DELETE` or `TRUNCATE` to do so. This is contrary to data and index files of [inward tables](../inward-and-outward-tables/index#inward-tables) are erased on DROP like for other MariaDB engines. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql_upgrade mysql\_upgrade ============== **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadb-upgrade` is a symlink to `mysql_upgrade`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mysql_upgrade` is the symlink, and `mariadb-upgrade` the binary name. **MariaDB starting with [10.2.42](https://mariadb.com/kb/en/mariadb-10242-release-notes/)**Starting from `mysql_upgrade` / `mariadb-upgrade` 2.0, the user running the upgrade tool must have write access to `datadir/mysql_upgrade_info`, so that the tool can write the current MariaDB version into the file. `mysql-upgrade` was updated in [MariaDB 10.2.42](https://mariadb.com/kb/en/mariadb-10242-release-notes/), [MariaDB 10.3.33](https://mariadb.com/kb/en/mariadb-10333-release-notes/), [MariaDB 10.4.23](https://mariadb.com/kb/en/mariadb-10423-release-notes/), [MariaDB 10.5.14](https://mariadb.com/kb/en/mariadb-10514-release-notes/), [MariaDB 10.6.6](https://mariadb.com/kb/en/mariadb-1066-release-notes/), [MariaDB 10.7.2](https://mariadb.com/kb/en/mariadb-1072-release-notes/) and newer. `mariadb-upgrade/mysql_upgrade` is a tool that checks and updates your tables to the latest version. You should run `mariadb-upgrade/mysql_upgrade` after upgrading from one major MySQL/MariaDB release to another, such as [from MySQL 5.0 to MariaDB 10.4](../upgrading-to-mariadb-from-mysql/index) or [MariaDB 10.4](../what-is-mariadb-104/index) to [MariaDB 10.5](../what-is-mariadb-105/index). You also have to use `mysql_upgrade` after a direct "horizontal" migration, for example from MySQL 5.5.40 to [MariaDB 5.5.40](https://mariadb.com/kb/en/mariadb-5540-release-notes/). It's also safe to run `mariadb-upgrade/mysql_upgrade` for minor upgrades, as if there are no incompatibilities nothing is changed. It needs to be run as a user with write access to the data directory. `mariadb-upgrade/mysql_upgrade` is run after starting the new MariaDB server. Running it before you shut down the old version will not hurt anything and will allow you to make sure it works and figure out authentication for it ahead of time. It is recommended to make a [backup](../backing-up-and-restoring/index) of all the databases before running `mariadb-upgrade/mysql_upgrade`. In most cases, `mariadb-upgrade/mysql_upgrade` should just take a few seconds. The main work of `mariadb-upgrade/mysql_upgrade` is to: * Update the system tables in the `mysql` database to the latest version (normally just add new fields to a few tables). * Check that all tables are up to date (runs [CHECK TABLE table\_name FOR UPGRADE](../sql-commands-check-table/index)). For tables that are not up to date, runs [ALTER TABLE table\_name FORCE](../alter-table/index) on the table to update it. A table is not up to date if: + The table uses an index for which there has been a [collation](../character-sets/index) change (rare) + A format change in the storage engine requires an update (very rare) Using mariadb-upgrade/mysql\_upgrade ------------------------------------ ``` mysql_upgrade [--force] [--user=# --password --host=hostname --port=# --socket=# --protocol=tcp|socket|pipe|memory --verbose] OTHER_OPTIONS] ``` `mariadb-upgrade/mysql_upgrade` is mainly a framework to call [mysqlcheck](../mysqlcheck/index). `mysql_upgrade` works by doing the following operations: ``` # Find out path to datadir echo "show show variables like 'datadir'" | mysql mysqlcheck --no-defaults --check-upgrade --auto-repair --databases mysql mysql_fix_privilege_tables mysqlcheck --no-defaults --all-databases --fix-db-names --fix-table-names mysqlcheck --no-defaults --check-upgrade --all-databases --auto-repair ``` The connect options given to `mariadb-upgrade/mysql_upgrade` are passed along to [mysqlcheck](../mysqlcheck/index) and [mysql](../mysql-command-line-client/index). The `mysql_fix_privilege_tables` script is not actually called; it's included as part of `mysql_upgrade` If you have a problem with `mariadb-upgrade/mysql_upgrade` try run it in very verbose mode: ``` mysql_upgrade --verbose --verbose other-options ``` `mariadb-upgrade/mysql_upgrade` also saves the MariaDB version number in a file named `mysql_upgrade_info` in the [data directory](../server-system-variables/index#datadir). This is used to quickly check whether all tables have been checked for this release so that table-checking can be skipped. For this reason, `mysql_upgrade` needs to be run as a user with write access to the data directory. To ignore this file and perform the check regardless, use the `--force` option. ### Options `mariadb-upgrade/mysql_upgrade` supports the following options: | Option | Description | Version | | --- | --- | --- | | `-?`, `--help` | Display this help message and exit. | | | `--basedir=path` | Old option accepted for backward compatibility but ignored. | | | `--character-sets-dir=path` | Old option accepted for backward compatibility but ignored. | | | `check-if-upgrade-is-needed` | Do a quick check if upgrade is needed. Returns 0 if yes, 1 if no. | 2.0 | | `--compress=name` | Old option accepted for backward compatibility but ignored. | | | `--datadir=name` | Old option accepted for backward compatibility but ignored. | | | `-# [name]`, `--debug[=name]` | For debug builds, output debug log. | | | `--debug-check` | Check memory and open file usage at exit. | | | `-T`, `--debug-info` | Print some debug info at exit. | | | `--default-character-set=name` | Old option accepted for backward compatibility but ignored. | | | `-f`, `--force` | Force execution of mysqlcheck even if `mysql_upgrade` has already been executed for the current version of MariaDB. Ignores `mysql_upgrade_info`. | | | `-h`, `--host=name` | Connect to MariaDB on the given host. | | | `-p`, `--password[=name]` | Password to use when connecting to server. If password is not given, it's solicited on the command line (which should be considered insecure). You can use an option file to avoid giving the password on the command line. | | | `-P`, `--port=name` | Port number to use for connection or 0 for default to, in order of preference, my.cnf, the MYSQL\_TCP\_PORT [environment variable](../mariadb-environment-variables/index), /etc/services, built-in default (3306). | | | `--protocol=name` | The protocol to use for connection (tcp, socket, pipe, memory). | | | `--silent` | Print less information. | | | `-S`, `--socket=name` | For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. | | | `--ssl` | Enables [TLS](../data-in-transit-encryption/index). TLS is also enabled even without setting this option when certain other TLS options are set. Starting with [MariaDB 10.2](../what-is-mariadb-102/index), the `--ssl` option will not enable [verifying the server certificate](../secure-connections-overview/index#server-certificate-verification) by default. In order to verify the server certificate, the user must specify the `--ssl-verify-server-cert` option. | | | `--ssl-ca=name` | Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option implies the `--ssl` option. | | | `--ssl-capath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the [openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html) command. See [Secure Connections Overview: Certificate Authorities (CAs)](../secure-connections-overview/index#certificate-authorities-cas) for more information. This option is only supported if the client was built with OpenSSL or yaSSL. If the client was built with GnuTLS or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. This option implies the `--ssl` option. | | | `--ssl-cert=name` | Defines a path to the X509 certificate file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | | `--ssl-cipher=name` | List of permitted ciphers or cipher suites to use for [TLS](../data-in-transit-encryption/index). This option implies the `--ssl` option. | | | `--ssl-crl=name` | Defines a path to a PEM file that should contain one or more revoked X509 certificates to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | | `--ssl-crlpath=name` | Defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the [openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html) command. See [Secure Connections Overview: Certificate Revocation Lists (CRLs)](../secure-connections-overview/index#certificate-revocation-lists-crls) for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. | | | `--ssl-key=name` | Defines a path to a private key file to use for [TLS](../data-in-transit-encryption/index). This option requires that you use the absolute path, not a relative path. This option implies the `--ssl` option. | | | `--ssl-verify-server-cert` | Enables [server certificate verification](../secure-connections-overview/index#server-certificate-verification). This option is disabled by default. | | | `-t`, `--tmpdir=name` | Directory for temporary files. | | | `-s`, `--upgrade-system-tables` | Only upgrade the system tables in the mysql database. Tables in other databases are not checked or touched. | | | `-u`, `--user=name` | User for login if not current user. | | | `-v`, `--verbose` | Display more output about the process, using it twice will print connection arguments; using it 3 times will print out all [CHECK](../check-table/index), [RENAME](../rename-table/index) and [ALTER TABLE](../alter-table/index) commands used during the check phase; using it 4 times will also write out all [mysqlcheck](../mysqlcheck/index) commands used. | | | `-V`, `--version` | Output version information and exit. | | | `-k`, `--version-check` | Run this program only if its 'server version' matches the version of the server to which it's connecting check. Note: the 'server version' of the program is the version of the MariaDB server with which it was built/distributed. (Defaults to on; use `--skip-version-check` to disable.) | | | `--write-binlog` | All commands including those run by [mysqlcheck](../mysqlcheck/index) are written to the [binary log](../binary-log/index). Disabled by default. Before [MariaDB 10.0.6](https://mariadb.com/kb/en/mariadb-1006-release-notes/) and [MariaDB 5.5.34](https://mariadb.com/kb/en/mariadb-5534-release-notes/), this was enabled by default, and `--skip-write-binlog` should be used when commands should not be sent to replication slaves. | | mariadb-upgrade/mysql\_upgrade 2.0 ---------------------------------- `mariadb-upgrate/mysql_upgrade 2.0` was introduced in [MariaDB 10.2.42](https://mariadb.com/kb/en/mariadb-10242-release-notes/), [MariaDB 10.3.33](https://mariadb.com/kb/en/mariadb-10333-release-notes/), [MariaDB 10.4.23](https://mariadb.com/kb/en/mariadb-10423-release-notes/), [MariaDB 10.5.14](https://mariadb.com/kb/en/mariadb-10514-release-notes/), [MariaDB 10.6.6](https://mariadb.com/kb/en/mariadb-1066-release-notes/), [MariaDB 10.7.2](https://mariadb.com/kb/en/mariadb-1072-release-notes/). Previously the tool first ran the upgrade process and then created the `datadir/mysql_upgrade_info` file. If the file could not be created because of permissions (`mysql_upgrade` did not have rights to create the file), `mariadb-upgrade/mysql_upgrade` gave an error, but this was often ignored. One effect of not being able to create the `mysql_upgrade_info` file was that every new `mysql_upgrade` run would have to do a full upgrade check, which can take a while if there are a lot of tables. `mariadb-upgrade/mysql_upgrade` 2.0 fixes the following issues: * The `datadir/mysql_upgrade_info` is now created at the start of the upgrade process and locked. This ensures that two `mariadb-upgrade/mysql_upgrade` processes cannot be run in parallel, which can cause deadlocks ([MDEV-27068](https://jira.mariadb.org/browse/MDEV-27068)). One side-effect of this is that `mariadb-upgrade/mysql_upgrade` has to have write access to `datadir`, which means it has to be run as as the user that installed MariaDB, normally 'mysql' or 'root' . * One can use `mariadb-upgrade/mysql_upgrade --force --force` to force the upgrade to be run, even if there was no version change or if one doesn't have write access to `datadir`. Note that if this option is used, the next `mariadb-upgrade/mysql_upgrade` run will assume that there is a major version change and the upgrade must be done (again). * The upgrade will only be done if there is a major server version change (10.4.X -> 10.5.X). This will avoid unnecessary upgrades. * New option added: `--check-if-upgrade-is-needed`. If this is used, `mariadb-upgrade/mysql_upgrade` will return 0 if there has been a major version change and one should run `mariadb-upgrade/mysql_upgrade`. If not upgrade is need, 1 will be returned. * `--verbose` writes more information, including from which version to which version the upgrade will be done. * Better messages when there is no need to run `mariadb-upgrade/mysql_upgrade`. ### Option Files In addition to reading options from the command-line, `mariadb-upgrade/mysql_upgrade` can also read options from [option files](../configuring-mariadb-with-option-files/index). If an unknown option is provided to `mariadb-upgrade/mysql_upgrade` in an option file, then it is ignored. The following options relate to how MariaDB command-line tools handles option files. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | | `--defaults-group-suffix=#` | In addition to the default option groups, also read option groups with this suffix. | In [MariaDB 10.2](../what-is-mariadb-102/index) and later, `mariadb-upgrade/mysql_upgrade` is linked with [MariaDB Connector/C](../about-mariadb-connector-c/index). However, MariaDB Connector/C does not yet handle the parsing of option files for this client. That is still performed by the server option file parsing code. See [MDEV-19035](https://jira.mariadb.org/browse/MDEV-19035) for more information. #### Option Groups `mariadb-upgrade/mysql_upgrade` reads options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysql_upgrade]` | Options read by `mysql_upgrade`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-upgrade]` | Options read by `mysql_upgrade`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[client]` | Options read by all MariaDB and MySQL [client programs](../clients-utilities/index), which includes both MariaDB and MySQL clients. For example, `mysqldump`. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[client-mariadb]` | Options read by all MariaDB [client programs](../clients-utilities/index). | Differences Between mysql\_upgrade in MariaDB and MySQL ------------------------------------------------------- This is as of [MariaDB 5.1.50](https://mariadb.com/kb/en/mariadb-5150-release-notes/): * MariaDB will convert long [table names](../identifier-names/index) properly. * MariaDB will convert [InnoDB](../xtradb-and-innodb/index) tables (no need to do a dump/restore or `[ALTER TABLE](../alter-table/index)`). * MariaDB will convert old archive tables to the new 5.1 format. * "mysql\_upgrade --verbose" will run "mysqlcheck --verbose" so that you get more information of what is happening. Running with 3 times --verbose will in [MariaDB 10.0](../what-is-mariadb-100/index) print out all CHECK, RENAME and ALTER TABLE commands executed. * The [mysql.event table](../mysqlevent-table/index) is upgraded live; no need to restart the server to use events if the event table has changed ([MariaDB 10.0.22](https://mariadb.com/kb/en/mariadb-10022-release-notes/) and [MariaDB 10.1.9](https://mariadb.com/kb/en/mariadb-1019-release-notes/)). * More descriptive output. Speeding Up mariadb-upgrade/mysql\_upgrade ------------------------------------------ - If you are sure that all your tables are up to date with the current version, then you can run `mysql_upgrade ---upgrade-system-tables`, which will only fix your system tables in the mysql database to be compatible with the latest version. The main reason to run `mariadb-upgrade/mysql_upgrade` on all your tables is to allow it to check that: * There has not been any change in table formats between versions. + This has not happened since [MariaDB 5.1](../what-is-mariadb-51/index). * If some of the tables are using an index for which we have changed sort order. + This has not happened since [MariaDB 5.5](../what-is-mariadb-55/index). If you are 100% sure this applies to you, you can just run `mariadb-upgrade/mysql_upgrade` with the `---upgrade-system-tables` option. Symptoms of Not Having Run mariadb-upgrade/mysql\_upgrade When It Was Needed ---------------------------------------------------------------------------- * Errors in the [error log](../error-log/index) that some system tables don't have all needed columns. * Updates or searches may not find the record they are attempting to update or search for. * [CHECKSUM TABLE](../checksum-table/index) may report the wrong checksum for [MyISAM](../myisam/index) or [Aria](../aria/index) tables. To fix issues like this, run `mariadb-upgrade/mysql_upgrade`, [mysqlcheck](../mysqlcheck/index), [CHECK TABLE](../sql-commands-check-table/index) and if needed [REPAIR TABLE](../repair-table/index) on the wrong table. Other Uses ---------- * `mariadb-upgrade/mysql_upgrade` will re-create any missing tables in the [mysql database](../the-mysql-database-tables/index). It will not touch any data in existing tables. See Also -------- * [mysqlcheck](../mysqlcheck/index) * [CHECK TABLE](../sql-commands-check-table/index) * [REPAIR TABLE](../repair-table/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb OPEN OPEN ==== Syntax ------ <= [MariaDB 10.2](../what-is-mariadb-102/index) ``` OPEN cursor_name ``` From [MariaDB 10.3](../what-is-mariadb-103/index) ``` OPEN cursor_name [expression[,...]]; ``` Description ----------- This statement opens a [cursor](../programmatic-and-compound-statements-cursors/index) which was previously declared with [DECLARE CURSOR](../declare-cursor/index). The query associated to the DECLARE CURSOR is executed when OPEN is executed. It is important to remember this if the query produces an error, or calls functions which have side effects. This is necessary in order to [FETCH](../fetch/index) rows from a cursor. See [Cursor Overview](../cursor-overview/index) for an example. See Also -------- * [Cursor Overview](../cursor-overview/index) * [DECLARE CURSOR](../declare-cursor/index) * [FETCH cursor\_name](../fetch/index) * [CLOSE cursor\_name](../close/index) * [Cursors in Oracle mode](../sql_modeoracle-from-mariadb-103/index#cursors) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysql-test mysql-test =========== MariaDB uses **mysql-test** to test functionality. It is an all-in-one test framework, doing unit, regression, and conformance testing. The framework was inherited from MySQL, but is greatly enhanced, optimized, and extended in MariaDB. | Title | Description | | --- | --- | | [mysql-test Overview](../mysql-test-overview/index) | Overview of mysql-test. | | [mysql-test Auxiliary Files](../mysql-test-auxiliary-files/index) | Besides test and result files, many other files that affect the testing process in mysql-test | | [mysql-test-run.pl Options](../mysql-test-runpl-options/index) | Run test cases. | | [Pausing mysql-test-run.pl](../pausing-mysql-test-runpl/index) | Working while your computer is busy running mysql-test-run.pl. | | [mysqltest and mysqltest-embedded](../mysqltest-and-mysqltest-embedded/index) | Runs a test case against a MariaDB server, optionally comparing the output with a result file. | | [New Features for mysqltest in MariaDB](../new-features-for-mysqltest-in-mariadb/index) | MariaDB added a number of new options and commands to mysqltest. | | [Debugging MariaDB With a Debugger](../debugging-mariadb-with-a-debugger/index) | If MariaDB is compiled for debugging, you can both use it in a debugger, an... | | [The Debug Sync Facility](../the-debug-sync-facility/index) | DEBUG\_SYNC synchronization points in server code | | [Code Coverage with dgcov](../dgcov/index) | The dgcov tool helps you check the coverage for new code. | | [Installing MinIO for Usage With mysql-test-run](../installing-minio-for-usage-with-mysql-test-run/index) | Easiest way to access to Amazon S3 compatible storage. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MOD MOD === Syntax ------ ``` MOD(N,M), N % M, N MOD M ``` Description ----------- Modulo operation. Returns the remainder of N divided by M. See also [Modulo Operator](../modulo-operator/index). If the `ERROR_ON_DIVISION_BY_ZERO` [SQL\_MODE](../sql-mode/index) is used, any number modulus zero produces an error. Otherwise, it returns NULL. The integer part of a division can be obtained using [DIV](../div/index). Examples -------- ``` SELECT 1042 % 50; +-----------+ | 1042 % 50 | +-----------+ | 42 | +-----------+ SELECT MOD(234, 10); +--------------+ | MOD(234, 10) | +--------------+ | 4 | +--------------+ SELECT 253 % 7; +---------+ | 253 % 7 | +---------+ | 1 | +---------+ SELECT MOD(29,9); +-----------+ | MOD(29,9) | +-----------+ | 2 | +-----------+ SELECT 29 MOD 9; +----------+ | 29 MOD 9 | +----------+ | 2 | +----------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LEAST LEAST ===== Syntax ------ ``` LEAST(value1,value2,...) ``` Description ----------- With two or more arguments, returns the smallest (minimum-valued) argument. The arguments are compared using the following rules: * If the return value is used in an INTEGER context or all arguments are integer-valued, they are compared as integers. * If the return value is used in a REAL context or all arguments are real-valued, they are compared as reals. * If any argument is a case-sensitive string, the arguments are compared as case-sensitive strings. * In all other cases, the arguments are compared as case-insensitive strings. LEAST() returns NULL if any argument is NULL. Examples -------- ``` SELECT LEAST(2,0); +------------+ | LEAST(2,0) | +------------+ | 0 | +------------+ ``` ``` SELECT LEAST(34.0,3.0,5.0,767.0); +---------------------------+ | LEAST(34.0,3.0,5.0,767.0) | +---------------------------+ | 3.0 | +---------------------------+ ``` ``` SELECT LEAST('B','A','C'); +--------------------+ | LEAST('B','A','C') | +--------------------+ | A | +--------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb OLD_MODE OLD\_MODE ========= The [old\_mode](../server-system-variables/index#old_mode) system variable was introduced in [MariaDB 5.5.35](https://mariadb.com/kb/en/mariadb-5535-release-notes/) to replace the [old](../server-system-variables/index#old) variable with a new one with better granularity. MariaDB supports several different modes which allow you to tune it to suit your needs. The most important ways for doing this are with [SQL\_MODE](../sql-mode/index) and `OLD_MODE`. [SQL\_MODE](../sql-mode/index) is used for getting MariaDB to emulate behavior from other SQL servers, while `OLD_MODE` is used for emulating behavior from older MariaDB or MySQL versions. `OLD_MODE` is a string with different options separated by commas ('`,`') without spaces. The options are case insensitive. Normally `OLD_MODE` should be empty. It's mainly used to get old behavior when switching to MariaDB or to a new major version of MariaDB, until you have time to fix your application. Between major versions of MariaDB various options supported by `OLD_MODE` may be removed. This is intentional as we assume that the application will be fixed to conform with the new MariaDB behavior between releases. You can check the local and global value of it with: ``` SELECT @@OLD_MODE, @@GLOBAL.OLD_MODE; ``` You can set the `OLD\_MODE` either from the [command line](../mysqld-options-full-list/index) (option `--old-mode`) or by setting the [old\_mode](../server-system-variables/index#old_mode) system variable. The different values of `OLD_MODE` are: | Option | Description | | --- | --- | | `NO_DUP_KEY_WARNINGS_WITH_IGNORE` | Don't print duplicate key warnings when using INSERT [IGNORE](../ignore/index). | | `NO_PROGRESS_INFO` | Don't show progress information in [SHOW PROCESSLIST](../show-processlist/index). | | `UTF8_IS_UTF8MB3` | From [MariaDB 10.6.1](https://mariadb.com/kb/en/mariadb-1061-release-notes/), the main name of the previous 3 byte `utf` [character set](../character-sets/index) has been changed to `utf8mb3`. If set, the default, `utf8` is an alias for `utf8mb3`. If not set, `utf8` would be an alias for `utf8mb4`. | | `ZERO_DATE_TIME_CAST` | When a [TIME](../time/index) value is cast to a [DATETIME](../datetime/index), the date part will be `0000-00-00`, not [CURRENT\_DATE](../curdate/index) (as dictated by the SQL standard). | | `IGNORE_INDEX_ONLY_FOR_JOIN` | From [MariaDB 10.9](../what-is-mariadb-109/index), --old option is deprecated. This option allows behaviour of --old option for disabling the index only for joins, but allow it for ORDER BY. | | `COMPAT_5_1_CHECKSUM` | From [MariaDB 10.9](../what-is-mariadb-109/index), --old option is deprecated. This option allows behaviour of --old option for enabling old-style checksum for `CHECKSUM TABLE` that MySQL 5.1 supports | OLD\_MODE and Stored Programs ----------------------------- In contrast to [SQL\_MODE](../sql-mode/index), [stored programs](../stored-programs-and-views/index) use the current user's `OLD_MODE`value. Changes to `OLD_MODE` are not sent to replicas. Examples -------- This example shows how to get a readable list of enabled OLD\_MODE flags: ``` SELECT REPLACE(@@OLD_MODE, ',', '\n'); +---------------------------------------------------+ | REPLACE(@@OLD_MODE, ',', '\n') | +---------------------------------------------------+ | NO_DUP_KEY_WARNINGS_WITH_IGNORE | | NO_PROGRESS_INFO | +---------------------------------------------------+ ``` Adding a new flag: ``` SET @@OLD_MODE = CONCAT(@@OLD_MODE, ',NO_PROGRESS_INFO'); ``` If the specified flag is already ON, the above example has no effect but does not produce an error. How to unset a flag: ``` SET @@OLD_MODE = REPLACE(@@OLD_MODE, 'NO_PROGRESS_INFO', ''); ``` How to check if a flag is set: ``` SELECT @@OLD_MODE LIKE '%NO_PROGRESS_INFO'; +------------------------------------+ | @@OLD_MODE LIKE '%NO_PROGESS_INFO' | +------------------------------------+ | 1 | +------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Performance Schema metadata_locks Table Performance Schema metadata\_locks Table ======================================== **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**The metadata\_locks table was introduced in [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/). The `metadata_locks` table contains [metadata lock](../metadata-locking/index) information. To enable metadata lock instrumention, at runtime: ``` UPDATE performance_schema.setup_instruments SET enabled='YES', timed='YES' WHERE name LIKE 'wait/lock/metadata%'; ``` or in the [configuration file](../configuring-mariadb-with-option-files/index): ``` performance-schema-instrument='wait/lock/metadata/sql/mdl=ON' ``` The table is by default autosized, but the size can be configured with the [performance\_schema\_max\_metadata\_locks](../performance-schema-system-variables/index#performance_schema_max_metadata_locks) system variabe. The table is read-only, and [TRUNCATE TABLE](../truncate-table/index) cannot be used to empty the table. The table contains the following columns: | Field | Type | Null | Default | Description | | --- | --- | --- | --- | --- | | OBJECT\_TYPE | varchar(64) | NO | NULL | Object type. One of `BACKUP`, `COMMIT`, `EVENT`, `FUNCTION`, `GLOBAL`, `LOCKING SERVICE`, `PROCEDURE`, `SCHEMA`, `TABLE`, `TABLESPACE`, `TRIGGER` (unused) or `USER LEVEL LOCK`. | | OBJECT\_SCHEMA | varchar(64) | YES | NULL | Object schema. | | OBJECT\_NAME | varchar(64) | YES | NULL | Object name. | | OBJECT\_INSTANCE\_BEGIN | bigint(20) unsigned | NO | NULL | Address in memory of the instrumented object. | | LOCK\_TYPE | varchar(32) | NO | NULL | Lock type. One of `BACKUP_FTWRL1`, `BACKUP_START`, `BACKUP_TRANS_DML`, `EXCLUSIVE`, `INTENTION_EXCLUSIVE`, `SHARED`, `SHARED_HIGH_PRIO`, `SHARED_NO_READ_WRITE`, `SHARED_NO_WRITE`, `SHARED_READ`, `SHARED_UPGRADABLE` or `SHARED_WRITE`. | | LOCK\_DURATION | varchar(32) | NO | NULL | Lock duration. One of `EXPLICIT` (locks released by explicit action, for example a global lock acquired with [FLUSH TABLES WITH READ LOCK](../flush/index)) , `STATEMENT` (locks implicitly released at statement end) or `TRANSACTION` (locks implicitly released at transaction end). | | LOCK\_STATUS | varchar(32) | NO | NULL | Lock status. One of `GRANTED`, `KILLED`, `PENDING`, `POST_RELEASE_NOTIFY`, `PRE_ACQUIRE_NOTIFY`, `TIMEOUT` or `VICTIM`. | | SOURCE | varchar(64) | YES | NULL | Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved. | | OWNER\_THREAD\_ID | bigint(20) unsigned | YES | NULL | Thread that requested the lock. | | OWNER\_EVENT\_ID | bigint(20) unsigned | YES | NULL | Event that requested the lock. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb GLENGTH GLENGTH ======= Syntax ------ ``` GLength(ls) ``` Description ----------- Returns as a double-precision number the length of the [LineString](../linestring/index) value *`ls`* in its associated spatial reference. Examples -------- ``` SET @ls = 'LineString(1 1,2 2,3 3)'; SELECT GLength(GeomFromText(@ls)); +----------------------------+ | GLength(GeomFromText(@ls)) | +----------------------------+ | 2.82842712474619 | +----------------------------+ ``` See Also -------- * [ST\_LENGTH()](../st_length/index) is the OpenGIS equivalent. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MyRocks and Replication MyRocks and Replication ======================= Details about how MyRocks works with [replication](../high-availability-performance-tuning-mariadb-replication/index). MyRocks and Statement-Based Replication --------------------------------------- [Statement-based](../binary-log-formats/index#statement-based) replication (SBR) works as follows: SQL statements are executed on the master (possibly concurrently). They are written into the binlog (this fixes their ordering, "a serialization"). The slave then reads the binlog and executes the statements in their binlog order. In order to prevent data drift, serial execution of statements on the slave must have the same effect as concurrent execution of these statements on the master. In other words, transaction isolation on the master must be close to `SERIALIZABLE` transaction isolation level (This is not a strict mathematical proof but shows the idea). InnoDB achieves this by (almost) supporting `SERIALIZABLE` transactional isolation level. It does so by supporting "Gap Locks". MyRocks doesn't support `SERIALIZABLE` isolation, and it doesn't support gap locks. Because of that, generally one cannot use MyRocks and statement-based replication. Updating a MyRocks table while having SBR on, will result in an error as follow: ``` ERROR 4056 (HY000): Can't execute updates on master with binlog_format != ROW. ``` ### Can One Still Use SBR with MyRocks? Yes. In many cases, database applications run a restricted set of SQL statements, and it's possible to prove that lack of Gap Lock support is not a problem and data skew will not occur. In that case, one can set `@@rocksdb_unsafe_for_binlog=1` and MyRocks will work with SBR. The user is however responsible for making sure their queries are not causing a data skew. Read-Free Slave --------------- TODO Differences From Upstream MyRocks --------------------------------- MyRocks upstream (that is, Facebook's MySQL branch) has a number of unique replication enhancements. These are available in upstream's version of MyRocks but not in MariaDB's version of MyRocks. * Read-Free Replication (see <https://github.com/facebook/mysql-5.6/wiki/Read-Free-Replication>) TODO * `<<unique\_check\_lag\_threshold>>`. This is FB/MySQL-5.6 feature where unique checks are disabled if replication lag exceeds a certain threshold. * `<<slave\_gtid\_info=OPTIMIZED>>`. This is said to be: ``` <<quote>> "Whether SQL threads update mysql.slave_gtid_info table. If this value " "is OPTIMIZED, updating the table is done inside storage engines to " "avoid MySQL layer's performance overhead", <</quote>> ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema SYSTEM_VARIABLES Table Information Schema SYSTEM\_VARIABLES Table ========================================== **MariaDB starting with [10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)**The `information_schema.SYSTEM_VARIABLES` table was introduced in [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/) The [Information Schema](../information_schema/index) `SYSTEM_VARIABLES` table shows current values and various metadata of all [system variables](../server-system-variables/index). It contains the following columns: | Column | Description | | --- | --- | | `VARIABLE_NAME` | System variable name. | | `SESSION_VALUE` | Session value of the variable or NULL if the variable only has a global scope. | | `GLOBAL_VALUE` | Global value of the variable or NULL if the variable only has a session scope. | | `GLOBAL_VALUE_ORIGIN` | How the global value was set — a compile-time default, auto-configured by the server, configuration file (or a command line), with the SQL statement. | | `DEFAULT_VALUE` | Compile-time default value of the variable. | | `VARIABLE_SCOPE` | Global, session, or session-only. | | `VARIABLE_TYPE` | Data type of the variable value. | | `VARIABLE_COMMENT` | Help text, usually shown in `mysqld --help --verbose`. | | `NUMERIC_MIN_VALUE` | For numeric variables — minimal allowed value. | | `NUMERIC_MAX_VALUE` | For numeric variables — maximal allowed value. | | `NUMERIC_BLOCK_SIZE` | For numeric variables — a valid value must be a multiple of the "block size". | | `ENUM_VALUE_LIST` | For `ENUM`, `SET`, and `FLAGSET` variables — the list of recognized values. | | `READ_ONLY` | Whether a variable can be set with the SQL statement. Note that many "read only" variables can still be set on the command line. | | `COMMAND_LINE_ARGUMENT` | Whether an argument is required when setting the variable on the command line. `NULL` when a variable can not be set on the command line. | | `GLOBAL_VALUE_PATH` | Which config file the variable got its value from. `NULL` if not set in any config file. Added in [MariaDB 10.5.0](https://mariadb.com/kb/en/mariadb-1050-release-notes/). | Example ------- ``` SELECT * FROM information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='JOIN_BUFFER_SIZE'\G *************************** 1. row ***************************** VARIABLE_NAME: JOIN_BUFFER_SIZE SESSION_VALUE: 131072 GLOBAL_VALUE: 131072 GLOBAL_VALUE_ORIGIN: COMPILE-TIME DEFAULT_VALUE: 131072 VARIABLE_SCOPE: SESSION VARIABLE_TYPE: BIGINT UNSIGNED VARIABLE_COMMENT: The size of the buffer that is used for joins NUMERIC_MIN_VALUE: 128 NUMERIC_MAX_VALUE: 18446744073709551615 NUMERIC_BLOCK_SIZE: 128 ENUM_VALUE_LIST: NULL READ_ONLY: NO COMMAND_LINE_ARGUMENT: REQUIRED ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ENDPOINT ENDPOINT ======== A synonym for [ST\_ENDPOINT](../st_endpoint/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb mysqld_safe mysqld\_safe ============ **MariaDB starting with [10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/)**From [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/), `mariadbd-safe` is a symlink to `mysqld_safe`. **MariaDB starting with [10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/)**From [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), `mariadbd-safe` is the name of the server, with `mysqld_safe` a symlink . The `mysqld_safe` startup script is in MariaDB distributions on Linux and Unix. It is a wrapper that starts `mysqld` with some extra safety features. For example, if `mysqld_safe` notices that `mysqld` has crashed, then `mysqld_safe` will automatically restart `mysqld`. `mysqld_safe` is the recommended way to start `mysqld` on Linux and Unix distributions that do not support `[systemd](../systemd/index)`. Additionally, the `[mysql.server](../mysqlserver/index)` init script used by `[sysVinit](../sysvinit/index)` starts `mysqld` with `mysqld_safe` by default. Using mysqld\_safe ------------------ The command to use `mysqld_safe` and the general syntax is: ``` mysqld_safe [ --no-defaults | --defaults-file | --defaults-extra-file | --defaults-group-suffix | --print-defaults ] <options> <mysqld_options> ``` ### Options Many of the options supported by `mysqld_safe` are identical to options supported by `[mysqld](../mysqld-options/index)`. If an unknown option is provided to `mysqld_safe` on the command-line, then it is passed to `mysqld`. `mysqld_safe` supports the following options: | Option | Description | | --- | --- | | `--help` | Display a help message and exit. | | `--autoclose` | (NetWare only) On NetWare, `mysqld_safe` provides a screen presence. When you unload (shut down) the `mysqld_safe` NLM, the screen does not by default go away. Instead, it prompts for user input: `NLM has terminated; Press any key to close the screen`. If you want NetWare to close the screen automatically instead, use the `--autoclose` option to mysqld\_safe. | | `--basedir=path` | The path to the MariaDB installation directory. | | `--core-file-size=size` | The size of the core file that mysqld should be able to create. The option value is passed to ulimit -c. | | `--crash-script=file` | Script to call in the event of mysqld crashing. | | `--datadir=path` | The path to the data directory. | | `--defaults-extra-file=path` | The name of an option file to be read in addition to the usual option files. This must be the first option on the command line if it is used. If the file does not exist or is otherwise inaccessible, the server will exit with an error. | | `--defaults-file=file_name` | The name of an option file to be read instead of the usual option files. This must be the first option on the command line if it is used. | | `--defaults-group-suffix=#` | In addition to the default option groups, also read option groups with this suffix. | | `--flush-caches` | Flush and purge buffers/caches before starting the server. | | `--ledir=path` | If mysqld\_safe cannot find the server, use this option to indicate the path name to the directory where the server is located. | | `--log-error=file_name` | Write the error log to the given file. | | `--malloc-lib=lib` | Preload shared library *lib* if available. See [debugging MariaDB](../debugging-a-running-server-on-linux/index) for an example. | | `--mysqld=prog_nam` | The name of the server program (in the ledir directory) that you want to start. This option is needed if you use the MariaDB binary distribution but have the data directory outside of the binary distribution. If mysqld\_safe cannot find the server, use the `--ledir` option to indicate the path name to the directory where the server is located. | | `--mysqld-version=suffix` | This option is similar to the `--mysqld` option, but you specify only the suffix for the server program name. The basename is assumed to be mysqld. For example, if you use`--mysqld-version=debug`, mysqld\_safe starts the mysqld-debug program in the ledir directory. If the argument to `--mysqld-version` is empty, mysqld\_safe uses mysqld in the ledir directory. | | `--nice=priority` | Use the nice program to set the server´s scheduling priority to the given value. | | `--no-auto-restart` | Exit after starting mysqld. | | `--no-defaults` | Do not read any option files. This must be the first option on the command line if it is used. | | `--no-watch` | Exit after starting mysqld. | | `--numa-interleave` | Run mysqld with its memory interleaved on all NUMA nodes. | | `--open-files-limit=count` | The number of files that mysqld should be able to open. The option value is passed to ulimit -n. Note that you need to start mysqld\_safe as root for this to work properly. | | `--pid-file=file_name` | The path name of the process ID file. | | `--plugin-dir=dir_name`, | Directory for client-side plugins. | | `--port=port_num` | The port number that the server should use when listening for TCP/IP connections. The port number must be 1024 or higher unless the server is started by the root system user. | | `--print-defaults` | Print the program argument list and exit. | | `--skip-kill-mysqld` | Do not try to kill stray mysqld processes at startup. This option works only on Linux. | | `--socket=path` | The Unix socket file that the server should use when listening for local connections. | | `--syslog`, `--skip-syslog` | `--syslog` causes error messages to be sent to syslog on systems that support the logger program. `--skip-syslog` suppresses the use of syslog; messages are written to an error log file. | | `--syslog-tag=tag` | For logging to syslog, messages from `mysqld_safe` and mysqld are written with a tag of mysqld\_safe and mysqld, respectively. To specify a suffix for the tag, use `--syslog-tag=tag`, which modifies the tags to be `mysqld_safe-tag` and `mysqld-tag`. | | `--timezone=timezone` | Set the TZ time zone [environment variable](../mariadb-environment-variables/index) to the given option value. Consult your operating system documentation for legal time zone specification formats. Also see [Time Zones](../time-zones/index). | | `--user={user_name or user_id}` | Run the mysqld server as the user having the name user\_name or the numeric user ID user\_id. (“User” in this context refers to a system login account, not a MariaDB user listed in the grant tables.) | ### Option Files In addition to reading options from the command-line, `mysqld_safe` can also read options from [option files](../configuring-mariadb-with-option-files/index). If an unknown option is provided to `mysqld_safe` in an option file, then it is ignored. The following options relate to how MariaDB command-line tools handles option files. They must be given as the **first argument** on the command-line: | Option | Description | | --- | --- | | `--print-defaults` | Print the program argument list and exit. | | `--no-defaults` | Don't read default options from any option file. | | `--defaults-file=#` | Only read default options from the given file #. | | `--defaults-extra-file=#` | Read this file after the global files are read. | | `--defaults-group-suffix=#` | In addition to the default option groups, also read option groups with this suffix. | #### Option Groups `mysqld_safe` reads options from the following [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysqld_safe]` | Options read by `mysqld_safe`, which includes both MariaDB Server and MySQL Server. | | `[safe_mysqld]` | Options read by `mysqld_safe`, which includes both MariaDB Server and MySQL Server. | | `[mariadb_safe]` | Options read by `mysqld_safe` from MariaDB Server. | | `[mariadb-safe]` | Options read by `mysqld_safe` from MariaDB Server. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | The `[safe_mysqld]` option group is primarily supported for backward compatibility. You should rename such option groups to `[mysqld_safe]` in MariaDB installations to prevent breakage in the future if this compatibility is removed. `mysqld_safe` also reads options from the following server [option groups](../configuring-mariadb-with-option-files/index#option-groups) from [option files](../configuring-mariadb-with-option-files/index): | Group | Description | | --- | --- | | `[mysqld]` | Options read by `mysqld`, which includes both MariaDB Server and MySQL Server. | | `[server]` | Options read by MariaDB Server. | | `[mysqld-X.Y]` | Options read by a specific version of `mysqld`, which includes both MariaDB Server and MySQL Server. For example, `[mysqld-5.5]`. | | `[mariadb]` | Options read by MariaDB Server. | | `[mariadb-X.Y]` | Options read by a specific version of MariaDB Server. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[galera]` | Options read by a galera-capable MariaDB Server. Available on systems compiled with Galera support. | For example, if you specify the `[log\_error](../server-system-variables/index#log_error)` option in a server option group in an option file, like this: ``` [mariadb] log_error=error.log ``` Then `mysqld_safe` will also use this value for its own `--log-error` option: ### Configuring the Open Files Limit When using `mysqld_safe`, the system's open files limit can be changed by providing the `--open-files-limit` option either on the command-line or in an option file. For example: ``` [mysqld_safe] open_files_limit=4294967295 ``` The option value is passed to `ulimit -n`. Note that you need to start `mysqld_safe` as root for this to work properly. However, you can't currently set this to `unlimited`. See [MDEV-18410](https://jira.mariadb.org/browse/MDEV-18410) about that. When `mysqld_safe` starts `mysqld`, it also uses this option to set the value of the `[open\_files\_limit](../server-system-variables/index#open_files_limit)` system variable for `mysqld`. ### Configuring the Core File Size When using `mysqld_safe`, if you would like to [enable core dumps](../enabling-core-dumps/index), the system's core file size limit can be changed by providing the `--core-file-size` option either on the command-line or in an option file. For example: ``` [mysqld_safe] core_file_size=unlimited ``` The option value is passed to `ulimit -c`. Note that you need to start `mysqld_safe` as root for this to work properly. ### Configuring MariaDB to Write the Error Log to Syslog When using `mysqld_safe`, if you would like to redirect the error log to the [syslog](https://linux.die.net/man/8/rsyslogd), then that can easily be done by using the `--syslog` option. `mysqld_safe` redirects two types of log messages to the syslog--its own log messages, and log messages for `mysqld`. * `mysqld_safe` configures its own log messages to go to the `daemon` syslog facility. The log level for these messages is either `notice` or `error`, depending on the specific type of log message. The default tag is `mysqld_safe`. * `mysqld_safe` also configures the log messages for `mysqld` to go to the `daemon` syslog facility. The log level for these messages is `error`. The default tag is `mysqld`. Sometimes it can be helpful to add a suffix to the syslog tag, such as if you are running multiple instances of MariaDB on the same host. To add a suffix to each syslog tag, use the `--syslog-tag` option. Specifying mysqld ----------------- By default, `mysqld_safe` tries to start an executable named `mysqld`. You can also specify another executable for `mysqld_safe` to start instead of `mysqld` by providing the `--mysqld` or `--mysqld-version` options either on the command-line or in an option file. By default, it will look for `mysqld` in the following locations in the following order: * `$BASEDIR/libexec/mysqld` * `$BASEDIR/sbin/mysqld` * `$BASEDIR/bin/mysqld` * `$PWD/bin/mysqld` * `$PWD/libexec/mysqld` * `$PWD/sbin/mysqld` * `@libexecdir@/mysql` Where `$BASEDIR` is set by the `--basedir` option, `$PWD` is the current working directory where `mysqld_safe` was invoked, and `@libexecdir@` is set at compile-time by the `INSTALL_BINDIR` option for `[cmake](../generic-build-instructions/index#using-cmake)`. You can also specify where the executable is located by providing the `--ledir` option either on the command-line or in an option file. Specifying datadir ------------------ By default, `mysqld_safe` will look for the `datadir` in the following locations in the following order: * `$BASEDIR/data/mysql` * `$BASEDIR/data` * `$BASEDIR/var/mysql` * `$BASEDIR/var` * `@localstatedir@` Where `$BASEDIR` is set by the `--basedir` option, and `@localstatedir@` is set at compile-time by the `INSTALL_MYSQLDATADIR` option for `[cmake](../generic-build-instructions/index#using-cmake)`. You can also specify where the `datadir` is located by providing the `--datadir` option either on the command-line or in an option file. Logging ------- When you use `mysqld_safe` to start `mysqld`, `mysqld_safe` logs to the same destination as `mysqld`. `mysqld_safe` has several log-related options: * `--syslog`: Write error messages to syslog on systems that support the logger program. * `--skip-syslog`: Do not write error messages to syslog. Messages are written to the default error log file (host\_name.err in the data directory), or to a named file if the `--log-error` option is given. * `--log-error=file_name`: Write error messages to the named error file. If none of these options is provided, then the default is `--skip-syslog`. If `--syslog` and `--log-error` are both provided, then a warning is issued and `--log-error` takes precedence. `mysqld_safe` also writes notices to `stdout` and errors to `stderr`. Editing mysqld\_safe -------------------- `mysqld_safe` is a `sh` script, so if you need to change its behavior, then it can easily be edited. However, you should not normally edit the script. A lot of behavior can be changed by providing options either on the command-line or in an option file. If you do edit `mysqld_safe`, then you should be aware of the fact that a package upgrade can overwrite your changes. If you would like to preserve your changes, be sure to have a backup. NetWare ------- On NetWare, mysqld\_safe is a NetWare Loadable Module (NLM) that is ported from the original Unix shell script. It starts the server as follows: 1. Runs a number of system and option checks. 2. Runs a check on MyISAM tables. 3. Provides a screen presence for the MariaDB server. 4. Starts mysqld, monitors it, and restarts it if it terminates in error. 5. Sends error messages from mysqld to the host\_name.err file in the data directory. 6. Sends mysqld\_safe screen output to the host\_name.safe file in the data directory. See Also -------- * [How to increase max number of open files on Linux](http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files). This can be used to solve issues like this warning from mysqld: `Changed limits: max_open_files: 1024 (requested 5000)"` * [mysqld Options](../mysqld-options/index) * [systemd](../systemd/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LOOP LOOP ==== Syntax ------ ``` [begin_label:] LOOP statement_list END LOOP [end_label] ``` Description ----------- `LOOP` implements a simple loop construct, enabling repeated execution of the statement list, which consists of one or more statements, each terminated by a semicolon (i.e., `;`) statement delimiter. The statements within the loop are repeated until the loop is exited; usually this is accomplished with a [LEAVE](../leave/index) statement. A `LOOP` statement can be [labeled](../labels/index). `end_label` cannot be given unless `begin_label` also is present. If both are present, they must be the same. See [Delimiters](../delimiters/index) in the [mysql](../mysql-client/index) client for more on delimiter usage in the client. See Also -------- * [LOOP in Oracle mode](../sql_modeoracle-from-mariadb-103/index#loop) * [ITERATE](../iterate/index) * [LEAVE](../leave/index) * [FOR Loops](../for/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb MariaDB Memory Usage MariaDB Memory Usage ===================== How MariaDB uses memory. | Title | Description | | --- | --- | | [Connect Memory Usage](../connect-memory-usage/index) | When creating a connection, a THD object is created for that connection. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT Table Types - VIR CONNECT Table Types - VIR ========================= VIR Type -------- A VIR table is a virtual table having only Special or Virtual columns. Its only property is its “size”, or cardinality, meaning the number of virtual rows it contains. It is created using the syntax: ``` CREATE TABLE name [coldef] ENGINE=CONNECT TABLE_TYPE=VIR [BLOCK_SIZE=n]; ``` The optional `BLOCK_SIZE` option gives the size of the table, defaulting to 1 if not specified. When its columns are not specified, it is almost equivalent to a [SEQUENCE](../sequence/index) table “seq\_1\_to\_Size”. ### Displaying constants or expressions Many DBMS use a no-column one-line table to do this, often call “dual”. MySQL and MariaDB use syntax where no table is specified. With CONNECT, you can achieve the same purpose with a virtual table, with the noticeable advantage of being able to display several lines. For example: ``` create table virt engine=connect table_type=VIR block_size=10; select concat('The square root of ', n, ' is') what, round(sqrt(n),16) value from virt; ``` This will return: | what | value | | --- | --- | | The square root of 1 is | 1.0000000000000000 | | The square root of 2 is | 1.4142135623730951 | | The square root of 3 is | 1.7320508075688772 | | The square root of 4 is | 2.0000000000000000 | | The square root of 5 is | 2.2360679774997898 | | The square root of 6 is | 2.4494897427831779 | | The square root of 7 is | 2.6457513110645907 | | The square root of 8 is | 2.8284271247461903 | | The square root of 9 is | 3.0000000000000000 | | The square root of 10 is | 3.1622776601683795 | What happened here? First of all, unlike Oracle “dual” tableS that have no columns, a MariaDB table must have at least one column. By default, CONNECT creates VIR tables with one special column. This can be seen with the SHOW CREATE TABLE statement: ``` CREATE TABLE `virt` ( `n` int(11) NOT NULL `SPECIAL`=ROWID, PRIMARY KEY (`n`) ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='VIR' `BLOCK_SIZE`=10 ``` This special column is called “n” and its value is the row number starting from 1. It is purely a virtual table and no data file exists corresponding to it and to its index. It is possible to specify the columns of a VIR table but they must be CONNECT special columns or virtual columns. For instance: ``` create table virt2 ( n int key not null special=rowid, sig1 bigint as ((n*(n+1))/2) virtual, sig2 bigint as(((2*n+1)*(n+1)*n)/6) virtual) engine=connect table_type=VIR block_size=10000000; select * from virt2 limit 995, 5; ``` This table shows the sum and the sum of the square of the n first integers: | n | sig1 | sig2 | | --- | --- | --- | | 996 | 496506 | 329845486 | | 997 | 497503 | 330839495 | | 998 | 498501 | 331835499 | | 999 | 499500 | 332833500 | | 1000 | 500500 | 333833500 | Note that the size of the table can be made very big as there no physical data. However, the result should be limited in the queries. For instance: ``` select * from virt2 where n = 1664510; ``` Such a query could last very long if the rowid column were not indexed. Note that by default, CONNECT declares the “n” column as a primary key. Actually, VIR tables can be indexed but only on the ROWID (or ROWNUM) columns of the table. This is a virtual index for which no data is stored. ### Generating a Table filled with constant values An interesting use of virtual tables, which often cannot be achieved with a table of any other type, is to generate a table containing constant values. This is easily done with a virtual table. Let us define the table FILLER as: ``` create table filler engine=connect table_type=VIR block_size=5000000; ``` Here we choose a size larger than the biggest table we want to generate. Later if we need a table pre- filled with default and/or null values, we can do for example: ``` create table tp ( id int(6) key not null, name char(16) not null, salary float(8,2)); insert into tp select n, 'unknown', NULL from filler where n <= 10000; ``` This will generate a table having 10000 rows that can be updated later when needed. Note that a [SEQUENCE](../sequence/index) table could have been used here instead of FILLING . ### VIR tables vs. SEQUENCE tables With just its default column, a VIR table is almost equivalent to a [SEQUENCE](../sequence/index) table. The syntax used is the main difference, for instance: ``` select * from seq_100_to_150_step_10; ``` can be obtained with a VIR table (of size >= 15) by: ``` select n*10 from vir where n between 10 and 15; ``` Therefore, the main difference is to be able to define the columns of VIR tables. Unfortunately, there are currently many limitations to virtual columns that hopefully should be removed in the future. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb ColumnStore System Monitoring Configuration ColumnStore System Monitoring Configuration =========================================== Introduction ============ ColumnStore is designed to be somewhat self managing and healing. The following 2 processes help achieve this: * **ProcMon** runs on each node and is responsible for ensuring that the other required ColumnStore processes are started and automatically restarted as appropriate on that server. This in turn is started and monitored by the run.sh shell script which ensures it is restarted should it be killed. The run.sh script is invoked and automatically started by the **columnstore** systemd service at bootup time. This can also be utilized to restart the service on an individual node though generally it is preferred to use the *mcsadmin stop, shutdown, and start* commands from the PM1 node. * **ProcMgr** runs on each PM node with only one taking an active role at a time, the others remaining in warm standby mode. This process manager is responsible for overall system health, resource monitoring, and PM node failover management. To provide additional monitoring guarantees, an external monitoring tool should monitor the health of these 3 processes and potentially all. If the run.sh process fails then the system is at potential risk of not being able to self heal. System monitoring configuration =============================== A number of system configuration variables exist to allow fine tuning of the system monitoring capabilities. In general the default values will work relatively well for many cases. The configuration parameters are maintained in the /usr/local/mariadb/columnstore/etc/Columnstore.xml file. In a multiple server deployment these should only be edited on the PM1 server as this will be automatically replicated to other servers by the system. A system restart will be required for the configuration change to take affect. Convenience utility programs *getConfig* and *setConfig* are available to safely update the Columnstore.xml without needing to be comfortable with editing XML files. The -h argument will display usage information. The section value will be *SystemConfig* for all settings in this document. For example: ``` # ./setConfig SystemConfig ModuleHeartbeatPeriod 5 # ./getConfig SystemConfig ModuleHeartbeatPeriod 5 ``` Module heartbeats ----------------- Heartbeat monitoring occurs between modules (both [UM](../columnstore-user-module/index) and [PM](../columnstore-performance-module/index)) to determine the module is up and functioning. The module heartbeat settings are the same for all modules. 1. *ModuleHeartbeatPeriod* refers to how often the heartbeat test is performed. For example, if you set the period to 5, then the heartbeat test is performed every 5 seconds. The initial default value is 1. To disable heartbeat monitoring set the value to -1. 2. *ModuleHeartbeatCount* refers to how many failures in a row must take place before a fault is processed. The initial default value is 3. Disk threshold -------------- Thresholds can be set to trigger a local alert when file system usage crosses a specified percentage of a file system on a server. Critical, Major or Minor thresholds can be set for the disk usage for each server. However it is recommend to use an external system monitoring tool configured to monitor for free disk space to perform proactive external alerting or paging. Actual columnstore data is stored within the *data<N>* directories of the installation and mariadb db files are stored under the *mysql/db* directory. 1. *ExternalMinorThreshold* - Percentage threshold for when a minor local alarm is triggered. Default value is 70. 2. *ExternalMajorThreshold* - Percentage threshold for when a minor local alarm is triggered. Default value is 80. 3. *ExternalCriticalThreshold* - Percentage threshold for when a minor local alarm is triggered. Default value is 90. The value is a numeric percentage value between 0 and 100. To disable a particular threshold use value 0. To disable a threshold alarm, set it to 0. Memory utilization ------------------ A couple of mcsadmin commands provide convenience functions for monitoring memory utilization across nodes. *getSystemMemory* returns server level memory statistics and *getSystemMemoryUsers* shows the the top 5 processes by server. The following examples are for a 2 server combined setup: ``` mcsadmin> getSystemMemory getsystemmemory Tue Nov 29 11:14:21 2016 System Memory Usage per Module (in K bytes) Module Mem Total Mem Used Cache Mem Usage % Swap Total Swap Used Swap Usage % ------ --------- -------- ------- ----------- ---------- --------- ------------ pm1 7979488 1014772 6438432 12 3145724 0 0 pm2 3850724 632712 1134324 16 3145724 0 0 mcsadmin> getSystemMemoryUsers getsystemmemoryusers Tue Nov 29 11:41:10 2016 System Process Top Memory Users per Module Module 'pm1' Top Memory Users (in bytes) Process Memory Used Memory Usage % ----------------- ----------- -------------- mysqld 19621 3 PrimProc 18990 3 gnome-shell 10192 2 systemd-journald 4236 1 DDLProc 3004 1 Module 'pm2' Top Memory Users (in bytes) Process Memory Used Memory Usage % ----------------- ----------- -------------- mysqld 19046 5 PrimProc 18891 5 ProcMon 2343 1 workernode 1806 1 WriteEngineServ 1507 1 ``` Viewing storage configuration ============================= To view the storage configuration, use the *getStorageConfig* command in [mcsadmin](../mariadb-columnstore-administrative-console/index), or simply use [mcsadmin](../mariadb-columnstore-administrative-console/index) *getStorageConfig* from the operating system prompt. This will provide information on DBRoots and which PM they are assigned to, if any. Example: ``` # mcsadmin getstorageconfig Wed Mar 28 10:40:34 2016 System Storage Configuration Storage Type = internal System DBRoot count = 6 DBRoot IDs assigned to 'pm1' = 1 DBRoot IDs assigned to 'pm2' = 2 DBRoot IDs assigned to 'pm3' = 3 DBRoot IDs assigned to 'pm4' = 4 DBRoot IDs assigned to 'pm5' = 5 DBRoot IDs assigned to 'pm6' = 6 ``` Module monitoring configuration =============================== An internal alarm system is used to keep track of internal notable events as a convenience or reference point. It is recommended to use a dedicated system monitoring tool for more proactive alerting of critical CPU, memory, or disk utilization issues for each of the servers. Alarms are logged to the */var/log/mariadb/columnstore/alarm.log* file and a summary is displayed in mcsadmin. The *getActiveAlarms* command in mcsadmin can be used to retrieve current alarm conditions. For each module (PM and UM), the following resource monitoring parameters can be configured: | Resource Monitoring Parameter | mcsadmin command | | --- | --- | | CPU thresholds | setModuleTypeConfig (module name) ModuleCPU(Clear/ Minor/Major/Critical)Threshold n (where n= percentage of CPU usage) | | Disk file system use threshold | setModuleTypeConfig (module name) ModuleDisk(Minor/ Major/Critical)Threshold n (where n= percentage of disk system used) | | Module swap thresholds | setModuleTypeConfig (module name) ModuleSwap(Minor/ Major/Crictical)Threshold n (where n= percentage of swap space used) | Alarm trigger count threshold ----------------------------- For an alarm, a threshold can be set for how many times the alarm can be triggered in 30 minutes. The default threshold is 100. ``` setAlarmConfig (alarmID#) Threshold n ``` (where n= maximum number of times an alarm can be triggered in 30 minutes), Example to change Alarm ID 22's threshold to 50: ``` # mcsadmin setAlarmConfig 22 Threshold 50 ``` Clearing alarms --------------- The *resetAlarm* command is used to clear and acknowledge the issue is resolved. The *resetAlarm* command can be invoked with the argument ALL to clear all outstanding local alarms. Automated restart based on excessive swapping --------------------------------------------- ColumnStore by default has behavior that will restart a server should swap space utilization exceed the configured module swap major threshold (default is 80%). At this point the system will likely be near unusable and so this is an attempt to recover from very large queries or data loads. The behavior of this is configured by the *SystemConfig* section configuration variable *SwapAction* which contains the oam command to be run if the threshold is exceeded. The default value is *'restartSystem'* but it can be set to *'none'* to disable this behavior. The fact that this has happened can be determined by the following log entry: ``` Nov 01 11:23:13 [ServerMonitor] 13.306324 |0|0|0| C 09 CAL0000: Swap Space usage over Major threashold, perform OAM command restartSystem ``` Logging level management ======================== There are five levels of logging in MariaDB ColumnStore. * Critical * Error * Warning * Info * Debug Application log files are written to */var/log/mariadb/columnstore* on each server and log rotation / archiving is configured to manage these automatically. To get details about current logging configuration: ``` # mcsadmin getlogconfig getlogconfig Wed Oct 19 06:58:47 2016 MariaDB Columnstore System Log Configuration Data System Logging Configuration File being used: /etc/rsyslog.d/49-columnstore.conf Module Configured Log Levels ------ --------------------------------------- pm1 Critical Error Warning Info ``` The system logging configuration file referenced is a standard syslog configuration file and may be edited to enable and or disable specific levels, for example to disable debug logging and to only log at the specific level in each file: ``` # cat /etc/rsyslog.d/49-columnstore.conf # MariaDb Columnstore Database Platform Logging local1.=crit -/var/log/mariadb/columnstore/crit.log local1.=err -/var/log/mariadb/columnstore/err.log local1.=warning -/var/log/mariadb/columnstore/warning.log local1.=info -/var/log/mariadb/columnstore/info.log ``` After making changes to this restart the syslog process, e.g: ``` # systemctl restart rsyslog ``` Log rotation and archiving are also configured by the installer and the settings for this may be found and managed similarly in the file */etc/logrotate.d/columnstore* . If the current log files are manually deleted restart the syslog process to resume logging. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb UNINSTALL PLUGIN UNINSTALL PLUGIN ================ Syntax ------ ``` UNINSTALL PLUGIN [IF EXISTS] plugin_name ``` Description ----------- This statement removes a single installed [plugin](../mariadb-plugins/index). To uninstall the whole library which contains the plugin, use [UNINSTALL SONAME](../uninstall-soname/index). You cannot uninstall a plugin if any table that uses it is open. `plugin_name` must be the name of some plugin that is listed in the [mysql.plugin](../mysqlplugin-table/index) table. The server executes the plugin's deinitialization function and removes the row for the plugin from the `mysql.plugin` table, so that subsequent server restarts will not load and initialize the plugin. `UNINSTALL PLUGIN` does not remove the plugin's shared library file. To use `UNINSTALL PLUGIN`, you must have the [DELETE](../grant/index) privilege for the [mysql.plugin](../mysqlplugin-table/index) table. **MariaDB starting with [10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/)**#### IF EXISTS If the `IF EXISTS` clause is used, MariaDB will return a note instead of an error if the plugin does not exist. See [SHOW WARNINGS](../show-warnings/index). Examples -------- ``` UNINSTALL PLUGIN example; ``` From [MariaDB 10.4.0](https://mariadb.com/kb/en/mariadb-1040-release-notes/): ``` UNINSTALL PLUGIN IF EXISTS example; Query OK, 0 rows affected (0.099 sec) UNINSTALL PLUGIN IF EXISTS example; Query OK, 0 rows affected, 1 warning (0.000 sec) SHOW WARNINGS; +-------+------+-------------------------------+ | Level | Code | Message | +-------+------+-------------------------------+ | Note | 1305 | PLUGIN example does not exist | +-------+------+-------------------------------+ ``` See Also -------- * [Plugin Overview](../plugin-overview/index) * [mysql\_plugin](../mysql_plugin/index) * [INSTALL PLUGIN](../install-plugin/index) * [List of Plugins](../list-of-plugins/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb UNHEX UNHEX ===== Syntax ------ ``` UNHEX(str) ``` Description ----------- Performs the inverse operation of [HEX](../hex/index)(str). That is, it interprets each pair of hexadecimal digits in the argument as a number and converts it to the character represented by the number. The resulting characters are returned as a binary string. If `str` is `NULL`, `UNHEX()` returns `NULL`. Examples -------- ``` SELECT HEX('MariaDB'); +----------------+ | HEX('MariaDB') | +----------------+ | 4D617269614442 | +----------------+ SELECT UNHEX('4D617269614442'); +-------------------------+ | UNHEX('4D617269614442') | +-------------------------+ | MariaDB | +-------------------------+ SELECT 0x4D617269614442; +------------------+ | 0x4D617269614442 | +------------------+ | MariaDB | +------------------+ SELECT UNHEX(HEX('string')); +----------------------+ | UNHEX(HEX('string')) | +----------------------+ | string | +----------------------+ SELECT HEX(UNHEX('1267')); +--------------------+ | HEX(UNHEX('1267')) | +--------------------+ | 1267 | +--------------------+ ``` See Also -------- * [Hexadecimal literals](../hexadecimal-literals/index) * [HEX()](../hex/index) * [CONV()](../conv/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb RQG Performance Comparisons RQG Performance Comparisons =========================== Performance testing ------------------- The `performance/perfrun.pl` executes each query against a set of tw servers and reports the outcome. ``` perl performance/perfrun.pl --input-directory=... --dsn1=... --dsn2=... --output-file=... --filter=... ``` * `--input-directory` contains the queries to be run, one query per file. Alternative sources for queries will be made available in the future; * `--dsn1` and `--dsn2` specify the locations of the two servers being compared in the Perl DBI URL format. If the queries are not fully qualified, the DSNs must contain the database name. The username and the password are also provided via the DSN. For example: ``` --dsn1=dbi:mysql:host=127.0.0.1:port=19300:user=root:database=test \ --dsn2=dbi:mysql:host=127.0.0.1:port=19302:user=root:database=test ``` * `--output-file=...` specifies a file where matching queries will be dumped in a form suitable for follow-up filtering with `perfreport` * if no `--filter` is specified, all queries from the input will be reported; Performance reporting --------------------- The `performance/perfreport.pl` script takes an ouput file created by `perfrun` and prints out its contents, possibly applying a filter in the process: ``` perl performance/perfreport.pl --input-file=... --filter=... ``` If no `--filter` is specified, all queries present in the input file are printed. Filters ------- The queries reported by the system can be filtered out using perl-based filtering expressions. A filter can be applied during data collection, at which point it determines what information is stored in the output file and at If you do not specify a filter, it is assumed that you want to output all queries. The following variables can participate in filter expressions: * Variables from `SHOW SESSION STATUS`, except: + variables that are not reset at the start of the query, which includes `Com_*`, `Uptime`, `Opened_files` and the like; + variables that relate to the operation of SSL encryption or the query cache; * Variables from `SHOW GLOBAL STATUS LIKE 'Innodb_%'` For each MySQL status variable, 4 Perl variables are provided — the value of the MySQL variable from each server, their absolute difference and their ratio. For example, for the `Innodb_rows_read` MySQL variable, you can use `Innodb_rows_read1`, `Innodb_rows_read2` , `Innodb_rows_read_delta` and `Innodb_rows_read_ratio` in your Perl filter expressions. In addition to the MySQL status variables, the framework provides the following additional variables: * `$Execution_time{1|2|delta|ratio}` reports the time the query took to run from start to end in seconds. The value is truncated at milliseconds in order to prevent exorbitant performance ratios from being reported on very fast queries; * `$Temperature` can either be `cold` or `warm` depending on whether the first execution of the query is being processed, or the second. * `$Query` contains the text of the query, in order to enable filtering such as `$Query !~ m{l_receiptDATE}` For example, the following command-line option: ``` --filter='($Execution_time1 > 0.1 || $Execution_time2 > 0.1) && $Temperature eq "warm"' ``` Will only process or report queries that took more than 0.1 sec to execute on a warm server. On-screen Reporting Format -------------------------- The ASCII on-screen reporting format is as follows: ``` Query: SELECT l_linenumber FROM lineitem WHERE l_suppkey IN ( 10 , 1 ) AND l_shipdate NOT IN ( '1993-06-06' , '1998-02-04' , '1992-01-08' ) AND l_linenumber NOT IN ( 8 , 7 ) AND l_quantity <> 3 AND ( l_orderkey NOT IN ( 1298 , 93 ) OR l_suppkey = 10 ) AND ( l_suppkey BETWEEN 4 AND 10 + 4 OR l_linenumber = 2 AND l_commitDATE BETWEEN '1993-06-27' AND '1993-09-05' AND l_linenumber BETWEEN 3 AND 9 + 9 ); Cache: warm 5.3.0-MariaDB- 5.2.6-MariaDB- Delta Ratio ------------------------------------------------------------------------------------------------------- Execution time 0.011s 0.004s -0.007s 0.36 Innodb_buffer_pool_read_requests 2171 1836 -335 0.85 Handler_read_rnd 583 0 -583 Handler_read_next 583 602 19 1.03 Innodb_rows_read 1166 602 -564 0.52 ``` Only variables whose values are different between the two servers are reported. In this particular example, the query ran slower on `5.3.0-MariaDB` with warm cache and caused twice as many `Innodb_rows_read`. On-disk Data Storage Format --------------------------- The on-disk storage format is `Data::Dumper` objects, wrapped in `<![CDATA[ ... ]]>` tags, without the file being a full-blown XML. The serialized representation is created by `GenTest::QueryPerformanceDelta::serialize()` and is read by using `eval()` in `performance/perfreport.pl` See also: --------- * [RQG Documentation](http://github.com/RQG/RQG-Documentation/wiki/Category:RandomQueryGenerator) * [RQG Extensions for MariaDB Features](../rqg-extensions-for-mariadb-features/index) * [Optimizer Quality](../optimizer-quality/index) * [QA Tools](../qa-tools/index) * [Worklog Quality Checklist Template](../worklog-quality-checklist-template/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb LOAD XML LOAD XML ======== Syntax ------ ``` LOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE [db_name.]tbl_name [CHARACTER SET charset_name] [ROWS IDENTIFIED BY '<tagname>'] [IGNORE number {LINES | ROWS}] [(column_or_user_var,...)] [SET col_name = expr,...] ``` Description ----------- The LOAD XML statement reads data from an XML file into a table. The `file_name` must be given as a literal string. The `tagname` in the optional ROWS IDENTIFIED BY clause must also be given as a literal string, and must be surrounded by angle brackets (< and >). LOAD XML acts as the complement of running the [mysql client](../mysql-command-line-client/index) in XML output mode (that is, starting the client with the --xml option). To write data from a table to an XML file, use a command such as the following one from the system shell: ``` shell> mysql --xml -e 'SELECT * FROM mytable' > file.xml ``` To read the file back into a table, use LOAD XML INFILE. By default, the <row> element is considered to be the equivalent of a database table row; this can be changed using the ROWS IDENTIFIED BY clause. This statement supports three different XML formats: * Column names as attributes and column values as attribute values: ``` <row column1="value1" column2="value2" .../> ``` * Column names as tags and column values as the content of these tags: ``` <row> <column1>value1</column1> <column2>value2</column2> </row> ``` * Column names are the name attributes of <field> tags, and values are the contents of these tags: ``` <row> <field name='column1'>value1</field> <field name='column2'>value2</field> </row> ``` This is the format used by other tools, such as [mysqldump](../mysqldump/index). All 3 formats can be used in the same XML file; the import routine automatically detects the format for each row and interprets it correctly. Tags are matched based on the tag or attribute name and the column name. The following clauses work essentially the same way for LOAD XML as they do for LOAD DATA: * LOW\_PRIORITY or CONCURRENT * LOCAL * REPLACE or IGNORE * CHARACTER SET * (column\_or\_user\_var,...) * SET See [LOAD DATA](../load-data-infile/index) for more information about these clauses. The IGNORE number LINES or IGNORE number ROWS clause causes the first number rows in the XML file to be skipped. It is analogous to the LOAD DATA statement's IGNORE ... LINES clause. If the `[LOW\_PRIORITY](../high_priority-and-low_priority-clauses/index)` keyword is used, insertions are delayed until no other clients are reading from the table. The `CONCURRENT` keyword allowes the use of [concurrent inserts](../concurrent-inserts/index). These clauses cannot be specified together. This statement activates INSERT [triggers](../triggers/index). See also -------- * The [CONNECT](../connect/index) storage engine has an [XML table type](../connect-table-types-data-files/index#xml-table-type). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Configuring MariaDB with Option Files Configuring MariaDB with Option Files ===================================== You can configure MariaDB to run the way you want by configuring the server with MariaDB's option files. The default MariaDB option file is called `my.cnf` on Unix-like operating systems and `my.ini` on Windows. Depending on how you've [installed](../getting-installing-and-upgrading-mariadb/index) MariaDB, the default option file may be in a number of places, or it may not exist at all. Global Options Related to Option Files -------------------------------------- The following options relate to how MariaDB handles option files. These options can be used with most of MariaDB's command-line tools, not just [mysqld](../mysqld-options/index). They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `[--print-defaults](../mysqld-options/index#-print-defaults)` | Read options from option files, print all option values, and then exit the program. | | `[--no-defaults](../mysqld-options/index#-no-defaults)` | Don't read options from any option file. | | `[--defaults-file](../mysqld-options/index#-defaults-file)` `=path` | Only read options from the given option file. | | `[--defaults-extra-file](../mysqld-options/index#-defaults-extra-file)` `=path` | Read this extra option file after all other option files are read. | | `[--defaults-group-suffix](../mysqld-options/index#-defaults-group-suffix)` `=suffix` | In addition to the default option groups, also read option groups with the given suffix. | Default Option File Locations ----------------------------- MariaDB reads option files from many different directories by default. See the sections below to find out which directories are checked for which system. For an exact list of option files read on your system by a specific program, you can execute: ``` $program --help --verbose ``` For example: ``` $ mysqld --help --verbose mysqld Ver 10.3.13-MariaDB-log for Linux on x86_64 (MariaDB Server) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Starts the MariaDB database server. Usage: mysqld [OPTIONS] Default options are read from the following files in the given order: /etc/my.cnf ~/.my.cnf The following groups are read: mysqld server mysqld-10.3 mariadb mariadb-10.3 client-server galera .... ``` The option files are each scanned once, in the order given by `--help --verbose`. The effect of the configuration options are as if they would have been given as command line options in the order they are found. ### Default Option File Locations on Linux, Unix, Mac On Linux, Unix, or Mac OS X, the default option file is called `my.cnf`. MariaDB looks for the MariaDB option file in the locations and orders listed below. The locations are dependent on whether the `DEFAULT_SYSCONFDIR` `[cmake](../generic-build-instructions/index#using-cmake)` option was defined when MariaDB was built. This option is usually defined as `/etc` when building [RPM packages](../rpm/index), but it is usually not defined when building [DEB packages](../installing-mariadb-deb-files/index) or [binary tarballs](../installing-mariadb-binary-tarballs/index). * When the `DEFAULT_SYSCONFDIR` `[cmake](../generic-build-instructions/index#using-cmake)` option was **not** defined, MariaDB looks for the MariaDB option file in the following locations in the following order: | Location | Scope | | --- | --- | | `/etc/my.cnf` | Global | | `/etc/mysql/my.cnf` | Global | | `$MARIADB_HOME/my.cnf` | Server | | `$MYSQL_HOME/my.cnf` | Server | | defaults-extra-file | File specified with `[--defaults-extra-file](../mysqld-options/index#-defaults-extra-file)`, if any | | `~/.my.cnf` | User | * When the `DEFAULT_SYSCONFDIR` `[cmake](../generic-build-instructions/index#using-cmake)` option was defined, MariaDB looks for the MariaDB option file in the following locations in the following order: | Location | Scope | | --- | --- | | `DEFAULT_SYSCONFDIR/my.cnf` | Global | | `$MARIADB_HOME/my.cnf` | Server (from [MariaDB 10.6](../what-is-mariadb-106/index)) | | `$MYSQL_HOME/my.cnf` | Server | | defaults-extra-file | File specified with `[--defaults-extra-file](../mysqld-options/index#-defaults-extra-file)`, if any | | `~/.my.cnf` | User | * `MARIADB_HOME` (from [MariaDB 10.6](../what-is-mariadb-106/index)) or `MYSQL_HOME` is the [environment variable](../mariadb-environment-variables/index) containing the path to the directory holding the server-specific `my.cnf` file. If `MYSQL_HOME` is not set, and the server is started with [mysqld\_safe](../mysqld_safe/index), `MYSQL_HOME` is set as follows: + If there is a `my.cnf` file in the MariaDB data directory, but not in the MariaDB base directory, `MYSQL_HOME` is set to the MariaDB data directory. + Else, `MYSQL_HOME` is set to the MariaDB base directory. * Note that if `MARIADB_HOME` is set (from [MariaDB 10.6](../what-is-mariadb-106/index)), `MYSQL_HOME` will not be used, even if set. ### Default Option File Locations on Windows On Windows, the option file can be called either `my.ini` or `my.cnf`. MariaDB looks for the MariaDB option file in the following locations in the following order: | Location | Scope | | --- | --- | | `System Windows Directory\my.ini` | Global | | `System Windows Directory\my.cnf` | Global | | `Windows Directory\my.ini` | Global | | `Windows Directory\my.cnf` | Global | | `C:\my.ini` | Global | | `C:\my.cnf` | Global | | `INSTALLDIR\my.ini` | Server | | `INSTALLDIR\my.cnf` | Server | | `INSTALLDIR\data\my.ini` | Server | | `INSTALLDIR\data\my.cnf` | Server | | `%MARIADB_HOME%\my.ini` | Server (from [MariaDB 10.6](../what-is-mariadb-106/index)) | | `%MARIADB_HOME%\my.cnf` | Server (from [MariaDB 10.6](../what-is-mariadb-106/index)) | | `%MYSQL_HOME%\my.ini` | Server | | `%MYSQL_HOME%\my.cnf` | Server | | defaults-extra-file | File specified with `[--defaults-extra-file](../mysqld-options/index#-defaults-extra-file)`, if any | * The `System Windows Directory` is the directory returned by the `[GetSystemWindowsDirectory](https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemwindowsdirectorya)` function. The value is usually `C:\Windows`. To find its specific value on your system, open `[cmd.exe](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd)` and execute: ``` echo %WINDIR% ``` * The `Windows Directory` is the directory returned by the `[GetWindowsDirectory](https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getwindowsdirectorya)` function. The value may be a private `Windows Directory` for the application, or it may be the same as the `System Windows Directory` returned by the `[GetSystemWindowsDirectory](https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemwindowsdirectorya)` function. * `INSTALLDIR` is the parent directory of the directory where `mysqld.exe` is located. For example, if `mysqld.exe` is in `C:\Program Files\[MariaDB 10.3](../what-is-mariadb-103/index)\bin`, then `INSTALLDIR` would be `C:\Program Files\[MariaDB 10.3](../what-is-mariadb-103/index)`. * `MARIADB_HOME` (from [MariaDB 10.6](../what-is-mariadb-106/index)) or `MYSQL_HOME` is the [environment variable](../mariadb-environment-variables/index) containing the path to the directory holding the server-specific `my.cnf` file. * Note that if `MARIADB_HOME` is set (from [MariaDB 10.6](../what-is-mariadb-106/index)), `MYSQL_HOME` will not be used, even if set. ### Default Option File Hierarchy MariaDB will look in all of the above locations, in order, even if has already found an option file, and it's possible for more than one option file to exist. For example, you could have an option file in `/etc/my.cnf` with global settings for all servers, and then you could another option file in `~/.my.cnf` (i.e.your user account's home directory) which will specify additional settings (or override previously specified setting) that are specific only to that user. Option files are usually optional. However, if the `[--defaults-file](../mysqld-options/index#-defaults-file)` option is set, and if the file does not exist, then MariaDB will raise an error. If the `[--defaults-file](../mysqld-options/index#-defaults-file)` option is set, then MariaDB will *only* read the option file referred to by this option. If an option or system variable is not explicitly set, then it will be set to its default value. See [Server System Variables](../server-system-variables/index) for a full list of all server system variables and their default values. Custom Option File Locations ---------------------------- MariaDB can be configured to read options from custom options files with the following command-line arguments. These command-line arguments can be used with most of MariaDB's command-line tools, not just `[mysqld](../mysqld-options/index)`. They must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `[--defaults-file](../mysqld-options/index#-defaults-file)` `=path` | Only read options from the given option file. | | `[--defaults-extra-file](../mysqld-options/index#-defaults-extra-file)` `=path` | Read this extra option file after all other option files are read. | Option File Syntax ------------------ The syntax of the MariaDB option files are: * Lines starting with # are comments. * Empty lines are ignored. * Option groups use the syntax `[group-name]`. See the [Option Groups](#option-groups) section below for more information on available option groups. * The same option group can appear multiple times. * The `!include` directive can be used to include other option files. See the [Including Option Files](#including-option-files) section below for more information on this syntax. * The `!includedir` directive can be used to include all `.cnf` files (and potentially `.ini` files) in a given directory. The option files within the directory are read in alphabetical order. See the [Including Option File Directories](#including-option-file-directories) section below for more information on this syntax. * Dashes (`-`) and underscores (`_`) in options are interchangeable. * Double quotes can be used to quote values * `\n`, `\r`, `\t`, `\b`, `\s`, `\"`, `\'`, and `\\` are recognized as character escapes for new line, carriage return, tab, backspace, space, double quote, single quote, and backslash respectively. * Certain option prefixes are supported. See the [Option Prefixes](#option-prefixes) section below for information about available option prefixes. * See the [Options](#options) section below for information about available options. Option Groups ------------- A MariaDB program can read options from one or many option groups. For an exact list of option groups read on your system by a specific program, you can execute: ``` $program --help --verbose ``` For example: ``` $ mysqld --help --verbose mysqld Ver 10.3.13-MariaDB-log for Linux on x86_64 (MariaDB Server) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Starts the MariaDB database server. Usage: mysqld [OPTIONS] Default options are read from the following files in the given order: /etc/my.cnf ~/.my.cnf The following groups are read: mysqld server mysqld-10.3 mariadb mariadb-10.3 client-server galera .... ``` ### Server Option Groups MariaDB programs reads server options from the following server option groups: | Group | Description | | --- | --- | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[server]` | Options read by MariaDB Server. | | `[mysqld]` | Options read by `mysqld`, which includes both MariaDB Server and MySQL Server. | | `[mysqld-X.Y]` | Options read by a specific version of `mysqld`, which includes both MariaDB Server and MySQL Server. For example, `[mysqld-10.4]`. | | `[mariadb]` | Options read by MariaDB Server. | | `[mariadb-X.Y]` | Options read by a specific version of MariaDB Server. For example, `[mariadb-10.4]`. | | `[mariadbd]` | Options read by MariaDB Server. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mariadbd-X.Y]` | Options read by a specific version of MariaDB Server. For example, `[mariadbd-10.4]`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[galera]` | Options read by MariaDB Server, but only if it is compiled with [Galera Cluster](../galera/index) support. In [MariaDB 10.1](../what-is-mariadb-101/index) and later, all builds on Linux are compiled with [Galera Cluster](../galera/index) support. When using one of these builds, options from this option group are read even if the [Galera Cluster](../galera/index) functionality is not enabled. | *X.Y* in the examples above refer to the base (major.minor) version of the server. For example, [MariaDB 10.3.10](https://mariadb.com/kb/en/mariadb-10310-release-notes/) would read from `[mariadb-10.3]`. By using the `mariadb-X.Y` syntax, one can create option files that have MariaDB-only options in the MariaDB-specific option groups. That would allow the option file to work for both MariaDB and MySQL. ### Client Option Groups MariaDB programs reads client options from the following option groups: | Group | Description | | --- | --- | | `[client]` | Options read by all MariaDB and MySQL [client programs](../clients-utilities/index), which includes both MariaDB and MySQL clients. For example, `mysqldump`. | | `[client-server]` | Options read by all MariaDB [client programs](../clients-utilities/index) and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients. | | `[client-mariadb]` | Options read by all MariaDB [client programs](../clients-utilities/index). | ### Tool-Specific Option Groups Many MariaDB tools reads options from their own option groups as well. Many of them are listed below: | Group | Description | | --- | --- | | `[mysqld_safe]` | Options read by `[mysqld\_safe](../mysqld_safe/index)`, which includes both MariaDB Server and MySQL Server. | | `[safe_mysqld]` | Options read by `[mysqld\_safe](../mysqld_safe/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb_safe]` | Options read by `[mysqld\_safe](../mysqld_safe/index)` from MariaDB Server. | | `[mariadb-safe]` | Options read by `[mysqld\_safe](../mysqld_safe/index)` from MariaDB Server. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mariabackup]` | Options read by [Mariabackup](../mariabackup/index). Available starting with [MariaDB 10.1.31](https://mariadb.com/kb/en/mariadb-10131-release-notes/) and [MariaDB 10.2.13](https://mariadb.com/kb/en/mariadb-10213-release-notes/). | | `[xtrabackup]` | Options read by [Mariabackup](../mariabackup/index) and [Percona XtraBackup](../percona-xtrabackup-overview/index). | | `[mysql_upgrade]` | Options read by `[mysql\_upgrade](../mysql_upgrade/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-upgrade]` | Options read by `[mysql\_upgrade](../mysql_upgrade/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[sst]` | Specific options read by the [mariabackup SST method](../mariabackup-sst-method/index) and the [xtrabackup-v2 SST method](../xtrabackup-v2-sst-method/index). | | `[mysql]` | Options read by `[mysql](../mysql-client/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-client]` | Options read by `[mysql](../mysql-client/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqldump]` | Options read by `[mysqldump](../mysqldump/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-dump]` | Options read by `[mysqldump](../mysqldump/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqlimport]` | Options read by `[mysqlimport](../mysqlimport/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-import]` | Options read by `[mysqlimport](../mysqlimport/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqlbinlog]` | Options read by `[mysqlbinlog](../mysqlbinlog/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-binlog]` | Options read by `[mysqlbinlog](../mysqlbinlog/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqladmin]` | Options read by `[mysqladmin](../mysqladmin/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-admin]` | Options read by `[mysqladmin](../mysqladmin/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqlshow]` | Options read by `[mysqlshow](../mysqlshow/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-show]` | Options read by `[mysqlshow](../mysqlshow/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqlcheck]` | Options read by `[mysqlcheck](../mysqlcheck/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-check]` | Options read by `[mysqlcheck](../mysqlcheck/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[mysqlslap]` | Options read by `[mysqlslap](../mysqlslap/index)`, which includes both MariaDB Server and MySQL Server. | | `[mariadb-slap]` | Options read by `[mysqlslap](../mysqlslap/index)`. Available starting with [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). | | `[odbc]` | Options read by [MariaDB Connector/ODBC](../mariadb-connector-odbc/index), but only if the `[USE\_MYCNF](../about-mariadb-connector-odbc/index#general-connection-parameters)` parameter has been set. | ### Custom Option Group Suffixes MariaDB can be configured to read options from option groups with a custom suffix by providing the following command-line argument. This command-line argument can be used with most of MariaDB's command-line tools, not just `[mysqld](../mysqld-options/index)`. It must be given as the first argument on the command-line: | Option | Description | | --- | --- | | `[--defaults-group-suffix](../mysqld-options/index#-defaults-group-suffix)` `=suffix` | In addition to the default option groups, also read option groups with the given suffix. | The default group suffix can also be specified via the `MYSQL_GROUP_SUFFIX` [environment variable](../mariadb-environment-variables/index). Including Option Files ---------------------- It is possible to include additional option files from another option file. For example, to include `/etc/mysql/dbserver1.cnf`, an option file could contain: ``` [mariadb] ... !include /etc/mysql/dbserver1.cnf ``` Including Option File Directories --------------------------------- It is also possible to include all option files in a directory from another option file. For example, to include all option files in `/etc/my.cnf.d/`, an option file could contain: ``` [mariadb] ... !includedir /etc/my.cnf.d/ ``` The option files within the directory are read in alphabetical order. All option file names must end in `.cnf` on Unix-like operating systems. On Windows, all option file names must end in `.cnf` or `.ini`. Checking Program Options ------------------------ You can check which options a given program is going to use by using the `[--print-defaults](../mysqld-options/index#-print-defaults)` command-line argument: | Option | Description | | --- | --- | | `[--print-defaults](../mysqld-options/index#-print-defaults)` | Read options from option files, print all option values, and then exit the program. | This command-line argument can be used with most of MariaDB's command-line tools, not just `[mysqld](../mysqld-options/index)`. It must be given as the first argument on the command-line. For example: ``` $ mysqldump --print-defaults mysqldump would have been started with the following arguments: --ssl_cert=/etc/my.cnf.d/certificates/client-cert.pem --ssl_key=/etc/my.cnf.d/certificates/client-key.pem --ssl_ca=/etc/my.cnf.d/certificates/ca.pem --ssl-verify-server-cert --max_allowed_packet=1GB ``` You can also check which options a given program is going to use by using the `[my\_print\_defaults](../my_print_defaults/index)` utility and providing the names of the option groups that the program reads. For example: ``` $ my_print_defaults mysqldump client client-server client-mariadb --ssl_cert=/etc/my.cnf.d/certificates/client-cert.pem --ssl_key=/etc/my.cnf.d/certificates/client-key.pem --ssl_ca=/etc/my.cnf.d/certificates/ca.pem --ssl-verify-server-cert --max_allowed_packet=1GB ``` The `[my\_print\_defaults](../my_print_defaults/index)` utility's `--mysqld` command-line option provides a shortcut to refer to all of the [server option groups](#server-option-groups): ``` $ my_print_defaults --mysqld --log_bin=mariadb-bin --log_slave_updates=ON --ssl_cert=/etc/my.cnf.d/certificates/server-cert.pem --ssl_key=/etc/my.cnf.d/certificates/server-key.pem --ssl_ca=/etc/my.cnf.d/certificates/ca.pem ``` MySQL 5.6 Obfuscated Authentication Credential Option File ---------------------------------------------------------- MySQL 5.6 and above support an obfuscated authentication credential option file called `.mylogin.cnf` that is created with `[mysql\_config\_editor](https://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html)`. MariaDB does not support this. The passwords in MySQL's `.mylogin.cnf` are only obfuscated, rather than encrypted, so the feature does not really add much from a security perspective. It is more likely to give users a false sense of security, rather than to seriously protect them. Option Prefixes --------------- MariaDB supports certain prefixes that can be used with options. The supported option prefixes are: | Option Prefix | Description | | --- | --- | | `[autoset](../mysqld-options/index#-autoset-)` | Sets the option value automatically. Only supported for certain options. Available in [MariaDB 10.1.7](https://mariadb.com/kb/en/mariadb-1017-release-notes/) and later. | | `[disable](../mysqld-options/index#-disable-)` | For all boolean options, disables the setting (equivalent to setting it to `0`). Same as `skip`. | | `[enable](../mysqld-options/index#-enable-)` | For all boolean options, enables the setting (equivalent to setting it to `1`). | | `[loose](../mysqld-options/index#-loose-)` | Don't produce an error if the option doesn't exist. | | `[maximum](../mysqld-options/index#-maximum-)` | Sets the maximum value for the option. | | `[skip](../mysqld-options/index#-skip-)` | For all boolean options, disables the setting (equivalent to setting it to `0`). Same as `disable`. | For example: ``` [mariadb] ... # determine a good value for open_files_limit automatically autoset_open_files_limit # disable the unix socket plugin disable_unix_socket # enable the slow query log enable_slow_query_log # don't produce an error if these options don't exist loose_file_key_management_filename = /etc/mysql/encryption/keyfile.enc loose_file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key loose_file_key_management_encryption_algorithm = AES_CTR # set max_allowed_packet to maximum value maximum_max_allowed_packet # disable external locking for MyISAM skip_external_locking ``` Options ------- Dashes (`-`) and underscores (`_`) in options are interchangeable. If an option is not explicitly set, then the server or client will simply use the default value for that option. ### MariaDB Server Options MariaDB Server options can be set in [server option groups](#server-option-groups). For a list of options that can be set for MariaDB Server, see the list of options available for `[mysqld](../mysqld-options/index)`. Most of the [server system variables](../server-system-variables/index) can also be set in MariaDB's option file. ### MariaDB Client Options MariaDB client options can be set in [client option groups](#client-option-groups). See the specific page for each [client program](../clients-utilities/index) to determine what options are available for that program. Example Option Files -------------------- Most MariaDB installations include a sample MariaDB option file called `my-default.cnf`. On older releases, you would have also found the following option files: * `my-small.cnf` * `my-medium.cnf` * `my-large.cnf` * `my-huge.cnf` However, these option files are now very dated for modern servers, so they were removed in [MariaDB 10.3.1](https://mariadb.com/kb/en/mariadb-1031-release-notes/). In source distributions, the sample option files are usually found in the `support-files` directory, and in other distributions, the option files are usually found in the `share/mysql` directory that is relative to the MariaDB base installation directory. You can copy one of these sample MariaDB option files and use it as the basis for building your server's primary MariaDB option file. ### Example Minimal Option File The following is a minimal my.cnf file that you can use to test MariaDB. ``` [client-server] # Uncomment these if you want to use a nonstandard connection to MariaDB #socket=/tmp/mysql.sock #port=3306 # This will be passed to all MariaDB clients [client] #password=my_password # The MariaDB server [mysqld] # Directory where you want to put your data data=/usr/local/mysql/var # Directory for the errmsg.sys file in the language you want to use language=/usr/local/share/mysql/english # This is the prefix name to be used for all log, error and replication files log-basename=mysqld # Enable logging by default to help find problems general-log log-slow-queries ``` ### Example Hybrid Option File The following is an extract of an option file that one can use if one wants to work with both MySQL and MariaDB. ``` # Example mysql config file. [client-server] socket=/tmp/mysql-dbug.sock port=3307 # This will be passed to all mysql clients [client] password=my_password # Here are entries for some specific programs # The following values assume you have at least 32M ram # The MySQL server [mysqld] temp-pool key_buffer_size=16M datadir=/my/mysqldata loose-innodb_file_per_table [mariadb] datadir=/my/data default-storage-engine=aria loose-mutex-deadlock-detector max-connections=20 [mariadb-5.5] language=/my/maria-5.5/sql/share/english/ socket=/tmp/mysql-dbug.sock port=3307 [mariadb-10.1] language=/my/maria-10.1/sql/share/english/ socket=/tmp/mysql2-dbug.sock [mysqldump] quick max_allowed_packet=16M [mysql] no-auto-rehash loose-abort-source-on-error ``` See Also -------- * [Configuring MariaDB Connector/C with Option Files](../configuring-mariadb-connectorc-with-option-files/index) * [Troubleshooting Connection Issues](../troubleshooting-connection-issues/index) * [Configuring MariaDB for Remote Client Access](../configuring-mariadb-for-remote-client-access/index) * [MySQL 5.6: Security through Complacency?](https://mariadb.com/resources/blog/mysql-5-6-security-through-complacency) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Subquery Cache Subquery Cache ============== The goal of the subquery cache is to optimize the evaluation of correlated subqueries by storing results together with correlation parameters in a cache and avoiding re-execution of the subquery in cases where the result is already in the cache. Administration -------------- The cache is on by default. One can switch it off using the [optimizer\_switch](../server-system-variables/index#optimizer_switch) `subquery_cache` setting, like so: ``` SET optimizer_switch='subquery_cache=off'; ``` The efficiency of the subquery cache is visible in 2 statistical variables: * [Subquery\_cache\_hit](../server-status-variables/index#subquery_cache_hit) - Global counter for all subquery cache hits. * [Subquery\_cache\_miss](../server-status-variables/index#subquery_cache_miss) - Global counter for all subquery cache misses. The session variables [tmp\_table\_size](../server-system-variables/index#tmp_table_size) and [max\_heap\_table\_size](../server-system-variables/index#max_heap_table_size) influence the size of in-memory temporary tables in the table used for caching. It cannot grow more than the minimum of the above variables values (see the [Implementation](#implementation) section for details). Visibility ---------- Your usage of the cache is visible in `EXTENDED EXPLAIN` output (warnings) as `"<expr_cache><//list of parameters//>(//cached expression//)"`. For example: ``` EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT b FROM t2); +----+--------------------+-------+------+---------------+------+---------+------+------+----------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+--------------------+-------+------+---------------+------+---------+------+------+----------+-------------+ | 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | 100.00 | Using where | | 2 | DEPENDENT SUBQUERY | t2 | ALL | NULL | NULL | NULL | NULL | 2 | 100.00 | Using where | +----+--------------------+-------+------+---------------+------+---------+------+------+----------+-------------+ 2 rows in set, 1 warning (0.00 sec) SHOW WARNINGS; +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Note | 1003 | SELECT `test`.`t1`.`a` AS `a` from `test`.`t1` WHERE <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(SELECT 1 FROM `test`.`t2` WHERE (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`b`)))) | +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) ``` In the example above the presence of `"<expr_cache><`test`.`t1`.`a`>(...)"` is how you know you are using the subquery cache. Implementation -------------- Every subquery cache creates a temporary table where the results and all parameters are stored. It has a unique index over all parameters. First the cache is created in a [MEMORY](../memory-storage-engine/index) table (if doing this is impossible the cache becomes disabled for that expression). When the table grows up to the minimum of `tmp_table_size` and `max_heap_table_size`, the hit rate will be checked: * if the hit rate is really small (<0.2) the cache will be disabled. * if the hit rate is moderate (<0.7) the table will be cleaned (all records deleted) to keep the table in memory * if the hit rate is high the table will be converted to a disk table (for 5.3.0 it can only be converted to a disk table). ``` hit rate = hit / (hit + miss) ``` Performance Impact ------------------ Here are some examples that show the performance impact of the subquery cache (these tests were made on a 2.53 GHz Intel Core 2 Duo MacBook Pro with dbt-3 scale 1 data set). | example | cache on | cache off | gain | hit | miss | hit rate | | --- | --- | --- | --- | --- | --- | --- | | 1 | 1.01sec | 1 hour 31 min 43.33sec | 5445x | 149975 | 25 | 99.98% | | 2 | 0.21sec | 1.41sec | 6.71x | 6285 | 220 | 96.6% | | 3 | 2.54sec | 2.55sec | 1.00044x | 151 | 461 | 24.67% | | 4 | 1.87sec | 1.95sec | 0.96x | 0 | 23026 | 0% | ### Example 1 Dataset from DBT-3 benchmark, a query to find customers with balance near top in their nation: ``` select count(*) from customer where c_acctbal > 0.8 * (select max(c_acctbal) from customer C where C.c_nationkey=customer.c_nationkey group by c_nationkey); ``` ### Example 2 DBT-3 benchmark, Query #17 ``` select sum(l_extendedprice) / 7.0 as avg_yearly from lineitem, part where p_partkey = l_partkey and p_brand = 'Brand#42' and p_container = 'JUMBO BAG' and l_quantity < (select 0.2 * avg(l_quantity) from lineitem where l_partkey = p_partkey); ``` ### Example 3 DBT-3 benchmark, Query #2 ``` select s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from part, supplier, partsupp, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and p_size = 33 and p_type like '%STEEL' and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'MIDDLE EAST' and ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'MIDDLE EAST' ) order by s_acctbal desc, n_name, s_name, p_partkey; ``` ### Example 4 DBT-3 benchmark, Query #20 ``` select s_name, s_address from supplier, nation where s_suppkey in ( select distinct (ps_suppkey) from partsupp, part where ps_partkey=p_partkey and p_name like 'indian%' and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= '1995-01-01' and l_shipdate < date_ADD('1995-01-01',interval 1 year) ) ) and s_nationkey = n_nationkey and n_name = 'JAPAN' order by s_name; ``` See Also -------- * [Query cache](../query-cache/index) * <http://mysqlmaniac.com/2012/what-about-the-subqueries/> blog post describing impact of subquery cache optimization on queries used by DynamicPageList MediaWiki extension * <http://varokism.blogspot.ru/2013/06/mariadb-subquery-cache-in-real-use-case.html> Another use case from the real world * [What is MariaDB 5.3](../what-is-mariadb-53/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LEAVE LEAVE ===== Syntax ------ ``` LEAVE label ``` This statement is used to exit the flow control construct that has the given [label](../labels/index). The label must be in the same stored program, not in a caller procedure. `LEAVE` can be used within [BEGIN ... END](../begin-end/index) or loop constructs ([LOOP](../loop/index), [REPEAT](../repeat-loop/index), [WHILE](../while/index)). In [Stored Procedures](../stored-procedures/index), [Triggers](../triggers/index) and [Events](../events/index), LEAVE can refer to the outmost BEGIN ... END construct; in that case, the program exits the procedure. In [Stored Functions](../stored-functions/index), [RETURN](../return/index) can be used instead. Note that LEAVE cannot be used to exit a [DECLARE HANDLER](../declare-handler/index) block. If you try to LEAVE a non-existing label, or if you try to LEAVE a HANDLER block, the following error will be produced: ``` ERROR 1308 (42000): LEAVE with no matching label: <label_name> ``` The following example uses `LEAVE` to exit the procedure if a condition is true: ``` CREATE PROCEDURE proc(IN p TINYINT) CONTAINS SQL `whole_proc`: BEGIN SELECT 1; IF p < 1 THEN LEAVE `whole_proc`; END IF; SELECT 2; END; CALL proc(0); +---+ | 1 | +---+ | 1 | +---+ ``` See Also -------- * [ITERATE](../iterate/index) - Repeats a loop execution Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb DROP LOGFILE GROUP DROP LOGFILE GROUP ================== The `DROP LOGFILE GROUP` statement is not supported by MariaDB. It was originally inherited from MySQL NDB Cluster. See [MDEV-19295](https://jira.mariadb.org/browse/MDEV-19295) for more information. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb WSREP_INFO Plugin WSREP\_INFO Plugin ================== The `WSREP_INFO` plugin library contains the following plugins: * `WSREP_MEMBERSHIP` * `WSREP_STATUS` The `WSREP_MEMBERSHIP` plugin creates the [WSREP\_MEMBERSHIP](../information-schema-wsrep_membership-table/index) table in the [INFORMATION\_SCHEMA](../information-schema/index) database. The plugin also adds the [SHOW WSREP\_MEMBERSHIP](../show-wsrep_membership/index) statement. The `WSREP_STATUS` plugin creates the [WSREP\_STATUS](../information-schema-wsrep_status-table/index) table in the [INFORMATION\_SCHEMA](../information-schema/index) database. The plugin also adds the [SHOW WSREP\_STATUS](../show-wsrep_status/index) statement. These tables and statements provide information about [Galera](../galera/index). Only users with the [SUPER](../grant/index#global-privileges) privilege can access this information. Installing the Plugin --------------------- Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB. The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing [INSTALL SONAME](../install-soname/index) or [INSTALL PLUGIN](../install-plugin/index). For example: ``` INSTALL SONAME 'wsrep_info'; ``` The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the [--plugin-load](../mysqld-options/index#-plugin-load) or the [--plugin-load-add](../mysqld-options/index#-plugin-load-add) options. This can be specified as a command-line argument to [mysqld](../mysqld-options/index) or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = wsrep_info ``` Uninstalling the Plugin ----------------------- You can uninstall the plugin dynamically by executing [UNINSTALL SONAME](../uninstall-soname/index) or [UNINSTALL PLUGIN](../uninstall-plugin/index). For example: ``` UNINSTALL SONAME 'wsrep_info'; ``` If you installed the plugin by providing the [--plugin-load](../mysqld-options/index#-plugin-load) or the [--plugin-load-add](../mysqld-options/index#-plugin-load-add) options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Example ------- ``` SHOW TABLES FROM information_schema LIKE 'WSREP%'; +---------------------------------------+ | Tables_in_information_schema (WSREP%) | +---------------------------------------+ | WSREP_STATUS | | WSREP_MEMBERSHIP | +---------------------------------------+ ``` Versions -------- | Version | Status | Introduced | | --- | --- | --- | | 1.0 | Stable | [MariaDB 10.1.18](https://mariadb.com/kb/en/mariadb-10118-release-notes/) | | 1.0 | Gamma | [MariaDB 10.1.13](https://mariadb.com/kb/en/mariadb-10113-release-notes/) | | 1.0 | Alpha | [MariaDB 10.1.2](https://mariadb.com/kb/en/mariadb-1012-release-notes/) | Options ------- ### `wsrep_membership` * **Description:** Controls how the server should treat the plugin when the server starts up. + Valid values are: - `OFF` - Disables the plugin without removing it from the [mysql.plugins](../mysqlplugin-table/index) table. - `ON` - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. - `FORCE` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. - `FORCE_PLUS_PERMANENT` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with [UNINSTALL SONAME](../uninstall-soname/index) or [UNINSTALL PLUGIN](../uninstall-plugin/index) while the server is running. + See [Plugin Overview: Configuring Plugin Activation at Server Startup](../plugin-overview/index#configuring-plugin-activation-at-server-startup) for more information. * **Commandline:** `--wsrep-membership=value` * **Data Type:** `enumerated` * **Default Value:** `ON` * **Valid Values:** `OFF`, `ON`, `FORCE`, `FORCE_PLUS_PERMANENT` --- ### `wsrep_status` * **Description:** Controls how the server should treat the plugin when the server starts up. + Valid values are: - `OFF` - Disables the plugin without removing it from the [mysql.plugins](../mysqlplugin-table/index) table. - `ON` - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. - `FORCE` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. - `FORCE_PLUS_PERMANENT` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with [UNINSTALL SONAME](../uninstall-soname/index) or [UNINSTALL PLUGIN](../uninstall-plugin/index) while the server is running. + See [Plugin Overview: Configuring Plugin Activation at Server Startup](../plugin-overview/index#configuring-plugin-activation-at-server-startup) for more information. * **Commandline:** `--wsrep-status=value` * **Data Type:** `enumerated` * **Default Value:** `ON` * **Valid Values:** `OFF`, `ON`, `FORCE`, `FORCE_PLUS_PERMANENT` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Secure Connections Overview Secure Connections Overview =========================== By default, MariaDB transmits data between the server and clients without encrypting it. This is generally acceptable when the server and client run on the same host or in networks where security is guaranteed through other means. However, in cases where the server and client exist on separate networks or they are in a high-risk network, the lack of encryption does introduce security concerns as a malicious actor could potentially eavesdrop on the traffic as it is sent over the network between them. To mitigate this concern, MariaDB allows you to encrypt data in transit between the server and clients using the Transport Layer Security (TLS) protocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly speaking the SSL protocol is a predecessor to TLS and, that version of the protocol is now considered insecure. The documentation still uses the term SSL often and for compatibility reasons TLS-related server system and status variables still use the prefix `ssl_`, but internally, MariaDB only supports its secure successors. Checking MariaDB Server for TLS Support --------------------------------------- In order for MariaDB Server to use TLS, it needs to be compiled with TLS support. All MariaDB packages distributed by MariaDB Foundation and MariaDB Corporation are compiled with TLS support. If you aren't sure whether your MariaDB Server binary was compiled with TLS support, then you can check the value of the `[have\_ssl](../ssl-system-variables/index#have_ssl)` system variable. For example: ``` SHOW GLOBAL VARIABLES LIKE 'have_ssl'; +---------------+----------+ | Variable_name | Value | +---------------+----------+ | have_ssl | DISABLED | +---------------+----------+ ``` The possible values are: * If it is `DISABLED`, then the server was compiled with TLS support, but TLS is not enabled. * If it is `YES`, then the server was compiled with TLS support, and TLS is enabled. * If it is `NO`, then the server was not compiled with TLS support. TLS Libraries ------------- When MariaDB is compiled with TLS and cryptography support, it is usually either statically linked with MariaDB's bundled TLS and cryptography library, which might be [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), or dynamically linked with the system's TLS and cryptography library, which might be [OpenSSL](https://www.openssl.org/), [GnuTLS](https://www.gnutls.org/), or [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel). See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. TLS Protocol Versions --------------------- There are 4 versions of the TLS protocol: * `TLSv1.0` * `TLSv1.1` * `TLSv1.2` * `TLSv1.3` ### Enabling Specific TLS Protocol Versions **MariaDB starting with [10.4](../what-is-mariadb-104/index)**The `[tls\_version](../ssltls-system-variables/index#tls_version)` system variable was first introduced in [MariaDB 10.4.6](https://mariadb.com/kb/en/mariadb-1046-release-notes/). In some cases, it might make sense to only enable specific TLS protocol versions. For example, it would make sense if your organization has to comply with a specific security standard. It would also make sense if a vulnerability is found in a specific TLS protocol version, and you would like to ensure that your server does not use the vulnerable protocol version. The [PCI DSS v3.2](https://blog.pcisecuritystandards.org/resource-guide-migrating-from-ssl-and-early-tls) recommends using a minimum protocol version of TLSv1.2. On the **server** side, users can enable specific TLS protocol versions by setting the `[tls\_version](../ssltls-system-variables/index#tls_version)` system variable. This system variable accepts a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. This system variable can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... tls_version = TLSv1.2,TLSv1.3 ``` You can check which TLS protocol versions are enabled on a server by executing `[SHOW GLOBAL VARIABLES](../show-variables/index)`. For example: ``` SHOW GLOBAL VARIABLES LIKE 'tls_version'; ``` On the **client** side, users can enable specific TLS protocol versions by setting the `--tls-version` option. This option accepts a comma-separated list of TLS protocol versions. A TLS protocol version will only be enabled if it is present in this list. All other TLS protocol versions will not be permitted. For example, to specify this option in a relevant client [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), you could set the following: ``` [client-mariadb] ... tls_version = TLSv1.2,TLSv1.3 ``` Or if you wanted to specify it on the command-line with the `[mysql](../mysql-command-line-client/index)` client, then you could execute something like this: ``` $ mysql -u myuser -p -h myserver.mydomain.com \ --ssl \ --tls-version="TLSv1.2,TLSv1.3" ``` ### TLS Protocol Version Support The TLS protocol versions that are supported depend on the underlying TLS library used by the specific MariaDB binary. | TLS Library | Supported TLS Protocol Versions | | --- | --- | | openSSL | TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 | | wolfSSL | TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 | | yaSSL | TLSv1, TLSv1.1 | | Schannel | TLSv1, TLSv1.1, TLSv1.2 | | GnuTLS | TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 | See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used by the server and by clients on each platform. #### TLS Protocol Version Support in OpenSSL MariaDB binaries built with the [OpenSSL](https://www.openssl.org/) library ([OpenSSL 1.0.1](https://www.openssl.org/news/changelog.html) or later) support TLSv1.1 and TLSv1.2 since [MariaDB 5.5.41](https://mariadb.com/kb/en/mariadb-5541-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/), and [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/). MariaDB binaries built with the [OpenSSL](https://www.openssl.org/) library ([OpenSSL 1.1.1](https://www.openssl.org/news/changelog.html) or later) support TLSv1.3 since [MariaDB 10.2.16](https://mariadb.com/kb/en/mariadb-10216-release-notes/) and [MariaDB 10.3.8](https://mariadb.com/kb/en/mariadb-1038-release-notes/). If your MariaDB Server binary is built with [OpenSSL](https://www.openssl.org/), then you can set the `[ssl\_cipher](../ssl-system-variables/index#ssl_cipher)` system variable to values like `SSLv3` or `TLSv1.2` to allow all SSLv3.0 or all TLSv1.2 ciphers. However, this does not necessarily limit the protocol version to TLSv1.2. See [MDEV-14101](https://jira.mariadb.org/browse/MDEV-14101) for more information about that. Note that the `TLSv1.3` ciphers cannot be excluded when using [OpenSSL](https://www.openssl.org/), even by using the `[ssl\_cipher](../ssl-system-variables/index#ssl_cipher)` system variable. See [Using TLSv1.3](../using-tlsv13/index) for details. SSLv3.0 is known to be vulnerable to the [POODLE attack](https://en.wikipedia.org/wiki/POODLE), so it should not be used. SSLv2.0 and SSLv3.0 are disabled for MariaDB Server binaries linked with [OpenSSL](https://www.openssl.org/) since [MariaDB 5.5.41](https://mariadb.com/kb/en/mariadb-5541-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/), and [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/). If you are using a MariaDB version older than that and you cannot upgrade, then please see the section titled "SSL 3.0 Fallback protection" in [OpenSSL Security Advisory - 15 Oct 2014](https://www.openssl.org/news/secadv/20141015.txt). #### TLS Protocol Version Support in wolfSSL MariaDB binaries built with the bundled [wolfSSL](https://www.wolfssl.com/products/wolfssl/) library support TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3. #### TLS Protocol Version Support in yaSSL MariaDB binaries built with the bundled [yaSSL](https://www.wolfssl.com/products/yassl/) library support SSLv3.0, TLSv1.0, and TLSv1.1. SSLv3.0 is known to be vulnerable to the [POODLE attack](https://en.wikipedia.org/wiki/POODLE), so it should not be used. SSLv2.0 and SSLv3.0 are disabled for MariaDB Server binaries linked with [yaSSL](https://www.wolfssl.com/products/yassl/) since [MariaDB 5.5.41](https://mariadb.com/kb/en/mariadb-5541-release-notes/), [MariaDB 10.0.15](https://mariadb.com/kb/en/mariadb-10015-release-notes/), and [MariaDB 10.1.4](https://mariadb.com/kb/en/mariadb-1014-release-notes/). #### TLS Protocol Version Support in Schannel MariaDB binaries built with the [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel) library support different versions of TLS on different versions of Windows. See the [Protocols in TLS/SSL (Schannel SSP)](https://docs.microsoft.com/en-us/windows/desktop/secauthn/protocols-in-tls-ssl--schannel-ssp-) documentation from Microsoft to determine which versions of TLS are supported on each version of Windows. #### TLS Protocol Version Support in GnuTLS MariaDB binaries built with the [GnuTLS](https://www.gnutls.org/) library support TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3. Enabling TLS ------------ See [Securing Connections for Client and Server](../securing-connections-for-client-and-server/index) for information on how to enable TLS on the client and server. Certificate Verification ------------------------ Certificate verification is how TLS authenticates its connections by verifying that it is talking to who it says it is. There are multiple components to this verification process: * Was the certificate signed by a trusted Certificate Authority (CA)? * Is the certificate expired? * Is the certificate on my Certificate Revocation List (CRL)? * Does the certificate belong to who I believe that I'm communicating with? ### Certificate Authorities (CAs) Certificate Authorities (CAs) are entities that you trust to sign TLS certificates. Your organization might have its own internal CA, or it might use trusted third-party CAs. CAs are specified on the server and client by using the `[ssl\_ca](../ssltls-system-variables/index#ssl_ca)` and `[ssl\_capath](../ssltls-system-variables/index#ssl_capath)` options. The `[ssl\_ca](../ssltls-system-variables/index#ssl_ca)` option defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs). This option requires that you use the absolute path, not a relative path. The `[ssl\_capath](../ssltls-system-variables/index#ssl_capath)` option defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA). This option requires that you use the absolute path, not a relative path. The `[ssl\_capath](../ssltls-system-variables/index#ssl_capath)` option is only supported if the server or client was built with [OpenSSL](https://www.openssl.org/), [wolfSSL](https://www.wolfssl.com/products/wolfssl/), or [yaSSL](https://www.wolfssl.com/products/yassl/). If the client was built with [GnuTLS](https://www.gnutls.org/) or [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel), then the `[ssl\_capath](../ssltls-system-variables/index#ssl_capath)` option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. The directory specified by `[ssl\_capath](../ssltls-system-variables/index#ssl_capath)` needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. For example, if the following is configured: ``` ssl_capath=/etc/my.cnf.d/certificates/ca/ ``` Then you would have to execute the following: ``` openssl rehash /etc/my.cnf.d/certificates/ca/ ``` #### Requiring a Specific Certificate Authority (CA) The server can require a specific Certificate Authority (CA) for a client if the client's user account has been defined with `REQUIRE ISSUER`. See [Securing Connections for Client and Server: Requiring TLS](../securing-connections-for-client-and-server/index#requiring-tls) for more information. ### Certificate Revocation Lists (CRLs) Certificate Revocation Lists (CRLs) are lists of certificates that have been revoked by the Certificate Authority (CA) before they were due to expire. CRLs are specified on the server and client by using the `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` and `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` options. The `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` option defines a path to a PEM file that should contain one or more X509 revoked certificates. This option requires that you use the absolute path, not a relative path. For servers, the `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` option is only valid if the server was built with OpenSSL. If the server was built with [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), then the `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` option is not supported. For clients, the `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` option is only valid if the client was built with [OpenSSL](https://www.openssl.org/) or [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel). Likewise, if the client was built with [GnuTLS](https://www.gnutls.org/), [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), then the `[ssl\_crl](../ssltls-system-variables/index#ssl_crl)` option is not supported. The `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` option defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate. This option requires that you use the absolute path, not a relative path. The `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` option is only supported if the server or client was built with [OpenSSL](https://www.openssl.org/). If the server was built with [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), then the `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` option is not supported. Likewise, if the client was built with [GnuTLS](https://www.gnutls.org/), [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel), [wolfSSL](https://www.wolfssl.com/products/wolfssl/), or [yaSSL](https://www.wolfssl.com/products/yassl/), then the `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` option is not supported. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. The directory specified by `[ssl\_crlpath](../ssltls-system-variables/index#ssl_crlpath)` needs to be run through the `[openssl rehash](https://www.openssl.org/docs/man1.1.1/man1/rehash.html)` command. For example, if the following is configured: ``` ssl_crlpath=/etc/my.cnf.d/certificates/crl/ ``` Then you would have to execute the following: ``` openssl rehash /etc/my.cnf.d/certificates/crl/ ``` ### Server Certificate Verification [Clients and utilities](../clients-utilities/index) verify a server certificate by checking the server's host name and IP address against certain attributes in the certificate. For most [clients and utilities](../clients-utilities/index), server certificate verification is disabled by default, and it is only enabled if an option, such as `ssl-verify-server-cert` is specified. To verify the server's certificate, [clients and utilities](../clients-utilities/index) will check the **Common Name (CN)** attribute located in the **[Subject](https://tools.ietf.org/html/rfc5280#section-4.1.2.6)** field of the certificate against the server's host name and IP address. If the **Common Name (CN)** matches either of those, then the certificate is verified. #### Server Certificate Verification with Subject Alternative Names (SANs) The **[Subject Alternative Name (SAN)](https://tools.ietf.org/html/rfc5280#section-4.2.1.6)** field, which is an X.509v3 extension, can also be used for server certificate verification, if it is present in the server certificate. This field is also sometimes called **subjectAltName**. When using a [client or utility](../clients-utilities/index) that supports server certificate verification with **subjectAltName** fields, if the server certificate contains any **subjectAltName** fields, then those fields will also be checked against the server's host name and IP address. Whether server certificate verification with **subjectAltName** fields is supported depends on the underlying TLS library used by the [client or utility](../clients-utilities/index). See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. ##### SAN Support with OpenSSL, wolfSSL, and yaSSL For [clients and utilities](../clients-utilities/index) built with [OpenSSL](https://www.openssl.org/) ([OpenSSL 1.0.2](https://www.openssl.org/news/changelog.html) or later), support for server certificate verification with **subjectAltName** fields that contain the server's **host name** was added in [MariaDB 10.1.23](https://mariadb.com/kb/en/mariadb-10123-release-notes/) and [MariaDB 10.2.6](https://mariadb.com/kb/en/mariadb-1026-release-notes/). See [MDEV-10594](https://jira.mariadb.org/browse/MDEV-10594) for more information. For [clients and utilities](../clients-utilities/index) built with [OpenSSL](https://www.openssl.org/) ([OpenSSL 1.0.2](https://www.openssl.org/news/changelog.html) or later), support for server certificate verification with **subjectAltName** fields that contain the server's **IP address** was added in [MariaDB 10.1.39](https://mariadb.com/kb/en/mariadb-10139-release-notes/), [MariaDB 10.2.24](https://mariadb.com/kb/en/mariadb-10224-release-notes/), [MariaDB 10.3.15](https://mariadb.com/kb/en/mariadb-10315-release-notes/), and [MariaDB 10.4.5](https://mariadb.com/kb/en/mariadb-1045-release-notes/). See [MDEV-18131](https://jira.mariadb.org/browse/MDEV-18131) for more information. This support also applies to other TLS libraries that use OpenSSL's API. In OpenSSL's API, server certificate verification with **subjectAltName** fields depends on the `[X509\_check\_host](https://www.openssl.org/docs/man1.1.1/man3/X509_check_host.html)` and `[X509\_check\_ip](https://www.openssl.org/docs/man1.1.1/man3/X509_check_host.html)` functions. These functions are supported in the following TLS libraries: * [OpenSSL](https://www.openssl.org/) 1.0.2 or later * [wolfSSL](https://www.wolfssl.com/products/wolfssl/) And they are **not** supported in the following TLS libraries: * [yaSSL](https://www.wolfssl.com/products/yassl/) MariaDB's [RPM packages](../rpm/index) were built with [OpenSSL](https://www.openssl.org/) 1.0.1 on RHEL 7 and CentOS 7, even after OpenSSL 1.0.2 became available on those distributions. As a side effect, the [clients and utilities](../clients-utilities/index) bundled in these packages did not support server certificate verification with the **subjectAltName** field, even if the packages were installed on a system that had OpenSSL 1.0.2 installed. Starting with MariaDB [MariaDB 10.1.39](https://mariadb.com/kb/en/mariadb-10139-release-notes/), [MariaDB 10.2.23](https://mariadb.com/kb/en/mariadb-10223-release-notes/), [MariaDB 10.3.14](https://mariadb.com/kb/en/mariadb-10314-release-notes/), and [MariaDB 10.4.4](https://mariadb.com/kb/en/mariadb-1044-release-notes/), MariaDB's [RPM packages](../rpm/index) on RHEL 7 and CentOS 7 are built with OpenSSL 1.0.2. See [MDEV-18277](https://jira.mariadb.org/browse/MDEV-18277) for more information. ##### SAN Support with Schannel For [clients and utilities](../clients-utilities/index) linked with [Schannel](https://docs.microsoft.com/en-us/windows/desktop/secauthn/secure-channel), support for server certificate verification with **subjectAltName** fields was added in [MariaDB Connector/C](../mariadb-connector-c/index) 3.0.2. See [CONC-250](https://jira.mariadb.org/browse/CONC-250) for more information. ##### SAN Support with GnuTLS For [clients and utilities](../clients-utilities/index) linked with GnuTLS, support for server certificate verification with **subjectAltName** fields was added in [MariaDB Connector/C](../mariadb-connector-c/index) 3.0.0. See [CONC-250](https://jira.mariadb.org/browse/CONC-250) for more information. ### Client Certificate Verification The server verifies a client certificate by checking the client's known `SUBJECT` against the **Subject** attribute in the client's certificate. This is only done for user accounts that have been defined with `REQUIRE SUBJECT`. See [Securing Connections for Client and Server: Requiring TLS](../securing-connections-for-client-and-server/index#requiring-tls) for more information. See Also -------- * [Securing Connections for Client and Server](../securing-connections-for-client-and-server/index) * [Using TLSv1.3](../using-tlsv13/index) * [Certificate Creation with OpenSSL](../certificate-creation-with-openssl/index) * [Replication with Secure Connections](../replication-with-secure-connections/index) * [Securing Communications in Galera Cluster](../securing-communications-in-galera-cluster/index) * [SSL/TLS System Variables](../ssltls-system-variables/index) * [Data-at-Rest Encryption](../data-at-rest-encryption/index) * [Cyberciti tutorial: How to setup MariaDB SSL and secure connections from clients](https://www.cyberciti.biz/faq/how-to-setup-mariadb-ssl-and-secure-connections-from-clients/) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Checking and Repairing CSV Tables Checking and Repairing CSV Tables ================================= [CSV tables](../csv/index) support the [CHECK TABLE](../check-table/index) and [REPAIR TABLE](../repair-table/index) statements. CHECK TABLE will mark the table as corrupt if it finds a problem, while REPAIR TABLE will restore rows until the first corrupted row, discarding the rest. Examples -------- ``` CREATE TABLE csv_test ( x INT NOT NULL, y DATE NOT NULL, z CHAR(10) NOT NULL ) ENGINE=CSV; INSERT INTO csv_test VALUES (1,CURDATE(),'one'), (2,CURDATE(),'two'), (3,CURDATE(),'three'); ``` ``` SELECT * FROM csv_test; +---+------------+-------+ | x | y | z | +---+------------+-------+ | 1 | 2013-07-08 | one | | 2 | 2013-07-08 | two | | 3 | 2013-07-08 | three | +---+------------+-------+ ``` Using an editor, the actual file will look as follows ``` $ cat csv_test.CSV 1,"2013-07-08","one" 2,"2013-07-08","two" 3,"2013-07-08","three" ``` Let's introduce some corruption with an unwanted quote in the 2nd row: ``` 1,"2013-07-08","one" 2","2013-07-08","two" 3,"2013-07-08","three" ``` ``` CHECK TABLE csv_test; +---------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +---------------+-------+----------+----------+ | test.csv_test | check | error | Corrupt | +---------------+-------+----------+----------+ ``` We can repair this, but all rows from the corrupt row onwards will be lost: ``` REPAIR TABLE csv_test; +---------------+--------+----------+----------------------------------------+ | Table | Op | Msg_type | Msg_text | +---------------+--------+----------+----------------------------------------+ | test.csv_test | repair | Warning | Data truncated for column 'x' at row 2 | | test.csv_test | repair | status | OK | +---------------+--------+----------+----------------------------------------+ SELECT * FROM csv_test; +---+------------+-----+ | x | y | z | +---+------------+-----+ | 1 | 2013-07-08 | one | +---+------------+-----+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SQL Language Structure SQL Language Structure ======================= SQL language structure rules. | Title | Description | | --- | --- | | [Identifier Names](../identifier-names/index) | Naming rules for identifiers. | | [Identifier Case-sensitivity](../identifier-case-sensitivity/index) | Whether objects are case-sensitive or not is partly determined by the under... | | [Binary Literals](../binary-literals/index) | Binary literals can be written in one of the following formats. | | [Boolean Literals](../sql-language-structure-boolean-literals/index) | True and false. | | [Date and Time Literals](../date-and-time-literals/index) | Literals regarding date and time. | | [Hexadecimal Literals](../hexadecimal-literals/index) | Hexadecimal literals can be written using any of the following syntaxes | | [Identifier Qualifiers](../identifier-qualifiers/index) | How to reference an object and its context in an SQL statement. | | [Identifier to File Name Mapping](../identifier-to-file-name-mapping/index) | Some identifiers map to a file name on the filesystem. Databases each have ... | | [MariaDB Error Codes](../mariadb-error-codes/index) | MariaDB error codes reference list. | | [Numeric Literals](../numeric-iterals/index) | Numeric literals are written as a sequence of digits from 0 to 9 | | [Reserved Words](../reserved-words/index) | List of reserved words in MariaDB. | | [SQLSTATE](../sqlstate/index) | A string which identifies a condition's class and subclass | | [String Literals](../string-literals/index) | Strings are sequences of characters and are enclosed with quotes. | | [Table Value Constructors](../table-value-constructors/index) | Documents adding arbitrary values to the result-set. | | [User-Defined Variables](../user-defined-variables/index) | Variables which exist within a session. | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ColumnStore Troubleshooting ColumnStore Troubleshooting ============================ | Title | Description | | --- | --- | | [MariaDB ColumnStore Cluster Test Tool](../mariadb-columnstore-cluster-test-tool/index) | Introduction MariaDB ColumnStore Cluster Test Tool is used to validate tha... | | [System Troubleshooting MariaDB ColumnStore](../system-troubleshooting-mariadb-columnstore/index) | Troubleshooting utilities, logging, database files, install and startup problems | Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Information Schema plugins: SHOW and FLUSH statements Information Schema plugins: SHOW and FLUSH statements ===================================================== **MariaDB starting with [10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/)**This extension was added in [MariaDB 10.1.1](https://mariadb.com/kb/en/mariadb-1011-release-notes/) Information Schema plugins can support [SHOW](../show/index) and [FLUSH](../flush/index) statements. SHOW ---- `SHOW` statements support is enabled automatically. A plugin only needs to specify column names for the `SHOW` statement in the `old_name` member of the field declaration structure. Columns with the `old_name` set to 0 will be hidden from the `SHOW` statement. If all columns are hidden, the `SHOW` statement will not work for this plugin. Note that `SHOW` statement is a user-friendly shortcut; it's easier to type and should be easier to view — if the Information Schema table contains many columns, the `SHOW` statement is supposed to display only most important columns and fit nicely on the 80x25 terminal screen. Consider an example, [LOCALES plugin](../locales-plugin/index): ``` static ST_FIELD_INFO locale_info_locale_fields_info[]= { {"ID", 4, MYSQL_TYPE_LONGLONG, 0, 0, "Id", 0}, {"NAME", 255, MYSQL_TYPE_STRING, 0, 0, "Name", 0}, {"DESCRIPTION", 255, MYSQL_TYPE_STRING, 0, 0, "Description", 0}, {"MAX_MONTH_NAME_LENGTH", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, {"MAX_DAY_NAME_LENGTH", 4, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, {"DECIMAL_POINT", 2, MYSQL_TYPE_STRING, 0, 0, 0, 0}, {"THOUSAND_SEP", 2, MYSQL_TYPE_STRING, 0, 0, 0, 0}, {"ERROR_MESSAGE_LANGUAGE", 64, MYSQL_TYPE_STRING, 0, 0, "Error_Message_Language", 0}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0} }; ``` While the the [INFORMATION\_SCHEMA.LOCALES](../information-schema-locales-table/index) table has 8 columns, the [SHOW LOCALES](../show-locales/index) statement will only display 4 of them: ``` MariaDB [test]> show locales; +-----+-------+-------------------------------------+------------------------+ | Id | Name | Description | Error_Message_Language | +-----+-------+-------------------------------------+------------------------+ | 0 | en_US | English - United States | english | | 1 | en_GB | English - United Kingdom | english | | 2 | ja_JP | Japanese - Japan | japanese | | 3 | sv_SE | Swedish - Sweden | swedish | ... ``` FLUSH ----- To support the `FLUSH` statement a plugin must declare the `reset_table` callback. For example, in the [QUERY\_RESPONSE\_TIME](../query_response_time-plugin/index) plugin: ``` static int query_response_time_info_init(void *p) { ST_SCHEMA_TABLE *i_s_query_response_time= (ST_SCHEMA_TABLE *) p; i_s_query_response_time->fields_info= query_response_time_fields_info; i_s_query_response_time->fill_table= query_response_time_fill; i_s_query_response_time->reset_table= query_response_time_flush; query_response_time_init(); return 0; } ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb ST_ExteriorRing ST\_ExteriorRing ================ Syntax ------ ``` ST_ExteriorRing(poly) ExteriorRing(poly) ``` Description ----------- Returns the exterior ring of the Polygon value `poly` as a LineString. `ST_ExteriorRing()` and `ExteriorRing()` are synonyms. Examples -------- ``` SET @poly = 'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'; SELECT AsText(ExteriorRing(GeomFromText(@poly))); +-------------------------------------------+ | AsText(ExteriorRing(GeomFromText(@poly))) | +-------------------------------------------+ | LINESTRING(0 0,0 3,3 3,3 0,0 0) | +-------------------------------------------+ ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb INSERT DELAYED INSERT DELAYED ============== Syntax ------ ``` INSERT DELAYED ... ``` Description ----------- The `DELAYED` option for the `[INSERT](../insert/index)` statement is a MariaDB/MySQL extension to standard SQL that is very useful if you have clients that cannot or need not wait for the `INSERT` to complete. This is a common situation when you use MariaDB for logging and you also periodically run `SELECT` and `UPDATE` statements that take a long time to complete. When a client uses `INSERT DELAYED`, it gets an okay from the server at once, and the row is queued to be inserted when the table is not in use by any other thread. Another major benefit of using `INSERT DELAYED` is that inserts from many clients are bundled together and written in one block. This is much faster than performing many separate inserts. Note that `INSERT DELAYED` is slower than a normal `INSERT` if the table is not otherwise in use. There is also the additional overhead for the server to handle a separate thread for each table for which there are delayed rows. This means that you should use `INSERT DELAYED` only when you are really sure that you need it. The queued rows are held only in memory until they are inserted into the table. This means that if you terminate mysqld forcibly (for example, with kill -9) or if mysqld dies unexpectedly, any queued rows that have not been written to disk are lost. The number of concurrent `INSERT DELAYED` threads is limited by the `[max\_delayed\_threads](../server-system-variables/index#max_delayed_threads)` server system variables. If it is set to 0, `INSERT DELAYED` is disabled. The session value can be equal to the global value, or 0 to disable this statement for the current session. If this limit has been reached, the `DELAYED` clause will be silently ignore for subsequent statements (no error will be produced). ### Limitations There are some limitations on the use of `DELAYED`: * `INSERT DELAYED` works only with [MyISAM](../myisam-storage-engine/index), [MEMORY](../memory-storage-engine/index), [ARCHIVE](../archive/index), and [BLACKHOLE](../blackhole/index) tables. If you execute INSERT DELAYED with another storage engine, you will get an error like this: `ERROR 1616 (HY000): DELAYED option not supported for table 'tab_name'` * For MyISAM tables, if there are no free blocks in the middle of the data file, concurrent SELECT and INSERT statements are supported. Under these circumstances, you very seldom need to use `INSERT DELAYED` with MyISAM. * `INSERT DELAYED` should be used only for `INSERT` statements that specify value lists. The server ignores `DELAYED` for `INSERT ... SELECT` or `INSERT ... ON DUPLICATE KEY UPDATE` statements. * Because the `INSERT DELAYED` statement returns immediately, before the rows are inserted, you cannot use `LAST_INSERT_ID()` to get the `AUTO_INCREMENT` value that the statement might generate. * `DELAYED` rows are not visible to `SELECT` statements until they actually have been inserted. * After `INSERT DELAYED`, [ROW\_COUNT()](../row_count/index) returns the number of the rows you tried to insert, not the number of the successful writes. * `DELAYED` is ignored on slave replication servers, so that `INSERT DELAYED` is treated as a normal `INSERT` on slaves. This is because `DELAYED` could cause the slave to have different data than the master. `INSERT DELAYED` statements are not [safe for replication](../unsafe-statements-for-replication/index). * Pending `INSERT DELAYED` statements are lost if a table is write locked and ALTER TABLE is used to modify the table structure. * `INSERT DELAYED` is not supported for views. If you try, you will get an error like this: `ERROR 1347 (HY000): 'view_name' is not BASE TABLE` * `INSERT DELAYED` is not supported for [partitioned tables](../managing-mariadb-partitioning/index). * `INSERT DELAYED` is not supported within [stored programs](../stored-programs-and-views/index). * `INSERT DELAYED` does not work with [triggers](../triggers/index). * `INSERT DELAYED` does not work if there is a check constraint in place. * `INSERT DELAYED` does not work if [skip-new](../mysqld-options/index#-skip-new) mode is active. See Also -------- * [INSERT](../insert/index) * [INSERT SELECT](../insert-select/index) * [HIGH\_PRIORITY and LOW\_PRIORITY](../high_priority-and-low_priority/index) * [Concurrent Inserts](../concurrent-inserts/index) * [INSERT - Default & Duplicate Values](../insert-default-duplicate-values/index) * [INSERT IGNORE](../insert-ignore/index) * [INSERT ON DUPLICATE KEY UPDATE](../insert-on-duplicate-key-update/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb VARBINARY VARBINARY ========= Syntax ------ ``` VARBINARY(M) ``` Description ----------- The VARBINARY type is similar to the [VARCHAR](../sql_language-data_types-varchar/index) type, but stores binary byte strings rather than non-binary character strings. `M` represents the maximum column length in bytes. It contains no [character set](../data-types-character-sets-and-collations/index), and comparison and sorting are based on the numeric value of the bytes. If the maximum length is exceeded, and [SQL strict mode](../sql-mode/index) is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur. Unlike [BINARY](../binary/index) values, VARBINARYs are not right-padded when inserting. ### Oracle Mode **MariaDB starting with [10.3](../what-is-mariadb-103/index)**In [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#synonyms-for-basic-sql-types), `RAW` is a synonym for `VARBINARY`. Examples -------- Inserting too many characters, first with strict mode off, then with it on: ``` CREATE TABLE varbins (a VARBINARY(10)); INSERT INTO varbins VALUES('12345678901'); Query OK, 1 row affected, 1 warning (0.04 sec) SELECT * FROM varbins; +------------+ | a | +------------+ | 1234567890 | +------------+ SET sql_mode='STRICT_ALL_TABLES'; INSERT INTO varbins VALUES('12345678901'); ERROR 1406 (22001): Data too long for column 'a' at row 1 ``` Sorting is performed with the byte value: ``` TRUNCATE varbins; INSERT INTO varbins VALUES('A'),('B'),('a'),('b'); SELECT * FROM varbins ORDER BY a; +------+ | a | +------+ | A | | B | | a | | b | +------+ ``` Using [CAST](../cast/index) to sort as a [CHAR](../char/index) instead: ``` SELECT * FROM varbins ORDER BY CAST(a AS CHAR); +------+ | a | +------+ | a | | A | | b | | B | +------+ ``` See Also -------- * [VARCHAR](../varchar/index) * [Data Type Storage Requirements](../data-type-storage-requirements/index) * [Oracle mode from MariaDB 10.3](../sql_modeoracle-from-mariadb-103/index#synonyms-for-basic-sql-types) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Condition Selectivity Computation Internals Condition Selectivity Computation Internals =========================================== This page describes how the MariaDB optimizer computes condition selectivities. calculate\_cond\_selectivity\_for\_table(T) ------------------------------------------- This function computes selectivity of the restrictions on a certain table T. (TODO: name in the optimizer trace) Selectivity is computed from * selectivities of restrictions on different columns ( [histogram data](../histogram-based-statistics/index)) * selectivities of potential range accesses. Restrictions on different columns, as well as disjoint sets of columns, are considered independent, so their selectivities are multiplied. ### Data From Potential Range Accesses First, we take into account the selectivities of potential range accesses. If range accesses on indexes IDX1 and IDX2 do not use the same table column (either the indexes do not have common columns, or they do but range accesses do not use them), then they are considered independent, and their selectivities can be multiplied. However, in general, range accesses on different indexes may use restrictions on the same column and so cannot be considered independent. In this case, the following approach is used: We start with selectivity=1, an empty set of range accesses, and an empty set of columns for which we have taken the selectivity into account. Then, we add range accesses one by one, updating the selectivity value and noting which columns we have taken into account. Range accesses that use more key parts are added first. If we are adding a range access $R whose columns do not overlap with the ones already added, we can just multiply the total selectivity by $R's selectivity. If $R's columns overlap with columns we've got selectivity data for, the process is as follows: Find the prefix of columns whose selectivity hasn't been taken into account yet. Then, take the selectivity of the whole range access and multiply it by ``` rec_per_key[i-1]/rec_per_key[i] ``` (TODO: and this logic is not clear. More, one can produce table->cond\_selectivity>1 this way. See [MDEV-20740](https://jira.mariadb.org/browse/MDEV-20740)) ### Data From Histograms Then, we want to take into account selectivity data from [histograms](../histogram-based-statistics/index). Each histogram covers one single column. If the selectivity of a column hasn't been taken into account on the previous step, we take it into account now by multiplying the selectivity by it. Otherwise, we assume that range access has fully taken the column selectivity into account and do nothing. The third step is sampling-based selectivity data which is out of the scope of this document. table\_cond\_selectivity() -------------------------- This function computes selectivity of restrictions that can be applied after table T has been joined with the join prefix `{T1, ..., Tk}`. There are two cases: * Table T uses ref access. In this case, the returned rows match the equalities ref\_access is constructed from. Restrictions on just table T are not checked, yet. * Table T uses ALL/index/quick select. In this case, restrictions on table T have been applied but cross-table restrictions were not. Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb OQGRAPH System and Status Variables OQGRAPH System and Status Variables =================================== This page documents system and status variables related to the [OQGRAPH storage engine](../oqgraph/index). See [Server Status Variables](../server-status-variables/index) and [Server System Variables](../server-system-variables/index) for complete list of all system and status variables. System Variables ---------------- #### `oqgraph_allow_create_integer_latch` * **Description:** Created when the [OQGRAPH](../oqgraph/index) storage engine is installed, if set to `1` (`0` is default), permits the `latch` field to be an integer (see [OQGRAPH Overview](../oqgraph-overview/index#creating-a-table)). * **Scope:** Global * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `0` --- Status Variables ---------------- #### `Oqgraph_boost_version` * **Description:** [OQGRAPH](../oqgraph/index) boost version. * **Scope:** Global, Session * **Data Type:** `string` --- #### `Oqgraph_compat_mode` * **Description:** Whether or not legacy tables with integer latches are supported. * **Scope:** Global, Session * **Data Type:** `string` --- #### `Oqgraph_verbose_debug` * **Description:** Whether or not verbose debugging is enabled. If it is, performance may be adversely impacted * **Scope:** Global, Session * **Data Type:** `string` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Stored Procedure Internals Stored Procedure Internals ========================== Implementation Specification for Stored Procedures -------------------------------------------------- ### How Parsing and Execution of Queries Work In order to execute a query, the function `sql_parse.cc:mysql_parse()` is called, which in turn calls the parser (`yyparse()`) with an updated Lex structure as the result. `mysql_parse()` then calls `mysql_execute_command()` which dispatches on the command code (in Lex) to the corresponding code for executing that particular query. There are three structures involved in the execution of a query which are of interest to the [stored procedure](../stored-procedures/index) implementation: * Lex (mentioned above) is the "compiled" query, that is the output from the parser and what is then interpreted to do the actual work. It constains an enum value (sql\_command) which is the query type, and all the data collected by the parser needed for the execution (table names, fields, values, etc). * THD is the "run-time" state of a connection, containing all that is needed for a particular client connection, and, among other things, the Lex structure currently being executed. * `Item_*`: During parsing, all data is translated into "items", objects of the subclasses of "Item", such as `Item_int`, `Item_real`, `Item_string`, etc., for basic datatypes, and also various more specialized Item types for expressions to be evaluated (`Item_func` objects). ### How to Fit Stored Procedures into this Scheme #### Overview of the Classes and Files for Stored Procedures (More detailed APIs at the end of this page) ##### class sp\_head (sp\_head.{cc,h}) This contains, among other things, an array of "instructions" and the method for executing the procedure. ##### class sp\_pcontext (sp\_pcontext.{cc,h} This is the parse context for the procedure. It's primarily used during parsing to keep track of local parameters, variables and labels, but it's also used at [CALL](../call/index) time to find the parameters mode (IN, OUT or INOUT) and type when setting up the runtime context. ##### class sp\_instr (sp\_head.{cc,h}) This is the base class for "instructions", that is, what is generated by the parser. It turns out that we only need a minimum of 5 different sub classes: * sp\_instr\_stmt Execute a statement. This is the "call-out" any normal SQL statement, like a [SELECT](../select/index), [INSERT](../insert/index) etc. It contains the Lex structure for the statement in question. * sp\_instr\_set Set the value of a local variable (or parameter) * sp\_instr\_jump An unconditional jump. * sp\_instr\_jump\_if\_not Jump if condition is not true. It turns out that the negative test is most convenient when generating the code for the flow control constructs. * sp\_instr\_freturn Return a value from a FUNCTION and exit. For condition HANDLERs some special instructions are also needed, see that section below. ##### class sp\_rcontext (sp\_rcontext.h) This is the runtime context in the THD structure. It contains an array of items, the parameters and local variables for the currently executing stored procedure. This means that variable value lookup is in runtime is constant time, a simple index operation. ##### class Item\_splocal (Item.{cc,h}) This is a subclass of Item. Its sole purpose is to hide the fact that the real Item is actually in the current frame (runtime context). It contains the frame offset and defers all methods to the real Item in the frame. This is what the parser generates for local variables. ##### Utility Functions (sp.{cc,h}) This contains functions for creating, dropping and finding a stored procedure in the [mysql.proc table](../mysqlproc-table/index) (or the internal cache). #### Parsing CREATE PROCEDURE When parsing a [CREATE PROCEDURE](../create-procedure/index) the parser first initializes the `sphead` and `spcont` (runtime context) fields in the Lex. The sql\_command code for the result of parsing a is `SQLCOM_CREATE_PROCEDURE`. The parsing of the parameter list and body is relatively straightforward: * Parameters: name, type and mode (IN/OUT/INOUT) is pushed to `spcont` * Declared local variables: Same as parameters (mode is then IN) * Local Variable references: If an identifier is found in in `spcont`, an `Item_splocal` is created with the variable's frame index, otherwise an `Item_field` or `Item_ref` is created (as before). * Statements: The Lex in THD is replaced by a new Lex structure and the statement, is parsed as usual. A `sp_instr_stmt` is created, containing the new Lex, and added to the instructions in `sphead`. Afterwards, the procedure's Lex is restored in THD. * SET var: Setting a local variable generates a `sp_instr_set` instruction, containing the variable's frame offset, the expression (an Item), and the type. * Flow control: Flow control constructs such as [IF](../if/index), [WHILE](../while/index), etc, generate a conditional and unconditional jumps in the "obvious" way, but a few notes may be required: * Forward jumps: When jumping forward, the exact destination is not known at the time of the creation of the jump instruction. The 1. sphead `therefore contains a list of instruction-label pairs for each forward reference. When the position later is known, the instructions in the list are updated with the correct location.` * Loop constructs have optional labels. If a loop doesn't have a label, an anonymous label is generated to simplify the parsing. * There are two types of CASE. The "simple" case is implemented with an anonymous variable bound to the value to be tested. ##### A Simple Example Parsing the procedure: ``` create procedure a(s char(16)) begin declare x int; set x = 3; while x > 0 do set x = x-1; insert into db.tab values (x, s); end while; end ``` would generate the following structures: ``` ______ thd: | | _________ | lex -+--->| | ___________________ |______| | spcont -+------------------->| "s",in,char(16):0 | | sphead -+------ |("x",in,int :1)| |_________| | |___________________| ____V__________________ | m_name: "a" | | m_defstr: "create ..."| | m_instr: ... | |_______________________| ``` Note that the contents of the `spcont` is changing during the parsing, at all times reflecting the state of the would-be runtime frame. The `m_instr` is an array of instructions: ``` Pos. Instruction 0 sp_instr_set(1, '3') 1 sp_instr_jump_if_not(5, 'x>0') 2 sp_instr_set(1, 'x-1') 3 sp_instr_stmt('insert into ...') 4 sp_instr_jump(1) 5 <end> ``` Here, '3', 'x>0', etc, represent the Items or Lex for the respective expressions or statements. #### Parsing CREATE FUNCTION [Creating a function](../create-function/index) is essentially the same thing as for a PROCEDURE, with the addition that a FUNCTION has a return type and a RETURN statement, but no OUT or INOUT parameters. The main difference during parsing is that we store the result type in the sp\_head. However, there are big differences when it comes to invoking a FUNCTION. (See below.) #### Storing, Caching, Dropping As seen above, the entired definition string, including the "CREATE PROCEDURE" (or "FUNCTION") is kept. The procedure definition string is stored in the table mysql.proc with the name and type as the key, the type being one of the enum ("procedure","function"). A PROCEDURE is just stored in the [mysql.proc table](../mysqlproc-table/index). A FUNCTION has an additional requirement. They will be called in expressions with the same syntax as UDFs, so UDFs and stored FUNCTIONs share the namespace. Thus, we must make sure that we do not have UDFs and FUNCTIONs with the same name (even if they are stored in different places). This means that we can reparse the procedure as many time as we want. The first time, the resulting Lex is used to store the procedure in the database (using the function sp.c:sp\_create\_procedure()). The simplest way would be to just leave it at that, and re-read the procedure from the database each time it is called. (And in fact, that's the way the earliest implementation will work.) However, this is not very efficient, and we can do better. The full implementation should work like this: 1. Upon creation time, parse and store the procedure. Note that we still need to parse it to catch syntax errors, but we can't check if called procedures exists for instance. 2. Upon first CALL, read from the database, parse it, and cache the resulting Lex in memory. This time we can do more error checking. 3. Upon subsequent CALLs, use the cached Lex. Note that this implies that the Lex structure with its sphead must be reentrant, that is, reusable and shareable between different threads and calls. The runtime state for a procedure is kept in the sp\_rcontext in THD. The mechanisms of storing, finding, and dropping procedures are encapsulated in the files sp.{cc,h}. #### CALLing a Procedure A [CALL](../call/index) is parsed just like any statement. The resulting Lex has the sql\_command SQLCOM\_CALL, the procedure's name and the parameters are pushed to the Lex' value\_list. sql\_parse.cc:mysql\_execute\_command() then uses sp.cc:sp\_find() to get the sp\_head for the procedure (which may have been read from the database or fetched from the in-memory cache) and calls the sp\_head's method execute(). Note: It's important that substatements called by the procedure do not do send\_ok(). Fortunately, there is a flag in THD->net to disable this during CALLs. If a substatement fails, it will however send an error back to the client, so the CALL mechanism must return immediately and without sending an error. The sp\_head::execute() method works as follows: 1. Keep a pointer to the old runtime context in THD (if any) 2. Create a new runtime context. The information about the required size is in sp\_head's parse time context. 3. Push each parameter (from the CALL's Lex->value\_list) to the new context. If it's an OUT or INOUT parameter, the parameter's offset in the caller's frame is set in the new context as well. 4. For each instruction, call its execute() method. The result is a pointer to the next instruction to execute (or NULL) if an error occurred. 5. On success, set the new values of the OUT and INOUT parameters in the caller's frame. #### USE database Before executing the instruction we also keeps the current default database (if any). If this was changed during execution (i.e. a [USE](../use/index) statement has been executed), we restore the current database to the original. This is the most useful way to handle USE in procedures. If we didn't, the caller would find himself in a different database after calling a function, which can be confusing. Restoring the database also gives full freedom to the procedure writer: - It's possible to write "general" procedures that are independent of the actual database name. - It's possible to write procedures that work on a particular database by calling USE, without having to use fully qualified table names everywhere (which doesn't help if you want to call other, "general", procedures anyway). #### Evaluating Items There are three occasions where we need to evaluate an expression: * When SETing a variable * When CALLing a procedure * When testing an expression for a branch (in IF, WHILE, etc) The semantics in stored procedures is "call-by-value", so we have to evaluate any "func" Items at the point of the CALL or SET, otherwise we would get a kind of "lazy" evaluation with unexpected results with respect to OUT parameters for instance. For this the support function, `sp_head.cc:eval_func_item()` is needed. #### Calling a FUNCTION Functions don't have an explicit call keyword like procedures. Instead, they appear in expressions with the conventional syntax "fun(arg, ...)". The problem is that we already have [User Defined Functions](../user-defined-functions/index) (UDFs) which are called the same way. A UDF is detected by the lexical analyzer (not the parser!), in the `find_keyword()` function, and returns a `UDF_*_FUNC` or `UDA_*_SUM` token with the `udf_func` object as the yylval. So, stored functions must be handled in a similar way, and as a consequence, UDFs and functions must not have the same name. #### Detecting and Parsing a FUNCTION Invocation The existence of UDFs are checked during the lexical analysis (in sql\_lex.cc:find\_keyword()). This has the drawback that they must exist before they are referred to, which was ok before SPs existed, but then it becomes a problem. The first implementation of SP FUNCTIONs will work the same way, but this should be fixed a.s.a.p. (This will required some reworking of the way UDFs are handled, which is why it's not done from the start.) For the time being, a FUNCTION is detected the same way, and returns the token SP\_FUNC. During the parsing we only check for the \*existence\* of the function, we don't parse it, since wa can't call the parser recursively. When encountering a SP\_FUNC with parameters in the expression parser, an instance of the new Item\_func\_sp class is created. Unlike UDFs, we don't have different classes for different return types, since we at this point don't know the type. #### Collecting FUNCTIONs to invoke A FUNCTION differs from a PROCEDURE in one important aspect: Whereas a PROCEDURE is CALLed as statement by itself, a FUNCTION is invoked "on-the-fly" during the execution of \*another\* statement. This makes things a lot more complicated compared to CALL: - We can't read and parse the FUNCTION from the [mysql.proc table](../mysqlproc-table/index) at the point of invocation; the server requires that all tables used are opened and locked at the beginning of the query execution. One "obvious" solution would be to simply push "mysql.proc" to the list of tables used by the query, but this implies a "join" with this table if the query is a select, so it doesn't work (and we can't exclude this table easily; since a privileged used might in fact want to search the proc table). Another solution would of course be to allow the opening and closing of the [mysql.proc table](../mysqlproc-table/index) during a query execution, but this it not possible at the present. So, the solution is to collect the names of the referred FUNCTIONs during parsing in the lex. Then, before doing anything else in `mysql_execute_command()`, read all functions from the database an keep them in the THD, where the function `sp_find_function()` can find them during the execution. Note: Even with an in-memory cache, we must still make sure that the functions are indeed read and cached at this point. The code that read and cache functions from the database must also be invoked recursively for each read FUNCTION to make sure we have \*all\* the functions we need. #### Parsing DROP PROCEDURE/FUNCTION The procedure name is pushed to Lex->value\_list. The sql\_command code for the result of parsing a is `SQLCOM_DROP_PROCEDURE`/`SQLCOM_DROP_FUNCTION`. Dropping is done by simply getting the procedure with the sp\_find() function and calling `sp_drop()` (both in `sp.{cc,h}`). [DROP PROCEDURE](../drop-procedure/index)/[DROP FUNCTION](../drop-function/index) also supports the non-standard "IF EXISTS", analogous to other [DROP](../drop/index) statements in MariaDB. #### Condition and Handlers Condition names are lexical entities and are kept in the parser context just like variables. But, condition are just "aliases" for SQLSTATE strings, or mysqld error codes (which is a non-standard extension in MySQL), and are only used during parsing. Handlers comes in three types, CONTINUE, EXIT and UNDO. The latter is like an EXIT handler with an implicit rollback, and is currently not implemented. The EXIT handler jumps to the end of its BEGIN-END block when finished. The CONTINUE handler returns to the statement following that which invoked the handler. The handlers in effect at any point is part of each thread's runtime state, so we need to push and pop handlers in the sp\_rcontext during execution. We use special instructions for this: - sp\_instr\_hpush\_jump Push a handler. The instruction contains the necessary information, like which conditions we handle and the location of the handler. The jump takes us to the location after the handler code. - sp\_instr\_hpop Pop the handlers of the current frame (which we are just leaving). It might seems strange to jump past the handlers like that, but there's no extra cost in doing this, and for technical reasons it's easiest for the parser to generate the handler instructions when they occur in the source. When an error occurs, one of the error routines is called and an error message is normally sent back to the client immediately. Catching a condition must be done in these error routines (there are quite a few) to prevent them from doing this. We do this by calling a method in the THD's sp\_rcontext (if there is one). If a handler is found, this is recorded in the context and the routine returns without sending the error message. The execution loop (sp\_head::execute()) checks for this after each statement and invokes the handler that has been found. If several errors or warnings occurs during one statement, only the first is caught, the rest are ignored. Invoking and returning from a handler is trivial in the EXIT case. We simply jump to it, and it will have an sp\_instr\_jump as its last instruction. Calling and returning from a CONTINUE handler poses some special problems. Since we need to return to the point after its invocation, we push the return location on a stack in the sp\_rcontext (this is done by the execution loop). The handler then ends with a special instruction, sp\_instr\_hreturn, which returns to this location. CONTINUE handlers have one additional problem: They are parsed at the lexical level where they occur, so variable offsets will assume that it's actually called at that level. However, a handler might be invoked from a sub-block where additional local variables have been declared, which will then share the location of any local variables in the handler itself. So, when calling a CONTINUE handler, we need to save any local variables above the handler's frame offset, and restore them upon return. (This is not a problem for EXIT handlers, since they will leave the block anyway.) This is taken care of by the execution loop and the sp\_instr\_hreturn instruction. ##### Examples EXIT handler: ``` begin declare x int default 0; begin declare exit handler for 'XXXXX' set x = 1; (statement1); (statement2); end; (statement3); end ``` ``` Pos. Instruction 0 sp_instr_set(0, '0') 1 sp_instr_hpush_jump(4, 1) # location and frame size 2 sp_instr_set(0, '1') 3 sp_instr_jump(6) 4 sp_instr_stmt('statement1') 5 sp_instr_stmt('statement2') 6 sp_instr_hpop(1) 7 sp_instr_stmt('statement3') ``` CONTINUE handler: ``` create procedure hndlr1(val int) begin declare x int default 0; declare foo condition for 1146; declare continue handler for foo set x = 1; insert into t3 values ("hndlr1", val); # Non-existing table? if x>0 then insert into t1 values ("hndlr1", val); # This instead then end if; end| ``` ``` Pos. Instruction 0 sp_instr_set(1, '0') 1 sp_instr_hpush_jump(4, 2) 2 sp_instr_set(1, '1') 3 sp_instr_hreturn(2) # frame size 4 sp_instr_stmt('insert ... t3 ...') 5 sp_instr_jump_if_not(7, 'x>0') 6 sp_instr_stmt('insert ... t1 ...') 7 sp_instr_hpop(2) ``` #### Cursors For stored procedures to be really useful, you want to have cursors. MySQL doesn't yet have "real" cursor support (with API and ODBC support, allowing updating, arbitrary scrolling, etc), but a simple asensitive, non-scrolling, read-only cursor can be implemented in SPs using the class Protocol\_cursor. This class intecepts the creation and sending of results sets and instead stores it in-memory, as MYSQL\_FIELDS and MYSQL\_ROWS (as in the client API). To support this, we need the usual name binding support in sp\_pcontext (similar to variables and conditions) to keep track on declared cursor names, and a corresponding run-time mechanism in sp\_rcontext. Cursors are lexically scoped like everything with a body or BEGIN/END block, so they are pushed and poped as usual (see conditions and variables above). The basic operations on a cursor are OPEN, FETCH and CLOSE, which will each have a corresponding instruction. In addition, we need instructions to push a new cursor (this will encapsulate the LEX of the SELECT statement of the cursor), and a pop instruction: - sp\_instr\_cpush Push a cursor to the sp\_rcontext. This instruction contains the LEX for the select statement - sp\_instr\_cpop Pop a number of cursors from the sp\_rcontext. - sp\_instr\_copen Open a cursor: This will execute the select and get the result set in a sepeate memroot. - sp\_instr\_cfetch Fetch the next row from the in-memory result set. The instruction contains a list of the variables (frame offsets) to set. - sp\_instr\_cclose Free the result set. A cursor is a separate class, sp\_cursor (defined in sp\_rcontex.h) which encapsulates the basic operations used by the above instructions. This class contains the LEX, Protocol\_cursor object, and its memroot, as well as the cursor's current state. Compiling and executing is fairly straight-forward. sp\_instr\_copen is a subclass of sp\_instr\_stmt and uses its mechanism to execute a substatement. ##### Example ``` begin declare x int; declare c cursor for select a from t1; open c; fetch c into x; close c; end ``` ``` Pos. Instruction 0 sp_instr_cpush('select a from ...') 1 sp_instr_copen(0) # The 0'th cursor 2 sp_instr_cfetch(0) # Contains the variable list 3 sp_instr_cclose(0) 4 sp_instr_cpop(1) ``` #### The SP cache There are two ways to cache SPs: 1. one global cache, share by all threads/connections, 2. one cache per thread. There are pros and cons with both methods: 1. * Pros: Save memory, each SP only read from table once, * Cons: Needs locking (= serialization at access), requires thread-safe data structures, 2. * Pros: Fast, no locking required (almost), limited thread-safe requirement, * Cons: Uses more memory, each SP read from table once per thread. Unfortunately, we cannot use alternative 1 for the time being, as most of the data structures to be cached (lex and items) are not reentrant and thread-safe. (Things are modified at execution, we have THD pointers stored everywhere, etc.) This leaves us with alternative 2, one cache per thread; or actually two, since we keep FUNCTIONs and PROCEDUREs in separate caches. This is not that terrible; the only case when it will perform significantly worse than a global cache is when we have an application where new threads are connecting, calling a procedure, and disconnecting, over and over again. The cache implementation itself is simple and straightforward, a hashtable wrapped in a class and a C API (see APIs below). There is however one issue with multiple caches: dropping and altering procedures. Normally, this should be a very rare event in a running system; it's typically something you do during development and testing, so it's not unthinkable that we would simply ignore the issue and let any threads running with a cached version of an SP keep doing so until its disconnected. But assuming we want to keep the caches consistent with respect to drop and alter, it can be done: 1. A global counter is needed, initialized to 0 at start. 2. At each DROP or ALTER, increase the counter by one. 3. Each cache has its own copy of the counter, copied at the last read. 4. When looking up a name in the cache, first check if the global counter is larger than the local copy. If so, clear the cache and return "not found", and update the local counter; otherwise, lookup as usual. This minimizes the cost to a single brief lock for the access of an integer when operating normally. Only in the event of an actual drop or alter, is the cache cleared. This may seem to be drastic, but since we assume that this is a rare event, it's not a problem. It would of course be possible to have a much more fine-grained solution, keeping track of each SP, but the overhead of doing so is not worth the effort. #### Class and Function APIs This is an outline of the key types. Some types and other details in the actual files have been omitted for readability. ##### The parser context: sp\_pcontext.h ``` typedef enum { sp_param_in, sp_param_out, sp_param_inout } sp_param_mode_t; typedef struct { LEX_STRING name; enum enum_field_types type; sp_param_mode_t mode; uint offset; // Offset in current frame my_bool isset; } sp_pvar_t; typedef struct sp_cond_type { enum { number, state, warning, notfound, exception } type; char sqlstate[6]; uint mysqlerr; } sp_cond_type_t; class sp_pcontext { sp_pcontext(); // Return the maximum frame size uint max_framesize(); // Return the current frame size uint current_framesize(); // Return the number of parameters uint params(); // Set the number of parameters to the current frame size void set_params(); // Set type of the variable at offset 'i' in the frame void set_type(uint i, enum enum_field_types type); // Mark the i:th variable to "set" (i.e. having a value) with // 'val' true. void set_isset(uint i, my_bool val); // Push the variable 'name' to the frame. void push_var(LEX_STRING *name, enum enum_field_types type, sp_param_mode_t mode); // Pop 'num' variables from the frame. void pop_var(uint num = 1); // Find variable by name sp_pvar_t *find_pvar(LEX_STRING *name); // Find variable by index sp_pvar_t *find_pvar(uint i); // Push label 'name' of instruction index 'ip' to the label context sp_label_t *push_label(char *name, uint ip); // Find label 'name' in the context sp_label_t *find_label(char *name); // Return the last pushed label sp_label_t *last_label(); // Return and remove the last pushed label. sp_label_t *pop_label(); // Push a condition to the context void push_cond(LEX_STRING *name, sp_cond_type_t *val); // Pop a 'num' condition from the context void pop_cond(uint num); // Find a condition in the context sp_cond_type_t *find_cond(LEX_STRING *name); // Increase the handler count void add_handler(); // Returns the handler count uint handlers(); // Push a cursor void push_cursor(LEX_STRING *name); // Find a cursor my_bool find_cursor(LEX_STRING *name, uint *poff); // Pop 'num' cursors void pop_cursor(uint num); // Return the number of cursors uint cursors(); } ``` ##### Run-time context (call frame): sp\_rcontext.h: ``` #define SP_HANDLER_NONE 0 #define SP_HANDLER_EXIT 1 #define SP_HANDLER_CONTINUE 2 #define SP_HANDLER_UNDO 3 typedef struct { struct sp_cond_type *cond; uint handler; // Location of handler int type; uint foffset; // Frame offset for the handlers declare level } sp_handler_t; class sp_rcontext { // 'fsize' is the max size of the context, 'hmax' the number of handlers, // 'cmax' the number of cursors sp_rcontext(uint fsize, uint hmax, , uint cmax); // Push value (parameter) 'i' to the frame void push_item(Item *i); // Set slot 'idx' to value 'i' void set_item(uint idx, Item *i); // Return the item in slot 'idx' Item *get_item(uint idx); // Set the "out" index 'oidx' for slot 'idx. If it's an IN slot, // use 'oidx' -1. void set_oindex(uint idx, int oidx); // Return the "out" index for slot 'idx' int get_oindex(uint idx); // Set the FUNCTION result void set_result(Item *i); // Get the FUNCTION result Item *get_result(); // Push handler at location 'h' for condition 'cond'. 'f' is the // current variable frame size. void push_handler(sp_cond_type_t *cond, uint h, int type, uint f); // Pop 'count' handlers void pop_handlers(uint count); // Find a handler for this error. This sets the state for a found // handler in the context. If called repeatedly without clearing, // only the first call's state is kept. int find_handler(uint sql_errno); // Returns 1 if a handler has been found, with '*ip' and '*fp' set // to the handler location and frame size respectively. int found_handler(uint *ip, uint *fp); // Clear the found handler state. void clear_handler(); // Push a return address for a CONTINUE handler void push_hstack(uint ip); // Pop the CONTINUE handler return stack uint pop_hstack(); // Save variables from frame index 'fp' and up. void save_variables(uint fp); // Restore saved variables from to frame index 'fp' and up. void restore_variables(uint fp); // Push a cursor for the statement (lex) void push_cursor(LEX *lex); // Pop 'count' cursors void pop_cursors(uint count); // Pop all cursors void pop_all_cursors(); // Get the 'i'th cursor sp_cursor *get_cursor(uint i); } ``` ##### The procedure: sp\_head.h: ``` #define TYPE_ENUM_FUNCTION 1 #define TYPE_ENUM_PROCEDURE 2 class sp_head { int m_type; // TYPE_ENUM_FUNCTION or TYPE_ENUM_PROCEDURE sp_head(); void init(LEX_STRING *name, LEX *lex, LEX_STRING *comment, char suid); // Store this procedure in the database. This is a wrapper around // the function sp_create_procedure(). int create(THD *); // Invoke a FUNCTION int execute_function(THD *thd, Item **args, uint argcount, Item **resp); // CALL a PROCEDURE int execute_procedure(THD *thd, List<Item> *args); // Add the instruction to this procedure. void add_instr(sp_instr *); // Returns the number of instructions. uint instructions(); // Returns the last instruction sp_instr *last_instruction(); // Resets lex in 'thd' and keeps a copy of the old one. void reset_lex(THD *); // Restores lex in 'thd' from our copy, but keeps some status from the // one in 'thd', like ptr, tables, fields, etc. void restore_lex(THD *); // Put the instruction on the backpatch list, associated with // the label. void push_backpatch(sp_instr *, struct sp_label *); // Update all instruction with this label in the backpatch list to // the current position. void backpatch(struct sp_label *); // Returns the SP name (with optional length in '*lenp'). char *name(uint *lenp = 0); // Returns the result type for a function Item_result result(); // Sets various attributes void sp_set_info(char *creator, uint creatorlen, longlong created, longlong modified, bool suid, char *comment, uint commentlen); } ``` ##### Instructions ##### The base class ``` class sp_instr { // 'ip' is the index of this instruction sp_instr(uint ip); // Execute this instrution. // '*nextp' will be set to the index of the next instruction // to execute. (For most instruction this will be the // instruction following this one.) // Returns 0 on success, non-zero if some error occurred. virtual int execute(THD *, uint *nextp) } <<code>> ===== Statement instruction <<code>> class sp_instr_stmt : public sp_instr { sp_instr_stmt(uint ip); int execute(THD *, uint *nextp); // Set the statement's Lex void set_lex(LEX *); // Return the statement's Lex LEX *get_lex(); } ``` ##### SET instruction ``` class sp_instr_set : public sp_instr { // 'offset' is the variable's frame offset, 'val' the value, // and 'type' the variable type. sp_instr_set(uint ip, uint offset, Item *val, enum enum_field_types type); int execute(THD *, uint *nextp); } ``` ##### Unconditional jump ``` class sp_instr_jump : public sp_instr { // No destination, must be set. sp_instr_jump(uint ip); // 'dest' is the destination instruction index. sp_instr_jump(uint ip, uint dest); int execute(THD *, uint *nextp); // Set the destination instruction 'dest'. void set_destination(uint dest); } ``` ##### Conditional jump ``` class sp_instr_jump_if_not : public sp_instr_jump { // Jump if 'i' evaluates to false. Destination not set yet. sp_instr_jump_if_not(uint ip, Item *i); // Jump to 'dest' if 'i' evaluates to false. sp_instr_jump_if_not(uint ip, Item *i, uint dest) int execute(THD *, uint *nextp); } ``` ##### Return a function value ``` class sp_instr_freturn : public sp_instr { // Return the value 'val' sp_instr_freturn(uint ip, Item *val, enum enum_field_types type); int execute(THD *thd, uint *nextp); } ``` ##### Push a handler and jump ``` class sp_instr_hpush_jump : public sp_instr_jump { // Push handler of type 'htype', with current frame size 'fp' sp_instr_hpush_jump(uint ip, int htype, uint fp); int execute(THD *thd, uint *nextp); // Add condition for this handler void add_condition(struct sp_cond_type *cond); } ``` ##### Pops handlers ``` class sp_instr_hpop : public sp_instr { // Pop 'count' handlers sp_instr_hpop(uint ip, uint count); int execute(THD *thd, uint *nextp); } ``` ##### Return from a CONTINUE handler ``` class sp_instr_hreturn : public sp_instr { // Return from handler, and restore variables to 'fp'. sp_instr_hreturn(uint ip, uint fp); int execute(THD *thd, uint *nextp); } ``` ##### Push a CURSOR ``` class sp_instr_cpush : public sp_instr_stmt { // Push a cursor for statement 'lex' sp_instr_cpush(uint ip, LEX *lex) int execute(THD *thd, uint *nextp); } ``` ##### Pop CURSORs ``` class sp_instr_cpop : public sp_instr_stmt { // Pop 'count' cursors sp_instr_cpop(uint ip, uint count) int execute(THD *thd, uint *nextp); } ``` ##### Open a CURSOR ``` class sp_instr_copen : public sp_instr_stmt { // Open the 'c'th cursor sp_instr_copen(uint ip, uint c); int execute(THD *thd, uint *nextp); } ``` ##### Close a CURSOR ``` class sp_instr_cclose : public sp_instr { // Close the 'c'th cursor sp_instr_cclose(uint ip, uint c); int execute(THD *thd, uint *nextp); } ``` ##### Fetch a row with CURSOR ``` class sp_instr_cfetch : public sp_instr { // Fetch next with the 'c'th cursor sp_instr_cfetch(uint ip, uint c); int execute(THD *thd, uint *nextp); // Add a target variable for the fetch void add_to_varlist(struct sp_pvar *var); } ``` ##### Utility functions: sp.h ``` #define SP_OK 0 #define SP_KEY_NOT_FOUND -1 #define SP_OPEN_TABLE_FAILED -2 #define SP_WRITE_ROW_FAILED -3 #define SP_DELETE_ROW_FAILED -4 #define SP_GET_FIELD_FAILED -5 #define SP_PARSE_ERROR -6 // Finds a stored procedure given its name. Returns NULL if not found. sp_head *sp_find_procedure(THD *, LEX_STRING *name); // Store the procedure 'name' in the database. 'def' is the complete // definition string ("create procedure ..."). int sp_create_procedure(THD *, char *name, uint namelen, char *def, uint deflen, char *comment, uint commentlen, bool suid); // Drop the procedure 'name' from the database. int sp_drop_procedure(THD *, char *name, uint namelen); // Finds a stored function given its name. Returns NULL if not found. sp_head *sp_find_function(THD *, LEX_STRING *name); // Store the function 'name' in the database. 'def' is the complete // definition string ("create function ..."). int sp_create_function(THD *, char *name, uint namelen, char *def, uint deflen, char *comment, uint commentlen, bool suid); // Drop the function 'name' from the database. int sp_drop_function(THD *, char *name, uint namelen); ``` ##### The cache: sp\_cache.h ``` /* Initialize the SP caching once at startup */ void sp_cache_init(); /* Clear the cache *cp and set *cp to NULL */ void sp_cache_clear(sp_cache **cp); /* Insert an SP to cache. If **cp points to NULL, it's set to a new cache */ void sp_cache_insert(sp_cache **cp, sp_head *sp); /* Lookup an SP in cache */ sp_head *sp_cache_lookup(sp_cache **cp, char *name, uint namelen); /* Remove an SP from cache */ void sp_cache_remove(sp_cache **cp, sp_head *sp); ``` ### The mysql.proc schema This is the [mysql.proc table](../mysqlproc-table/index) used in [MariaDB 10.4](../what-is-mariadb-104/index): ``` CREATE TABLE `proc` ( `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `name` char(64) NOT NULL DEFAULT '', `type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL, `specific_name` char(64) NOT NULL DEFAULT '', `language` enum('SQL') NOT NULL DEFAULT 'SQL', `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', `param_list` blob NOT NULL, `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT') NOT NULL DEFAULT '', `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `body_utf8` longblob DEFAULT NULL, `aggregate` enum('NONE','GROUP') NOT NULL DEFAULT 'NONE', PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Stored Procedures' ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Buildbot Setup for Virtual Machines - Red Hat 6 x86 Buildbot Setup for Virtual Machines - Red Hat 6 x86 =================================================== The following steps were used to create a Red Hat 6 x86 buildslave. Initial Setup ------------- ``` cd vms qemu-img create -f qcow2 vm-rhel6-x86-base.qcow2 8G kvm -m 1024 -hda vm-rhel6-x86-base.qcow2 -cdrom ../iso/red-hat/rhel-server-6.0-i386-dvd.iso -redir 'tcp:22275::22' -boot d -smp 2 -cpu qemu32,-nx -net nic,model=virtio -net user ``` When the VM boots. Go through the prompts. Re-initialize the drive, when prompted. Set the Hostname to "rhel6-x86". Configure Network, set eth0 to "Connect Automatically" Set the root password. Set partitioning type to: Use All Space Don't encrypt the partitions (just adds overhead). Select "Write Changes to Disk" on the popup that appears. Set the software set to "Virtual Host". After clicking next on the install-type page, the installation will finally start. After installation completes, click reboot. Then shutdown the VM. Serial Console Setup -------------------- ``` cd vms qemu-img create -b vm-rhel6-x86-base.qcow2 -f qcow2 vm-rhel6-x86-serial.qcow2 kvm -m 1024 -hda vm-rhel6-x86-serial.qcow2 -redir 'tcp:22275::22' -boot c -smp 2 -cpu qemu32,-nx -net nic,model=virtio -net user ``` Login as root. Add to /boot/grub/menu.lst: ``` serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=3 serial console ``` also add in menu.lst to kernel line (after removing 'quiet'): ``` console=tty0 console=ttyS0,115200n8 ``` Add login prompt on serial console: ``` cat >>/etc/inittab <<END # Serial console. S0:2345:respawn:/sbin/agetty -h -L ttyS0 19200 vt100 END ``` Create buildbot account ----------------------- With the network up and running, it's time to add a user so that we don't have to login as root all the time. ``` useradd buildbot # Password is disabled by default in Centos5. usermod -a -G wheel buildbot visudo # Uncomment the line "%wheel ALL=(ALL) NOPASSWD: ALL" # Comment out this line: # Defaults requiretty # Put in public ssh key for own account and host buildbot account. # Note that Centos5 seems to require .ssh/authorized_keys chmod go-rwx. su - buildbot mkdir .ssh chmod go-rwx .ssh # scp the key from the vm host over to .ssh/authorized_keys chmod go-rwx .ssh/authorized_keys ``` Now logout and then ssh to the VM as the buildbot user. On my local box I added the following to my /.ssh/config file to make logging in easier: ``` Host rhel6-x86 HostName localhost User buildbot IdentityFile ~/.ssh/id_rsa Port 2225 ``` With the above in place I can simply type: ``` ssh rhel6-x86 ``` ...to connect to the vm. RHN and Updates --------------- Register the system with RHN: ``` sudo rhn_register ``` Choose defaults when registering. After the process is complete: ``` sudo yum update ``` The first time you update you'll be prompted to import some GPG keys from Red Hat. The updating process may take a while, depending on the number of updates and the speed of your Internet connection. After updating shutdown so we can make more copies. ``` sudo shutdown -h now ``` Image for RPM Build ------------------- ``` qemu-img create -b vm-rhel6-x86-serial.qcow2 -f qcow2 vm-rhel6-x86-build.qcow2 kvm -m 1024 -hda vm-rhel6-x86-build.qcow2 -redir 'tcp:22275::22' -boot c -smp 2 -cpu qemu32,-nx -net nic,model=virtio -net user -nographic ``` Wait for the system to boot. Install compilers etc: ``` sudo yum groupinstall "Development Tools" sudo yum install libaio-devel openssl-devel ``` If the "Development Tools" group is not available, the following lines will install the packages from it: ``` # Mandatory Packages: sudo yum install autoconf automake binutils bison flex gcc gcc-c++ gettext sudo yum install libtool make patch pkgconfig redhat-rpm-config rpm-build # Default Packages: sudo yum install byacc cscope ctags cvs diffstat doxygen elfutils gcc-gfortran sudo yum install git indent intltool patchutils rcs subversion swig systemtap # Optional Packages: sudo yum install ElectricFence ant babel bzr chrpath cmake compat-gcc-34 sudo yum install compat-gcc-34-c++ compat-gcc-34-g77 dejagnu expect gcc-gnat sudo yum install gcc-java gcc-objc gcc-objc++ imake jpackage-utils libstdc++-docs sudo yum install mercurial mod_dav_svn nasm perltidy python-docs rpmdevtools sudo yum install rpmlint systemtap-sdt-devel systemtap-server ``` Other packages to install: ``` sudo yum install gperf readline-devel ncurses-devel zlib-devel perl perl\(DBI\) ``` Create rpm directories and download 5.0 rpm for shared-compat: ``` sudo mkdir -vp /usr/src/redhat/SOURCES /usr/src/redhat/SPECS /usr/src/redhat/RPMS /usr/src/redhat/SRPMS sudo mkdir -vp /srv/shared/yum/CentOS/5/i386/RPMS/ cd /srv/shared/yum/CentOS/5/i386/RPMS/ sudo wget http://mirror.ourdelta.org/yum/CentOS/5/i386/RPMS/MySQL-OurDelta-shared-5.0.87.d10-65.el5.i386.rpm ``` Image for install/test ---------------------- ``` qemu-img create -b vm-rhel6-x86-serial.qcow2 -f qcow2 vm-rhel6-x86-install.qcow2 kvm -m 1024 -hda vm-rhel6-x86-install.qcow2 -redir 'tcp:22275::22' -boot c -smp 2 -cpu qemu32,-nx -net nic,model=virtio -net user -nographic ``` Install extra dependencies: ``` sudo yum install perl perl\(DBI\) ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb LTRIM LTRIM ===== Syntax ------ ``` LTRIM(str) ``` Description ----------- Returns the string `str` with leading space characters removed. Returns NULL if given a NULL argument. If the result is empty, returns either an empty string, or, from [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/) with [SQL\_MODE=Oracle](../sql_modeoracle-from-mariadb-103/index), NULL. The Oracle mode version of the function can be accessed outside of Oracle mode by using `LTRIM_ORACLE` as the function name. Examples -------- ``` SELECT QUOTE(LTRIM(' MariaDB ')); +-------------------------------+ | QUOTE(LTRIM(' MariaDB ')) | +-------------------------------+ | 'MariaDB ' | +-------------------------------+ ``` Oracle mode version from [MariaDB 10.3.6](https://mariadb.com/kb/en/mariadb-1036-release-notes/): ``` SELECT LTRIM(''),LTRIM_ORACLE(''); +-----------+------------------+ | LTRIM('') | LTRIM_ORACLE('') | +-----------+------------------+ | | NULL | +-----------+------------------+ ``` See Also -------- * [RTRIM](../rtrim/index) - trailing spaces removed * [TRIM](../trim/index) - removes all given prefixes or suffixes Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb QA - Aria Recovery QA - Aria Recovery ================== General Principles ------------------ Recovery is tested via the [RQG](http://github.com/RQG/RQG-Documentation/wiki/Category:RandomQueryGenerator), which provides a random workload against the server, and then uses kill -9 to kill the process. After that, recovery is attempted both by using `maria_read_log` and by restarting the `mysqld` process. Once the server has started up, the tables are verified in various ways, including `ALTER|OPTIMIZE|ANALYZE|REPAIR TABLE` as well `SELECT` queries that read the table back and forth using various access methods. A combinations `.CC` file named `lp:randgen/conf/engines/maria/maria_recovery.cc` is used to define various `mysql` options and RQG parameters that are relavant to recovery. Then, RQG's `combinations.pl` script is used to run hundreds of individual test runs. Each run uses a random permutation from the settings in the `.CC` file in order to generate a unique workload that is then validated via the `Recovery` RQG Reporter. Individual tests ---------------- The following are the individual tests or test runs that must be completed or created in order to ensure that Aria recovery is solid. ### Standard kill -9 testing **Done 2011-02-28** The standard `conf/engines/maria/maria_recovery.cc` passes with no failures when run with hundreds of trials. ### Testing with small block sizes On hold pending 2 bug fixes related to --maria-block-size=1K and --maria-block-size=2K ### Testing with small page cache size **Done 2011-03-04** Completed 400 rounds with ``` '--mysqld=--maria-block-size=4K --mysqld=--maria-pagecache-buffer-size=128K', '--mysqld=--maria-block-size=16K --mysqld=--maria-pagecache-buffer-size=256K', '--mysqld=--maria-block-size=32K --mysqld=--maria-pagecache-buffer-size=512K' ``` two pre-recovery crashes were filed, no recovery issues. ### Killing and restarting the recovery process itself **In Progress** The AriaDoubleRecovery reporter currently attempts doble recovery via maria\_read\_log. The first invocation of maria\_read\_log is killed halfway through the process and the second invocation is left to complete the recovery. Future testing will involve doing the same with the mysqld server in place of maria\_read\_log. ### Another realistic workload The usefullness of the SMF workload, derived from the SimpleMachines forum application means that another such workload is required in order to make sure no residual recovery bugs remain. Hopefully something can be cooked up using Wikipedia so that longer fields and blobs are exercised. ### Transactional consistency A transactional grammar that simulates transactions using LOCK TABLEs is required. The RecoveryConsistency Reporter can then be used to validate that no partial transactions appear in the database after recovery. See also -------- * [RQG Performance Comparisons](../rqg-performance-comparisons/index) * [RQG Extensions for MariaDB Features](../rqg-extensions-for-mariadb-features/index) * [Optimizer Quality](../optimizer-quality/index) * [QA Tools](../qa-tools/index) * [Worklog Quality Checklist Template](../worklog-quality-checklist-template/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb PointFromWKB PointFromWKB ============ A synonym for [ST\_PointFromWKB](../st_pointfromwkb/index). Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb CONNECT Table Types - Catalog Tables CONNECT Table Types - Catalog Tables ==================================== A catalog table is one that returns information about another table, or data source. It is similar to what MariaDB commands such as `DESCRIBE` or `SHOW` do. Applied to local tables, this just duplicates what these commands do, with the noticeable difference that they are tables and can be used inside queries as joined tables or inside sub-selects. But their main interest is to enable querying the structure of external tables that cannot be directly queried with description commands. Let's see an example: Suppose we want to access the tables from a Microsoft Access database as an ODBC type table. The first information we must obtain is the list of tables existing in this data source. To get it, we will create a catalog table that will return it extracted from the result set of the SQLTables ODBC function: ``` create table tabinfo ( table_name varchar(128) not null, table_type varchar(16) not null) engine=connect table_type=ODBC catfunc=tables Connection='DSN=MS Access Database;DBQ=C:/Program Files/Microsoft Office/Office/1033/FPNWIND.MDB;'; ``` The SQLTables function returns a result set having the following columns: | Field | Data Type | Null | Info Type | Flag Value | | --- | --- | --- | --- | --- | | Table\_Cat | char(128) | NO | FLD\_CAT | 17 | | Table\_Name | char(128) | NO | FLD\_SCHEM | 18 | | Table\_Name | char(128) | NO | FLD\_NAME | 1 | | Table\_Type | char(16) | NO | FLD\_TYPE | 2 | | Remark | char(128) | NO | FLD\_REM | 5 | **Note:** The Info Type and Flag Value are CONNECT interpretations of this result. Here we could have omitted the column definitions of the catalog table or, as in the above example, chose the columns returning the name and type of the tables. If specified, the columns must have the exact name of the corresponding SQLTables result set, or be given a different name with the matching flag value specification. (The Table\_Type can be TABLE, SYSTEM TABLE, VIEW, etc.) For instance, to get the tables we want to use we can ask: ``` select table_name from tabinfo where table_type = 'TABLE'; ``` This will return: | table\_name | | --- | | Categories | | Customers | | Employees | | Products | | Shippers | | Suppliers | Now we want to create the table to access the CUSTOMERS table. Because CONNECT can retrieve the column description of ODBC tables, it not necessary to specify them in the create table statement: ``` create table Customers engine=connect table_type=ODBC Connection='DSN=MS Access Database;DBQ=C:/Program Files/Microsoft Office/Office/1033/FPNWIND.MDB;'; ``` However, if we prefer to specify them (to eventually modify them) we must know what the column definitions of that table are. We can get this information with a catalog table. This is how to do it: ``` create table custinfo engine=connect table_type=ODBC tabname=customers catfunc=columns Connection='DSN=MS Access Database;DBQ=C:/Program Files/Microsoft Office/Office/1033/FPNWIND.MDB;'; ``` Alternatively it is possible to specify what columns of the catalog table we want: ``` create table custinfo ( column_name char(128) not null, type_name char(20) not null, length int(10) not null flag=7, prec smallint(6) not null flag=9) nullable smallint(6) not null) engine=connect table_type=ODBC tabname=customers catfunc=columns Connection='DSN=MS Access Database;DBQ=C:/Program Files/Microsoft Office/Office/1033/FPNWIND.MDB;'; ``` To get the column info: ``` select * from custinfo; ``` which results in this table: | column\_name | type\_name | length | prec | nullable | | --- | --- | --- | --- | --- | | CustomerID | VARCHAR | 5 | 0 | 1 | | CompanyName | VARCHAR | 40 | 0 | 1 | | ContactName | VARCHAR | 30 | 0 | 1 | | ContactTitle | VARCHAR | 30 | 0 | 1 | | Address | VARCHAR | 60 | 0 | 1 | | City | VARCHAR | 15 | 0 | 1 | | Region | VARCHAR | 15 | 0 | 1 | | PostalCode | VARCHAR | 10 | 0 | 1 | | Country | VARCHAR | 15 | 0 | 1 | | Phone | VARCHAR | 24 | 0 | 1 | | Fax | VARCHAR | 24 | 0 | 1 | Now you can create the CUSTOMERS table as: ``` create table Customers ( CustomerID varchar(5), CompanyName varchar(40), ContactName varchar(30), ContactTitle varchar(30), Address varchar(60), City varchar(15), Region varchar(15), PostalCode varchar(10), Country varchar(15), Phone varchar(24), Fax varchar(24)) engine=connect table_type=ODBC block_size=10 Connection='DSN=MS Access Database;DBQ=C:/Program Files/Microsoft Office/Office/1033/FPNWIND.MDB;'; ``` Let us explain what we did here: First of all, the creation of the catalog table. This table returns the result set of an ODBC SQLColumns function sent to the ODBC data source. Columns functions always return a data set having some of the following columns, depending on the table type: | Field | Data Type | Null | Info Type | Flag Value | Returned by | | --- | --- | --- | --- | --- | --- | | Table\_Cat\* | char(128) | NO | FLD\_CAT | 17 | ODBC, JDBC | | Table\_Schema\* | char(128) | NO | FLD\_SCEM | 18 | ODBC, JDBC | | Table\_Name | char(128) | NO | FLD\_TABNAME | 19 | ODBC, JDBC | | Column\_Name | char(128) | NO | FLD\_NAME | 1 | ALL | | Data\_Type | smallint(6) | NO | FLD\_TYPE | 2 | ALL | | Type\_Name | char(30) | NO | FLD\_TYPENAME | 3 | ALL | | Column\_Size\* | int(10) | NO | FLD\_PREC | 4 | ALL | | Buffer\_Length\* | int(10) | NO | FLD\_LENGTH | 5 | ALL | | Decimal\_Digits\* | smallint(6) | NO | FLD\_SCALE | 6 | ALL | | Radix | smallint(6) | NO | FLD\_RADIX | 7 | ODBC, JDBC, MYSQL | | Nullable | smallint(6) | NO | FLD\_NULL | 8 | ODBC, JDBC, MYSQL | | Remarks | char(255) | NO | FLD\_REM | 9 | ODBC, JDBC, MYSQL | | Collation | char(32) | NO | FLD\_CHARSET | 10 | MYSQL | | Key | char(4) | NO | FLD\_KEY | 11 | MYSQL | | Default\_value | N.A. | | FLD\_DEFAULT | 12 | | | Privilege | N.A. | | FLD\_PRIV | 13 | | | Date\_fmt | char(32) | NO | FLD\_DATEFMT | 15 | MYSQL | | Xpath/Jpath | Varchar(256) | NO | FLD\_FORMAT | 16 | XML/JSON | '\*': These names have changed since earlier versions of CONNECT. **Note:** ALL includes the ODBC, JDBC, MYSQL, DBF, CSV, PROXY, TBL, XML, JSON, XCOL, and WMI table types. More could be added later. We chose among these columns the ones that were useful for our create statement, using the flag value when we gave them a different name (case insensitive). The options used in this definition are the same as the one used later for the actual CUSTOMERS data tables except that: 1. The `TABNAME` option is mandatory here to specify what the queried table name is. 2. The `CATFUNC` option was added both to indicate that this is a catalog table, and to specify that we want column information. **Note:** If the `TABNAME` option had not been specified, this table would have returned the columns of all the tables defined in the connected data source. Currently the available `CATFUNC` are: | Function | Specified as: | Applies to table types: | | --- | --- | --- | | FNC\_TAB | **tab**les | ODBC, JDBC, MYSQL | | FNC\_COL | **col**umns | ODBC, JDBC, MYSQL, DBF, CSV, PROXY, XCOL, TBL, WMI | | FNC\_DSN | **datasource**s**dsn****sqldatasource**s | ODBC | | FNC\_DRIVER | **driver**s**sqldriver**s | ODBC, JDBC | **Note:** Only the bold part of the function name specification is required. The `DATASOURCE` and `DRIVERS` functions respectively return the list of available data sources and ODBC drivers available on the system. The SQLDataSources function returns a result set having the following columns: | Field | Data Type | Null | Info Type | Flag value | | --- | --- | --- | --- | --- | | Name | varchar(256) | NO | FLD\_NAME | 1 | | Description | varchar(256) | NO | FLD\_REM | 9 | To get the data source, you can do for instance: ``` create table datasources ( engine=CONNECT table_type=ODBC catfunc=DSN; ``` The SQLDrivers function returns a result set having the following columns: | Field | Type | Null | Info Type | Flag value | | --- | --- | --- | --- | --- | | Description | varchar(128) | YES | FLD\_NAME | 1 | | Attributes | varchar(256) | YES | FLD\_REM | 9 | You can get the driver list with: ``` create table drivers engine=CONNECT table_type=ODBC catfunc=drivers; ``` ### Another example, WMI table To create a catalog table returning the attribute names of a WMI class, use the same table options as the ones used with the normal WMI table plus the additional option ‘catfunc=columns’. If specified, the columns of such a catalog table can be chosen among the following: | Name | Type | Flag | Description | | --- | --- | --- | --- | | Column\_Name | CHAR | 1 | The name of the property | | Data\_Type | INT | 2 | The SQL data type | | Type\_Name | CHAR | 3 | The SQL type name | | Column\_Size | INT | 4 | The field length in characters | | Buffer\_Length | INT | 5 | Depends on the coding | | Scale | INT | 6 | Depends on the type | If you wish to use a different name for a column, set the Flag column option. For example, before creating the "csprod" table, you could have created the info table: ``` create table CSPRODCOL ( Column_name char(64) not null, Data_Type int(3) not null, Type_name char(16) not null, Length int(6) not null, Prec int(2) not null flag=6) engine=CONNECT table_type='WMI' catfunc=col; ``` Now the query: ``` select * from csprodcol; ``` will display the result: | Column\_name | Data\_Type | Type\_name | Length | Prec | | --- | --- | --- | --- | --- | | Caption | 1 | CHAR | 255 | 1 | | Description | 1 | CHAR | 255 | 1 | | IdentifyingNumber | 1 | CHAR | 255 | 1 | | Name | 1 | CHAR | 255 | 1 | | SKUNumber | 1 | CHAR | 255 | 1 | | UUID | 1 | CHAR | 255 | 1 | | Vendor | 1 | CHAR | 255 | 1 | | Version | 1 | CHAR | 255 | 1 | This can help to define the columns of the matching normal table. **Note 1:** The column length, for the Info table as well as for the normal table, can be chosen arbitrarily, it just must be enough to contain the returned information. **Note 2:** The Scale column returns 1 for text columns (meaning case insensitive); 2 for float and double columns; and 0 for other numeric columns. ### Catalog Table result size limit Because catalog tables are processed like the information retrieved by “Discovery” when table columns are not specified in a Create Table statement, their result set is entirely retrieved and memory allocated. By default, this allocation is done for a maximum return line number of: | Catfunc | Max lines | | --- | --- | | Drivers | 256 | | Data Sources | 512 | | Columns | 20,000 | | Tables | 10,000 | When the number of lines retrieved for a table is more than this maximum, a warning is issued by CONNECT. This is mainly prone to occur with columns (and also tables) with some data sources having many tables when the table name is not specified. If this happens, it is possible to increase the default limit using the MAXRES option, for instance: ``` create table allcols engine=connect table_type=odbc connection='DSN=ORACLE_TEST;UID=system;PWD=manager' option_list='Maxres=110000' catfunc=columns; ``` Indeed, because the entire table result is memorized before the query is executed; the returned value would be limited even on a query such as: ``` select count(*) from allcols; ``` Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb Application-Time Periods Application-Time Periods ======================== **MariaDB starting with [10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/)**Support for application-time period-versioning was added in [MariaDB 10.4.3](https://mariadb.com/kb/en/mariadb-1043-release-notes/). Extending [system-versioned tables](../system-versioned-tables/index), [MariaDB 10.4](../what-is-mariadb-104/index) supports application-time period tables. Time periods are defined by a range between two temporal columns. The columns must be of the same [temporal data type](../date-and-time-data-types/index), i.e. [DATE](../date/index), [TIMESTAMP](../timestamp/index) or [DATETIME](../datetime/index) ([TIME](../time/index) and [YEAR](../year-data-type/index) are not supported), and of the same width. Using time periods implicitly defines the two columns as `NOT NULL`. It also adds a constraint to check whether the first value is less than the second value. The constraint is invisible to [SHOW CREATE TABLE](../show-create-table/index) statements. The name of this constraint is prefixed by the time period name, to avoid conflict with other constraints. ### Creating Tables with Time Periods To create a table with a time period, use a [CREATE TABLE](../create-table/index) statement with the `PERIOD` table option. ``` CREATE TABLE t1( name VARCHAR(50), date_1 DATE, date_2 DATE, PERIOD FOR date_period(date_1, date_2)); ``` This creates a table with a `time_period` period and populates the table with some basic temporal values. Examples are available in the MariaDB Server source code, at `mysql-test/suite/period/r/create.result`. ### Adding and Removing Time Periods The [ALTER TABLE](../alter-table/index) statement now supports syntax for adding and removing time periods from a table. To add a period, use the `ADD PERIOD` clause. For example: ``` CREATE OR REPLACE TABLE rooms ( room_number INT, guest_name VARCHAR(255), checkin DATE, checkout DATE ); ALTER TABLE rooms ADD PERIOD FOR p(checkin,checkout); ``` To remove a period, use the `DROP PERIOD` clause: ``` ALTER TABLE rooms DROP PERIOD FOR p; ``` Both `ADD PERIOD` and `DROP PERIOD` clauses include an option to handle whether the period already exists: ``` ALTER TABLE rooms ADD PERIOD IF NOT EXISTS FOR p(checkin,checkout); ALTER TABLE rooms DROP PERIOD IF EXISTS FOR p; ``` ### Deletion by Portion You can also remove rows that fall within certain time periods. When MariaDB executes a `DELETE FOR PORTION` statement, it removes the row: * When the row period falls completely within the delete period, it removes the row. * When the row period overlaps the delete period, it shrinks the row, removing the overlap from the first or second row period value. * When the delete period falls completely within the row period, it splits the row into two rows. The first row runs from the starting row period to the starting delete period. The second runs from the ending delete period to the ending row period. To test this, first populate the table with some data to operate on: ``` CREATE TABLE t1( name VARCHAR(50), date_1 DATE, date_2 DATE, PERIOD FOR date_period(date_1, date_2)); INSERT INTO t1 (name, date_1, date_2) VALUES ('a', '1999-01-01', '2000-01-01'), ('b', '1999-01-01', '2018-12-12'), ('c', '1999-01-01', '2017-01-01'), ('d', '2017-01-01', '2019-01-01'); SELECT * FROM t1; +------+------------+------------+ | name | date_1 | date_2 | +------+------------+------------+ | a | 1999-01-01 | 2000-01-01 | | b | 1999-01-01 | 2018-12-12 | | c | 1999-01-01 | 2017-01-01 | | d | 2017-01-01 | 2019-01-01 | +------+------------+------------+ ``` Then, run the `DELETE FOR PORTION` statement: ``` DELETE FROM t1 FOR PORTION OF date_period FROM '2001-01-01' TO '2018-01-01'; Query OK, 3 rows affected (0.028 sec) SELECT * FROM t1 ORDER BY name; +------+------------+------------+ | name | date_1 | date_2 | +------+------------+------------+ | a | 1999-01-01 | 2000-01-01 | | b | 1999-01-01 | 2001-01-01 | | b | 2018-01-01 | 2018-12-12 | | c | 1999-01-01 | 2001-01-01 | | d | 2018-01-01 | 2019-01-01 | +------+------------+------------+ ``` Here: * *a* is unchanged, as the range falls entirely out of the specified portion to be deleted. * *b*, with values ranging from 1999 to 2018, is split into two rows, 1999 to 2000 and 2018-01 to 2018-12. * *c*, with values ranging from 1999 to 2017, where only the upper value falls within the portion to be deleted, has been shrunk to 1999 to 2001. * *d*, with values ranging from 2017 to 2019, where only the lower value falls within the portion to be deleted, has been shrunk to 2018 to 2019. The `DELETE FOR PORTION` statement has the following restrictions * The `FROM...TO` clause must be constant * Multi-delete is not supported If there are `DELETE` or `INSERT` triggers, it works as follows: any matched row is deleted, and then one or two rows are inserted. If the record is deleted completely, nothing is inserted. ### Updating by Portion The [UPDATE](../update/index) syntax now supports `UPDATE FOR PORTION`, which modifies rows based on their occurrence in a range: To test it, first populate the table with some data: ``` TRUNCATE t1; INSERT INTO t1 (name, date_1, date_2) VALUES ('a', '1999-01-01', '2000-01-01'), ('b', '1999-01-01', '2018-12-12'), ('c', '1999-01-01', '2017-01-01'), ('d', '2017-01-01', '2019-01-01'); SELECT * FROM t1; +------+------------+------------+ | name | date_1 | date_2 | +------+------------+------------+ | a | 1999-01-01 | 2000-01-01 | | b | 1999-01-01 | 2018-12-12 | | c | 1999-01-01 | 2017-01-01 | | d | 2017-01-01 | 2019-01-01 | +------+------------+------------+ ``` Then run the update: ``` UPDATE t1 FOR PORTION OF date_period FROM '2000-01-01' TO '2018-01-01' SET name = CONCAT(name,'_original'); SELECT * FROM t1 ORDER BY name; +------------+------------+------------+ | name | date_1 | date_2 | +------------+------------+------------+ | a | 1999-01-01 | 2000-01-01 | | b | 1999-01-01 | 2000-01-01 | | b | 2018-01-01 | 2018-12-12 | | b_original | 2000-01-01 | 2018-01-01 | | c | 1999-01-01 | 2000-01-01 | | c_original | 2000-01-01 | 2017-01-01 | | d | 2018-01-01 | 2019-01-01 | | d_original | 2017-01-01 | 2018-01-01 | +------------+------------+------------+ ``` * *a* is unchanged, as the range falls entirely out of the specified portion to be deleted. * *b*, with values ranging from 1999 to 2018, is split into two rows, 1999 to 2000 and 2018-01 to 2018-12. * *c*, with values ranging from 1999 to 2017, where only the upper value falls within the portion to be deleted, has been shrunk to 1999 to 2001. * *d*, with values ranging from 2017 to 2019, where only the lower value falls within the portion to be deleted, has been shrunk to 2018 to 2019. * Original rows affected by the update have "\_original" appended to the name. The `UPDATE FOR PORTION` statement has the following limitations: * The operation cannot modify the two temporal columns used by the time period * The operation cannot reference period values in the `SET` expression * `FROM...TO` expressions must be constant ### WITHOUT OVERLAPS **MariaDB starting with [10.5.3](https://mariadb.com/kb/en/mariadb-1053-release-notes/)**[MariaDB 10.5](../what-is-mariadb-105/index) introduced a new clause, `WITHOUT OVERLAPS`, which allows one to create an index specifying that application time periods should not overlap. An index constrained by `WITHOUT OVERLAPS` is required to be either a primary key or a unique index. Take the following example, an application time period table for a booking system: ``` CREATE OR REPLACE TABLE rooms ( room_number INT, guest_name VARCHAR(255), checkin DATE, checkout DATE, PERIOD FOR p(checkin,checkout) ); INSERT INTO rooms VALUES (1, 'Regina', '2020-10-01', '2020-10-03'), (2, 'Cochise', '2020-10-02', '2020-10-05'), (1, 'Nowell', '2020-10-03', '2020-10-07'), (2, 'Eusebius', '2020-10-04', '2020-10-06'); ``` Our system is not intended to permit overlapping bookings, so the fourth record above should not have been inserted. Using `WITHOUT OVERLAPS` in a unique index (in this case based on a combination of room number and the application time period) allows us to specify this constraint in the table definition. ``` CREATE OR REPLACE TABLE rooms ( room_number INT, guest_name VARCHAR(255), checkin DATE, checkout DATE, PERIOD FOR p(checkin,checkout), UNIQUE (room_number, p WITHOUT OVERLAPS) ); INSERT INTO rooms VALUES (1, 'Regina', '2020-10-01', '2020-10-03'), (2, 'Cochise', '2020-10-02', '2020-10-05'), (1, 'Nowell', '2020-10-03', '2020-10-07'), (2, 'Eusebius', '2020-10-04', '2020-10-06'); ERROR 1062 (23000): Duplicate entry '2-2020-10-06-2020-10-04' for key 'room_number' ``` ### Further Examples The implicit change from NULL to NOT NULL: ``` CREATE TABLE `t2` ( `id` int(11) DEFAULT NULL, `d1` datetime DEFAULT NULL, `d2` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE t2 ADD PERIOD FOR p(d1,d2); SHOW CREATE TABLE t2\G *************************** 1. row *************************** Table: t2 Create Table: CREATE TABLE `t2` ( `id` int(11) DEFAULT NULL, `d1` datetime NOT NULL, `d2` datetime NOT NULL, PERIOD FOR `p` (`d1`, `d2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ``` Due to this constraint, trying to add a time period where null data already exists will fail. ``` CREATE OR REPLACE TABLE `t2` ( `id` int(11) DEFAULT NULL, `d1` datetime DEFAULT NULL, `d2` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO t2(id) VALUES(1); ALTER TABLE t2 ADD PERIOD FOR p(d1,d2); ERROR 1265 (01000): Data truncated for column 'd1' at row 1 ``` ### See Also * [System-versioned Tables](../system-versioned-tables/index) * [Bitemporal Tables](../bitemporal-tables/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb Storage-Engine Independent Column Compression Storage-Engine Independent Column Compression ============================================= **MariaDB starting with [10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/)**Storage-engine independent support for column compression was introduced in [MariaDB 10.3.2](https://mariadb.com/kb/en/mariadb-1032-release-notes/) Storage-engine independent column compression enables [TINYBLOB](../tinyblob/index), [BLOB](../blob/index), [MEDIUMBLOB](../mediumblob/index), [LONGBLOB](../longblob/index), [TINYTEXT](../tinytext/index), [TEXT](../text/index), [MEDIUMTEXT](../mediumtext/index), [LONGTEXT](../longtext/index), [VARCHAR](../varchar/index) and [VARBINARY](../varbinary/index) columns to be compressed. This is performed by means of a new COMPRESSED [column attribute](../create-table/index#column-and-index-definitions): `COMPRESSED[=<compression_method>]` Currently the only supported compression method is `zlib`. ### Field Length Compatibility When using the `COMPRESSED` attribute, note that FIELD LENGTH is reduced by 1; for example, a BLOB has a length of 65535, while BLOB COMPRESSED has 65535-1. See [MDEV-15592](https://jira.mariadb.org/browse/MDEV-15592). ### New System Variables #### `column_compression_threshold` * **Description:** Minimum column data length eligible for compression. * **Commandline:** `--column-compression-threshold=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `100` * **Range:** `0` to `4294967295` --- #### `column_compression_zlib_level` * **Description:** zlib compression level (1 gives best speed, 9 gives best compression). * **Commandline:** `--column-compression-zlib-level=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `numeric` * **Default Value:** `6` * **Range:** `1` to `9` --- #### `column_compression_zlib_strategy` * **Description:** The strategy parameter is used to tune the compression algorithm. Use the value `DEFAULT_STRATEGY` for normal data, `FILTERED` for data produced by a filter (or predictor), `HUFFMAN_ONLY` to force Huffman encoding only (no string match), or `RLE` to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of `FILTERED` is to force more Huffman coding and less string matching; it is somewhat intermediate between `DEFAULT_STRATEGY` and `HUFFMAN_ONLY`. `RLE` is designed to be almost as fast as `HUFFMAN_ONLY`, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. `FIXED` prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. * **Commandline:** `--column-compression-zlib-strategy=#` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `enum` * **Default Value:** `DEFAULT_STRATEGY` * **Valid Values:** `DEFAULT_STRATEGY`, `FILTERED`, `HUFFMAN_ONLY`, `RLE`, `FIXED` --- #### `column_compression_zlib_wrap` * **Description:** If set to `1` (`0` is default), generate zlib header and trailer and compute adler32 check value. It can be used with storage engines that don't provide data integrity verification to detect data corruption. * **Commandline:** `--column-compression-zlib-wrap{=0|1}` * **Scope:** Global, Session * **Dynamic:** Yes * **Data Type:** `boolean` * **Default Value:** `OFF` --- ### New Status Variables #### `Column_compressions` * **Description:** Incremented each time field data is compressed. * **Scope:** Global, Session * **Data Type:** `numeric` --- #### `Column_decompressions` * **Description:** Incremented each time field data is decompressed. * **Scope:** Global, Session * **Data Type:** `numeric` --- ### Limitations * The only supported method currently is zlib. * The [CSV](../csv/index) storage engine stores data uncompressed on-disk even if the COMPRESSED attribute is present. * It is not possible to create indexes over compressed columns. ### Comparison with InnoDB Page Compression Storage-independent column compression is different to [InnoDB Page Compression](../innodb-page-compression/index) in a number of ways. * It is storage engine independent, while InnoDB page compression applies to InnoDB only. * By being specific to a column, one can access non-compressed fields without the decompression overhead. * Only zlib is available, while InnoDB page compression can offer alternative compression algorithms. * It is not recommended to use multiple forms of compression over the same data. * It is intended for compressing large blobs, while InnoDB page compression is suitable for a more general case. * Columns cannot be indexed, while with InnoDB page compression indexes are possible as usual. ### Examples ``` CREATE TABLE cmp (i TEXT COMPRESSED); CREATE TABLE cmp2 (i TEXT COMPRESSED=zlib); ``` ### See Also * [InnoDB Page Compression](../innodb-page-compression/index) * [InnoDB Compressed Row Format](../innodb-compressed-row-format/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party. mariadb SHOW SLAVE STATUS SHOW SLAVE STATUS ================= Syntax ------ ``` SHOW SLAVE ["connection_name"] STATUS [FOR CHANNEL "connection_name"] SHOW REPLICA ["connection_name"] STATUS -- From MariaDB 10.5.1 ``` or ``` SHOW ALL SLAVES STATUS SHOW ALL REPLICAS STATUS -- From MariaDB 10.5.1 ``` Description ----------- This statement is to be run on a replica and provides status information on essential parameters of the [replica](../replication/index) threads. This statement requires the [SUPER](../grant/index#super) privilege, the [REPLICATION\_CLIENT](../grant/index#replication-client) privilege, or, from [MariaDB 10.5.2](https://mariadb.com/kb/en/mariadb-1052-release-notes/), the [REPLICATION SLAVE ADMIN](../grant/index#binlog-monitor) privilege, or, from [MariaDB 10.5.9](https://mariadb.com/kb/en/mariadb-1059-release-notes/), the [REPLICA MONITOR](../grant/index#replica-monitor) privilege. ### Multi-Source The `ALL` and `"connection_name"` options allow you to connect to [many primaries at the same time](../multi-source-replication/index). `ALL SLAVES` (or `ALL REPLICAS` from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)) gives you a list of all connections to the primary nodes. The rows will be sorted according to `Connection_name`. If you specify a `connection_name`, you only get the information about that connection. If `connection_name` is not used, then the name set by `default_master_connection` is used. If the connection name doesn't exist you will get an error: `There is no master connection for 'xxx'`. **MariaDB starting with [10.7.0](https://mariadb.com/kb/en/mariadb-1070-release-notes/)**The `FOR CHANNEL` keyword was added for MySQL compatibility. This is identical as using the channel\_name directly after `SHOW SLAVE`. ### Column Descriptions | Name | Description | Added | | --- | --- | --- | | Connection\_name | Name of the primary connection. Returned with `SHOW ALL SLAVES STATUS` (or `SHOW ALL REPLICAS STATUS` from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)) only. | | | Slave\_SQL\_State | State of SQL thread. Returned with `SHOW ALL SLAVES STATUS` (or `SHOW ALL REPLICAS STATUS` from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)) only. See [Slave SQL Thread States](../slave-sql-thread-states/index). | | | Slave\_IO\_State | State of I/O thread. See [Slave I/O Thread States](../slave-io-thread-states/index). | | | Master\_host | Master host that the replica is connected to. | | | Master\_user | Account user name being used to connect to the primary. | | | Master\_port | The port being used to connect to the primary. | | | Connect\_Retry | Time in seconds between retries to connect. The default is 60. The [CHANGE MASTER TO](../change-master-to/index) statement can set this. The [master-retry-count](../mysqld-options/index#-master-retry-count) option determines the maximum number of reconnection attempts. | | | Master\_Log\_File | Name of the primary [binary log](../binary-log/index) file that the I/O thread is currently reading from. | | | Read\_Master\_Log\_Pos | Position up to which the I/O thread has read in the current primary [binary log](../binary-log/index) file. | | | Relay\_Log\_File | Name of the relay log file that the SQL thread is currently processing. | | | Relay\_Log\_Pos | Position up to which the SQL thread has finished processing in the current relay log file. | | | Relay\_Master\_Log\_File | Name of the primary [binary log](../binary-log/index) file that contains the most recent event executed by the SQL thread. | | | Slave\_IO\_Running | Whether the replica I/O thread is running and connected (`Yes`), running but not connected to a primary (`Connecting`) or not running (`No`). | | | Slave\_SQL\_Running | Whether or not the SQL thread is running. | | | Replicate\_Do\_DB | Databases specified for replicating with the `[replicate\_do\_db](../replication-and-binary-log-server-system-variables/index#replicate_do_db)` option. | | | Replicate\_Ignore\_DB | Databases specified for ignoring with the `[replicate\_ignore\_db](../replication-and-binary-log-server-system-variables/index#replicate_ignore_db)` option. | | | Replicate\_Do\_Table | Tables specified for replicating with the `[replicate\_do\_table](../replication-and-binary-log-server-system-variables/index#replicate_do_table)` option. | | | Replicate\_Ignore\_Table | Tables specified for ignoring with the `[replicate\_ignore\_table](../replication-and-binary-log-server-system-variables/index#replicate_ignore_table)` option. | | | Replicate\_Wild\_Do\_Table | Tables specified for replicating with the `[replicate\_wild\_do\_table](../replication-and-binary-log-server-system-variables/index#replicate_wild_do_table)` option. | | | Replicate\_Wild\_Ignore\_Table | Tables specified for ignoring with the `[replicate\_wild\_ignore\_table](../replication-and-binary-log-server-system-variables/index#replicate_wild_ignore_table)` option. | | | Last\_Errno | Alias for `Last_SQL_Errno` (see below) | | | Last Error | Alias for `Last_SQL_Error` (see below) | | | Skip\_Counter | Number of events that a replica skips from the master, as recorded in the [sql\_slave\_skip\_counter](../replication-and-binary-log-server-system-variables/index#sql_slave_skip_counter) system variable. | | | Exec\_Master\_Log\_Pos | Position up to which the SQL thread has processed in the current master [binary log](../binary-log/index) file. Can be used to start a new replica from a current replica with the [CHANGE MASTER TO ... MASTER\_LOG\_POS](../change-master-to/index) option. | | | Relay\_Log\_Space | Total size of all relay log files combined. | | | Until\_Condition | | | | Until\_Log\_File | The `MASTER_LOG_FILE` value of the [START SLAVE UNTIL](../start-slave/index) condition. | | | Until\_Log\_Pos | The `MASTER_LOG_POS` value of the [START SLAVE UNTIL](../start-slave/index) condition. | | | Master\_SSL\_Allowed | Whether an SSL connection is permitted (`Yes`), not permitted (`No`) or permitted but without the replica having SSL support enabled (`Ignored`) | | | Master\_SSL\_CA\_File | The `MASTER_SSL_CA` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Master\_SSL\_CA\_Path | The `MASTER_SSL_CAPATH` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Master\_SSL\_Cert | The `MASTER_SSL_CERT` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Master\_SSL\_Cipher | The `MASTER_SSL_CIPHER` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Master\_SSL\_Key | The `MASTER_SSL_KEY` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Seconds\_Behind\_Master | Difference between the timestamp logged on the master for the event that the replica is currently processing, and the current timestamp on the replica. Zero if the replica is not currently processing an event. With [parallel replication](../parallel-replication/index), `seconds_behind_master` is updated only after transactions commit. | | | Master\_SSL\_Verify\_Server\_Cert | The `MASTER_SSL_VERIFY_SERVER_CERT` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Last\_IO\_Errno | [Error code](../mariadb-error-codes/index) of the most recent error that caused the I/O thread to stop (also recorded in the replica's error log). `0` means no error. [RESET SLAVE](../reset-slave/index) or [RESET MASTER](../reset-master/index) will reset this value. | | | Last\_IO\_Error | [Error message](../mariadb-error-codes/index) of the most recent error that caused the I/O thread to stop (also recorded in the replica's error log). An empty string means no error. [RESET SLAVE](../reset-slave/index) or [RESET MASTER](../reset-master/index) will reset this value. | | | Last\_SQL\_Errno | [Error code](../mariadb-error-codes/index) of the most recent error that caused the SQL thread to stop (also recorded in the replica's error log). `0` means no error. [RESET SLAVE](../reset-slave/index) or [RESET MASTER](../reset-master/index) will reset this value. | | | Last\_SQL\_Error | [Error message](../mariadb-error-codes/index) of the most recent error that caused the SQL thread to stop (also recorded in the replica's error log). An empty string means no error. [RESET SLAVE](../reset-slave/index) or [RESET MASTER](../reset-master/index) will reset this value. | | | Replicate\_Ignore\_Server\_Ids | List of [server\_ids](../replication-and-binary-log-server-system-variables/index#server_id) that are currently being ignored for replication purposes, or an empty string for none, as specified in the `IGNORE_SERVER_IDS` option of the `[CHANGE MASTER TO](../change-master-to/index#ignore_server_ids)` statement. | | | Master\_Server\_Id | The master's [server\_id](../replication-and-binary-log-server-system-variables/index#server_id) value. | | | Master\_SSL\_Crl | The `MASTER_SSL_CRL` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Master\_SSL\_Crlpath | The `MASTER_SSL_CRLPATH` option of the `[CHANGE MASTER TO](../change-master-to/index)` statement. | | | Using\_Gtid | Whether or not [global transaction ID's](../global-transaction-id/index) are being used for replication (can be `No`, `Slave_Pos`, or `Current_Pos`). | | | Gtid\_IO\_Pos | Current [global transaction ID](../global-transaction-id/index) value. | | | Retried\_transactions | Number of retried transactions for this connection. Returned with `SHOW ALL SLAVES STATUS` only. | | | Max\_relay\_log\_size | Max [relay log](../relay-log/index) size for this connection. Returned with `SHOW ALL SLAVES STATUS` only. | | | Executed\_log\_entries | How many log entries the replica has executed. Returned with `SHOW ALL SLAVES STATUS` only. | | | Slave\_received\_heartbeats | How many heartbeats we have got from the master. Returned with `SHOW ALL SLAVES STATUS` only. | | | Slave\_heartbeat\_period | How often to request a heartbeat packet from the master (in seconds). Returned with `SHOW ALL SLAVES STATUS` only. | | | Gtid\_Slave\_Pos | GTID of the last event group replicated on a replica server, for each replication domain, as stored in the [gtid\_slave\_pos](../global-transaction-id/index#gtid_slave_pos) system variable. Returned with `SHOW ALL SLAVES STATUS` only. | | | SQL\_Delay | Value specified by `MASTER_DELAY` in `[CHANGE MASTER](../change-master-to/index)` (or 0 if none). | [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) | | SQL\_Remaining\_Delay | When the replica is delaying the execution of an event due to `MASTER_DELAY`, this is the number of seconds of delay remaining before the event will be applied. Otherwise, the value is `NULL`. | [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) | | Slave\_SQL\_Running\_State | The state of the SQL driver threads, same as in `[SHOW PROCESSLIST](../show-processlist/index)`. When the replica is delaying the execution of an event due to `MASTER_DELAY`, this field displays: "`Waiting until MASTER_DELAY seconds after master executed event`". | [MariaDB 10.2.3](https://mariadb.com/kb/en/mariadb-1023-release-notes/) | | Slave\_DDL\_Groups | This status variable counts the occurrence of DDL statements. This is a replica-side counter for optimistic parallel replication. | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) | | Slave\_Non\_Transactional\_Groups | This status variable counts the occurrence of non-transactional event groups. This is a replica-side counter for optimistic parallel replication. | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) | | Slave\_Transactional\_Groups | This status variable counts the occurrence of transactional event groups. This is a replica-side counter for optimistic parallel replication. | [MariaDB 10.3.7](https://mariadb.com/kb/en/mariadb-1037-release-notes/) | ### SHOW REPLICA STATUS **MariaDB starting with [10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/)**`SHOW REPLICA STATUS` is an alias for `SHOW SLAVE STATUS` from [MariaDB 10.5.1](https://mariadb.com/kb/en/mariadb-1051-release-notes/). Examples -------- If you issue this statement using the [mysql](../mysql-client/index) client, you can use a ``\G`` statement terminator rather than a semicolon to obtain a more readable vertical layout. ``` SHOW SLAVE STATUS\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: db01.example.com Master_User: replicant Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mariadb-bin.000010 Read_Master_Log_Pos: 548 Relay_Log_File: relay-bin.000004 Relay_Log_Pos: 837 Relay_Master_Log_File: mariadb-bin.000010 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 548 Relay_Log_Space: 1497 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 101 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: No Gtid_IO_Pos: ``` ``` SHOW ALL SLAVES STATUS\G *************************** 1. row *************************** Connection_name: Slave_SQL_State: Slave has read all relay log; waiting for the slave I/O thread to update it Slave_IO_State: Waiting for master to send event Master_Host: db01.example.com Master_User: replicant Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mariadb-bin.000010 Read_Master_Log_Pos: 3608 Relay_Log_File: relay-bin.000004 Relay_Log_Pos: 3897 Relay_Master_Log_File: mariadb-bin.000010 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 3608 Relay_Log_Space: 4557 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 101 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: No Gtid_IO_Pos: Retried_transactions: 0 Max_relay_log_size: 104857600 Executed_log_entries: 40 Slave_received_heartbeats: 11 Slave_heartbeat_period: 1800.000 Gtid_Slave_Pos: 0-101-2320 ``` You can also access some of the variables directly from status variables: ``` SET @@default_master_connection="test" ; show status like "%slave%" Variable_name Value Com_show_slave_hosts 0 Com_show_slave_status 0 Com_start_all_slaves 0 Com_start_slave 0 Com_stop_all_slaves 0 Com_stop_slave 0 Rpl_semi_sync_slave_status OFF Slave_connections 0 Slave_heartbeat_period 1800.000 Slave_open_temp_tables 0 Slave_received_heartbeats 0 Slave_retried_transactions 0 Slave_running OFF Slaves_connected 0 Slaves_running 1 ``` See Also -------- * [MariaDB replication](../high-availability-performance-tuning-mariadb-replication/index) Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs
mariadb File Key Management Encryption Plugin File Key Management Encryption Plugin ===================================== MariaDB's [data-at-rest encryption](../data-at-rest-encryption/index) requires the use of a [key management and encryption plugin](../encryption-key-management/index). These plugins are responsible both for the management of encryption keys and for the actual encryption and decryption of data. MariaDB supports the use of [multiple encryption keys](../encryption-key-management/index#using-multiple-encryption-keys). Each encryption key uses a 32-bit integer as a key identifier. If the specific plugin supports [key rotation](../encryption-key-management/index#key-rotation), then encryption keys can also be rotated, which creates a new version of the encryption key. The File Key Management plugin that ships with MariaDB is a [key management and encryption plugin](../encryption-key-management/index) that reads encryption keys from a plain-text file. Overview -------- The File Key Management plugin is the easiest [key management and encryption plugin](../encryption-key-management/index) to set up for users who want to use [data-at-rest encryption](../data-at-rest-encryption/index). Some of the plugin's primary features are: * It reads encryption keys from a plain-text key file. * As an extra protection mechanism, the plain-text key file can be encrypted. * It supports multiple encryption keys. * It does **not** support key rotation. * It supports two different algorithms for encrypting data. It can also serve as an example and as a starting point when developing a key management and encryption plugin with the [encryption plugin API](../encryption-plugin-api/index). Installing the File Key Management Plugin's Package --------------------------------------------------- The File Key Management plugin is included in MariaDB packages as the `file_key_management.so` or `file_key_management.dll` shared library. The shared library is in the main server package, so no additional package installations are necessary. Installing the Plugin --------------------- Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. The plugin can be installed by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options. This can be specified as a command-line argument to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... plugin_load_add = file_key_management ``` Uninstalling the Plugin ----------------------- Before you uninstall the plugin, you should ensure that [data-at-rest encryption](../data-at-rest-encryption/index) is completely disabled, and that MariaDB no longer needs the plugin to decrypt tables or other files. You can uninstall the plugin dynamically by executing `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)`. For example: ``` UNINSTALL SONAME 'file_key_management'; ``` If you installed the plugin by providing the `[--plugin-load](../mysqld-options/index#-plugin-load)` or the `[--plugin-load-add](../mysqld-options/index#-plugin-load-add)` options in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index), then those options should be removed to prevent the plugin from being loaded the next time the server is restarted. Creating the Key File --------------------- In order to encrypt your tables with encryption keys using the File Key Management plugin, you first need to create the file that contains the encryption keys. The file needs to contain two pieces of information for each encryption key. First, each encryption key needs to be identified with a 32-bit integer as the key identifier. Second, the encryption key itself needs to be provided in hex-encoded form. These two pieces of information need to be separated by a semicolon. For example, the file is formatted in the following way: ``` <encryption_key_id1>;<hex-encoded_encryption_key1> <encryption_key_id2>;<hex-encoded_encryption_key2> ``` You can also optionally encrypt the key file to make it less accessible from the file system. That is explained further in the section below. The File Key Management plugin uses [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) to encrypt data, which supports 128-bit, 192-bit, and 256-bit encryption keys. Therefore, the plugin also supports 128-bit, 192-bit, and 256-bit encryption keys. You can generate random encryption keys using the `[openssl rand](https://www.openssl.org/docs/man1.1.1/man1/rand.html)` command. For example, to create a random 256-bit (32-byte) encryption key, you would run the following command: ``` $ openssl rand -hex 32 a7addd9adea9978fda19f21e6be987880e68ac92632ca052e5bb42b1a506939a ``` The key file still needs to have a key identifier for each encryption key added to the beginning of each line. Key identifiers do not need to be contiguous. For example, to append three new encryption keys to a new key file, you could execute the following: ``` $ (echo -n "1;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile $ (echo -n "2;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile $ (echo -n "100;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile ``` The new key file would look something like the following after this step: ``` 1;a7addd9adea9978fda19f21e6be987880e68ac92632ca052e5bb42b1a506939a 2;49c16acc2dffe616710c9ba9a10b94944a737de1beccb52dc1560abfdd67388b 100;8db1ee74580e7e93ab8cf157f02656d356c2f437d548d5bf16bf2a56932954a3 ``` The key identifiers give you a way to reference the encryption keys from MariaDB. In the example above, you could reference these encryption keys using the key identifiers `1`, `2` or `100` with the `[ENCRYPTION\_KEY\_ID](../create-table/index#encryption_key_id)` table option or with system variables such as `[innodb\_default\_encryption\_key\_id](../innodb-system-variables/index#innodb_default_encryption_key_id)`. You do not necessarily need multiple encryption keys--the encryption key with the key identifier `1` is the only mandatory encryption key. ### Configuring the Path to an Unencrypted Key File If the key file is unencrypted, then the File Key Management plugin only requires the `[file\_key\_management\_filename](#file_key_management_filename)` system variable to be configured. This system variable can be specified as command-line arguments to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... loose_file_key_management_filename = /etc/mysql/encryption/keyfile ``` Note that the `[loose](../mysqld-options/index#-loose-)` option prefix is specified. This option prefix is used in case the plugin hasn't been installed yet. Encrypting the Key File ----------------------- By enabling the File Key Management plugin and setting the appropriate path on the `[file\_key\_management\_filename](#file_key_management_filename)` system variable, you can begin using the plugin to manage your encryption keys. But, there is a security risk in doing so, given that the keys are stored in plain text on your system. You can reduce this exposure using file permissions, but it's better to encrypt the whole key file to further restrict access. There are some important details to keep in mind about encrypting the key file, such as: * The only algorithm that MariaDB currently supports to encrypt the key file is [Cipher Block Chaining (CBC)](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CBC) mode of [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard). * The encryption key size can be 128-bits, 192-bits, or 256-bits. * The encryption key is created from the [SHA-1](https://en.wikipedia.org/wiki/SHA-1) hash of the encryption password. * The encryption password has a max length of 256 characters. You can generate a random encryption password using the `[openssl rand](https://www.openssl.org/docs/man1.1.1/man1/rand.html)` command. For example, to create a random 256 character encryption password, you could execute the following: ``` $ sudo openssl rand -hex 128 > /etc/mysql/encryption/keyfile.key ``` You can encrypt the key file using the `[openssl enc](https://www.openssl.org/docs/man1.1.1/man1/enc.html)` command. For example, to encrypt the key file with the encryption password created in the previous step, you could execute the following: ``` $ sudo openssl enc -aes-256-cbc -md sha1 \ -pass file:/etc/mysql/encryption/keyfile.key \ -in /etc/mysql/encryption/keyfile \ -out /etc/mysql/encryption/keyfile.enc ``` Running this command reads the unencrypted `keyfile` file created above and creates a new encrypted `keyfile.enc` file, using the encryption password stored in `keyfile.key`. Once you've finished preparing your system, you can delete the unencrypted `keyfile` file, as it's no longer necessary. ### Configuring the Path to an Encrypted Key File If the key file is encrypted, then the File Key Management plugin requires both the `[file\_key\_management\_filename](#file_key_management_filename)` and the `[file\_key\_management\_filekey](#file_key_management_filekey)` system variables to be configured. The `[file\_key\_management\_filekey](#file_key_management_filekey)` system variable can be provided in two forms: * It can be the actual plain-text encryption password. This is not recommended, since the plain-text encryption password would be visible in the output of the `[SHOW VARIABLES](../show-variables/index)` statement. * If it is prefixed with `FILE:`, then it can be a path to a file that contains the plain-text encryption password. These system variables can be specified as command-line arguments to `[mysqld](../mysqld-options/index)` or they can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... loose_file_key_management_filename = /etc/mysql/encryption/keyfile.enc loose_file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key ``` Note that the `[loose](../mysqld-options/index#-loose-)` option prefix is specified. This option prefix is used in case the plugin hasn't been installed yet. Choosing an Encryption Algorithm -------------------------------- The File Key Management plugin currently supports two encryption algorithms for encrypting data: `AES_CBC` and `AES_CTR`. Both of these algorithms use [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) in different modes. AES uses 128-bit blocks, and supports 128-bit, 192-bit, and 256-bit keys. The modes are: * The `AES_CBC` mode uses AES in the [Cipher Block Chaining (CBC)](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29) mode. * The `AES_CTR` mode uses AES in two slightly different modes in different contexts. When encrypting tablespace pages (such as pages in InnoDB, XtraDB, and Aria tables), it uses AES in the [Counter (CTR)](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29) mode. When encrypting temporary files (where the cipher text is allowed to be larger than the plain text), it uses AES in the authenticated [Galois/Counter Mode (GCM)](http://en.wikipedia.org/wiki/Galois/Counter_Mode). The recommended algorithm is `AES_CTR`, but this algorithm is only available when MariaDB is built with recent versions of [OpenSSL](https://www.openssl.org/). If the server is built with [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), then this algorithm is not available. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. ### Configuring the Encryption Algorithm The encryption algorithm can be configured by setting the `[file\_key\_management\_encryption\_algorithm](#file_key_management_encryption_algorithm)` system variable. This system variable can be set to one of the following values: | System Variable Value | Description | | --- | --- | | `AES_CBC` | Data is encrypted using AES in the [Cipher Block Chaining (CBC)](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29) mode. This is the default value. | | `AES_CTR` | Data is encrypted using AES either in the [Counter (CTR)](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29) mode or in the authenticated [Galois/Counter Mode (GCM)](http://en.wikipedia.org/wiki/Galois/Counter_Mode) mode, depending on context. This is only supported in some builds. See the previous section for more information. | This system variable can be specified as command-line arguments to `[mysqld](../mysqld-options/index)` or it can be specified in a relevant server [option group](../configuring-mariadb-with-option-files/index#option-groups) in an [option file](../configuring-mariadb-with-option-files/index). For example: ``` [mariadb] ... loose_file_key_management_encryption_algorithm = AES_CTR ``` Note that the `[loose](../mysqld-options/index#-loose-)` option prefix is specified. This option prefix is used in case the plugin hasn't been installed yet. Note that this variable does not affect the algorithm that MariaDB uses to decrypt the key file. This variable only affects the encryption algorithm that MariaDB uses to encrypt and decrypt data. The only algorithm that MariaDB currently supports to encrypt the key file is [Cipher Block Chaining (CBC)](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CBC) mode of [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard). Using the File Key Management Plugin ------------------------------------ Once the File Key Management Plugin is enabled, you can use it by creating an encrypted table: ``` CREATE TABLE t (i int) ENGINE=InnoDB ENCRYPTED=YES ``` Now, table `t` will be encrypted using the encryption key from the key file. For more information on how to use encryption, see [Data at Rest Encryption](../data-at-rest-encryption/index). Using Multiple Encryption Keys ------------------------------ The File Key Management Plugin supports [using multiple encryption keys](../encryption-key-management/index#using-multiple-encryption-keys). Each encryption key can be defined with a different 32-bit integer as a key identifier. When [encrypting InnoDB tables](../innodb-encryption/index), the key that is used to encrypt tables [can be changed](../innodb-xtradb-encryption-keys/index). When [encrypting Aria tables](../aria-encryption/index), the key that is used to encrypt tables [cannot currently be changed](../aria-encryption-keys/index). Key Rotation ------------ The File Key Management plugin does not currently support [key rotation](../encryption-key-management/index#key-rotation). See [MDEV-20713](https://jira.mariadb.org/browse/MDEV-20713) for more information. Versions -------- | Version | Status | Introduced | | --- | --- | --- | | 1.0 | Stable | [MariaDB 10.1.18](https://mariadb.com/kb/en/mariadb-10118-release-notes/) | | 1.0 | Gamma | [MariaDB 10.1.13](https://mariadb.com/kb/en/mariadb-10113-release-notes/) | | 1.0 | Alpha | [MariaDB 10.1.3](https://mariadb.com/kb/en/mariadb-1013-release-notes/) | System Variables ---------------- ### `file_key_management_encryption_algorithm` * **Description:** This system variable is used to determine which algorithm the plugin will use to encrypt data. + The recommended algorithm is `AES_CTR`, but this algorithm is only available when MariaDB is built with recent versions of [OpenSSL](https://www.openssl.org/). If the server is built with [wolfSSL](https://www.wolfssl.com/products/wolfssl/) or [yaSSL](https://www.wolfssl.com/products/yassl/), then this algorithm is not available. See [TLS and Cryptography Libraries Used by MariaDB](../tls-and-cryptography-libraries-used-by-mariadb/index) for more information about which libraries are used on which platforms. * **Commandline:** `--file-key-management-encryption-algorithm=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `enumerated` * **Default Value:** `AES_CBC` * **Valid Values:** `AES_CBC`, `AES_CTR` --- ### `file_key_management_filekey` * **Description:** This system variable is used to determine the encryption password that is used to decrypt the key file defined by `[file\_key\_management\_filename](#file_key_management_filename)`. + If this system variable's value is prefixed with `FILE:`, then it is interpreted as a path to a file that contains the plain-text encryption password. + If this system variable's value is **not** prefixed with `FILE:`, then it is interpreted as the plain-text encryption password. However, this is not recommended. + The encryption password has a max length of 256 characters. + The only algorithm that MariaDB currently supports when decrypting the key file is [Cipher Block Chaining (CBC)](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CBC) mode of [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard). The encryption key size can be 128-bits, 192-bits, or 256-bits. The encryption key is calculated by taking a [SHA-1](https://en.wikipedia.org/wiki/SHA-1) hash of the encryption password. * **Commandline:** `--file-key-management-filekey=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (empty) --- ### `file_key_management_filename` * **Description:** This system variable is used to determine the path to the file that contains the encryption keys. If `[file\_key\_management\_filekey](#file_key_management_filekey)` is set, then this file can be encrypted with [Cipher Block Chaining (CBC)](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#CBC) mode of [Advanced Encryption Standard (AES)](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard). * **Commandline:** `--file-key-management-filename=value` * **Scope:** Global * **Dynamic:** No * **Data Type:** `string` * **Default Value:** (empty) --- Options ------- ### `file_key_management` * **Description:** Controls how the server should treat the plugin when the server starts up. + Valid values are: - `OFF` - Disables the plugin without removing it from the `[mysql.plugins](../mysqlplugin-table/index)` table. - `ON` - Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. - `FORCE` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. - `FORCE_PLUS_PERMANENT` - Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled with `[UNINSTALL SONAME](../uninstall-soname/index)` or `[UNINSTALL PLUGIN](../uninstall-plugin/index)` while the server is running. + See [Plugin Overview: Configuring Plugin Activation at Server Startup](../plugin-overview/index#configuring-plugin-activation-at-server-startup) for more information. * **Commandline:** `--file-key-management=value` * **Data Type:** `enumerated` * **Default Value:** `ON` * **Valid Values:** `OFF`, `ON`, `FORCE`, `FORCE_PLUS_PERMANENT` --- Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
programming_docs