Prakash Premkumar wrote:
> Can you please tell me which grammar rule in parse.y file parses aggregate
> function ?

As you already were told, there are rules that parse _all_ functions:

  expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP(E).
  expr(A) ::= id(X) LP STAR RP(E).

Due to the sharing of these rules, the parser allows DISTINCT and * to
be used with non-aggregate functions:

  sqlite> SELECT date();
  2015-09-21
  sqlite> SELECT date(DISTINCT);
  2015-09-21
  sqlite> SELECT date(*);
  2015-09-21

(But it wouldn't be a good idea to rely on this implementation ...)


Regards,
Clemens

Reply via email to