Added ca_arena_sprintf and ca_arena_add_pointer

These functions simplify the use of arenas for allocating strings and buffers
of unknown (expensive to precalculate) size.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Allow specify growth amount to CA_ARRAY_GROW

This was accomplished by adding a second macro CA_ARRAY_GROW_N.  This is useful
for building long strings, where checking for resize for every single byte can
be too expensive.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
query-parser.y: Return error status rather than printing error messages

Different front-ends may have different opininons on how to display error
messages, so it does not make sense to print error messages in the query
parsing code.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
query-lexer.l: Correctly treat "foo" as an Identifier

Previously, the "s were being skipped, and the string contents were treated as
syntax.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Improve support for formatting the SELECT output expression list

The architecture to accomplish this is quite convoluted at the moment.  There's
a large amount of branching to deal with different expression types and value
types.  When we move to LLVM based query processing, the code that's actually
being run per row will be significantly simple, as the branching will happen
once per query, rather than once per value.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>