MantisBT - TestLink
View Issue Details
0008507TestLinkDatabase Generalpublic2018-12-17 11:072018-12-17 20:56
mraurelien 
fman 
highmajoralways
resolvedfixed 
Linux CentOS release 7.5
1.9.18 (2018 Q3) 
 
MySQL 14.14
Chrome Version 71.0.3578.80 (Build officiel) (64 bits)
7.2.12
READY FOR TESTING
0008507: New version on a test use a bad timestamp (db access error)
When I click on "new version" of a test in the Test Specification, i got a database access error. Edit on actual version is fine.

==============================================================================
 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(/* Class:testcase - Method: copy_tcversion */ INSERT INTO t_tcversions (id,version,tc_external_id,author_id,creation_ts,summary, importance,execution_type,preconditions,estimated_exec_duration) SELECT 7339 AS id, 7 AS version, tc_external_id, 3 AS author_id, '2018-12-17 11:31:42' AS creation_ts, summary,importance,execution_type, preconditions,estimated_exec_duration FROM t_tcversions WHERE id=4617 ) called at [/var/www/html/testlink-1.9.18/lib/functions/testcase.class.php:2107]
#1 testcase->copy_tcversion(2856, 4617, 7339, 7, 3) called at [/var/www/html/testlink-1.9.18/lib/functions/testcase.class.php:1960]
0000002 testcase->create_new_version(2856, 3, 4617) called at [/var/www/html/testlink-1.9.18/lib/testcases/tcEdit.php:276]
# Go to Test Specification
# Select a Test in the tree
# Click on the Test Case Version Operations > "New Version" button
-> DB Access Error

Some more logs :
[18/Dec/17 09:47:11][ERROR][2cbdf1d5ed22c49ed4949d84ab3559bd][DATABASE]

                ERROR ON exec_query() - database.class.php
1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'modification_ts' at row 1 - /* Class:testcase - Method: copy_tcversion */ INSERT INTO t_tcversions (id,version,tc_external_id,author_id,creation_ts,summary, importance,execution_type,preconditions,estimated_exec_duration) SELECT 7336 AS id, 7 AS version, tc_external_id, 3 AS author_id, '2018-12-17 10:47:11' AS creation_ts, summary,importance,execution_type, preconditions,estimated_exec_duration FROM t_tcversions WHERE id=4617
THE MESSAGE : /* Class:testcase - Method: copy_tcversion */ INSERT INTO t_tcversions (id,version,tc_external_id,author_id,creation_ts,summary, importance,execution_type,preconditions,estimated_exec_duration) SELECT 7336 AS id, 7 AS version, tc_external_id, 3 AS author_id, '2018-12-17 10:47:11' AS creation_ts, summary,importance,execution_type, preconditions,estimated_exec_duration FROM t_tcversions WHERE id=4617

Query failed: errorcode[1292]
No tags attached.
Issue History
2018-12-17 11:07mraurelienNew Issue
2018-12-17 20:56fmanNote Added: 0028332
2018-12-17 20:56fmanQA Team - Task Workflow Status => READY FOR TESTING
2018-12-17 20:56fmanStatusnew => resolved
2018-12-17 20:56fmanResolutionopen => fixed
2018-12-17 20:56fmanAssigned To => fman

Notes
(0028332)
fman   
2018-12-17 20:56   
>> Incorrect datetime value: '0000-00-00 00:00:00' for column 'modification_ts'
this has happened and continue to happen due to the changes that has been made on new MySQL versions since 5.7

You need to change the columns definition for each timestamp column that has '0000-00-00 00:00:00', with CURRENT_TIMESTAMP or the right default for your MySQL DB version