Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 missing group by gives bad error

open
nobody
None
5
2002-05-07
2002-05-07
Anthony Baxter
No

The following SQL:

select bar, sum(quantity), avg(quantity),
count(*), sum(quantity)/count(quantity)
from serves
where beer<>'bud'

(missing the 'group by bar')

gives the following error

Traceback (most recent call last):
File "test/test_gadfly.py", line 834, in test2
self.curs.execute(dudsql)
File "gadfly/database.py", line 361, in execute
results[i] = cs[i].eval(params)
File "gadfly/semantics.py", line 2819, in eval
(tups, attorder) = select_list.map(substseq)
File "gadfly/semantics.py", line 1288, in map
values.append(exp.value(assnlist))
File "gadfly/semantics.py", line 1146, in value
result[i] = contexts[i][ra]
File "gadfly/kjbuckets0.py", line 533, in __getitem__
return self.dict[item]
KeyError: ('SERVES', 'BAR')

Discussion