Skip to content

Cherry pick #120972 to 26.3: MySQL dictionary source: accept enable_local_infile only in the configuration file - #121594

Merged
PedroTadim merged 1 commit into
backport/26.3/120972from
cherrypick/26.3/120972
Sep 25, 2026
Merged

PedroTadim merged 1 commit into
backport/26.3/120972from
cherrypick/26.3/120972

Conversation

@robot-ch-test-poll3

Copy link
Copy Markdown
Contributor

Original pull-request #120972

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Before you resolve anything

Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

@robot-ch-test-poll3 robot-ch-test-poll3 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Sep 22, 2026
@groeneai

groeneai commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Every conflict here is master context that 26.3 never had, so the resolution is exactly the five files of #120972 and nothing else. The resolved merge is on my fork; I hold pull and triage but not push, so moving it here needs write access. No PR of mine is involved: per #118300 a fork PR is not needed when the resolution can be fast-forwarded straight onto the cherry-pick branch, which it can here:

git fetch https://github.com/groeneai/ClickHouse groeneai/resolve-26.3-cherrypick-120972
git push origin FETCH_HEAD:cherrypick/26.3/120972

ee2d5630558287482dd66b4a93f62ea3a404f8eb, tree 7de483c6c2bd95cee6bb46ef00f633deaa0b5f45, parents 3fc318b24f8b (this PR's head) and a0063573bfe4 (backport/26.3/120972, still the live tip). git merge-base --is-ancestor 3fc318b24f8b ee2d56305582 returns 0, so it fast-forwards this branch, and git diff --stat a0063573bfe4 ee2d56305582 is 5 files, +233 / -1, the single deletion being the one-line DICTS assignment in the integration test.

MySQLDictionarySource.cpp, three conflicts, all "master adds, the branch has nothing":

  1. The #if USE_MYSQL helper block and the guard calls at the replica prefix. checkNoSSLPaths in both comes from e700bbe (MySQL TLS credentials as contents), absent from 26.3, so only checkNoLocalInfile is carried over, in its own #if USE_MYSQL / #endif; its comment loses "Same reasoning as above.", which pointed at checkNoSSLPaths' comment. The registerDictionarySourceMysql forward declaration next to it is unrelated to MySQL dictionary source: accept enable_local_infile only in the configuration file #120972 and is also not ported: 26.3 sets no_warning(missing-prototypes), which is why it never needed one.
  2. factory.registerSource("mysql", ...): master passes a Documentation{} argument holding this source's docs as a R"DOCS_MD(...)" block, 26.3 registers the source with no documentation argument at all, so MySQL dictionary source: accept enable_local_infile only in the configuration file #120972's two documentation lines have no counterpart and the branch side stands unchanged.
  3. extern const int BAD_ARGUMENTS; is restored so the ErrorCodes block matches master's: it reached master with checkNoSSLPaths, so the merge dropped it as a branch-side deletion. The file does still compile without it (Storages/NamedCollectionsHelpers.h declares it too), but check_cpp.sh:149 looks the declaration up in the using file.

test_dictionaries_mysql/test.py, two more conflicts, both from master tests 26.3 never received (compression, wire-level compression, shared-pool inheritance) and the dictionary configs they register. Only #120972's own additions are ported: test_enable_local_infile_xml_dict byte for byte, plus mysql_dict_local_infile.xml appended to the branch's own two-entry DICTS list.

-X ours is not a shortcut on this wave: on the cherry-pick side "ours" is master, so it would silently backport checkNoSSLPaths, the documentation migration and four unrelated tests.

Validated on the resolved branch, built with 26.3's own clang-21 pin, server 26.3.33.1: 05229_mysql_dictionary_enable_local_infile passes, and passes 50/50 with randomized settings; reverting only MySQLDictionarySource.cpp to this branch's blob (one TU rebuilt, Build ID 754bfd9b vs 03de1131) fails exactly the four arms that expect a rejection. ci/jobs/check_style.py flags none of the five files. The integration arm needs the Docker MySQL fixture and was not run here; its added function is byte-identical to master's.

@nihalzp, you merged #120972, so flagging this to you as the remaining step on the 26.3 arm.

…guration file

`enable_local_infile` sets `MYSQL_OPT_LOCAL_INFILE`, which lets the MySQL endpoint the
dictionary points at ask the client for the contents of a file of its choosing, read with the
server's own privileges. The source configuration of a dictionary created with a DDL query
comes from the query itself, so it may not reach that option; it stays available to a
dictionary defined in a server configuration file.

(cherry picked from commit c1a3809)

Adapted for 26.3. #112070 is not on this branch, so there is no `checkNoSSLPaths` for the
guard to sit beside and no `BAD_ARGUMENTS` in the file's `ErrorCodes` block.
`checkNoLocalInfile` is therefore added standalone, with that declaration, and hooked into
the two `created_from_ddl` call sites this branch already has: the per-`<replica>` loop,
which passes the parent prefix so an inherited value is resolved the way `Pool::Pool`
resolves it, and the single-endpoint branch. The documentation hunk of the original is
dropped, because the settings table it edits does not exist on this branch.

Original pull-request: #120972

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants