Skip to content

Commit 9a2565e

Browse files
committed
Merge branch 'mysql57-workaround'
2 parents fb623da + 6822ad6 commit 9a2565e

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ before_install:
77
- |
88
bash -c " # Install MySQL 5.7 if DB=mysql57
99
if [[ x$DB =~ mysql57 ]]; then
10-
bash .travis_mysql57.sh
10+
sudo bash .travis_mysql57.sh
1111
fi
1212
"
1313
- |
@@ -29,6 +29,7 @@ before_install:
2929
"
3030
- mysqld --version
3131
- mysql -u root -e "CREATE DATABASE IF NOT EXISTS test"
32+
- mysql -u root -e "CREATE USER '$USER'@'localhost'" || true
3233
os:
3334
- linux
3435
rvm:

.travis_mariadb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
service mysql stop
44
apt-get purge '^mysql*' 'libmysql*'

.travis_mysql57.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
sudo apt-get remove --purge "^mysql.*"
2-
sudo apt-get autoremove
3-
sudo apt-get autoclean
4-
sudo rm -rf /var/lib/mysql
5-
sudo rm -rf /var/log/mysql
6-
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
7-
wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
8-
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
9-
sudo apt-get update -q
10-
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server ruby libmysqlclient-dev
1+
#!/bin/sh
2+
3+
service mysql stop
4+
5+
apt-get purge '^mysql*' 'libmysql*'
6+
apt-get autoclean
7+
8+
rm -rf /var/lib/mysql
9+
rm -rf /var/log/mysql
10+
11+
apt-get install python-software-properties
12+
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x8C718D3B5072E1F5
13+
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.7-dmr'
14+
15+
apt-get update
16+
apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -y install mysql-server libmysqlclient-dev

.travis_ssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# Halt the tests on error
44
set -e

ext/mysql2/client.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,10 @@ void init_mysql2_client() {
13781378
#ifdef CLIENT_SECURE_CONNECTION
13791379
rb_const_set(cMysql2Client, rb_intern("SECURE_CONNECTION"),
13801380
LONG2NUM(CLIENT_SECURE_CONNECTION));
1381+
#else
1382+
/* HACK because MySQL5.7 no longer defines this constant,
1383+
* but we're using it in our default connection flags. */
1384+
rb_const_set(cMysql2Client, rb_intern("SECURE_CONNECTION"), LONG2NUM(0));
13811385
#endif
13821386

13831387
#ifdef CLIENT_MULTI_STATEMENTS

0 commit comments

Comments
 (0)