Every native scalar function is already tagged whether they're pure or
not but because we don't implement the is_pure() function, all functions
end up being advertised as pure. This means that functions like now()
that are *not* pure, end up being evaluated only once.
Fixes#571.
Message-Id: <1456227171-461-1-git-send-email-penberg@scylladb.com>
There's no benefit to using C include guards so switch to pragma once
everywhere for consistency.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Also replace derived types (map_type, collection_type, etc.).
As we'll change data_type's definition, this reduces the number of places
that need to be modified later, and is more readable.
Change function argument types and return values to bytes_opt.
Note: a comment in the code says that NULL arguments are not supported,
but it seems prudent to prepare for the day they will be.
The Functions class wants to store functions in a map and hand them out later,
so we need a shared_ptr.
(could have had a map of name -> function factory, maybe one day)