dynamobi/dynamobi — Issue #201: [LDB-120] select count(...) and select count(distinct...) issued back-to-back return wrong result due to caching
Author: dynamobi-build
Created: 2011-12-30 02:21:20+00:00
State: open
Labels: LDB

[reporter="kvu", created="Mon, 24 Jul 2006 19:25:18 -0500 (GMT-05:00)"]
To reproduce:

create schema s;

set schema 's';

create table t1(n integer);

insert into t1 values (1),(1);

select count(n) from t1;

select count(distinct n) from t1;

Result:

0: jdbc:luciddb:> select count(n) from t1;

+---------+

| EXPR$0 |

+---------+

| 2 |

+---------+

1 row selected (0.018 seconds)

0: jdbc:luciddb:> select count(distinct n) from t1;

+---------+

| EXPR$0 |

+---------+

| 2 |

+---------+

1 row selected (0.077 seconds)

The 2 queries return correct answer after this:

alter system set "codeCacheMaxBytes" = min;

0: jdbc:luciddb:> select count(n) from t1;

+---------+

| EXPR$0 |

+---------+

| 2 |

+---------+

1 row selected (0.8 seconds)

0: jdbc:luciddb:> select count(distinct n) from t1;

+---------+

| EXPR$0 |

+---------+

| 1 |

+---------+

1 row selected (0.779 seconds)