fix #3653 - mySQL installation failing on Rows reserved word

This commit is contained in:
sbwalker
2024-01-25 10:59:18 -05:00
parent 38a5cc33e8
commit 7c6424e05c
4 changed files with 22 additions and 2 deletions

View File

@ -75,6 +75,14 @@ namespace Oqtane.Database.MySQL
return dr;
}
public override string RewriteName(string name, bool isQuery)
{
if (name.ToLower() == "rows" && isQuery)
{
name = $"`{name}`"; // escape reserved word in SQL query
}
return name;
}
public override DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
{