Skip to content

drop LEX_STRING from VDF arg/return#420

Merged
villagestevers merged 2 commits intovillagesql:mainfrom
pyshx:pyshx/lex-string-vdf-helpers
May 6, 2026
Merged

drop LEX_STRING from VDF arg/return#420
villagestevers merged 2 commits intovillagesql:mainfrom
pyshx:pyshx/lex-string-vdf-helpers

Conversation

@pyshx
Copy link
Copy Markdown
Contributor

@pyshx pyshx commented May 2, 2026

Description

  • Change ValidateAndConvertVDFArguments and SetVDFReturnTypeContext's extension_name param from const LEX_STRING& to std::string_view.
  • Drop the const std::string ext_name(extension_name.str, extension_name.length) local at util.cc:1280 — it existed only to satisfy make_qualified_base_name and ResolveTypeToContext, both of which now take string_view.
  • Drop the inner to_string_view(extension_name) wrap at util.cc:1440 — push the conversion outward to the caller boundary.
  • Update both call sites in villagesql/vdf/vdf_handler.cc:100, 174 to use to_string_view(m_udf->extension_name) from include/lex_string.h:58.
  • No behavior change.

Related Issue

Closes #415. Follow-up to #412; surfaced in @malone-at-work review on #257. Same shape as #412 — a function that converts at the inner boundary, where pushing the conversion out to the caller eliminates a std::string allocation per VDF arg-validation pass.

Depends on #419 landing first. Without it, make_qualified_base_name(extension_name, ...) would need a temporary std::string(extension_name) — exactly what this PR removes. The branch carries #419's commit until it merges; will rebase onto main after.

How was this tested?

  • Debug build clean (-DWITH_DEBUG=1)
  • villint.sh --commit upstream/main clean on the changed files
  • ctest -L villagesql — 7/7 villagesql unit tests pass
  • MTR --do-suite=village --nounit-tests --parallel=auto — 552 tests pass, 8 skipped, 0 failures
  • Maintainer-mode build: not verified locally (same pre-existing macOS clang -Werror issues as drop LEX_STRING from ResolveTypeToContext #412; trusting upstream CI)

Checklist

  • I have signed the CLA
  • I have read CONTRIBUTING.md
  • I have added or updated tests as appropriate
  • My changes maintain compatibility with upstream MySQL 8.4

@pyshx pyshx changed the title drop LEX_STRING from VDF arg/return helpers drop LEX_STRING from VDF arg/return May 2, 2026
@villagestevers villagestevers self-requested a review May 4, 2026 14:37
@pyshx pyshx force-pushed the pyshx/lex-string-vdf-helpers branch from 05499a2 to 29b95a0 Compare May 5, 2026 13:04
pyshx added 2 commits May 6, 2026 15:44
ValidateAndConvertVDFArguments immediately decomposed const LEX_STRING&
extension_name into a std::string at line 1280, used only to satisfy
make_qualified_base_name and ResolveTypeToContext. SetVDFReturnTypeContext
wrapped its parameter via to_string_view() at the inner ResolveTypeToContext
call instead of the outer boundary. Take std::string_view directly in both
so callers do the conversion once via to_string_view() from
include/lex_string.h. Follow-up to villagesql#412; surfaced in villagesql#257 review thread.
CI villint flagged two line-wrap nits caused by the longer
extension_name / to_string_view(...) text replacing ext_name /
m_udf->extension_name in villagesql#415.
@pyshx pyshx force-pushed the pyshx/lex-string-vdf-helpers branch from 29b95a0 to 6353b43 Compare May 6, 2026 10:21
@villagestevers villagestevers merged commit 805bcbe into villagesql:main May 6, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server]: cleanup LEX_STRING in VDF arg/return helpers

2 participants