empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject empire-db git commit: EMPIREDB-236 fixed subquery join problem
Date Thu, 11 Feb 2016 16:13:53 GMT
Repository: empire-db
Updated Branches:
  refs/heads/master 269ce4f44 -> 873f699f8


EMPIREDB-236
fixed subquery join problem


Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo
Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/873f699f
Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/873f699f
Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/873f699f

Branch: refs/heads/master
Commit: 873f699f89c6bd1aa9c85dc3bdd769f7b8a1dc7e
Parents: 269ce4f
Author: Rainer Döbele <doebele@apache.org>
Authored: Thu Feb 11 17:13:44 2016 +0100
Committer: Rainer Döbele <doebele@apache.org>
Committed: Thu Feb 11 17:13:44 2016 +0100

----------------------------------------------------------------------
 .../org/apache/empire/db/expr/join/DBJoinExprEx.java     | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/empire-db/blob/873f699f/empire-db/src/main/java/org/apache/empire/db/expr/join/DBJoinExprEx.java
----------------------------------------------------------------------
diff --git a/empire-db/src/main/java/org/apache/empire/db/expr/join/DBJoinExprEx.java b/empire-db/src/main/java/org/apache/empire/db/expr/join/DBJoinExprEx.java
index 111116c..639dd47 100644
--- a/empire-db/src/main/java/org/apache/empire/db/expr/join/DBJoinExprEx.java
+++ b/empire-db/src/main/java/org/apache/empire/db/expr/join/DBJoinExprEx.java
@@ -20,6 +20,7 @@ package org.apache.empire.db.expr.join;
 
 import org.apache.empire.db.DBColumnExpr;
 import org.apache.empire.db.DBJoinType;
+import org.apache.empire.db.DBQuery;
 import org.apache.empire.db.DBRowSet;
 import org.apache.empire.db.expr.compare.DBCompareAndOrExpr;
 import org.apache.empire.db.expr.compare.DBCompareColExpr;
@@ -55,6 +56,14 @@ public class DBJoinExprEx extends DBJoinExpr
         return null;
     }
     
+    private static DBColumnExpr firstRsetColumn(DBRowSet rset)
+    {
+        if (rset instanceof DBQuery)
+           return ((DBQuery)rset).getQueryColumns()[0];
+        else 
+           return rset.getColumn(0);
+    }
+    
     /**
      * Constructs a new DBJoinExprEx
      * 
@@ -64,7 +73,7 @@ public class DBJoinExprEx extends DBJoinExpr
      */
     public DBJoinExprEx(DBRowSet rset, DBCompareExpr cmp, DBJoinType joinType)
     {
-        super(rset.getColumn(0), findFirstColumn(cmp), joinType);
+        super(firstRsetColumn(rset), findFirstColumn(cmp), joinType);
         this.cmp = cmp;
     }
     


Mime
View raw message