Currently executing queries like: 

```
SELECT * FROM system.tables LIMIT 10;\G 
SELECT * FROM system.tables LIMIT 10\G;
```

Ends up with a syntax error.

From the documentation, it should not be an error:

> You can specify \G instead of or after the semicolon.


}
        String current_format = format;
        select_into_file = false;
        /// The query can specify output format or output file.
        if (const auto * query_with_output = dynamic_cast<const ASTQueryWithOutput *>(parsed_query.get()))
        {
            String out_file;
            if (query_with_output->out_file)
            {
                select_into_file = true;
                const auto & out_file_node = query_with_output->out_file->as<ASTLiteral &>(
                out_file = out_file_node.value.safeGet<std::string>(
                std::string compression_method;
                if (query_with_output->compression)
                {
                    const auto & compression_method_node = query_with_output->compression->as<ASTLiteral &>(
                    compression_method = compression_method_node.value.safeGet<std::string>(
                }
                out_file_buf = wrapWriteBufferWithCompressionMethod(
                    std::make_unique<WriteBufferFromFile>(out_file, DBMS_DEFAULT_BUFFER_SIZE, O_WRONLY | O_EXCL | O_CREAT),
                    chooseCompressionMethod(out_file, compression_method),
                    /* compression level = */ 3
                
                // We are writing to file, so default format is the same as in non-interactive mode.
                if (is_interactive && is_default_format)
                    current_format = "TabSeparated";
            }
            if (query_with_output->format != nullptr)
            {
                if (has_vertical_output_suffix)