MantisBT - TestLink
View Issue Details
0008874TestLinkDatabase Postgrespublic2020-02-23 20:042020-02-26 21:07
postgresql 12
0008874: testlink_create_tables.sql aborts with syntax error at or near "unsigned"
TestLink 1.9.20 can not be installed on PostgreSQL, cause
- *testlink-code-1.9.20/install/sql/postgres/testlink_create_tables.sql*
includes MYSQL specific (nonstandard) attribute *unsigned*

Creation of table *baseline_l1l2_details* aborts with a *syntax error at or near "unsigned"*

2020-02-23 19:26:50.983 UTC [71] STATEMENT: CREATE TABLE /*prefix*/baseline_l1l2_details (,
      "qty" INT unsigned NOT NULL DEFAULT '0',,
2020-02-23 19:26:50.983 UTC [71] ERROR: syntax error at or near "unsigned" at character 389,
      "id" BIGSERIAL NOT NULL , ,
      "context_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/baseline_l1l2_context (id),,
      "top_tsuite_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/testsuites (id),,
      "child_tsuite_id" BIGINT NOT NULL DEFAULT '0' REFERENCES /*prefix*/testsuites (id),,
      "status" char(1) DEFAULT NULL,,
      "total_tc" INT unsigned NOT NULL DEFAULT '0',,
      PRIMARY KEY ("id"),
    ) ;,
psql:/docker-entrypoint-initdb.d/testlink_create_tables.sql:940: ERROR: syntax error at or near "unsigned",
LINE 7: "qty" INT unsigned NOT NULL DEFAULT '0',,
                    ^ [^]

No tags attached.
Issue History
2020-02-23 20:04lczubNew Issue
2020-02-23 20:14lczubNote Added: 0029506
2020-02-25 09:47fmanNote Added: 0029509
2020-02-26 21:06lczubNote Added: 0029511
2020-02-26 21:07lczubNote Edited: 0029511bug_revision_view_page.php?bugnote_id=29511#r6017

2020-02-23 20:14   
Followup failure:
when remove the *unsigned* attributes, another failure occur, cause index for table *baseline_l1l2_details* and *baseline_l1l2_context* uses the same name *udx1*

2020-02-23 20:03:03.965 UTC [71] ERROR: relation "udx1" already exists,
2020-02-23 20:03:03.965 UTC [71] STATEMENT: CREATE UNIQUE INDEX /*prefix*/udx1 ,
    ON /*prefix*/baseline_l1l2_details ("context_id","top_tsuite_id","child_tsuite_id","status");,
psql:/docker-entrypoint-initdb.d/10-testlink_create_tables.sql:942: ERROR: relation "udx1" already exists
2020-02-25 09:47   
2020-02-26 21:06   
(edited on: 2020-02-26 21:07)
I published a docker composed configuration to reproduce this issue with the 1.9.20.fixed branch - [^]

Hopefully this helps for testing:

# build tl code pg and php image from branch 1.9.20.fixed
docker-compose --env-file .\envs\testlink-1.9.20.fixed.env -f docker-compose.yml -f build

# start tl pg and php container
docker-compose --env-file .\envs\testlink-1.9.20.fixed.env -f docker-compose.yml up -d

# inspect tl pg database creation - reports reported creation failure
docker logs testlink_pg

# try to log into tl - localhost:8085
# - reports failure - Connect to database testlink-1.9.20.fixed on Host tl_pg fails

# remove tl container, networks and volumes
docker-compose --env-file .\envs\testlink-1.9.20.fixed.env -f docker-compose.yml down --rmi local -v