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

Update CI, fix Embedded server, improve tests, adjust to MySQL 8 #213

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

choroba
Copy link
Member

@choroba choroba commented Dec 10, 2024

No description provided.

@choroba choroba force-pushed the mysql8 branch 4 times, most recently from 85d6f5d to d18479b Compare December 11, 2024 21:41
pali added 22 commits December 11, 2024 23:10
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.
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.
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
@choroba choroba force-pushed the mysql8 branch 2 times, most recently from c43be43 to fabcb64 Compare December 12, 2024 23:08
pali and others added 2 commits December 13, 2024 13:49
…s CI

cpanm --with-configure requires Makefile.PL to finish successfully and it
requires DBD_MARIADB_* env to be set properly.
choroba and others added 7 commits January 12, 2025 01:02
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.
@choroba choroba force-pushed the mysql8 branch 3 times, most recently from eaed3e9 to cd1b99c Compare January 13, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants