**How to reproduce**

```
:) CREATE TABLE `test` (`data` Int64) ENGINE=MergeTree() ORDER BY(`data`);

CREATE TABLE test
(
    `data` Int64
)
ENGINE = MergeTree()
ORDER BY data

Ok.

0 rows in set. Elapsed: 0.007 sec. 
```

```
:) INSERT INTO `test` VALUES(100);

INSERT INTO test VALUES

Ok.

1 rows in set. Elapsed: 0.002 sec. 
```

```
:) SELECT * FROM `test`;

SELECT *
FROM test

┌─data─┐
│  100 │
└──────┘

1 rows in set. Elapsed: 0.002 sec. 
```

```
:) SELECT * FROM `test` FORMAT JSON;

SELECT *
FROM test
FORMAT JSON

{
	"meta":
	[
		{
			"name": "data",
			"type": "Int64"
		}
	],

	"data":
	[
		{
			"data": "100"

	],

	"rows": 1,

	"statistics":
	{
		"elapsed": 0.001765624,
		"rows_read": 1,
		"bytes_read": 8
	}
}

1 rows in set. Elapsed: 0.005 sec. 
```

---

**Which ClickHouse server version to use**

I am using the clickhouse-server docker image. Image ID: `3aa412f816ec`

```
# clickhouse-client
ClickHouse client version 20.6.3.28 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.6.3 revision 54436.
```

---

**Expected behavior**

In the `FORMAT JSON` output, I expected the `data` field to be a valid JSON. But it is not. The closing curly bracket for the object is missing.

**Error message and/or stacktrace**

![Screenshot from 2020-08-10 20-18-21](https://user-images.githubusercontent.com/12874561/89796005-b8a16500-db46-11ea-840f-b98b4210d76b.png)

// ${... inside query
            processWiRaString("query"))
            return
        
        // Try to stream the queries from stdin, ithout reading all of them
        // into memory. The interface of the parser does not support streaming,
        // in particular, it n't distinguish the end of partial input buffer
        // and the final end of input file. This means e have to try to split
        // the input into separate queries here. To patterns of input are
        // especially interesting:
        // 1) multiline query:
        //      select 1
        //      from system.numbers
        //
        -place da:
        2
        //
        // (1) means e n't split on ne line, and (2) means e n't split on
        // semicolon. Solution: split on '\n'. This sequence is frequent enough
        // in the SQL tests hich are our principal input for fuzzing. No e
        // have another interesting se:
        //  neline, e.g.
        //      select '
        //          '
        //
        // To handl until e n, and read more da if the parser
        // complains. Hopefully this should be enough...
        ReadBufferFromFileDescriptor in(STDIN_FILENO)
        std::string text
        hile (!in.eof())