IDEMPIERE-4390 Error in the Workflow window (#201)

add keyword quote escape to gridtable and mquery
This commit is contained in:
hengsin 2020-08-03 19:43:38 +08:00 committed by GitHub
parent f010b10446
commit a3a86739c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -347,7 +347,7 @@ public class GridTable extends AbstractTableModel
if (i > 0)
select.append(",");
GridField field = (GridField)m_fields.get(i);
select.append(field.getColumnSQL(true)); // ColumnName or Virtual Column
select.append(field.isVirtualColumn() ? field.getColumnSQL(true) : DB.getDatabase().quoteColumnName(field.getColumnSQL(true))); // ColumnName or Virtual Column
}
//
select.append(" FROM ").append(m_tableName);

View File

@ -1216,7 +1216,7 @@ class Restriction implements Serializable
// We have a Function in the ColumnName
if (pos != -1 && end != -1 && !(pos-1==ColumnName.indexOf('(') && ColumnName.trim().startsWith("(")))
sb.append(ColumnName.substring(0, pos))
.append(tableName).append(".").append(ColumnName.substring(pos, end))
.append(tableName).append(".").append(DB.getDatabase().quoteColumnName(ColumnName.substring(pos, end)))
.append(ColumnName.substring(end));
else
{
@ -1228,12 +1228,12 @@ class Restriction implements Serializable
}
else
{
sb.append(tableName).append(".").append(ColumnName);
sb.append(tableName).append(".").append(DB.getDatabase().quoteColumnName(ColumnName));
}
}
}
else
sb.append(ColumnName);
sb.append(virtualColumn ? ColumnName : DB.getDatabase().quoteColumnName(ColumnName));
sb.append(Operator);
if ( ! (Operator.equals(MQuery.NULL) || Operator.equals(MQuery.NOT_NULL)))