Skip to content

history file not written if clickhouse-client was stopped by Ctrl+C #9897

@filimonov

Description

@filimonov

Before the test

 cat ~/.clickhouse-client-history 
### 2020-03-27 11:26:19.472
exit
### 2020-03-27 11:26:25.071
select 1;
### 2020-03-27 11:26:34.441
exit;

Test - run clickhouse & kill it by double Ctrl+C.

clickhouse-client
ClickHouse client version 20.4.1.1.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.4.1 revision 54434.

node_1_1 :) select 2;

SELECT 2

┌─2─┐
│ 2 │
└───┘

1 rows in set. Elapsed: 0.004 sec. 

node_1_1 :) select * from remote('node_2_1','system','one');

SELECT *
FROM remote('node_2_1', 'system', 'one')

^CCancelling query.
^C

When i rerun clickhouse-client again, I have a history of last session lost.

# cat ~/.clickhouse-client-history 
### 2020-03-27 11:26:19.472
exit
### 2020-03-27 11:26:25.071
select 1;
### 2020-03-27 11:26:34.441
exit;

AFAIR it was working properly with readline

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official releasecomp-cliclickhouse-client (interactive CLI) and client library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions