Compare commits

...

9 Commits
0.3.3 ... 0.3.5

Author SHA1 Message Date
Raul Ochoa
8349e3c94c Merge tag '0.3.5' into cdb
Release 0.3.5 fixed
2014-08-11 16:14:00 +02:00
Raul Ochoa
a747f16ecc Fixes release dates 2014-08-11 16:13:04 +02:00
Raul Ochoa
93de996acc Fixes 0.3.5 version:
- Version in Makefile
- Upgrade path from 0.3.4
2014-08-11 15:41:53 +02:00
Raul Ochoa
a98b100182 Ignore idea ide based settings 2014-08-11 15:41:33 +02:00
Kartones
72d8cf6210 Merge pull request #46 from CartoDB/CDB-3870
CDB-3870
2014-08-11 15:30:11 +02:00
Kartones
6c57640901 CDB-3870 replaced priority of qmax inside checkquota 2014-08-11 15:26:13 +02:00
Raul Ochoa
a67f324001 Release 0.3.4 version 2014-08-01 18:21:48 +02:00
Raul Ochoa
5bb638b995 Merge pull request #45 from CartoDB/CDB-3743
CDB_QueryTables returns only results for schemas associated to Relation-Names
2014-08-01 18:14:53 +02:00
Raul Ochoa
2637742c2e CDB-3743 Makes CDB_QueryTables to return only results for schemas associated to Relation-Names 2014-08-01 18:06:06 +02:00
6 changed files with 47 additions and 11 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ results/
regression.*
expected/test
sql/test
.idea/*

View File

@@ -1,7 +1,7 @@
# cartodb/Makefile
EXTENSION = cartodb
EXTVERSION = 0.3.3
EXTVERSION = 0.3.5
SED = sed
@@ -23,6 +23,8 @@ UPGRADABLE = \
0.3.0dev \
0.3.1 \
0.3.2 \
0.3.3 \
0.3.4 \
$(EXTVERSION)dev \
$(EXTVERSION)next \
$(END)

10
NEWS
View File

@@ -1,4 +1,12 @@
0.3.3 (2014-07-xx)
0.3.5 (2014-08-11)
------------------
Inverting priority of CDB_CheckQuota qmax so gies more priority to existing user quota function over parameter value.
0.3.4 (2014-08-01)
------------------
Fixes issue with schemas in CDB_QueryTables
0.3.3 (2014-07-30)
------------------
* Splitting of CartodbfyTable method in subfunctions to be able to call in fragments and evade timeouts on hot zones

View File

@@ -39,7 +39,7 @@ BEGIN
inp AS (
SELECT
xpath('//x:Relation-Name/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as x,
xpath('//x:Schema/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as s
xpath('//x:Relation-Name/../x:Schema/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as s
)
SELECT unnest(x)::name as p, unnest(s)::name as sc from inp
LOOP

View File

@@ -46,16 +46,20 @@ BEGIN
ELSE
schema_name := 'public';
END IF;
-- Hack to support old versions of CDB_CheckQuota with 2 params but without schema_name
IF TG_NARGS >= 2 AND TG_ARGV[1] <> '-1' THEN
qmax := TG_ARGV[1];
ELSE
-- By default try to use quota function, and if not present then rely on the one specified by params
BEGIN
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO qmax;
EXCEPTION WHEN undefined_function THEN
BEGIN
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO qmax;
EXCEPTION WHEN undefined_function THEN
RAISE EXCEPTION 'Missing "%"._CDB_UserQuotaInBytes()', schema_name;
IF TG_NARGS >= 2 AND TG_ARGV[1] <> '-1' THEN
qmax := TG_ARGV[1];
ELSE
RAISE EXCEPTION 'Missing "%"._CDB_UserQuotaInBytes()', schema_name;
END IF;
END;
END IF;
END;
pbfact := TG_ARGV[0];
dice := random();

View File

@@ -325,6 +325,27 @@ function test_user_can_read_when_it_has_permission_after_organization_permission
drop_role_and_schema cdb_testmember_3
}
function test_cdb_querytables_returns_schema_and_table_name() {
sql "CREATE EXTENSION plpythonu;"
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryStatements.sql
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryTables.sql
sql cdb_testmember_1 "select * from CDB_QueryTables('select * from foo');" should "{cdb_testmember_1.foo}"
}
function test_cdb_querytables_returns_schema_and_table_name_for_several_schemas() {
sql "CREATE EXTENSION plpythonu;"
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryStatements.sql
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryTables.sql
sql postgres "select * from CDB_QueryTables('select * from cdb_testmember_1.foo, cdb_testmember_2.bar');" should "{cdb_testmember_1.foo,cdb_testmember_2.bar}"
}
function test_cdb_querytables_does_not_return_functions_as_part_of_the_resultset() {
sql "CREATE EXTENSION plpythonu;"
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryStatements.sql
${CMD} -d ${DATABASE} -f scripts-available/CDB_QueryTables.sql
sql postgres "select * from CDB_QueryTables('select * from cdb_testmember_1.foo, cdb_testmember_2.bar, plainto_tsquery(''foo'')');" should "{cdb_testmember_1.foo,cdb_testmember_2.bar}"
}
#################################################### TESTS END HERE ####################################################