adjust database count checking DatabaseCatalog::TEMPORARY_DATABASE explicitly, change 'yandex' into 'clickhouse' in config.xml

This commit is contained in:
Xu Jia 2024-06-10 16:45:38 +08:00
parent 446cc0542b
commit a2fd206a4d
2 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create)
{
size_t db_count = DatabaseCatalog::instance().getDatabases().size();
// there's an invisible system database _temporary_and_external_tables, so we need to subtract 1
if (db_count > 0)
if (db_count > 0 && DatabaseCatalog::instance().isDatabaseExist(DatabaseCatalog::TEMPORARY_DATABASE))
db_count--;
if (db_count >= max_db)
throw Exception(ErrorCodes::TOO_MANY_DATABASES,

View File

@ -19,7 +19,7 @@ TEMP_DIR=$(mktemp -d "$CUR_DIR/$(basename "$BASE").XXXXXX")
# Generate config.xml
CONFIG_FILE="$TEMP_DIR/config.xml"
cat > "$CONFIG_FILE" <<EOL
<yandex>
<clickhouse>
<logger>
<level>information</level>
<log>$TEMP_DIR/clickhouse-server.log</log>
@ -35,7 +35,7 @@ cat > "$CONFIG_FILE" <<EOL
</users_xml>
</user_directories>
</yandex>
</clickhouse>
EOL
echo "<clickhouse>