test fixes

This commit is contained in:
velavokr 2023-07-03 18:28:56 +03:00 committed by velavokr
parent 2f85d048ae
commit ae87d43f88
2 changed files with 8 additions and 5 deletions

View File

@ -881,13 +881,16 @@ void InterpreterCreateQuery::validateTableStructure(const ASTCreateQuery & creat
}
}
namespace {
void checkTemporaryTableEngineName(const String& name) {
namespace
{
void checkTemporaryTableEngineName(const String& name)
{
if (name.starts_with("Replicated") || name == "KeeperMap")
throw Exception(ErrorCodes::INCORRECT_QUERY, "Temporary tables cannot be created with Replicated or KeeperMap table engines");
}
void setDefaultTableEngine(ASTStorage &storage, DefaultTableEngine engine) {
void setDefaultTableEngine(ASTStorage &storage, DefaultTableEngine engine)
{
if (engine == DefaultTableEngine::None)
throw Exception(ErrorCodes::ENGINE_REQUIRED, "Table engine is not specified in CREATE query");

View File

@ -83,8 +83,8 @@ CREATE TEMPORARY TABLE tmp (n int);
SHOW CREATE TEMPORARY TABLE tmp;
CREATE TEMPORARY TABLE tmp1 (n int) ENGINE=Memory;
CREATE TEMPORARY TABLE tmp2 (n int) ENGINE=Log;
CREATE TEMPORARY TABLE tmp2 (n int) ORDER BY n; -- {serverError 80}
CREATE TEMPORARY TABLE tmp2 (n int, PRIMARY KEY (n)); -- {serverError 80}
CREATE TEMPORARY TABLE tmp2 (n int) ORDER BY n; -- {serverError 36}
CREATE TEMPORARY TABLE tmp2 (n int, PRIMARY KEY (n)); -- {serverError 36}
CREATE TABLE log (n int);
SHOW CREATE log;