From 5ef4656ded42cbba85d6ffef7eaee25b5ae57f1e Mon Sep 17 00:00:00 2001 From: Olaf van Zandwijk Date: Thu, 30 Aug 2018 19:25:39 +0200 Subject: [PATCH 1/2] Make default character set consequent --- lib/mariaex/protocol.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mariaex/protocol.ex b/lib/mariaex/protocol.ex index 9ab89ea..897ff00 100644 --- a/lib/mariaex/protocol.ex +++ b/lib/mariaex/protocol.ex @@ -187,7 +187,7 @@ defmodule Mariaex.Protocol do defp handle_handshake(packet(seqnum: seqnum) = packet, opts, %{ssl_conn_state: :ssl_handshake} = s) do # Create and send an SSL request packet per the spec: # https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest - msg = ssl_connection_request(capability_flags: ssl_capabilities(opts), max_size: @maxpacketbytes, character_set: 8) + msg = ssl_connection_request(capability_flags: ssl_capabilities(opts), max_size: @maxpacketbytes, character_set: 33) msg_send(msg, s, new_seqnum = seqnum + 1) case upgrade_to_ssl(s, opts) do {:ok, new_state} -> @@ -212,7 +212,7 @@ defmodule Mariaex.Protocol do {database, capabilities} = capabilities(opts) msg = handshake_resp(username: :unicode.characters_to_binary(opts[:username]), password: scramble, database: database, capability_flags: capabilities, - max_size: @maxpacketbytes, character_set: 8) + max_size: @maxpacketbytes, character_set: 33) msg_send(msg, s, seqnum + 1) handshake_recv(%{s | state: :handshake_send, deprecated_eof: deprecated_eof}, nil) end From caa1ec6b251ddde395a610020629603d73aab8ea Mon Sep 17 00:00:00 2001 From: Olaf van Zandwijk Date: Thu, 30 Aug 2018 20:13:50 +0200 Subject: [PATCH 2/2] Fix Travis build on MySQL 8 --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0655094..8c0e690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,17 +16,17 @@ env: global: - MDBSOCKET=/var/run/mysqld/mysqld.sock matrix: - - DB=mariadb:10.1 JSON_SUPPORT=false - - DB=mariadb:10.2 JSON_SUPPORT=false - - DB=mariadb:10.3 JSON_SUPPORT=false GEOMETRY_SUPPORT=false - - DB=mysql:8.0 JSON_SUPPORT=true - - DB=mysql:5.7 JSON_SUPPORT=true - - DB=mysql:5.6 JSON_SUPPORT=false + - DB=mariadb:10.1 JSON_SUPPORT=false MYSQL_EXTRA_ARGS="" + - DB=mariadb:10.2 JSON_SUPPORT=false MYSQL_EXTRA_ARGS="" + - DB=mariadb:10.3 JSON_SUPPORT=false GEOMETRY_SUPPORT=false MYSQL_EXTRA_ARGS="" + - DB=mysql:8.0 JSON_SUPPORT=true MYSQL_EXTRA_ARGS="--default_authentication_plugin=mysql_native_password" + - DB=mysql:5.7 JSON_SUPPORT=true MYSQL_EXTRA_ARGS="" + - DB=mysql:5.6 JSON_SUPPORT=false MYSQL_EXTRA_ARGS="" matrix: include: - elixir: 1.4.5 otp_release: 19.3 - env: DB=mysql:8.0 JSON_SUPPORT=true + env: DB=mysql:8.0 JSON_SUPPORT=true MYSQL_EXTRA_ARGS="--default_authentication_plugin=mysql_native_password" - elixir: 1.5.1 otp_release: 19.3 env: DB=mysql:5.7 JSON_SUPPORT=true @@ -38,5 +38,5 @@ matrix: before_install: - sudo service mysql stop - docker pull $DB || true - - docker run --name mariadb -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -d $DB + - docker run --name mariadb -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -d $DB $MYSQL_EXTRA_ARGS script: "JSON_SUPPORT=$JSON_SUPPORT mix test --cover"