File tree Expand file tree Collapse file tree
src/Pomelo.Extensions.Caching.MySql Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ internal class MySqlQueries
5252 public MySqlQueries ( string schemaName , string tableName )
5353 {
5454 var tableNameWithSchema = string . Format (
55- "{0}.{1}" , DelimitIdentifier ( schemaName ) , DelimitIdentifier ( tableName ) ) ;
55+ "{0}.{1}" , EscapeIdentifier ( DelimitIdentifier ( schemaName ) ) , EscapeIdentifier ( DelimitIdentifier ( tableName ) ) ) ;
5656
5757 // when retrieving an item, we do an UPDATE first and then a SELECT
5858 GetCacheItem = string . Format ( UpdateCacheItemFormat + GetCacheItemFormat , tableNameWithSchema ) ;
@@ -85,5 +85,10 @@ private string EscapeLiteral(string literal)
8585 {
8686 return literal . Replace ( "'" , "''" ) ;
8787 }
88+
89+ private string EscapeIdentifier ( string identifier )
90+ {
91+ return $ "`{ identifier } `";
92+ }
8893 }
8994}
You can’t perform that action at this time.
0 commit comments