Skip to content

fix: accept STANDALONE_TABLE_FUNCTION_ENTRY in bindInQueryCall (VECTOR extension fix) - #1

Open
chiangchenghsin-hash wants to merge 1 commit into
mainfrom
fix/vector-standalone-table-function
Open

fix: accept STANDALONE_TABLE_FUNCTION_ENTRY in bindInQueryCall (VECTOR extension fix)#1
chiangchenghsin-hash wants to merge 1 commit into
mainfrom
fix/vector-standalone-table-function

Conversation

@chiangchenghsin-hash

Copy link
Copy Markdown
Owner

Summary

Fixes CREATE_VECTOR_INDEX returning Binder exception: CREATE_VECTOR_INDEX is not a table or algorithm function when called from the Node.js API.

Bug

The VECTOR extension registers CREATE_VECTOR_INDEX as a STANDALONE_TABLE_FUNCTION_ENTRY (type 26). However, bindInQueryCall() in bind_in_query_call.cpp only matches TABLE_FUNCTION_ENTRY (type 23) — missing the standalone variant entirely.

This causes the error on ALL database types (:memory: and file-based) when calling CREATE_VECTOR_INDEX from Node.js. The CLI shell is unaffected because it goes through parser/visitor/standalone_call_rewriter.cpp which handles the rewrite path differently.

Fix

Add case CatalogEntryType::STANDALONE_TABLE_FUNCTION_ENTRY: to the switch statement in bindInQueryCall(). One line change.

Verification

  • Windows 11 x64, MSVC 19.50, LadybugDB 0.18.3
  • Node.js API: conn.querySync("CALL CREATE_VECTOR_INDEX(...)") → ✅ HNSW index created and queried successfully
  • FTS (CREATE_FTS_INDEX) continues to work correctly (unaffected by this change)
  • ALGO functions (page_rank, scc, etc.) continue to work correctly

Related

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.
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.

1 participant