fix: implement proper table name escaping for all DBMS#9
Open
vipitec-neo wants to merge 1 commit intohickelsoft:mainfrom
Open
fix: implement proper table name escaping for all DBMS#9vipitec-neo wants to merge 1 commit intohickelsoft:mainfrom
vipitec-neo wants to merge 1 commit intohickelsoft:mainfrom
Conversation
SQL_Escape_TableName had several issues:
1. SQL Server: escaped [ with [[] instead of escaping ] with ]].
Only ] needs doubling inside [...] brackets.
2. MySQL: backticks in table names were not escaped.
Fix: double backticks (`` -> ````).
3. InterBase/Firebird: table names were returned unquoted.
Fix: use SQL-standard double-quote quoting ("" -> """").
4. Access: table names were returned unquoted.
Fix: use square bracket quoting (] -> ]]).
5. BDE/Local: table names were returned unquoted.
Fix: use square bracket quoting like Access.
Includes unit tests (Free Pascal) and integration tests against
real Firebird 4.0 and MariaDB 10 Docker containers.
529d443 to
1ff40cb
Compare
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.
Problem
SQL_Escape_TableNamehad incomplete or incorrect escaping for most DBMS:[with[[](wrong)]with]]`→`` ``"quoting,"→""[]quoting,]→]][]quoting like AccessTests
Unit Tests (Free Pascal)
11 tests covering all DBMS: simple names, special characters, schema-qualified names.
Integration Tests (Docker)
6 tests against real Firebird 4.0 and MariaDB 10:
Not testable in CI