This commit is contained in:
万康 2021-07-27 20:32:04 +08:00
parent d826115f2a
commit 720f8805f9
6 changed files with 52 additions and 2 deletions

View File

@ -0,0 +1,5 @@
//
// Created by max_w on 2021/7/27.
//
#include "ASTDatabaseOrNone.h"

View File

@ -0,0 +1,16 @@
//
// Created by max_w on 2021/7/27.
//
#ifndef CLICKHOUSE_ASTDATABASEORNONE_H
#define CLICKHOUSE_ASTDATABASEORNONE_H
class ASTDatabaseOrNone {
};
#endif //CLICKHOUSE_ASTDATABASEORNONE_H

View File

@ -0,0 +1,5 @@
//
// Created by max_w on 2021/7/27.
//
#include "ParserDatabaseOrNone.h"

View File

@ -0,0 +1,16 @@
//
// Created by max_w on 2021/7/27.
//
#ifndef CLICKHOUSE_PARSERDATABASEORNONE_H
#define CLICKHOUSE_PARSERDATABASEORNONE_H
class ParserDatabaseOrNone {
};
#endif //CLICKHOUSE_PARSERDATABASEORNONE_H

View File

@ -1,2 +1,4 @@
default
db_01939
CREATE USER u_01939
CREATE USER u_01939 DEFAULT DATABASE NONE

View File

@ -5,8 +5,8 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
${CLICKHOUSE_CLIENT_BINARY} --query "drop database if exists db_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "create database db_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "create database if not exists db_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "create database if not exists NONE"
#create user by sql
${CLICKHOUSE_CLIENT_BINARY} --query "drop user if exists u_01939"
@ -15,5 +15,11 @@ ${CLICKHOUSE_CLIENT_BINARY} --query "create user u_01939 default database db_01
${CLICKHOUSE_CLIENT_BINARY} --query "SELECT currentDatabase();"
${CLICKHOUSE_CLIENT_BINARY} --user=u_01939 --query "SELECT currentDatabase();"
${CLICKHOUSE_CLIENT_BINARY} --query "alter user u_01939 default database NONE"
${CLICKHOUSE_CLIENT_BINARY} --query "show create user u_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "alter user u_01939 default database \`NONE\`"
${CLICKHOUSE_CLIENT_BINARY} --query "show create user u_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "drop user u_01939 "
${CLICKHOUSE_CLIENT_BINARY} --query "drop database db_01939"
${CLICKHOUSE_CLIENT_BINARY} --query "drop database NONE"