This commit is contained in:
Mikhail Artemenko 2024-08-29 13:12:37 +00:00
parent e9497cdcbc
commit f06678ee6c
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,15 @@
initial
A C
simple copy
A C D
node-A
simple move
A C H
node-A
move node with childs -- must be error
Transaction failed (Not empty): Op #2, path: /test-keeper-client-cp-mv-commands/A
A C H
move node to existing
Transaction failed (Node exists): Op #1, path: /test-keeper-client-cp-mv-commands/A
A C H
clean up

View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
path="/test-keeper-client-cp-mv-commands"
$CLICKHOUSE_KEEPER_CLIENT -q "rm '$path'" >& /dev/null
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path' 'root'"
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/A' 'node-A'"
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/A/B' 'node-B'"
$CLICKHOUSE_KEEPER_CLIENT -q "create '$path/C' 'node-B'"
echo 'initial'
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
echo 'simple copy'
$CLICKHOUSE_KEEPER_CLIENT -q "cp '$path/A' '$path/D'"
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
$CLICKHOUSE_KEEPER_CLIENT -q "get '$path/D'"
echo 'simple move'
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/D' '$path/H'"
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
$CLICKHOUSE_KEEPER_CLIENT -q "get '$path/H'"
echo 'move node with childs -- must be error'
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/A' '$path/ERROR'" 2>&1
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
echo 'move node to existing'
$CLICKHOUSE_KEEPER_CLIENT -q "mv '$path/C' '$path/A'" 2>&1
$CLICKHOUSE_KEEPER_CLIENT -q "ls '$path'"
echo 'clean up'
$CLICKHOUSE_KEEPER_CLIENT -q "rmr '$path'"