Skip call to get partitions if domain is NONE
Fix incorrect parsing of function arguments

The current parser incorrectly allows function calls with the following syntax:

    foo(,1,2)
    foo(DISTINCT ,x)
    foo(DISTINCT)