mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Make sure to always escape table and column names properly
Always put `...` around the names of tables, columns and other objects to avoid errors when the user creates objects with the name of key words.
This commit is contained in:
@@ -605,7 +605,7 @@ void MainWindow::deleteObject()
|
||||
QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) == QMessageBox::Yes)
|
||||
{
|
||||
// Delete the table
|
||||
QString statement = QString("DROP %1 %2;").arg(type.toUpper()).arg(table);
|
||||
QString statement = QString("DROP %1 `%2`;").arg(type.toUpper()).arg(table);
|
||||
if(!db.executeSQL( statement))
|
||||
{
|
||||
QString error = QString("Error: could not delete the %1. Message from database engine:\n%2").arg(type).arg(db.lastErrorMessage);
|
||||
|
||||
Reference in New Issue
Block a user