penberg / limbo

Limbo is a work-in-progress, in-process OLTP database management system, compatible with SQLite.
MIT License
896 stars 49 forks source link

fix: unhanded empty args in aggregate function #102

Closed KunalSin9h closed 1 month ago

KunalSin9h commented 1 month ago

When the args are empty in aggregate function like

SELECT COUNT() FROM users; // This is valid
SELECT AVG() from users; // this must give error

The value of info.args.as_ref() is None which make the program crash due to unwrap(). All the implementation till now of aggrigate function check the args using args.len() then are assuming that the args after unwrap will be an empty array. But that not the case as we have explained before.

This pr, created an empty args vector then the args is None.

image

penberg commented 1 month ago

Thank you, @KunalSin9h! 🚀