Skip to content

Commit f7b4177

Browse files
committed
Travis CI tests on MySQL 8.0
+ fixes issues in MysqlPlatform::getListTableIndexesSQL() and getListTableColumnsSQL() on MySQL 8.0
1 parent 2179996 commit f7b4177

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before_commands:
2121
tools:
2222
external_code_coverage:
2323
timeout: 3600
24-
runs: 28 # 23x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP
24+
runs: 30 # 25x Travis (jobs with COVERAGE=yes) + 3x AppVeyor (jobs with coverage=yes) + 2x ContinuousPHP
2525

2626
filter:
2727
excluded_paths:

.travis.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,18 @@ jobs:
4747
include:
4848
- stage: Test
4949
php: 7.1
50-
env: DB=mysql MYSQL_VERSION=5.7
50+
env: DB=mysql MYSQL_VERSION=8.0
51+
dist: xenial
5152
sudo: required
5253
before_script:
53-
- bash ./tests/travis/install-mysql-5.7.sh
54+
- bash ./tests/travis/install-mysql-8.0.sh
5455
- stage: Test
5556
php: 7.1
56-
env: DB=mysqli MYSQL_VERSION=5.7
57+
env: DB=mysqli MYSQL_VERSION=8.0
58+
dist: xenial
5759
sudo: required
5860
before_script:
59-
- bash ./tests/travis/install-mysql-5.7.sh
61+
- bash ./tests/travis/install-mysql-8.0.sh
6062
- stage: Test
6163
php: 7.1
6264
env: DB=mariadb MARIADB_VERSION=10.3
@@ -119,6 +121,13 @@ jobs:
119121
sudo: required
120122
before_script:
121123
- bash ./tests/travis/install-mysql-5.7.sh
124+
- stage: Test
125+
php: 7.2
126+
env: DB=mysql MYSQL_VERSION=8.0 COVERAGE=yes
127+
dist: xenial
128+
sudo: required
129+
before_script:
130+
- bash ./tests/travis/install-mysql-8.0.sh
122131
- stage: Test
123132
php: 7.2
124133
env: DB=mysqli COVERAGE=yes
@@ -128,6 +137,13 @@ jobs:
128137
sudo: required
129138
before_script:
130139
- bash ./tests/travis/install-mysql-5.7.sh
140+
- stage: Test
141+
php: 7.2
142+
env: DB=mysqli MYSQL_VERSION=8.0 COVERAGE=yes
143+
dist: xenial
144+
sudo: required
145+
before_script:
146+
- bash ./tests/travis/install-mysql-8.0.sh
131147
- stage: Test
132148
php: 7.2
133149
env: DB=mariadb MARIADB_VERSION=10.0 COVERAGE=yes
@@ -304,16 +320,18 @@ jobs:
304320
- bash ./tests/travis/install-mssql.sh
305321
- stage: Test
306322
php: nightly
307-
env: DB=mysql MYSQL_VERSION=5.7
323+
env: DB=mysql MYSQL_VERSION=8.0
324+
dist: xenial
308325
sudo: required
309326
before_script:
310-
- bash ./tests/travis/install-mysql-5.7.sh
327+
- bash ./tests/travis/install-mysql-8.0.sh
311328
- stage: Test
312329
php: nightly
313-
env: DB=mysqli MYSQL_VERSION=5.7
330+
env: DB=mysqli MYSQL_VERSION=8.0
331+
dist: xenial
314332
sudo: required
315333
before_script:
316-
- bash ./tests/travis/install-mysql-5.7.sh
334+
- bash ./tests/travis/install-mysql-8.0.sh
317335
- stage: Test
318336
php: nightly
319337
env: DB=mariadb MARIADB_VERSION=10.3

lib/Doctrine/DBAL/Platforms/MySqlPlatform.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
158158
'SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ' .
159159
'CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, ' .
160160
'NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment ' .
161-
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase;
161+
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase .
162+
' ORDER BY SEQ_IN_INDEX ASC';
162163
}
163164

164165
return 'SHOW INDEX FROM ' . $table;
@@ -376,7 +377,8 @@ public function getListTableColumnsSQL($table, $database = null)
376377
return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' .
377378
'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' .
378379
'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' .
379-
'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table;
380+
'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table .
381+
' ORDER BY ORDINAL_POSITION ASC';
380382
}
381383

382384
public function getListTableMetadataSQL(string $table, ?string $database = null) : string

tests/travis/install-mysql-8.0.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
echo "Installing MySQL 8.0..."
6+
7+
echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
8+
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
9+
sudo dpkg --install mysql-apt-config_0.8.10-1_all.deb
10+
sudo apt-get update -q
11+
sudo apt-get install -q -y --force-yes -o Dpkg::Options::=--force-confnew mysql-server
12+
echo -e "[mysqld]\ndefault_authentication_plugin=mysql_native_password" | sudo tee --append /etc/mysql/my.cnf
13+
sudo /etc/init.d/mysql start
14+
sudo mysql_upgrade
15+
16+
mysql --version

0 commit comments

Comments
 (0)