Fix checks

This commit is contained in:
kssenii 2021-09-09 09:53:01 +03:00
parent bed2688dad
commit f26da04cdf
4 changed files with 4 additions and 7 deletions

View File

@ -30,7 +30,6 @@ namespace DB
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
extern const int LOGICAL_ERROR;
extern const int QUERY_NOT_ALLOWED;
extern const int UNKNOWN_TABLE;
@ -313,8 +312,8 @@ void DatabaseMaterializedPostgreSQL::attachTable(const String & table_name, cons
StoragePtr DatabaseMaterializedPostgreSQL::detachTable(const String & table_name)
{
/// If there is query context then we need to dettach materialized storage.
/// If there is no query context then we need to dettach internal storage from atomic database.
/// If there is query context then we need to detach materialized storage.
/// If there is no query context then we need to detach internal storage from atomic database.
if (CurrentThread::isInitialized() && CurrentThread::get().getQueryContext())
{
auto & table_to_delete = materialized_tables[table_name];

View File

@ -199,7 +199,7 @@ BlockIO InterpreterAlterQuery::executeToDatabase(const ASTAlterQuery & alter)
if (command.type == AlterCommand::MODIFY_DATABASE_SETTING)
database->applyNewSettings(command.settings_changes, getContext());
else
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unsupported alter command");
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Unsupported alter command");
}
}
}

View File

@ -197,8 +197,6 @@ public:
/// Commands have to be prepared before apply.
void apply(StorageInMemoryMetadata & metadata, ContextPtr context) const;
/// At least one command modify settings.
bool hasSettingsAlterCommand() const;

View File

@ -151,7 +151,7 @@ def test_grant_all_on_table():
instance.query("GRANT ALL ON test.table TO A WITH GRANT OPTION")
instance.query("GRANT ALL ON test.table TO B", user='A')
assert instance.query(
"SHOW GRANTS FOR B") == "GRANT SHOW TABLES, SHOW COLUMNS, SHOW DICTIONARIES, SELECT, INSERT, ALTER, CREATE TABLE, CREATE VIEW, CREATE DICTIONARY, DROP TABLE, DROP VIEW, DROP DICTIONARY, TRUNCATE, OPTIMIZE, SYSTEM MERGES, SYSTEM TTL MERGES, SYSTEM FETCHES, SYSTEM MOVES, SYSTEM SENDS, SYSTEM REPLICATION QUEUES, SYSTEM DROP REPLICA, SYSTEM SYNC REPLICA, SYSTEM RESTART REPLICA, SYSTEM RESTORE REPLICA, SYSTEM FLUSH DISTRIBUTED, dictGet ON test.table TO B\n"
"SHOW GRANTS FOR B") == "GRANT SHOW TABLES, SHOW COLUMNS, SHOW DICTIONARIES, SELECT, INSERT, ALTER TABLE, ALTER VIEW, CREATE TABLE, CREATE VIEW, CREATE DICTIONARY, DROP TABLE, DROP VIEW, DROP DICTIONARY, TRUNCATE, OPTIMIZE, SYSTEM MERGES, SYSTEM TTL MERGES, SYSTEM FETCHES, SYSTEM MOVES, SYSTEM SENDS, SYSTEM REPLICATION QUEUES, SYSTEM DROP REPLICA, SYSTEM SYNC REPLICA, SYSTEM RESTART REPLICA, SYSTEM RESTORE REPLICA, SYSTEM FLUSH DISTRIBUTED, dictGet ON test.table TO B\n"
instance.query("REVOKE ALL ON test.table FROM B", user='A')
assert instance.query("SHOW GRANTS FOR B") == ""