Skip to content

Commit

Permalink
Travis CI tests on MySQL 8.0
Browse files Browse the repository at this point in the history
+ fixes issues in MysqlPlatform::getListTableIndexesSQL() and getListTableColumnsSQL() on MySQL 8.0
  • Loading branch information
BenMorel committed Dec 2, 2018
1 parent 1a2b9aa commit 4000e07
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ before_commands:
tools:
external_code_coverage:
timeout: 3600
runs: 27 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 1x ContinuousPHP
runs: 29 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 1x ContinuousPHP

filter:
excluded_paths:
Expand Down
34 changes: 26 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
'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;
Expand Down Expand Up @@ -376,7 +377,8 @@ public function getListTableColumnsSQL($table, $database = null)
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
Expand Down
16 changes: 16 additions & 0 deletions tests/travis/install-mysql-8.0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/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

0 comments on commit 4000e07

Please sign in to comment.