Fix identifier handling for identifiers with special characters (e.g. org.uat)#23
Fix identifier handling for identifiers with special characters (e.g. org.uat)#23jbdocuphase wants to merge 4 commits intoMariaDB:mainfrom
org.uat)#23Conversation
|
Fixes #25 |
|
Going to take a different approach with this. It's probably best we automatically quote all identifiers coming into the MCP to make the rules simper. Please hold-off on merge until I've made those changes. Thanks! |
|
Simplified the implementation and updated PR details |
org.uat)
|
Q: Will this solve if there is special characters? For example i have an issue when the LLM does a LIKE '%Test%' the % throws an error in the mcp application? @jbdocuphase |
No, that sounds like a separate problem that probably warrants a separate issue. This PR simply fixes the handling of identifiers (database names, table names, etc) that have special characters in them. |
|
@mariadb-RyanKillea @mariadb-VijayMullangi I haven't received feedback on this PR. Not sure what else is needed from me. Please let me know, thanks. |
This PR fixes an issue when using the MCP against databases that have special characters in their name, such as
org.uat, which would cause MCP calls to fail due to "invalid name" errors.According to MariaDB's documentation here, there are particular rules around what constitutes a valid/invalid identifier.
Key Changes
.isidentifier()with_is_valid_identifier()method that follows MariaDB identifier rules_normalize_identifier()as a guard method at all MCP endpoint entry points that:_quote_identifier()to safely quote identifiers for SQL without double-quotingorg.uatand`org.uat`are handled identicallyTesting
Verified this works for databases with special characters. Unable to test vector store endpoints due to missing embedding provider setup.