fix: accept STANDALONE_TABLE_FUNCTION_ENTRY in bindInQueryCall (VECTOR extension fix) - #1
Open
chiangchenghsin-hash wants to merge 1 commit into
Open
Conversation
Fixes CREATE_VECTOR_INDEX returning "not a table or algorithm function" from Node.js API. The function is registered as STANDALONE_TABLE_FUNCTION_ENTRY but bindInQueryCall only matched TABLE_FUNCTION_ENTRY.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes
CREATE_VECTOR_INDEXreturningBinder exception: CREATE_VECTOR_INDEX is not a table or algorithm functionwhen called from the Node.js API.Bug
The VECTOR extension registers
CREATE_VECTOR_INDEXas aSTANDALONE_TABLE_FUNCTION_ENTRY(type 26). However,bindInQueryCall()inbind_in_query_call.cpponly matchesTABLE_FUNCTION_ENTRY(type 23) — missing the standalone variant entirely.This causes the error on ALL database types (
:memory:and file-based) when callingCREATE_VECTOR_INDEXfrom Node.js. The CLI shell is unaffected because it goes throughparser/visitor/standalone_call_rewriter.cppwhich handles the rewrite path differently.Fix
Add
case CatalogEntryType::STANDALONE_TABLE_FUNCTION_ENTRY:to the switch statement inbindInQueryCall(). One line change.Verification
conn.querySync("CALL CREATE_VECTOR_INDEX(...)")→ ✅ HNSW index created and queried successfullyCREATE_FTS_INDEX) continues to work correctly (unaffected by this change)page_rank,scc, etc.) continue to work correctlyRelated