Open yahonda opened 11 months ago
It's pretty exciting to see the news on MySQL 8.x Innovation releases breathing some life into it.
If a user wants to put in a deprecated option they may do so. I wouldn't remove the flag bindings yet, but would certainly want to gracefully handle the missing definition in future versions of the mysql2 gem.
Just wanted to add to this: passing in reconnect
as a config option, regardless of whether it is true
or false
(or even nil
) will cause this error to be displayed (just spotted this in our Rails app as it has reconnect: false
configured in database.yml
)
I guess ideally it should not even set this if reconnect: false
as that's the default (according to https://dev.mysql.com/doc/c-api/8.0/en/c-api-auto-reconnect.html, anyway) but it would be good if a clearer deprecation message could be displayed by the gem :+1:
Same warning here with MySQL 8.1 and mysql2 0.5.5.
Does anyone know why MYSQL_OPT_RECONNECT is being deprecated? I tried looking for the related work log item, 15766, but couldn't find it here.
Any updates on this? will this not break mysql2
once MYSQL_OPT_RECONNECT
is removed?
It will break when removed, yes. Need to get in a conditional definition with an in-Ruby warning that says the feature was removed.
@sodabrew our c++ application uses mysql_options with MYSQL_OPT_RECONNECT. what are alternatives so we get the same behavior without changing our application code to get same behavior as RECONNECT. if changing the application is only option what is the best way with minimal impact, so the reconnect works as before.
It would be nice to get rid of this MYSQL_OPT_RECONNECT warning message.
@breisig FYI, we moved to Trilogy. Would highly recommend it as well, if it's possible for you. Modern and well-maintained going forward. Some tweaks needed but mostly a drop-in replacement.
@joshuapinter Trilogy doesn't have basic caching_sha2_password support which is required in newer MySQL 8.x so that's out.
@joshuapinter Trilogy doesn't have basic caching_sha2_password support which is required in newer MySQL 8.x so that's out.
The support for that has been added recently - see https://github.com/trilogy-libraries/trilogy/releases/tag/v2.8.0, @breisig. I haven't yet used Trilogy myself, but github.com stands behind it, so it looks solid.
MySQL 8.0.34 and 8.1.0 deprecates
MYSQL_OPT_RECONNECT
Since MySQL 8.0.34 and 8.1.0 deprecates
MYSQL_OPT_RECONNECT
, mysql2 gem is also affected.https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html#mysqld-8-0-34-deprecation-removal https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html#mysqld-8-1-0-deprecation-removal
The related MYSQL_OPT_RECONNECT option is still available but it is also deprecated. C API functions mysql_get_option() and mysql_options() now write a deprecation warning to the standard error output when an application specifies MYSQL_OPT_RECONNECT. (WL #15766)
Here are two specs that raise
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
$ sudo apt list --installed |grep mysql ... snip ... libmysqlclient-dev/now 8.1.0-1ubuntu23.04 amd64 [installed,local] libmysqlclient22/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-apt-config/now 0.8.24-1 all [installed,local] mysql-client/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-common/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-community-client-core/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-community-client-plugins/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-community-client/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-community-server-core/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-community-server/now 8.1.0-1ubuntu23.04 amd64 [installed,local] mysql-server/now 8.1.0-1ubuntu23.04 amd64 [installed,local] $