Commit f7b41778 authored by Benjamin Morel's avatar Benjamin Morel

Travis CI tests on MySQL 8.0

+ fixes issues in MysqlPlatform::getListTableIndexesSQL() and getListTableColumnsSQL() on MySQL 8.0
parent 2179996d
......@@ -21,7 +21,7 @@ before_commands:
tools:
external_code_coverage:
timeout: 3600
runs: 28 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP
runs: 30 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP
filter:
excluded_paths:
......
......@@ -47,16 +47,18 @@ jobs:
include:
- stage: Test
php: 7.1
env: DB=mysql MYSQL_VERSION=5.7
env: DB=mysql MYSQL_VERSION=8.0
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: 7.1
env: DB=mysqli MYSQL_VERSION=5.7
env: DB=mysqli MYSQL_VERSION=8.0
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: 7.1
env: DB=mariadb MARIADB_VERSION=10.3
......@@ -119,6 +121,13 @@ jobs:
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysql MYSQL_VERSION=8.0 COVERAGE=yes
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: 7.2
env: DB=mysqli COVERAGE=yes
......@@ -128,6 +137,13 @@ jobs:
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- stage: Test
php: 7.2
env: DB=mysqli MYSQL_VERSION=8.0 COVERAGE=yes
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: 7.2
env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes
......@@ -304,16 +320,18 @@ jobs:
- bash ./tests/travis/install-mssql.sh
- stage: Test
php: nightly
env: DB=mysql MYSQL_VERSION=5.7
env: DB=mysql MYSQL_VERSION=8.0
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: nightly
env: DB=mysqli MYSQL_VERSION=5.7
env: DB=mysqli MYSQL_VERSION=8.0
dist: xenial
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
- bash ./tests/travis/install-mysql-8.0.sh
- stage: Test
php: nightly
env: DB=mariadb MARIADB_VERSION=10.3
......
......@@ -158,7 +158,8 @@ class MySqlPlatform extends AbstractPlatform
'SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ' .
'CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, ' .
'NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment ' .
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase;
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase .
' ORDER BY SEQ_IN_INDEX ASC';
}
return 'SHOW INDEX FROM ' . $table;
......@@ -376,7 +377,8 @@ class MySqlPlatform extends AbstractPlatform
return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' .
'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' .
'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' .
'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table;
'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table .
' ORDER BY ORDINAL_POSITION ASC';
}
public function getListTableMetadataSQL(string $table, ?string $database = null) : string
......
#!/usr/bin/env bash
set -ex
echo "Installing MySQL 8.0..."
echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg --install mysql-apt-config_0.8.10-1_all.deb
sudo apt-get update -q
sudo apt-get install -q -y --force-yes -o Dpkg::Options::=--force-confnew mysql-server
echo -e "[mysqld]\ndefault_authentication_plugin=mysql_native_password" | sudo tee --append /etc/mysql/my.cnf
sudo /etc/init.d/mysql start
sudo mysql_upgrade
mysql --version
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment