MantisBT - TestLink
View Issue Details
0007680TestLinkInstallerpublic2016-09-22 15:262018-10-06 12:17
abIng 
fman 
normalminoralways
closedfixed 
WINDOWS
1.9.15 (2015 Q4) 
1.9.18 (2018 Q3) 
MS SQL
READY FOR TESTING
0007680: Bug in MSSQL/testlink_create_tables.sql while creating plugins table
When I install 1.9.15 with MS SQL (10.50.1600) the following error appears:

Processing:sql/mssql/testlink_create_tables.sql

==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)
            Having this additional Information could be useful for reporting
            issue to development TEAM.
 ==============================================================================
#0 database->exec_query(CREATE TABLE /*prefix*/plugins (
  plugin_id int NOT NULL IDENTITY(1,1) CONSTRAINT /*prefix*/DF_plugins_plugin_id DEFAULT ((0)),
  basename VARCHAR(100) NOT NULL,
  enabled tinyint NOT NULL CONSTRAINT /*prefix*/DF_plugins_enabled DEFAULT ((0)),
  author_id int NOT NULL,
  creation_ts datetime NOT NULL CONSTRAINT /*prefix*/DF_plugins_creation_ts DEFAULT (getdate()),
 CONSTRAINT /*prefix*/PK_plugins PRIMARY KEY CLUSTERED
 (
  plugin_id ASC
 ) ON [PRIMARY]
) ON [PRIMARY]) called at [D:\Web\testlink-1.9.15\install\sqlParser.class.php:103]
#1 SqlParser->process(sql/mssql/testlink_create_tables.sql) called at [D:\Web\testlink-1.9.15\install\installNewDB.php:427]
-------------

When I execute the query in SQL Server Management Studio the error message is:
Msg 1754, Level 16, State 0, Line 1
Defaults cannot be created on columns with an IDENTITY attribute. Table 'plugins', column 'plugin_id'.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
-------
Solution: remove constraint.
The same error appears with the next statement when plugins_configuration table is created.
After removing these two constraints the installation script works properly.
No tags attached.
has duplicate 0007743closed fman Unable to deploy on MSSQL 2008 R2 
related to 0008280closed fman Installation script fails (MS SQL used) 
Issue History
2016-09-22 15:26abIngNew Issue
2016-09-25 10:09fmanQA Team - Task Workflow Status => TBD
2016-09-25 10:09fmanSummaryBug in mssql/testlink_create_tables.sql while creating plugins table => Bug in MSSQL/testlink_create_tables.sql while creating plugins table
2017-01-25 09:07abIngNote Added: 0025922
2018-06-13 12:29abIngNote Added: 0027581
2018-06-16 16:57fmanNote Added: 0027590
2018-06-16 17:01fmanRelationship addedrelated to 0008280
2018-06-16 17:02fmanRelationship addedhas duplicate 0007743
2018-06-16 17:28fmanNote Added: 0027596
2018-06-16 17:28fmanFixed in Version => 1.9.18 (2018 Q3)
2018-06-16 17:28fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2018-06-16 17:28fmanStatusnew => resolved
2018-06-16 17:28fmanResolutionopen => fixed
2018-06-16 17:28fmanAssigned To => fman
2018-10-06 12:17fmanNote Added: 0027946
2018-10-06 12:17fmanStatusresolved => closed

Notes
(0025922)
abIng   
2017-01-25 09:07   
The problem is not fixed in 1.9.16.
The installation procedure finishes OK if I remove constraints for the first fields of two last tables:
CREATE TABLE /*prefix*/plugins (
  plugin_id int NOT NULL IDENTITY(1,1),
  basename VARCHAR(100) NOT NULL,
  enabled tinyint NOT NULL CONSTRAINT /*prefix*/DF_plugins_enabled DEFAULT ((0)),
  author_id int NOT NULL,
  creation_ts datetime NOT NULL CONSTRAINT /*prefix*/DF_plugins_creation_ts DEFAULT (getdate()),
 CONSTRAINT /*prefix*/PK_plugins PRIMARY KEY CLUSTERED
 (
  plugin_id ASC
 ) ON [PRIMARY]
) ON [PRIMARY];

CREATE TABLE /*prefix*/plugins_configuration (
  plugin_config_id int IDENTITY(1,1) NOT NULL ,
  testproject_id int NOT NULL CONSTRAINT /*prefix*/DF_plugins_configuration__testproject_id DEFAULT ((0)),
  config_key VARCHAR(255) NOT NULL,
  config_type int NOT NULL,
  config_value VARCHAR(255) NOT NULL,
  author_id int NOT NULL,
  creation_ts datetime NOT NULL CONSTRAINT /*prefix*/DF_plugins_configuration__creation_ts DEFAULT (getdate()),
 CONSTRAINT /*prefix*/PK_plugins_configuration PRIMARY KEY CLUSTERED
 (
  plugin_config_id ASC
 ) ON [PRIMARY]
) ON [PRIMARY];
(0027581)
abIng   
2018-06-13 12:29   
The problem is not fixed in 1.9.17.
See also http://mantis.testlink.org/view.php?id=8280 [^] and http://mantis.testlink.org/view.php?id=7743 [^]
(0027590)
fman   
2018-06-16 16:57   
if ticket status is not set to resolved then this means that issue is still open, then your note on problem still on 1.9.17 provides no help.
(0027596)
fman   
2018-06-16 17:28   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/522352792272801c2df317fc5111ddb88e2273b7 [^]
(0027946)
fman   
2018-10-06 12:17   
1.9.18 released