Skip to content

Commit 4ca5dc1

Browse files
author
ilker moral
committed
Fixing the problem with alter table query execution
1 parent 4e28693 commit 4ca5dc1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

bootstrap.go

+3
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ func (ch *clickhouse) hello(database, username, password string) error {
184184
if err := ch.ServerInfo.Read(ch.decoder); err != nil {
185185
return err
186186
}
187+
case protocol.ServerEndOfStream:
188+
ch.logf("[bootstrap] <- end of stream")
189+
return nil
187190
default:
188191
ch.conn.Close()
189192
return fmt.Errorf("[hello] unexpected packet [%d] from server", packet)

clickhouse_read_meta.go

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ func (ch *clickhouse) readMeta() (*data.Block, error) {
4040
}
4141
ch.logf("[read meta] <- data: packet=%d, columns=%d, rows=%d", packet, block.NumColumns, block.NumRows)
4242
return block, nil
43+
case protocol.ServerEndOfStream:
44+
_, err := ch.readBlock()
45+
ch.logf("[process] <- end of stream")
46+
return nil, err
4347
default:
4448
ch.conn.Close()
4549
return nil, fmt.Errorf("[read meta] unexpected packet [%d] from server", packet)

0 commit comments

Comments
 (0)