Author: shawkins
Date: 2011-08-11 07:36:26 -0400 (Thu, 11 Aug 2011)
New Revision: 3375
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestAccessNode.java
Log:
TEIID-1704 fix for not returning rows from implicit grouping
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
===================================================================
---
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2011-08-10
20:39:40 UTC (rev 3374)
+++
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2011-08-11
11:36:26 UTC (rev 3375)
@@ -108,6 +108,11 @@
}
return true;
}
+
+ if (query.hasAggregates() && query.getGroupBy() == null) {
+ return true;
+ }
+
break;
case Command.TYPE_INSERT:
Insert insert = (Insert) command;
Modified:
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestAccessNode.java
===================================================================
---
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestAccessNode.java 2011-08-10
20:39:40 UTC (rev 3374)
+++
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational/TestAccessNode.java 2011-08-11
11:36:26 UTC (rev 3375)
@@ -124,4 +124,9 @@
Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT e1,
e2 FROM pm1.g1 LIMIT 0"); //$NON-NLS-1$
assertFalse(RelationalNodeUtil.shouldExecute(query, false));
}
+
+ @Test public void testShouldExecuteAgg() throws Exception {
+ Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT
count(*) FROM pm1.g1 where false"); //$NON-NLS-1$
+ assertTrue(RelationalNodeUtil.shouldExecute(query, false));
+ }
}
Show replies by date