Kaydet (Commit) 046771ca authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic

#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.
üst d0991ab9
...@@ -83,6 +83,10 @@ public class SQLQueryComposer ...@@ -83,6 +83,10 @@ public class SQLQueryComposer
public String getSelectClause(boolean _baddAliasFieldNames) throws SQLException 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 sSelectBaseClause = "SELECT ";
String sSelectClause = sSelectBaseClause; String sSelectClause = sSelectBaseClause;
for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++) for (int i = 0; i < CurDBMetaData.FieldColumns.length; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment