You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2015/11/07 19:26:04 UTC

svn commit: r1713164 - /openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java

Author: damjan
Date: Sat Nov  7 18:26:04 2015
New Revision: 1713164

URL: http://svn.apache.org/viewvc?rev=1713164&view=rev
Log:
#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.


Modified:
    openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java

Modified: openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java?rev=1713164&r1=1713163&r2=1713164&view=diff
==============================================================================
--- openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java (original)
+++ openoffice/trunk/main/wizards/com/sun/star/wizards/db/SQLQueryComposer.java Sat Nov  7 18:26:04 2015
@@ -83,6 +83,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++)