drop LEX_STRING from VDF arg/return helpers (#415)#1
Closed
pyshx wants to merge 1 commit intopyshx/qbn-string-viewfrom
Closed
drop LEX_STRING from VDF arg/return helpers (#415)#1pyshx wants to merge 1 commit intopyshx/qbn-string-viewfrom
pyshx wants to merge 1 commit intopyshx/qbn-string-viewfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ValidateAndConvertVDFArgumentsandSetVDFReturnTypeContext'sextension_nameparam fromconst LEX_STRING&tostd::string_view.const std::string ext_name(extension_name.str, extension_name.length)local atutil.cc:1280— it existed only to satisfymake_qualified_base_nameandResolveTypeToContext, both of which now takestring_view.to_string_view(extension_name)wrap atutil.cc:1440— push the conversion outward to the caller boundary.villagesql/vdf/vdf_handler.cc:100, 174to useto_string_view(m_udf->extension_name)frominclude/lex_string.h:58.Related Issue
Closes villagesql#415. Follow-up to villagesql#412; surfaced in @malone-at-work review on villagesql#257. Same shape as villagesql#412 — a function that converts at the inner boundary, where pushing the conversion out to the caller eliminates a
std::stringallocation per VDF arg-validation pass.Depends on villagesql#419 landing first. Without it,
make_qualified_base_name(extension_name, ...)would need a temporarystd::string(extension_name)— exactly what this PR removes. The branch carries villagesql#419's commit until it merges; will rebase onto main after.How was this tested?
-DWITH_DEBUG=1)villint.sh --commit upstream/mainclean on the changed filesctest -L villagesql— 7/7 villagesql unit tests pass--do-suite=village --nounit-tests --parallel=auto— 552 tests pass, 8 skipped, 0 failures-Werrorissues as drop LEX_STRING from ResolveTypeToContext villagesql/villagesql-server#412; trusting upstream CI)Checklist