Merge pull request #387 from CartoDB/2273_support

use literal substitution instead of identifier
This commit is contained in:
Raúl Marín 2019-12-24 14:24:32 +01:00 committed by GitHub
commit 4c15fafd72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,7 @@
0.35.0 (XXXX-XX-XX)
* Reapply the changes in 0.33.0 (the issue we were looking for was unrelated)
* Reapply `Make PG12 depend on plpython3u instead of plpythonu`
* Fix identifier quotation in `CDB_UserDataSize`
0.34.0 (2019-12-23)
* Revert changes done in 0.33.0, keeping function signature to drop them

View File

@ -33,7 +33,7 @@ BEGIN
IF raster_available THEN
raster_read_query := Format('SELECT o_table_name, r_table_name FROM @postgisschema@.raster_overviews
WHERE o_table_schema = ''%I'' AND o_table_catalog = current_database()', schema_name);
WHERE o_table_schema = %L AND o_table_catalog = current_database()', schema_name);
ELSE
raster_read_query := 'SELECT NULL::text AS o_table_name, NULL::text AS r_table_name';
END IF;
@ -42,7 +42,7 @@ BEGIN
%s
),
user_tables AS (
SELECT table_name FROM @extschema@._CDB_NonAnalysisTablesInSchema(''%I'')
SELECT table_name FROM @extschema@._CDB_NonAnalysisTablesInSchema(%L)
),
table_cat AS (
SELECT
@ -55,7 +55,7 @@ BEGIN
FROM user_tables
),
sizes AS (
SELECT COALESCE(INT8(SUM(@extschema@._CDB_total_relation_size(''%I'', table_name)))) table_size,
SELECT COALESCE(INT8(SUM(@extschema@._CDB_total_relation_size(%L, table_name)))) table_size,
CASE
WHEN is_overview THEN 0
WHEN is_raster THEN 1

View File

@ -60,6 +60,9 @@ SELECT 'excess3', catch_error($$INSERT INTO big VALUES (3);$$); -- disallowed, q
DROP TABLE big;
SELECT CDB_SetUserQuotaInBytes(0);
CREATE SCHEMA "complex-name%_with'quotes""";
SELECT CDB_UserDataSize('"complex-name%_with''quotes"');
DROP SCHEMA "complex-name%_with'quotes""";
set client_min_messages to NOTICE;
DROP FUNCTION catch_error(text);

View File

@ -30,6 +30,9 @@ DROP TABLE
excess3|t
DROP TABLE
0
CREATE SCHEMA
0
DROP SCHEMA
SET
DROP FUNCTION
DROP FUNCTION