mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #8323 from ClickHouse/minor-improvements-backquote
Added quoting of db and table names where appropriate
This commit is contained in:
commit
980cf16873
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <Core/Types.h>
|
#include <Core/Types.h>
|
||||||
#include <Common/CpuId.h>
|
#include <Common/CpuId.h>
|
||||||
|
#include <Common/quoteString.h>
|
||||||
#include <common/getMemoryAmount.h>
|
#include <common/getMemoryAmount.h>
|
||||||
#include <DataStreams/copyData.h>
|
#include <DataStreams/copyData.h>
|
||||||
#include <DataStreams/NullBlockOutputStream.h>
|
#include <DataStreams/NullBlockOutputStream.h>
|
||||||
@ -142,7 +143,7 @@ bool PerformanceTest::checkPreconditions() const
|
|||||||
|
|
||||||
if (!exist)
|
if (!exist)
|
||||||
{
|
{
|
||||||
LOG_WARNING(log, "Table " << table_to_check << " doesn't exist");
|
LOG_WARNING(log, "Table " << backQuote(table_to_check) << " doesn't exist");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ void TCPHandler::runImpl()
|
|||||||
{
|
{
|
||||||
if (!connection_context.isDatabaseExist(default_database))
|
if (!connection_context.isDatabaseExist(default_database))
|
||||||
{
|
{
|
||||||
Exception e("Database " + default_database + " doesn't exist", ErrorCodes::UNKNOWN_DATABASE);
|
Exception e("Database " + backQuote(default_database) + " doesn't exist", ErrorCodes::UNKNOWN_DATABASE);
|
||||||
LOG_ERROR(log, "Code: " << e.code() << ", e.displayText() = " << e.displayText()
|
LOG_ERROR(log, "Code: " << e.code() << ", e.displayText() = " << e.displayText()
|
||||||
<< ", Stack trace:\n\n" << e.getStackTrace().toString());
|
<< ", Stack trace:\n\n" << e.getStackTrace().toString());
|
||||||
sendException(e, connection_context.getSettingsRef().calculate_text_stack_trace);
|
sendException(e, connection_context.getSettingsRef().calculate_text_stack_trace);
|
||||||
|
@ -153,7 +153,7 @@ StoragePtr DatabaseWithOwnTablesBase::detachTable(const String & table_name)
|
|||||||
|
|
||||||
auto it = tables.find(table_name);
|
auto it = tables.find(table_name);
|
||||||
if (it == tables.end())
|
if (it == tables.end())
|
||||||
throw Exception("Table " + name + "." + table_name + " doesn't exist.", ErrorCodes::UNKNOWN_TABLE);
|
throw Exception("Table " + backQuote(name) + "." + backQuote(table_name) + " doesn't exist.", ErrorCodes::UNKNOWN_TABLE);
|
||||||
res = it->second;
|
res = it->second;
|
||||||
tables.erase(it);
|
tables.erase(it);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ LibraryDictionarySource::LibraryDictionarySource(
|
|||||||
|
|
||||||
if (!Poco::File(path).exists())
|
if (!Poco::File(path).exists())
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"LibraryDictionarySource: Can't load lib " + toString() + ": " + Poco::File(path).path() + " - File doesn't exist",
|
"LibraryDictionarySource: Can't load library " + Poco::File(path).path() + ": file doesn't exist",
|
||||||
ErrorCodes::FILE_DOESNT_EXIST);
|
ErrorCodes::FILE_DOESNT_EXIST);
|
||||||
|
|
||||||
description.init(sample_block);
|
description.init(sample_block);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <Common/setThreadName.h>
|
#include <Common/setThreadName.h>
|
||||||
#include <Common/typeid_cast.h>
|
#include <Common/typeid_cast.h>
|
||||||
#include <common/logger_useful.h>
|
#include <common/logger_useful.h>
|
||||||
|
#include <Common/quoteString.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
@ -364,7 +365,7 @@ bool StorageKafka::streamToViews()
|
|||||||
{
|
{
|
||||||
auto table = global_context.getTable(database_name, table_name);
|
auto table = global_context.getTable(database_name, table_name);
|
||||||
if (!table)
|
if (!table)
|
||||||
throw Exception("Engine table " + database_name + "." + table_name + " doesn't exist.", ErrorCodes::LOGICAL_ERROR);
|
throw Exception("Engine table " + backQuote(database_name) + "." + backQuote(table_name) + " doesn't exist.", ErrorCodes::LOGICAL_ERROR);
|
||||||
|
|
||||||
// Create an INSERT query for streaming data
|
// Create an INSERT query for streaming data
|
||||||
auto insert = std::make_shared<ASTInsertQuery>();
|
auto insert = std::make_shared<ASTInsertQuery>();
|
||||||
|
Loading…
Reference in New Issue
Block a user