mirror of https://github.com/citusdata/citus.git
Merge pull request #432 from citusdata/bugfix/#374-select-without-target-crash
Fix SELECT problem with no target listpull/436/head
commit
a3b1b8944d
|
@ -46,7 +46,7 @@ SetRangeTblExtraData(RangeTblEntry *rte, CitusRTEKind rteKind,
|
||||||
Const *fragmentTableData = NULL;
|
Const *fragmentTableData = NULL;
|
||||||
Const *tableIdListData = NULL;
|
Const *tableIdListData = NULL;
|
||||||
|
|
||||||
Assert(rte->eref && rte->eref->colnames != NIL);
|
Assert(rte->eref);
|
||||||
|
|
||||||
/* store RTE kind as a plain int4 */
|
/* store RTE kind as a plain int4 */
|
||||||
rteKindData = makeNode(Const);
|
rteKindData = makeNode(Const);
|
||||||
|
|
|
@ -285,6 +285,19 @@ SELECT COUNT(*) FROM articles;
|
||||||
50
|
50
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
-- test with empty target list
|
||||||
|
SELECT FROM articles;
|
||||||
|
--
|
||||||
|
(50 rows)
|
||||||
|
|
||||||
|
SELECT FROM articles WHERE author_id = 3737;
|
||||||
|
--
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT FROM articles WHERE word_count = 65500;
|
||||||
|
--
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
-- having queries unsupported in Citus
|
-- having queries unsupported in Citus
|
||||||
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
||||||
GROUP BY author_id
|
GROUP BY author_id
|
||||||
|
|
|
@ -166,6 +166,13 @@ $sharded_sql$;
|
||||||
-- test cross-shard queries
|
-- test cross-shard queries
|
||||||
SELECT COUNT(*) FROM articles;
|
SELECT COUNT(*) FROM articles;
|
||||||
|
|
||||||
|
-- test with empty target list
|
||||||
|
SELECT FROM articles;
|
||||||
|
|
||||||
|
SELECT FROM articles WHERE author_id = 3737;
|
||||||
|
|
||||||
|
SELECT FROM articles WHERE word_count = 65500;
|
||||||
|
|
||||||
-- having queries unsupported in Citus
|
-- having queries unsupported in Citus
|
||||||
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
SELECT author_id, sum(word_count) AS corpus_size FROM articles
|
||||||
GROUP BY author_id
|
GROUP BY author_id
|
||||||
|
|
Loading…
Reference in New Issue