diff options
author | Damjan Jovanovic <damjan@apache.org> | 2015-11-07 18:26:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-10 09:46:53 +0000 |
commit | b9042d2e46f4a0645b63efb23e49b9421d04d837 (patch) | |
tree | 09621a996c9de8453bb0c0332149859c1b824fe1 | |
parent | f7715e6821c6763a9c57a06be482925ba75d9779 (diff) |
#i126029# Base query wizard error due to missing quoting of table and column names
During the Base query design wizard,
com.sun.star.wizards.ui.FilterComponent.getFilterConditions()
calls
com.sun.star.wizards.db.SQLQueryComposer.getSelectClause()
before its
getFromClause(). However the getSelectClause() needs composedCommandNames
which is populated only by getFromClause() in order to quote table and column names.
Without this, table and column names that need quoting (spaces, special characters,
reserved words) produce errors.
(cherry picked from commit 046771cac8605e5826a150e4454eff332b65d517)
-rw-r--r-- | wizards/com/sun/star/wizards/db/SQLQueryComposer.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index 4a7a679f3479..7a99b7d1d0f8 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -68,6 +68,10 @@ public class SQLQueryComposer public String getSelectClause(boolean _baddAliasFieldNames) throws SQLException { + // getFromClause() must be called first to populate composedCommandNames, + // but it's idempotent, so let's call it now in case the caller didn't already: + getFromClause(); + String sSelectBaseClause = "SELECT "; String sSelectClause = sSelectBaseClause; for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++) |