Skip to content

Wrong error message when (mis)using aggregate functions #1826

Description

@SimoneLazzaris

What happened

immuclient>query select * from aaa;
+----------------------------------------+---------------+---------------+
|               (aaa.xid)                | (aaa.payload) | (aaa.cronogy) |
+----------------------------------------+---------------+---------------+
| "00000000-0000-0000-0000-000000000000" | "salacadula"  |             1 |
| "46297fd0-68dd-11ee-8e22-9387c2da716c" | "apollo"      |             1 |
| "7a8d7d06-c703-4656-b5e4-380ae65763ea" | "apollo"      |             1 |
| "b96d62f3-2cb6-5122-bba8-4e6bfdafef35" | "apollo"      |             1 |
| "ffffffff-ffff-ffff-ffff-ffffffffffff" | "salacadula"  |             1 |
+----------------------------------------+---------------+---------------+

immuclient>exec update aaa set cronogy=max(cronogy)+1.0;
ERROR: rpc error: code = Unknown desc = column does not exist (cronogy)

What you expected to happen
This is how sqlite reports the error:

sqlite> update asd set cronogy=max(cronogy)+1.0;
Parse error: misuse of aggregate function max()
  update asd set cronogy=max(cronogy)+1.0;
                         ^--- error here

How to reproduce it (as minimally and precisely as possible)

See above

Environment

$ immudb version
immudb 1.9.0-RC1
Commit  : 0a2992d0bfcde383379081a10cd1d12af68c486b
Built by: slazzaris@gmail.com
Built at: Thu, 12 Oct 2023 11:43:26 CEST

Additional info (any other context about the problem)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions