Skip to content

Commit 1a903eb

Browse files
committed
Merge branch 'master' into force_latin1_to_utf8
2 parents e0d01eb + 58d0a0d commit 1a903eb

28 files changed

Lines changed: 843 additions & 375 deletions

.rubocop_todo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Offense count: 2
1010
Metrics/AbcSize:
11-
Max: 80
11+
Max: 85
1212

1313
# Offense count: 1
1414
Metrics/BlockNesting:
@@ -20,7 +20,7 @@ Metrics/ClassLength:
2020

2121
# Offense count: 2
2222
Metrics/CyclomaticComplexity:
23-
Max: 26
23+
Max: 30
2424

2525
# Offense count: 290
2626
# Configuration parameters: AllowURI, URISchemes.
@@ -30,7 +30,7 @@ Metrics/LineLength:
3030
# Offense count: 5
3131
# Configuration parameters: CountComments.
3232
Metrics/MethodLength:
33-
Max: 50
33+
Max: 60
3434

3535
# Offense count: 1
3636
Metrics/PerceivedComplexity:

.travis.yml

Lines changed: 67 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ sudo: required
22
dist: trusty
33
language: ruby
44
bundler_args: --without benchmarks development
5-
# Temporary workaround for broken Rubygems on Travis
5+
# Pin Rubygems to a working version. Sometimes it breaks upstream. Update now and then.
66
before_install:
7-
- gem update --system 2.4.8
7+
- gem --version
8+
- gem update --system 2.6.12
9+
- gem update bundler
810
- gem --version
911
- bash .travis_setup.sh
1012
addons:
1113
hosts:
1214
- mysql2gem.example.com
1315
apt:
1416
packages:
15-
- mysql-server-5.5
16-
- mysql-client-core-5.5
17-
- mysql-client-5.5
17+
- mysql-server-5.6
18+
- mysql-client-core-5.6
19+
- mysql-client-5.6
1820
rvm:
19-
- 2.3.0
21+
- 2.4
22+
- 2.3
2023
- 2.2
2124
- 2.1
2225
- 2.0.0
@@ -26,50 +29,88 @@ matrix:
2629
include:
2730
- rvm: 1.8.7
2831
dist: precise
32+
env: SPEC_OPTS="--order rand:11"
33+
addons:
34+
hosts:
35+
- mysql2gem.example.com
36+
apt:
37+
packages:
38+
- mysql-server-5.5
39+
- mysql-client-core-5.5
40+
- mysql-client-5.5
2941
- rvm: ree
3042
dist: precise
31-
- rvm: rbx-2
32-
dist: precise
33-
- rvm: 2.0.0
34-
env: DB=mariadb55
43+
env: SPEC_OPTS="--order rand:11"
3544
addons:
36-
mariadb: 5.5
3745
hosts:
3846
- mysql2gem.example.com
39-
- rvm: 2.0.0
47+
apt:
48+
packages:
49+
- mysql-server-5.5
50+
- mysql-client-core-5.5
51+
- mysql-client-5.5
52+
- rvm: 2.4
4053
env: DB=mariadb10.0
4154
addons:
4255
mariadb: 10.0
4356
hosts:
4457
- mysql2gem.example.com
45-
- rvm: 2.0.0
58+
- rvm: 2.4
4659
env: DB=mariadb10.1
4760
addons:
4861
mariadb: 10.1
4962
hosts:
5063
- mysql2gem.example.com
64+
- rvm: 2.4
65+
env: DB=mariadb10.2
66+
addons:
67+
mariadb: 10.2
68+
hosts:
69+
- mysql2gem.example.com
5170
- rvm: 2.0.0
52-
env: DB=mysql56
71+
env: DB=mysql51
72+
dist: precise
5373
addons:
5474
hosts:
5575
- mysql2gem.example.com
56-
apt:
57-
packages:
58-
- mysql-server-5.6
59-
- mysql-client-core-5.6
60-
- mysql-client-5.6
6176
- rvm: 2.0.0
62-
env: DB=mysql57
77+
env: DB=mysql55
78+
dist: precise
6379
addons:
6480
hosts:
6581
- mysql2gem.example.com
6682
apt:
6783
packages:
68-
- mysql-server-5.7
69-
- mysql-client-core-5.7
70-
- mysql-client-5.7
71-
- rvm: 2.0.0
72-
env: DB=mysql55
73-
os: osx
84+
- mysql-server-5.5
85+
- mysql-client-core-5.5
86+
- mysql-client-5.5
87+
- rvm: 2.4
88+
env: DB=mysql57
89+
addons:
90+
hosts:
91+
- mysql2gem.example.com
92+
- rvm: 2.4
93+
env: DB=mysql80
94+
addons:
95+
hosts:
96+
- mysql2gem.example.com
97+
- os: osx
98+
rvm: system
99+
env: DB=mysql56
100+
addons:
101+
hosts:
102+
- mysql2gem.example.com
103+
before_install:
104+
# Use the system RubyGem with the system Ruby
105+
- gem --version
106+
- sudo gem install bundler
107+
- bash .travis_setup.sh
108+
fast_finish: true
74109
allow_failures:
75110
- rvm: ruby-head
111+
- os: osx
112+
rvm: system
113+
env: DB=mysql56
114+
- rvm: 2.0.0
115+
env: DB=mysql51
116+
dist: precise

.travis_mysql51.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
apt-get purge -qq '^mysql*' '^libmysql*'
6+
rm -fr /etc/mysql
7+
rm -fr /var/lib/mysql
8+
apt-key adv --keyserver keys.gnupg.net --recv-keys 8507EFA5
9+
add-apt-repository 'deb http://repo.percona.com/apt precise main'
10+
apt-get update -qq
11+
apt-get install -qq percona-server-server-5.1 percona-server-client-5.1 libmysqlclient16-dev

.travis_mysql57.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
#!/usr/bin/env bash
22

3-
set -eu
4-
5-
service mysql stop
6-
apt-get purge '^mysql*' 'libmysql*'
7-
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x8C718D3B5072E1F5
3+
set -eux
84

5+
apt-get purge -qq '^mysql*' '^libmysql*'
6+
rm -fr /etc/mysql
7+
rm -fr /var/lib/mysql
8+
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
99
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7'
10+
apt-get update -qq
11+
apt-get install -qq mysql-server libmysqlclient-dev
1012

11-
apt-get update
12-
apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew -y install mysql-server libmysqlclient-dev
13-
14-
mysql_upgrade -u root --force --upgrade-system-tables
15-
16-
# Replace the final line of the mysql apparmor, allowing /etc/mysql/*.pem
17-
sed -ie '$ s|}|\
18-
/etc/mysql/*.pem r,\
19-
}|' /etc/apparmor.d/usr.sbin.mysqld
20-
service apparmor restart
13+
# https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
14+
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''"

.travis_mysql80.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
apt-get purge -qq '^mysql*' '^libmysql*'
6+
rm -fr /etc/mysql
7+
rm -fr /var/lib/mysql
8+
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
9+
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-8.0'
10+
apt-get update -qq
11+
apt-get install -qq mysql-server libmysqlclient-dev
12+
13+
# https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
14+
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''"

.travis_setup.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
#!/usr/bin/env bash
22

3-
set -eu
3+
set -eux
4+
5+
# Install MySQL 5.1 if DB=mysql51
6+
if [[ -n ${DB-} && x$DB =~ ^xmysql51 ]]; then
7+
sudo bash .travis_mysql51.sh
8+
fi
49

510
# Install MySQL 5.7 if DB=mysql57
611
if [[ -n ${DB-} && x$DB =~ ^xmysql57 ]]; then
712
sudo bash .travis_mysql57.sh
813
fi
914

15+
# Install MySQL 8.0 if DB=mysql80
16+
if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then
17+
sudo bash .travis_mysql80.sh
18+
fi
19+
20+
# Install MariaDB 10.2 if DB=mariadb10.2
21+
# NOTE this is a workaround until Travis CI merges a fix to its mariadb addon.
22+
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.2 ]]; then
23+
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' mariadb-server mariadb-server-10.2 libmariadbclient18
24+
fi
25+
1026
# Install MySQL if OS=darwin
1127
if [[ x$OSTYPE =~ ^xdarwin ]]; then
1228
brew update
13-
brew install "$DB"
29+
brew install "$DB" mariadb-connector-c
1430
$(brew --prefix "$DB")/bin/mysql.server start
1531
fi
1632

@@ -20,15 +36,12 @@ if ! [[ x$OSTYPE =~ ^xdarwin ]]; then
2036
sudo service mysql restart
2137
fi
2238

23-
sudo mysql -u root -e "CREATE USER '$USER'@'localhost'" || true
24-
sudo mysql -u root -e "GRANT ALL ON test.* TO '$USER'@'localhost'" || true
25-
2639
# Print the MySQL version and create the test DB
2740
if [[ x$OSTYPE =~ ^xdarwin ]]; then
2841
$(brew --prefix "$DB")/bin/mysqld --version
29-
$(brew --prefix "$DB")/bin/mysql -u $USER -e "CREATE DATABASE IF NOT EXISTS test"
42+
$(brew --prefix "$DB")/bin/mysql -u root -e 'CREATE DATABASE IF NOT EXISTS test'
3043
else
3144
mysqld --version
3245
# IF NOT EXISTS is mariadb-10+ only - https://mariadb.com/kb/en/mariadb/comment-syntax/
33-
mysql -u $USER -e "CREATE DATABASE /*M!50701 IF NOT EXISTS */ test"
46+
mysql -u root -e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test'
3447
fi

.travis_ssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -eu
3+
set -eux
44

55
# Make sure there is an /etc/mysql
66
mkdir -p /etc/mysql

0 commit comments

Comments
 (0)