Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI tests on MySQL 8.0 #3372

Merged
merged 1 commit into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 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:
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
Ocramius marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Docker container instead of arbitrary 3rd-party debfile. As done in #3183.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with Docker, however for the record this isn't an arbitrary debfile, this is MySQL's official APT repository.

Copy link
Contributor

@Majkl578 Majkl578 Dec 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the nature of APT repositories, it's not a good idea to depend on a debfile as debfiles may randomly disappear when they get superseded by newer version.
Also Docker is easier to setup, configure environment, maintain and in the end is more reliable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that MySQL 5.7 is already installed using MySQL's APT repo. If you move to Docker, then this one should be updated as well for consistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

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