Fix #2583: quote identifiers, not expressions

94023a5 switched to storing OrderBy terms by column
 name and/or expression instead of by column index, and
 includes a test to ensure that identifiers are quoted
 and raw expressions are not; unfortunately it seems to
 have gotten the logic backwards.
This commit is contained in:
oldlaptop
2021-06-21 15:23:50 -04:00
parent 5097760fe6
commit 6b03a33eae
+2 -2
View File
@@ -32,9 +32,9 @@ struct OrderBy
std::string toSql() const
{
if(is_expression)
return sqlb::escapeIdentifier(expr) + (direction == Ascending ? " ASC" : " DESC");
else
return expr + (direction == Ascending ? " ASC" : " DESC");
else
return sqlb::escapeIdentifier(expr) + (direction == Ascending ? " ASC" : " DESC");
}
std::string expr;