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

Improvements for database handle and connection attributes #190

Merged
merged 8 commits into from
Aug 13, 2023

Conversation

pali
Copy link
Member

@pali pali commented Jul 14, 2023

  • Allow to modify $dbh->{mariadb_multi_statements} also after connection to server was established
  • Allow to specify mariadb_auth_plugin connection attribute

pali added 3 commits July 14, 2023 18:54
It is enabled by default via CLIENT_FOUND_ROWS, so only clearing it is needed.
It is disabled by default, so only setting it is needed.
lib/DBD/MariaDB.pod Outdated Show resolved Hide resolved
dbdimp.h Show resolved Hide resolved
return FALSE;
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, what about testing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully automated testing of mariadb_auth_plugin is not possible. It requires configuration of different authentication method which would be understood by both client and server. Maybe it could be possible to write github CI testing for it, but that would require to change / hack how MySQL::Sandbox setup mysql server in its virtual env.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not even the mysql_native_password with a new client?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot expect that mysql_native_password is always present in new mysql versions (e.g. system admin can decide to not install support for it) and also we cannot expect that oracle does not decide to drop support for this specific plugin in some new mysql version. So automated test which is always run during install/test phase of perl DBD-MariaDB and uses mysql_native_password is fragile and can cause breaking of installation in future.

We can run such test only in controlled env, e.g. on github actions under configuration where we are sure that this one specific method mysql_native_password is enabled and is working.

@pali
Copy link
Member Author

pali commented Jul 25, 2023

Unfortunately new tests for mariadb_auth_plugin are failing (bug in MySQL 8.x client), details in: #156 (comment)

So I would have to prepare different test for mariadb_auth_plugin.

Since MySQL client version 5.5.7 it is possible to specify other
authentication method than "mysql_native_password". This option can be
used to specify authentication method which will client use during
connection to MariaDB or MySQL server.
It is possible either via Makefile.PL option --testauthplugin or
Makefile.PL env variable DBD_MARIABD_TESTAUTHPLUGIN.
Move documentation for mariadb_multi_statements, mariadb_server_prepare,
and mariadb_server_prepare_disable_fallback from connection section to
database handle section. And add information that any read/write dbh
attribute can be specified also as connection parameter.
Sometimes git commit for pull requests on Github Actions CI is the fake
merge commit, not the pushed one. So checkout the correct pushed (HEAD)
commit.
@pali
Copy link
Member Author

pali commented Aug 12, 2023

Unfortunately I was not able to write any other reliable automated test for mariadb_auth_plugin due to those mentioned issues.

I squashed commits and dropped changes for non-working tests.

@pali pali merged commit e81937d into perl5-dbi:master Aug 13, 2023
186 checks passed
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