-
Notifications
You must be signed in to change notification settings - Fork 18
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
Update CI, fix Embedded server, improve tests, adjust to MySQL 8 #213
Open
choroba
wants to merge
44
commits into
perl5-dbi:master
Choose a base branch
from
choroba:mysql8
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choroba
force-pushed
the
mysql8
branch
4 times, most recently
from
December 11, 2024 21:41
85d6f5d
to
d18479b
Compare
This test has two major problems: It tries to call non-existent function fatal() and test fails when DSN contains connection parameters to embedded server. Fix these two problems and also cleanup test a bit more. Do not catch and rethrow errors from File::Temp::tempdir(), instead let it die directly (per documentation this function croaks on error). And remove duplicated code by extracting them into unified common functions get_error() and fatal_connection_error().
Replace infinite loop pattern 'sleep 1 until func()' by just checking it for limited time. This change allows to whole test file and does not need to call die at random places.
Sort all keys and use deterministic indentation in Data::Dumper calls.
…ile.PL runs Cached auth plugin value is in $::test_authplugin variable. For remembering it during next Makefile.PL run, it is required to store its value into $opt->{'testauthplugin'} variable. But auth plugin value was stored only into $test_authplugin variable from which its value never read. Fix it.
This will be used in upcoming changes.
mariadb_hostinfo and SQL_SERVER_NAME attributes provides direct string value from client function mysql_get_host_info(). But this function returns NULL when connection is to Embedded server. Fix this problem by returning "Embedded" string instead of NULL when connection is to Embedded server.
This is because mysql_send_query() client function is synchronous and waits for results when connection is to Embedded server. So asynchronous support via mysql_send_query() is not supported for Embedded server. So do not allow to create asynchronous queries within Embedded server.
It has no effect with Embedded server because connection to Embedded server does not use packets. So do not allow mariadb_max_allowed_packet usage with Embedded server.
Attribute $dbh->{mariadb_protoinfo} returns number 0 and attribute $dbh->{mariadb_stat} returns empty string "". So fix t/10connect.t test to check that $dbh attributes are defined, instead of being true in boolean context.
Connection to Embedded server is not socket orientated, so it does not have socket. Fix code and tests for Embedded server connection.
Async mode is not supported for Embedded server.
Connection to Embedded server is not disconnected on wait_timeout.
… client libraries
Do not specify explicit language subdir in --language= argument as it breaks multi language support or explicit language selection via SQL command "SET lc_messages = 'ja_JP'" (it does not signal any error). Add information about --log-error= argument and why it is suggested to always specify it.
Currently in Makefile.PL there is a check that option --testhost cannot be embedded. It is because Makefile.PL cannot generate t/MariaDB.mtest file for connection with Embedded server. Fix it. Add a new Makfile.PL option --testembdatadir= which is specify database directory of the Embedded server and hence it is required for running test suite against Embedded server. Add a new optional Makfile.PL option --testemboptions= which specifies additional comma separate options for Embedded server. Cleanup code for checking if combination of host, port, socket and embdatadir is allowed and makes sense. Running test suite against embedded server is activated either explicitly by --testhost=embedded option or just by specifying --testembdatadir= option.
This replaces the old undocumented DBD_MARIADB_TESTLANGDIR env variable.
…ing to Github Actions CI Some code for client PIC library was already in .github/workflows/ci.yaml (from Travis-CI conversion) but incomplete and non-working. Fix it and use DBD_MARIADB_TESTEMBDATADIR and DBD_MARIADB_TESTEMBOPTIONS env variables which are parsed by Makefile.PL for --testembdatadir and --testemboptions parameters.
MySQL server version 8.0.24 started returning new error code ER_CLIENT_INTERACTION_TIMEOUT for timeout disconnect reason. Fix mariadb_auto_reconnect to handle this new code and extend t/15reconnect.t test for timeout disconnect reason via changing wait_timeout. See: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-24.html#mysqld-8-0-24-connection-management See: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html#error_er_client_interaction_timeout
MySQL 8.3.0 client library removed mysql_ssl_set() function. Replacement is mysql_options() function with appropriate arguments. This change fixes compilation with MySQL 8.3.0+ client library. See: https://dev.mysql.com/doc/relnotes/mysql/8.3/en/news-8-3-0.html#mysqld-8-3-0-deprecation-removal
…rams to bool has_params" This reverts commit ee26e0b. For MySQL 8.3.0 is needed to know number of parameters in mariadb_st_internal_execute41() function. Number of parameter will be used in follow up change.
MySQL 8.3.0 client library started to deprecate mysql_stmt_bind_param() function. Replacement is a new mysql_stmt_bind_named_param() function. See: https://dev.mysql.com/doc/relnotes/mysql/8.3/en/news-8-3-0.html#mysqld-8-3-0-deprecation-removal
…or testing to Github Actions CI
choroba
force-pushed
the
mysql8
branch
2 times, most recently
from
December 12, 2024 23:08
c43be43
to
fabcb64
Compare
…s CI cpanm --with-configure requires Makefile.PL to finish successfully and it requires DBD_MARIADB_* env to be set properly.
…or testing to Github Actions CI
…or testing to Github Actions CI
…erver for testing to Github Actions CI
…or testing to Github Actions CI
…or testing to Github Actions CI
This new Makefile.PL option --requireembsup or the new ENV variable DBD_MARIADB_REQUIREEMBSUP=1 cause that Makefile.PL will fail if the Embedded server is not supported by client library. This allows build scripts to verify that the correct client library is used for compiling the DBD-MariaDB.
…on=system-pic parametrization This ensures that the Makefile.PL will correctly use libmysqld library with embedded server support for compiling DBD-MariaDB. If the libmysqld library cannot be used then the Makefile.PL will return an error and build fails.
…or testing to Github Actions CI
…or testing to Github Actions CI
choroba
force-pushed
the
mysql8
branch
3 times, most recently
from
January 13, 2025 14:35
eaed3e9
to
cd1b99c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.