diff --git a/Makefile b/Makefile index 9c4d9af..16bd74b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # cartodb/Makefile EXTENSION = cartodb -EXTVERSION = 0.9.2 +EXTVERSION = 0.9.3 SED = sed @@ -45,6 +45,7 @@ UPGRADABLE = \ 0.9.0 \ 0.9.1 \ 0.9.2 \ + 0.9.3 \ $(EXTVERSION)dev \ $(EXTVERSION)next \ $(END) diff --git a/NEWS.md b/NEWS.md index ae2fc43..2ae0db4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +0.9.3 (2015-08-27) +------------------ +* Modify sampling of quota trigger [#126](https://github.com/CartoDB/cartodb-postgresql/issues/126) + 0.9.2 (2015-08-24) ------------------ * Fix for `the_geom` column present but not SRID (EWKT) and other corner cases [#121](https://github.com/CartoDB/cartodb-postgresql/pull/121) diff --git a/scripts-available/CDB_CartodbfyTable.sql b/scripts-available/CDB_CartodbfyTable.sql index 1dc1ac1..aaee3af 100644 --- a/scripts-available/CDB_CartodbfyTable.sql +++ b/scripts-available/CDB_CartodbfyTable.sql @@ -222,7 +222,7 @@ BEGIN sql := 'CREATE TRIGGER test_quota BEFORE UPDATE OR INSERT ON ' || reloid::text - || ' EXECUTE PROCEDURE public.CDB_CheckQuota(1, ''-1'', ''' + || ' EXECUTE PROCEDURE public.CDB_CheckQuota(0.1, ''-1'', ''' || schema_name::text || ''')'; EXECUTE sql; diff --git a/test/CDB_QuotaTest.sql b/test/CDB_QuotaTest.sql index f834c7b..dc4ec68 100644 --- a/test/CDB_QuotaTest.sql +++ b/test/CDB_QuotaTest.sql @@ -1,6 +1,9 @@ set client_min_messages to error; \set VERBOSITY default +-- See the dice +SELECT setseed(0.5); + CREATE TABLE big(a int); -- Try the legacy interface -- See https://github.com/CartoDB/cartodb-postgresql/issues/13 @@ -18,6 +21,7 @@ SELECT CDB_UserDataSize(); SELECT cartodb._CDB_total_relation_size('public', 'big'); SELECT cartodb._CDB_total_relation_size('public', 'nonexistent_table_name'); -- END Test for #108 +SELECT setseed(0.9); SELECT CDB_SetUserQuotaInBytes(2); INSERT INTO big VALUES (8193); SELECT CDB_SetUserQuotaInBytes(0); diff --git a/test/CDB_QuotaTest_expect b/test/CDB_QuotaTest_expect index de50130..0d1b9c0 100644 --- a/test/CDB_QuotaTest_expect +++ b/test/CDB_QuotaTest_expect @@ -1,4 +1,5 @@ SET + CREATE TABLE CREATE TRIGGER INSERT 0 1 @@ -11,6 +12,7 @@ INSERT 0 2048 454656 909312 0 + 2 ERROR: Quota exceeded by 443.998046875KB 0