Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL reconnect option is depreciated #317

Closed
server24 opened this issue Sep 20, 2023 · 5 comments
Closed

MySQL reconnect option is depreciated #317

server24 opened this issue Sep 20, 2023 · 5 comments

Comments

@server24
Copy link

Describe the bug
Recent libmysqlclient-packages output an stderr warning when MYSQL_OPT_RECONNECT is used (even if set to false!) that fills up logs and maybe even e-mail messages.

To Reproduce
Steps to reproduce the behavior:

  1. Perform an update to a recent version of libmysqlclient (8.0.34 and 8.1)
  2. Run spine

Expected behavior
No STDERR output should be shown.

Possible patch/fix

--- sql.orig.c 2023-09-05 01:57:16.000000000 +0200
+++ sql.c 2023-09-20 23:15:37.933557926 +0200
@@ -277,7 +277,9 @@
MYSQL_SET_OPTION(MYSQL_OPT_READ_TIMEOUT, (int *)&rtimeout, "read timeout");
MYSQL_SET_OPTION(MYSQL_OPT_WRITE_TIMEOUT, (int *)&wtimeout, "write timeout");
MYSQL_SET_OPTION(MYSQL_OPT_CONNECT_TIMEOUT, (int *)&timeout, "general timeout");

  • #if MYSQL_VERSION_ID >= 50013 && MYSQL_VERSION_ID < 80034
    MYSQL_SET_OPTION(MYSQL_OPT_RECONNECT, &reconnect, "reconnect");

  • #endif

    #ifdef HAS_MYSQL_OPT_RETRY_COUNT
    MYSQL_SET_OPTION(MYSQL_OPT_RETRY_COUNT, &tries, "retry count");

@server24
Copy link
Author

Of course please verify how reconnections are handled and/or if handling is needed as this patch would effectively disable the automatic reconnection mechanism.

@TheWitness
Copy link
Member

Is that built from MySQL or MoriaDB. I'm suspecting MySQL.

@server24
Copy link
Author

The change came from MySQL (they are no longer offering detailed/split up patches AFAIK).

But the problem is that this deprecation sends messages to stderr and this was marked as a MINOR package update in Ubuntu.

TheWitness added a commit that referenced this issue Sep 22, 2023
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
@TheWitness
Copy link
Member

Resolved this one.

@TheWitness TheWitness added this to the 1.2.26 milestone Sep 22, 2023
@TheWitness
Copy link
Member

There is lot's of discussion about 'why' this was done in a minor release with little or no explanation of what customers 'should' do to accommodate for the change. Not a good look for Oracle.

TheWitness added a commit that referenced this issue Dec 7, 2023
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
@netniV netniV changed the title WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version. MySQL reconnect option is depreciated Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants