diff options
| author | 2017-02-09 04:36:04 -0500 | |
|---|---|---|
| committer | 2017-02-09 04:36:04 -0500 | |
| commit | d9aa870e5d509cc7309ab82dd102a937ab58613a (patch) | |
| tree | d92d03d76b5c390b335f1cfd761f1a0b59ec8496 /SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp | |
| parent | 68ee4cbcbe424b95969c70346283a9f217f63825 (diff) | |
Imported Upstream version 3.1.1+dfsg1upstream/3.1.1+dfsg1
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp b/SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp index 4e2d9b6..c10e8f7 100644 --- a/SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/querygenerator.cpp @@ -87,7 +87,10 @@ QString QueryGenerator::generateUpdateOfTable(Db* db, const QString& database, c // If no values were given, we simply use column names as values everywhere if (values.isEmpty()) - return tplWithWhere.arg(target, commonColumnStr, commonColumnStr); + { + QString conditionStr = commonUpdateCols.join(" AND "); + return tplWithWhere.arg(target, commonColumnStr, conditionStr); + } // If values were given, then they will be used in WHERE clause QStringList valueCols = values.keys(); @@ -126,7 +129,7 @@ QString QueryGenerator::generateDeleteFromTable(Db* db, const QString& database, conditionCols << conditionColTpl.arg(wrapObjIfNeeded(col, dialect), wrapString(col)); // Put it to comma spearated string - QString conditionStr = conditionCols.join(", "); + QString conditionStr = conditionCols.join(" AND "); return tplWithWhere.arg(target, conditionStr); } |
