cql3 : add workaround to antlr3 null dereference bug
cql3 : add workaround to antlr3 null dereference bug

The Antlr3 exception class has a null dereference bug that crashes
the system when trying to extract the exception message using
ANTLR_Exception<...>::displayRecognitionError(...) function. When
a parsing error occurs the CqlParser throws an exception which in
turn processesed for some special cases in scylla to generate a custom
message. The default case however, creates the message using
displayRecognitionError, causing the system to crash.
The fix is a simple workaround, making sure the pointer is not null
before the call to the function. A "proper" fix can't be implemented
because the exception class itself is implemented outside scylla
in antlr headers that resides on the host machine os.

Tested manualy 2 testcases, a typo causing scylla to crash and
a cql comment without a newline at the end also caused scylla to crash.
Ran unit tests (release).

Fixes #3740
Fixes #3764

Signed-off-by: Eliran Sinvani <da50580cbf194fc955df7e548082c96276f28b37@scylladb.com>
Message-Id: <cfc7e0d758d7a855d113bb7c8191b0fd7d2e8921.1538566542.git.da50580cbf194fc955df7e548082c96276f28b37@scylladb.com>

scylladb/scylla,avikivity/scylla,scylladb/scylla,scylladb/scylla,avikivity/scylla,scylladb/scylla,avikivity/scylla