mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
SHOW TABLES is now considered as one query in the quota calculations, not two queries.
This commit is contained in:
parent
dab2356833
commit
f83be158ba
@ -20,6 +20,11 @@ public:
|
|||||||
|
|
||||||
BlockIO execute() override;
|
BlockIO execute() override;
|
||||||
|
|
||||||
|
/// We ignore the quota and limits here because execute() will rewrite a show query as a SELECT query and then
|
||||||
|
/// the SELECT query will checks the quota and limits.
|
||||||
|
bool ignoreQuota() const override { return true; }
|
||||||
|
bool ignoreLimits() const override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ASTPtr query_ptr;
|
ASTPtr query_ptr;
|
||||||
Context & context;
|
Context & context;
|
||||||
|
@ -20,6 +20,11 @@ public:
|
|||||||
|
|
||||||
BlockIO execute() override;
|
BlockIO execute() override;
|
||||||
|
|
||||||
|
/// We ignore the quota and limits here because execute() will rewrite a show query as a SELECT query and then
|
||||||
|
/// the SELECT query will checks the quota and limits.
|
||||||
|
bool ignoreQuota() const override { return true; }
|
||||||
|
bool ignoreLimits() const override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ASTPtr query_ptr;
|
ASTPtr query_ptr;
|
||||||
Context & context;
|
Context & context;
|
||||||
|
@ -71,12 +71,12 @@ def started_cluster():
|
|||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def reset_quotas_and_usage_info():
|
def reset_quotas_and_usage_info():
|
||||||
try:
|
try:
|
||||||
yield
|
|
||||||
finally:
|
|
||||||
copy_quota_xml('simpliest.xml') # To reset usage info.
|
|
||||||
instance.query("DROP QUOTA IF EXISTS qA, qB")
|
instance.query("DROP QUOTA IF EXISTS qA, qB")
|
||||||
copy_quota_xml('simpliest.xml') # To reset usage info.
|
copy_quota_xml('simpliest.xml') # To reset usage info.
|
||||||
copy_quota_xml('normal_limits.xml')
|
copy_quota_xml('normal_limits.xml')
|
||||||
|
yield
|
||||||
|
finally:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def test_quota_from_users_xml():
|
def test_quota_from_users_xml():
|
||||||
@ -379,4 +379,11 @@ def test_query_inserts():
|
|||||||
|
|
||||||
instance.query("INSERT INTO test_table values(1)")
|
instance.query("INSERT INTO test_table values(1)")
|
||||||
system_quota_usage(
|
system_quota_usage(
|
||||||
[["myQuota", "default", 31556952, 1, 1000, 0, 500, 1, 500, 0, "\\N", 0, "\\N", 0, "\\N", 0, 1000, 0, "\\N", "\\N"]])
|
[["myQuota", "default", 31556952, 1, 1000, 0, 500, 1, 500, 0, "\\N", 0, "\\N", 0, "\\N", 0, 1000, 0, "\\N", "\\N"]])
|
||||||
|
|
||||||
|
def test_consumption_show_tables_quota():
|
||||||
|
instance.query("SHOW TABLES")
|
||||||
|
|
||||||
|
assert re.match(
|
||||||
|
"myQuota\\tdefault\\t.*\\t31556952\\t1\\t1000\\t1\\t500\\t0\\t500\\t0\\t\\\\N\\t1\\t\\\\N\\t19\\t\\\\N\\t1\\t1000\\t35\\t\\\\N\\t.*\\t\\\\N\n",
|
||||||
|
instance.query("SHOW QUOTA"))
|
||||||
|
Loading…
Reference in New Issue
Block a user