Skip to content

add mysql_optional as dsn parameter#1022

Open
Thomblin wants to merge 3 commits intopercona:3.xfrom
Thomblin:pt-osc-mysql_optional
Open

add mysql_optional as dsn parameter#1022
Thomblin wants to merge 3 commits intopercona:3.xfrom
Thomblin:pt-osc-mysql_optional

Conversation

@Thomblin
Copy link
Copy Markdown

This pull requests adds mysql_ssl_option as an dsn paramter to pt-online-schema-change.

Why?

Upgrading debian from bullseye to bookworm or trixie changes the behaviour of perl DBI. As a consequence perl DBI is not able to use ssl anymore when enforced (pt-online-schema-change raises the exception "SSL connection error: Enforcing SSL encryption is not supported").

See: Debian Bug Report 1032074

I found no fix for this (using official sources). The only workaround to make it work is calling pt-online-schema-change with both mysql_ssl=1 and mysl_ssl_optional=1

Please advice how and if tests or documentation need to be adjusted.

  • The contributed code is licensed under GPL v2.0
  • Individual Contributor License Agreement is signed
  • util/update-modules has been ran
  • Documentation updated
  • Test suite update

@it-percona-cla
Copy link
Copy Markdown

it-percona-cla commented Oct 29, 2025

CLA assistant check
All committers have signed the CLA.

@svetasmirnova
Copy link
Copy Markdown
Collaborator

Immediate workaround is to install DBD::mysql, depending on upstream or Percona libmysql, available in Percona repositories.

I will check proposed solution, so Percona Toolkit can run with default DBD::mysql, linked to libmariadb3 too. Currently I can only say that you modified auto-generated code that will be rewritten once we create packages or simply update modules. Check CONTRIBUTING.md for how to update modules and create tests for your contributions.

@Thomblin
Copy link
Copy Markdown
Author

@svetasmirnova I added the option to lib and tests

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces support for mysql_ssl_optional as a DSN key (o=...) and as a command-line option (--mysql_ssl_optional) for pt-online-schema-change, to work around SSL enforcement behavior changes in Perl DBI on newer Debian releases.

Changes:

  • Add DSN key o (mysql_ssl_optional) to generated DBI connection strings.
  • Document --mysql_ssl_optional and DSN key o in pt-online-schema-change POD.
  • Extend the pt-online-schema-change test suite to cover the new option and validate it appears in --help.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
t/pt-online-schema-change/ssl.t Adds new SSL test cases for mysql_ssl_optional via DSN and CLI.
t/pt-online-schema-change/option_sanity.t Adds a help-text assertion for --mysql_ssl_optional.
lib/DSNParser.pm Extends MySQL connection string construction to include DSN key o.
bin/pt-online-schema-change Extends embedded DSN parsing/connection string logic and updates POD for the new option/DSN key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +197 to +207
is(
$exit_code,
0,
"No error when using mysql_ssl_optional DSN parameter (o=1)"
) or diag($output);

like(
$output,
qr/Successfully altered `test`.`t1`/,
"DROP PRIMARY KEY with mysql_ssl_optional DSN parameter"
);
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The new mysql_ssl_optional assertions only check exit code and success output. Earlier in this file, the SSL-related tests also assert the absence of the "Authentication requires secure connection" error to verify the connection mode. Adding the same unlike(... secure connection ...) check here would make the new tests validate SSL behavior more directly and consistently.

Copilot uses AI. Check for mistakes.
- Adjusted t/pt-online-schema-change/ssl.t, so it checks if secure connection works
- Checked --help output for --mysql_ssl_optional together with other options in option_sanity.t
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.

4 participants