Fix evil tests #305

Basically force generation of long name identifiers that conflict
with first choice of another unique identifier.
This commit is contained in:
Rafa de la Torre 2017-06-29 18:53:24 +02:00
parent ffb779eb74
commit 711c954d1a
2 changed files with 22 additions and 22 deletions

View File

@ -14,17 +14,17 @@ SELECT * FROM cartodb._CDB_Unique_Identifier(NULL, 'largolargolargolargolargolar
SELECT * FROM cartodb._CDB_Unique_Identifier('prefix_', 'largolargolargolargolargolargolargolargolargolargolargolargolar', NULL);
-- Test new identifier is found when name is taken from previous case
CREATE TABLE prefix_largolargolargolargolargolargolargolargolargolargolar (name text);
CREATE TABLE prefix_largolargolargolargolargolargolargolargolargolargola (name text);
SELECT * FROM cartodb._CDB_Unique_Identifier('prefix_', 'largolargolargolargolargolargolargolargolargolargolargolargolar', NULL);
DROP TABLE prefix_largolargolargolargolargolargolargolargolargolargolar;
DROP TABLE prefix_largolargolargolargolargolargolargolargolargolargola;
-- Test unique identifier creation with suffix with long length normal relname
SELECT * FROM cartodb._CDB_Unique_Identifier(NULL, 'largolargolargolargolargolargolargolargolargolargolargolargolar', '_suffix');
-- Test new identifier is found when name is taken from previous case
CREATE TABLE largolargolargolargolargolargolargolargolargolargolar_suffix (name text);
CREATE TABLE largolargolargolargolargolargolargolargolargolargola_suffix (name text);
SELECT * FROM cartodb._CDB_Unique_Identifier(NULL, 'largolargolargolargolargolargolargolargolargolargolargolargolar', '_suffix');
DROP TABLE largolargolargolargolargolargolargolargolargolargolar_suffix;
DROP TABLE largolargolargolargolargolargolargolargolargolargola_suffix;
-- Test unique identifier creation with normal length UTF8 relname
SELECT * FROM cartodb._CDB_Unique_Identifier(NULL, 'piraña', NULL);
@ -72,7 +72,7 @@ SELECT * FROM cartodb._CDB_Unique_Column_Identifier('prefix_', 'largolargolargol
DROP TABLE test;
-- Test new identifier is found when name is taken from previous case
CREATE TABLE test (prefix_largolargolargolargolargolargolargolargolargolargolar text);
CREATE TABLE test (prefix_largolargolargolargolargolargolargolargolargolargola text);
SELECT * FROM cartodb._CDB_Unique_Column_Identifier('prefix_', 'largolargolargolargolargolargolargolargolargolargolargolargolar', NULL, 'test'::regclass);
DROP TABLE test;
@ -82,7 +82,7 @@ SELECT * FROM cartodb._CDB_Unique_Column_Identifier(NULL, 'largolargolargolargol
DROP TABLE test;
-- Test new identifier is found when name is taken from previous case
CREATE TABLE test (largolargolargolargolargolargolargolargolargolargolar_suffix text);
CREATE TABLE test (largolargolargolargolargolargolargolargolargolargola_suffix text);
SELECT * FROM cartodb._CDB_Unique_Column_Identifier(NULL, 'largolargolargolargolargolargolargolargolargolargolargolargolar', '_suffix', 'test'::regclass);
DROP TABLE test;

View File

@ -1,58 +1,58 @@
relname
prefix_relname
relname_suffix
largolargolargolargolargolargolargolargolargolargolargolargo
prefix_largolargolargolargolargolargolargolargolargolargolar
largolargolargolargolargolargolargolargolargolargolargolarg
prefix_largolargolargolargolargolargolargolargolargolargola
CREATE TABLE
prefix_largolargolargolargolargolargolargolargolargolargolar_0
prefix_largolargolargolargolargolargolargolargolargolargola0
DROP TABLE
largolargolargolargolargolargolargolargolargolargolar_suffix
largolargolargolargolargolargolargolargolargolargola_suffix
CREATE TABLE
largolargolargolargolargolargolargolargolargolargolar_suffix_0
largolargolargolargolargolargolargolargolargolargola_suffix0
DROP TABLE
piraña
prefix_piraña
piraña_suffix
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpiñaácid
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpiñaáci
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi
CREATE TABLE
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_0
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi0
DROP TABLE
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix
CREATE TABLE
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix_0
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix0
DROP TABLE
CREATE TABLE
colname
prefix_colname
colname_suffix
largolargolargolargolargolargolargolargolargolargolargolargo
prefix_largolargolargolargolargolargolargolargolargolargolar
largolargolargolargolargolargolargolargolargolargolargolarg
prefix_largolargolargolargolargolargolargolargolargolargola
DROP TABLE
CREATE TABLE
prefix_largolargolargolargolargolargolargolargolargolargolar_0
prefix_largolargolargolargolargolargolargolargolargolargola0
DROP TABLE
CREATE TABLE
largolargolargolargolargolargolargolargolargolargolar_suffix
largolargolargolargolargolargolargolargolargolargola_suffix
DROP TABLE
CREATE TABLE
largolargolargolargolargolargolargolargolargolargolar_suffix_0
largolargolargolargolargolargolargolargolargolargola_suffix0
DROP TABLE
CREATE TABLE
piraña
prefix_piraña
piraña_suffix
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpiñaácid
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpiñaáci
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi
DROP TABLE
CREATE TABLE
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_0
prefix_piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi0
DROP TABLE
CREATE TABLE
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix
DROP TABLE
CREATE TABLE
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix_0
piñaácidpiñaácidpiñaácidpiñaácidpiñaácidpi_suffix0
DROP TABLE
pira
pirañ