Skip to content

Commit 2e61525

Browse files
authored
Merge pull request #67 from macbre/mariadb-support
Add support for MariaDB
2 parents cc4e3be + 3accf7c commit 2e61525

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ services:
1111
env:
1212
# @see https://docs.travis-ci.com/user/environment-variables/#Defining-Multiple-Variables-per-Item
1313
# @see https://hub.docker.com/_/mysql/
14-
- MYSQL_VERSION=5.5
15-
- MYSQL_VERSION=5.6
16-
- MYSQL_VERSION=5.7
17-
- MYSQL_VERSION=8.0
14+
- DOCKER_IMAGE=mysql:5.5
15+
- DOCKER_IMAGE=mysql:5.6
16+
- DOCKER_IMAGE=mysql:5.7
17+
- DOCKER_IMAGE=mysql:8.0
18+
# @see https://hub.docker.com/_/mariadb/
19+
- DOCKER_IMAGE=mariadb:10.0 # used by Wikipedia
20+
- DOCKER_IMAGE=mariadb:10.2
1821
before_script:
1922
# @see https://medium.com/@mtparet/install-mysql-server-5-7-on-travis-96f2ebc0f339
2023
# @see https://hub.docker.com/_/mysql/
2124
- sudo service mysql stop # stop any running MySQL server
22-
- sudo docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d -p 3306:3306 mysql:$MYSQL_VERSION
25+
- sudo docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d -p 3306:3306 $DOCKER_IMAGE
2326
- sleep 15 # wait for MySQL server to be fully set up
2427
- sudo docker ps
2528
# set up a database

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Analyses your database queries and schema and suggests indices improvements. You
1313
* reports queries that do not use indices
1414
* reports queries that use filesort, temporary file or full table scan
1515

16-
This tool **supports MySQL 5.5, 5.6, 5.7 and 8.0**.
16+
This tool **supports MySQL 5.5, 5.6, 5.7, 8.0 and MariaDB 10.0, 10.2** .
1717

1818
## Requirements & install
1919

indexdigest/test/core/test_database.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ class TestDatabase(TestCase, DatabaseTestMixin):
5656
TABLE_NAME = '0000_the_table'
5757

5858
def test_database_version(self):
59-
version = self.connection.get_server_version() # 5.5.57-0+deb8u1 / 8.0.3-rc-log
59+
# 5.5.57-0+deb8u1 / 8.0.3-rc-log / 10.2.10-MariaDB-10.2.10+maria~jessie
60+
version = self.connection.get_server_version()
6061

6162
self.assertTrue(
62-
version.startswith('5.') or version.startswith('8.'),
63-
'MySQL server should be from 5.x or 8.x line')
63+
version.startswith('5.') or version.startswith('8.') or 'MariaDB' in version,
64+
'MySQL server should be from 5.x or 8.x line or have MariaDB part')
6465

6566
def test_get_tables(self):
6667
tables = list(self.connection.get_tables())

0 commit comments

Comments
 (0)