Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007212TestLinkInstallerpublic2015-08-05 09:132015-08-11 05:34
Reporteranushajoisa 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSWindowsOS VersionWindows 2012 R2
Product Version1.9.13 (2015 #1) 
Fixed in Version1.9.14 (2015 Q3) 
Summary0007212: Alter tables SQL files not updated for MSSQL
DescriptionThe content of the file testlink\install\sql\alter_tables\1.9.13\mssql\DB.1.9.13\step1\db_schema_update.sql is:

CREATE TABLE /*prefix*/testcase_relations (
  id int IDENTITY(1,1) NOT NULL,
  source_id INT NOT NULL DEFAULT '0',
  destination_id INT NOT NULL DEFAULT '0',
  relation_type INT NOT NULL DEFAULT '1',
  author_id int NOT NULL,
  creation_ts datetime NOT NULL CONSTRAINT /*prefix*/DF_testcase_relations_creation_ts DEFAULT (getdate()),
  CONSTRAINT /*prefix*/PK_req_relations PRIMARY KEY CLUSTERED
  (
    id
  ) ON [PRIMARY]
) ON [PRIMARY];

The content of the corresponding file for MyQSL is:

ALTER TABLE /*prefix*/execution_tcsteps DROP PRIMARY KEY;
ALTER TABLE /*prefix*/execution_tcsteps ADD id INT PRIMARY KEY AUTO_INCREMENT;
ALTER TABLE /*prefix*/execution_tcsteps ADD UNIQUE KEY /*prefix*/execution_tcsteps_idx1 (execution_id, tcstep_id);

Here, in the MySQL file, new column is being added to the table 'execution_tcsteps' and is made the primary key and also unique keys are defined. In the corresponding MSSQL file, these steps are not present and hence while trying to add a file as attachment for execution steps in Test Execution, the following DB access error is displayed:

ERROR ON exec_query() - database.class.php
156 - SQLState: 42000 Error Code: 156 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'AND'. SQLState: 42000 Error Code: 156 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'AND'. -
SELECT id FROM attachments WHERE fk_id = AND fk_table = 'execution_tcsteps' ORDER BY date_added DESC


Also, after the file is uploaded to an execution step, when 'Test Report' and 'Test Report on Build' are clicked, the below DB access error is seen:

ERROR ON exec_query() - database.class.php
102 - SQLState: 42000 Error Code: 102 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ','. SQLState: 42000 Error Code: 102 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ','. -
INSERT INTO attachments (fk_id,fk_table,file_name,file_path,file_size,file_type, date_added,content,compression_type,title) VALUES (,'execution_tcsteps','TP_req_spec-2015-08-04.doc','execution_tcsteps\\f7249fbc765b79369f021861d16b7889.doc',2145,'application/msword','2015-08-05 05:03:14',NULL,1,'')
Additional InformationPlease update the codes wherever required for the file \\10.66.28.35\c$\wamp\www\testlink\install\sql\alter_tables\1.9.13\mssql\DB.1.9.13\step1\db_schema_update.sql
and
\\10.66.28.35\c$\wamp\www\testlink\install\sql\alter_tables\1.9.13\mssql\DB.1.9.13\stepZ\z_final_step.sql
TagsNo tags attached.
Database (MySQL,Postgres,etc)MSSQL
BrowserChrome
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Filespng file icon db_schema_update_sql.png [^] (94,114 bytes) 2015-08-11 03:27

- Relationships
child of 0006830closedfman Availables hot-fixes for 1.9.13 & How To get full fixed package from GitHub 

-  Notes
(0023677)
fman (administrator)
2015-08-05 19:59

what it is supposed to be done with the links that point to PRIVATE IP ?
have you checked on latest code on github ?
(0023682)
anushajoisa (reporter)
2015-08-06 09:18

Yes I have checked the latest code in Github: https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/testlink_1_9/install/sql/alter_tables/1.9.13/mssql/DB.1.9.13/step1/db_schema_update.sql. [^] The same code that I mentioned is there for MSSQL.

I am sorry about the private IP. I had mentioned it by mistake. I had meant to say:

Please update the codes wherever required for the files:

testlink\install\sql\alter_tables\1.9.13\mssql\DB.1.9.13\step1\db_schema_update.sql

and

testlink\install\sql\alter_tables\1.9.13\mssql\DB.1.9.13\stepZ\z_final_step.sql

in your package.
(0023697)
fman (administrator)
2015-08-08 09:42

Can you explain why in your opinion z_final_step.sql need to be changes?
how ?
(0023698)
fman (administrator)
2015-08-08 09:43

Please get latest code from github, retest & provide feedback
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/50243306047d81fcaa31774a942b4797c2cf8ba2 [^]
(0023703)
anushajoisa (reporter)
2015-08-10 04:23

I did not mean to say that z_final_step.sql has to be changed. I just mentioned "Please update the codes wherever required for the files".

There are few errors in the latest code that you pointed me to:

1. The constraint is "PK_executions_tcsteps", not "PK_execution_tcsteps".
2. The statement "CREATE TABLE /*prefix*/testcase_relations" returns the error "There is already an object named 'testcase_relations' in the database.". This statement is not required.

After making the correction in point 1, it is working.
(0023705)
fman (administrator)
2015-08-10 09:51

OK, thanks I'm going to fix it
(0023725)
fman (administrator)
2015-08-10 18:27

>> I did not mean to say that z_final_step.sql has to be changed. I just mentioned "Please update >>the codes wherever required for the files".
please try to provide info that do not generate confusion

>> 1. The constraint is "PK_executions_tcsteps", not "PK_execution_tcsteps".
There is an error on original code right name is WITHOUT s
Will be recreated without S


>> The statement "CREATE TABLE /*prefix*/testcase_relations" returns the error "There is >>already an object named 'testcase_relations' in the database.". This statement is not required.
this is not present in the code, at least I'm not able to find it.
can you provide more details.
(0023726)
anushajoisa (reporter)
2015-08-11 03:26

Attached file 'db_schema_update_sql.png' is the screen shot of the latest github code that you had provided for testing:

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/50243306047d81fcaa31774a942b4797c2cf8ba2 [^]

In the code, the first SQL statement is:

-CREATE TABLE /*prefix*/testcase_relations (
- id int IDENTITY(1,1) NOT NULL,
- source_id INT NOT NULL DEFAULT '0',
- destination_id INT NOT NULL DEFAULT '0',
- relation_type INT NOT NULL DEFAULT '1',
- author_id int NOT NULL,
- creation_ts datetime NOT NULL CONSTRAINT /*prefix*/DF_testcase_relations_creation_ts DEFAULT (getdate()),
- CONSTRAINT /*prefix*/PK_testcase_relations PRIMARY KEY CLUSTERED
- (
- id
- ) ON [PRIMARY]
-) ON [PRIMARY];

This is the statement that returns an error "There is already an object named 'testcase_relations' in the database."
(0023730)
fman (administrator)
2015-08-11 05:34

you do not can COPY AND PASTE code from WEB blindly => minus means code has been REMOVED, + has been added.

- Issue History
Date Modified Username Field Change
2015-08-05 09:13 anushajoisa New Issue
2015-08-05 19:59 fman Note Added: 0023677
2015-08-05 19:59 fman Assigned To => fman
2015-08-05 19:59 fman Status new => feedback
2015-08-06 09:18 anushajoisa Note Added: 0023682
2015-08-06 09:18 anushajoisa Status feedback => assigned
2015-08-08 09:42 fman Note Added: 0023697
2015-08-08 09:43 fman Note Added: 0023698
2015-08-08 09:43 fman Status assigned => feedback
2015-08-08 09:44 fman Relationship added child of 0006830
2015-08-10 04:23 anushajoisa Note Added: 0023703
2015-08-10 04:23 anushajoisa Status feedback => assigned
2015-08-10 09:51 fman Note Added: 0023705
2015-08-10 18:27 fman Note Added: 0023725
2015-08-11 03:26 anushajoisa Note Added: 0023726
2015-08-11 03:27 anushajoisa File Added: db_schema_update_sql.png
2015-08-11 05:34 fman Note Added: 0023730
2015-08-11 05:34 fman QA Team - Task Workflow Status => READY FOR TESTING
2015-08-11 05:34 fman Status assigned => closed
2015-08-11 05:34 fman Resolution open => fixed
2015-08-11 05:34 fman Fixed in Version => 1.9.14 (2015 Q3)



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker