empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1628677 - /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java
Date Wed, 01 Oct 2014 11:25:55 GMT
Author: doebele
Date: Wed Oct  1 11:25:55 2014
New Revision: 1628677

URL: http://svn.apache.org/r1628677
Log:
EMPIREDB-212

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java?rev=1628677&r1=1628676&r2=1628677&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCombinedCmd.java Wed Oct
 1 11:25:55 2014
@@ -128,17 +128,25 @@ public class DBCombinedCmd extends DBCom
    {
       // the left part
       left.clearOrderBy();
-      buf.append( "(" );
-      left.getSelect(buf);
+      if (!(left instanceof DBCombinedCmd)) {
+	      buf.append( "(" );
+	      left.getSelect(buf);
+	      buf.append( ")" );
+      } else
+	      left.getSelect(buf);
       // concat keyword     
-      buf.append( ")\r\n" );
+      buf.append( "\r\n" );
       buf.append( keyWord );
-      buf.append( " (" );
+      buf.append( "\r\n" );
       // the right part
       right.clearOrderBy();
-      right.getSelect(buf);
+      if (!(right instanceof DBCombinedCmd)) {
+	      buf.append( "(" );
+	      right.getSelect(buf);
+	      buf.append( ")" );
+      } else
+	      right.getSelect(buf);
       // done
-      buf.append( ")" );
       // Add optional Order by statement
       if ( orderBy!=null )
       {    // Having



Mime
View raw message