Do not allow cartodbfying tables while no user quota is set

Closes #17
Updates tests
This commit is contained in:
Sandro Santilli
2014-05-12 13:07:47 +02:00
parent e6b02de9aa
commit f98071cdac
7 changed files with 28 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ CREATE TRIGGER test_quota BEFORE UPDATE OR INSERT ON big
EXECUTE PROCEDURE CDB_CheckQuota(1,1);
INSERT INTO big VALUES (1); -- allowed, check runs before
INSERT INTO big VALUES (1); -- disallowed, quota exceeds before
SELECT CDB_SetUserQuotaInBytes(0);
SELECT CDB_CartodbfyTable('big');
INSERT INTO big SELECT generate_series(1,1024);
SELECT CDB_SetUserQuotaInBytes(8);
@@ -15,3 +16,4 @@ SELECT CDB_SetUserQuotaInBytes(0);
INSERT INTO big VALUES (1);
DROP TABLE big;
set client_min_messages to NOTICE;
DROP FUNCTION _CDB_UserQuotaInBytes();