-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: Net MEVD: Sqlite escape table and column names, treat empty batches as NOP #11252
base: feature-vector-data-preb2
Are you sure you want to change the base?
.Net: Net MEVD: Sqlite escape table and column names, treat empty batches as NOP #11252
Conversation
@@ -15,6 +15,6 @@ internal abstract class SqliteWhereCondition(string operand, List<object> values | |||
public abstract string BuildQuery(List<string> parameterNames); | |||
|
|||
protected string GetOperand() => !string.IsNullOrWhiteSpace(this.TableName) ? | |||
$"{this.TableName}.{this.Operand}" : | |||
this.Operand; | |||
$"[{this.TableName}].[{this.Operand}]" : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In SQLite, the standard quoting mechanism is double-quoted (the square brackets is more of a SQL Server thing). In fact I'm surprised this works!
Also, don't we need to escape TableName and Operand, in case they contain special characters?
I'd maybe suggest having a single method somewhere (RenderSqlIdentifier?) which does the quoting and escaping, and used from everywhere (for column, table, index names...).
fixes #11251
contributes to #10194