Replies: 3 comments 3 replies
-
Can you explain why you believe that this is a bug in diesel and not just a change in libmariadb that is incompatible with your setup? I mean diesel does at no point guarantee a certain set of default settings there. Finally: Mariadb (including the client libraries) is something we do not officially support (yet, we still look for someone that implements and maintains an official backend). It's something that mostly works, but we do not guarantee anything there. |
Beta Was this translation helpful? Give feedback.
-
You are right, this is not really a bug in Diesel in the sense that Diesel does something wrong. Though, there is something which Diesel could do to improve the situation and to avoid issues when the updated MariaDB Connector ends up in Debian/Ubuntu which then means Diesel cannot easily be used anymore. So at the very least, it is now documented here that MariaDB Connector/C 3.4 does not work with Diesel's MySQL backend implementation, while previous versions have worked just fine. This ticket also can serve as a debate if Diesel should simply set |
Beta Was this translation helpful? Give feedback.
-
We could use something like The other variant for this is to say libmariadb itself describes itself as:
If it is a drop in replacement the new behavior is a bug and should be fixed there. Have you considered raising it as bug in their issue tracker as well? This kind of suddenly diverging behavior makes it really hard to continue supporting both libraries. |
Beta Was this translation helpful? Give feedback.
-
Setup
Versions
Feature Flags
Problem Description
MariaDB Connector/C is an implementation of the MySQL Client library from MariaDB. It is used as drop-in replacement for the MySQL Client library for example on Debian and Ubuntu via the
libmariadb-dev-compat
package and offers a compatible C ABI.Thus also Diesel via
mysqlclient_sys
does use the MariaDB Connector if it is installed as replacement for the MySQL client library.This has worked for most purposes without any issue for MariaDB Connector/C <= 3.3.
Now with 3.4, Diesel fails to connect to the server with
TLS/SSL error: SSL is required, but the server does not support it
error message.This is because for some reason, the MariaDB developers decided it is a good idea to ship with
options.use_ssl=1
inmysql_init
. Diesel is not aware of this (indiesel/diesel/src/mysql/connection/raw.rs
Line 30 in f7e9819
Furthermore, the MariaDB Connector/C does not support
MYSQL_OPT_SSL_MODE
which is implemented by Diesel indiesel/diesel/src/mysql/connection/raw.rs
Line 199 in f7e9819
The corresponding MariaDB ticket which as a result produced this change is at: https://jira.mariadb.org/browse/MDEV-31857?focusedCommentId=279904&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-279904
And the actual change is at: MariaDB/server@abcd23a#diff-b7189447363b2b74ee642549c398c1adcee11e2c8f4e0fa529dfde9d8f9e32faR1442
Thoughts
I am not sure what should be done about this. One way to solve the issue would be to simply add a line which sets
options.use_ssl=0
after the call to mysql_init in Diesel code. That should restore the previous behavior.MariaDB Connector/C and MySQL Client library have diverged in terms of "options" at least for TLS and the way how Diesel sets TLS options only works for the MySQL Client library - but not for the MariaDB Connector.
What is the actual output?
Diesel fails to connect, errors out with
TLS/SSL error: SSL is required, but the server does not support it
.Steps to reproduce
To reproduce, use Debian 12, download the matching MariaDB-Connector C Connector 3.4.x release from https://mariadb.com/downloads/connectors/ and install it so that the shared library is actually used. One simple way to do this is via this script:
Afterwards, use any Diesel program which uses the MySQL backend.
Checklist
closed if this is not the case)
Beta Was this translation helpful? Give feedback.
All reactions