public QueryParseResult parse(String sql, @Nonnull SqlSecurityContext ssc) {
        try {
            return parse0(sql, ssc);
        } catch (QueryException e) {
            throw e;
        } catch (Exception e) {
            String message;
            // Check particular type of exception which causes typical long multiline error messages.
            if (e instanceof SqlParseException && e.getCause() instanceof ParseException) {
                message = trimMessage(e.getMessage());
            } else {
                message = e.getMessage();
            }
            throw QueryException.error(SqlErrorCode.PARSING, message, e);
        }
    }
@Test
    public void test_trailingSemicolon() {
        given(sqlValidator.validate(isA(SqlNode.class))).willReturn(validatedNode);

        parser.parse("SELECT * FROM t;");
        parser.parse("SELECT * FROM t;;");
    }