Add test for faulty use case #305

This commit is contained in:
Rafa de la Torre 2017-06-29 15:58:17 +02:00
parent 208ebb2724
commit 8db73ae9bd
2 changed files with 16 additions and 0 deletions

View File

@ -372,6 +372,19 @@ SELECT column_name FROM information_schema.columns WHERE table_name = 'test' AND
DROP TABLE test; DROP TABLE test;
SET client_min_messages TO error; SET client_min_messages TO error;
-- Unique identifier generation can break CDB_CartodbfyTable #305
BEGIN;
DO $$
BEGIN
FOR i IN 1..150 LOOP
EXECUTE 'CREATE TABLE untitled_table();';
EXECUTE $query$SELECT CDB_CartodbfyTable('untitled_table');$query$;
EXECUTE 'ALTER TABLE untitled_table RENAME TO my_renamed_table_' || i;
END LOOP;
END;
$$;
ROLLBACK;
-- TODO: table with existing custom-triggered the_geom -- TODO: table with existing custom-triggered the_geom
DROP FUNCTION CDB_CartodbfyTableCheck(regclass, text); DROP FUNCTION CDB_CartodbfyTableCheck(regclass, text);

View File

@ -147,5 +147,8 @@ NOTICE: Trying to recover data from _cartodb_id0 column
DROP TABLE DROP TABLE
SET SET
BEGIN
DO
ROLLBACK
DROP FUNCTION DROP FUNCTION
DROP FUNCTION DROP FUNCTION