Anonymous | Login | Signup for a new account | 2019-02-16 14:20 UTC | ![]() |
Main | My View | View Issues | Change Log | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0007668 | TestLink | Requirement Management | public | 2016-09-13 10:06 | 2018-12-17 21:00 | ||||
Reporter | daronz | ||||||||
Assigned To | fman | ||||||||
Priority | urgent | Severity | crash | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Windows | OS | Windows Server | OS Version | 2012 R2 | ||||
Product Version | 1.9.15 (2015 Q4) | ||||||||
Fixed in Version | |||||||||
Summary | 0007668: DB Access Error when saving Requirements due to difference in data management fo MySQL Versions | ||||||||
Description | Cannot save the log when I am editing Requirements | ||||||||
Steps To Reproduce | 1) Go to Requirement Spec. 2) Select a Requirement 3) Do any action that could be triggered to add a log 4) Click OK | ||||||||
Additional Information | ============================================================================== 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:requirement_mgr - Method: create_new_revision */ UPDATE req_versions SET revision = 2, log_message=' ', creation_ts = '2016-09-13 17:48:13' ,author_id = 32, modifier_id = NULL, modification_ts = NULL WHERE id = 107603 ) called at [D:\WebService\testlink\lib\functions\requirement_mgr.class.php:2947] #1 requirement_mgr->create_new_revision(107603, 32, 1, Array ([id] => 107602,[srs_id] => 107600,[req_doc_id] => 001.1,[scope] => Test ,[status] => D,[type] => 3,[active] => 1,[is_open] => 1,[author_id] => 32,[version] => 1,[version_id] => 107603,[expected_coverage] => 1,[creation_ts] => 2016-09-13 17:45:23,[modifier_id] => ,[modification_ts] => 2016-09-13 17:45:23,[revision] => 1,[revision_id] => -1,[title] => Test,[testproject_id] => 1,[req_spec_title] => Test,[req_spec_doc_id] => 001,[node_order] => 1,[author] => zhudl,[modifier] => ), ) called at [D:\WebService\testlink\lib\requirements\reqCommands.class.php:735] 0000002 reqCommands->doCreateRevision(, Array ([CSRFName] => CSRFGuard_1947398264,[CSRFToken] => f15317fe1130ba3fece5f4a750146c83453075f133c6a0f8c2d490800926b2f8ced6fd2187fd8e2e08b01085d005b8fc8ed98afbde8bda6f82d95f94fede53cb,[requirement_id] => 107602,[req_version_id] => 107603,[doAction] => doCreateRevision,[log_message] => )) called at [D:\WebService\testlink\lib\requirements\reqEdit.php:41] | ||||||||
Tags | No tags attached. | ||||||||
Database (MySQL,Postgres,etc) | MySQL | ||||||||
Browser | Chrome | ||||||||
PHP Version | 7.0.9 | ||||||||
TestCaseID | |||||||||
QA Team - Task Workflow Status | TBD | ||||||||
Attached Files | ![]() ![]() | ||||||||
![]() |
|
(0025401) mbar (reporter) 2016-09-13 10:24 |
I confirm the problem: ============================================================================== 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(/* $debugMsg */ INSERT INTO req_revisions (parent_id,id,revision,scope,status,type,active,is_open, expected_coverage,author_id,creation_ts,modifier_id,modification_ts,log_message) SELECT REQV.id, 200274, 1, REQV.scope,REQV.status,REQV.type,REQV.active,REQV.is_open, REQV.expected_coverage,REQV.author_id,REQV.creation_ts,REQV.modifier_id, REQV.modification_ts,REQV.log_message FROM req_versions REQV WHERE REQV.id = 118648 ) called at [/var/www/html/testlink/lib/functions/requirement_mgr.class.php:2969] #1 requirement_mgr->copy_version_as_revision(118648, 200274, 1, 2, 118372) called at [/var/www/html/testlink/lib/functions/requirement_mgr.class.php:2928] 0000002 requirement_mgr->create_new_revision(118648, 2, 118372, Array ([id] => 118647,[srs_id] => 118643,[req_doc_id] => test,[scope] => test ,[status] => D,[type] => 5,[active] => 1,[is_open] => 1,[author_id] => 2,[version] => 1,[version_id] => 118648,[expected_coverage] => 1,[creation_ts] => 2014-07-14 12:52:02,[modifier_id] => ,[modification_ts] => 0000-00-00 00:00:00,[revision] => 1,[revision_id] => -1,[title] => ,[testproject_id] => 118372,[req_spec_title] => ,[req_spec_doc_id] => SWD21,[node_order] => 2,[author] => ,[modifier] => ), ) called at [/var/www/html/testlink/lib/functions/requirement_mgr.class.php:518] 0000003 requirement_mgr->update(118647, 118648, test, , 2, D, 5, 1, , , 0, 1, ) called at [/var/www/html/testlink/lib/requirements/reqCommands.class.php:302] 0000004 reqCommands->doUpdate(stdClass Object ([requirement_id] => 118647,[req_version_id] => 118648,[req_spec_id] => 0,[req_title] => test,[req_id_cbox] => ,[reqDocId] => test,[reqStatus] => D,[reqType] => 5,[containerID] => ,[scope] => test ,[countReq] => ,[expected_coverage] => 1,[doAction] => doUpdate,[itemSet] => ,[testcase_count] => ,[copy_testcase_assignment] => ,[relation_id] => ,[relation_source_req_id] => ,[relation_type] => ,[relation_destination_req_doc_id] => ,[relation_destination_testproject_id] => ,[save_rev] => 1,[do_save] => 1,[log_message] => ,[tcaseIdentity] => ,[file_id] => ,[fileTitle] => ,[req_id] => 118647,[title] => ,[arrReqIds] => ,[basehref] => https://testlink./,[tproject_id] [^] => 118372,[tproject_name] => ,[tcasePrefix] => swd,[user_id] => 2,[refreshTree] => 1,[stay_here] => 0), Array ([CSRFName] => CSRFGuard_1635534596,[CSRFToken] => ,[req_spec_id] => 0,[requirement_id] => 118647,[req_version_id] => 118648,[last_doc_id] => NFPW.8,[save_rev] => 1,[log_message] => ,[goaway] => 1,[prompt4log] => 0,[do_save] => 1,[prompt4revision] => 1,[reqDocId] => PR.ODO.2.4,[req_title] => ,[scope] => test ,[reqStatus] => D,[reqType] => 5,[expected_coverage] => 1,[doAction] => doUpdate)) called at [/var/www/html/testlink/lib/requirements/reqEdit.php:41] |
(0025402) mbar (reporter) 2016-09-13 11:45 |
Additional info: ERROR ON exec_query() - database.class.php 1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'modification_ts' at row 1 - /* $debugMsg */ INSERT INTO req_revisions (parent_id,id,revision,scope,status,type,active,is_open, expected_coverage,author_id,creation_ts,modifier_id,modification_ts,log_message) SELECT REQV.id, 200274, 1, REQV.scope,REQV.status,REQV.type,REQV.active,REQV.is_open, REQV.expected_coverage,REQV.author_id,REQV.creation_ts,REQV.modifier_id, REQV.modification_ts,REQV.log_message FROM req_versions REQV WHERE REQV.id = 118648 THE MESSAGE : /* $debugMsg */ INSERT INTO req_revisions (parent_id,id,revision,scope,status,type,active,is_open, expected_coverage,author_id,creation_ts,modifier_id,modification_ts,log_message) SELECT REQV.id, 200274, 1, REQV.scope,REQV.status,REQV.type,REQV.active,REQV.is_open, REQV.expected_coverage,REQV.author_id,REQV.creation_ts,REQV.modifier_id, REQV.modification_ts,REQV.log_message FROM req_versions REQV WHERE REQV.id = 118648 Query failed: errorcode[1292] errormsg:Incorrect datetime value: '0000-00-00 00:00:00' for column 'modification_ts' at row 1 |
(0025403) mbar (reporter) 2016-09-13 12:16 |
https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date [^] |
(0025404) mbar (reporter) 2016-09-13 12:19 |
And this seems to cause the problem (I have MySQL 5.7.15 installed): mysql> SHOW VARIABLES LIKE 'sql_mode'; +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | Variable_name | Value | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ | sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+ |
(0025405) mbar (reporter) 2016-09-13 12:27 |
I reinitialized all 'modification_ts' values to current date (temporarily disabled strict_trans_tables, then enabled again), but it still fails. Now the error is: ERROR ON exec_query() - database.class.php 1048 - Column 'modification_ts' cannot be null - /* Class:requirement_mgr - Method: create_new_revision */ UPDATE req_versions SET revision = 2, log_message=' ', creation_ts = '2016-09-13 14:25:09' ,author_id = 2, modifier_id = NULL, modification_ts = NULL WHERE id = 118646 THE MESSAGE : /* Class:requirement_mgr - Method: create_new_revision */ UPDATE req_versions SET revision = 2, log_message=' ', creation_ts = '2016-09-13 14:25:09' ,author_id = 2, modifier_id = NULL, modification_ts = NULL WHERE id = 118646 Query failed: errorcode[1048] errormsg:Column 'modification_ts' cannot be null |
(0025408) fman (administrator) 2016-09-14 17:27 |
@daronz 1) Reporter does not need to monitor his/her own issue. |
(0025410) daronz (reporter) 2016-09-14 18:05 |
I've temporarily fixed it. File: testlink-code/lib/functions/database.class.php Line: 889 - $nullValue = NULL; + $nullValue = " '0000-00-00 00:00:00' "; |
(0025411) fman (administrator) 2016-09-14 19:04 edited on: 2016-09-14 19:07 |
Just tested using XAMPP 5.6.3 on OSX (MySQL 5.6.21) => no issues. Issue is related to MySQL Version. Would you mind to provide MySQL Version? probably as happened to user mbar issue is due to changes on date & time columns, between MySQL Versions. |
(0025412) daronz (reporter) 2016-09-15 02:08 |
MySQL Version: 5.7.14 |
(0026150) hguilherme66 (reporter) 2017-03-21 09:57 |
I am also getting this issue. I am using dev 1.9.17 (was having same problem with 1.9.16). I tried to Edit Requirement (change number of coverage tests from 0 to 1) and got the same DB error. I attach the HTML with the errors (and Event message). I am using MySQL v. 5.7.17 on CentOS 6.8 |
(0026151) fman (administrator) 2017-03-21 10:05 |
Use temp fix I've temporarily fixed it. File: testlink-code/lib/functions/database.class.php Line: 889 - $nullValue = NULL; + $nullValue = " '0000-00-00 00:00:00' "; |
(0026152) hguilherme66 (reporter) 2017-03-21 11:40 edited on: 2017-03-21 12:08 |
I managed to fix error by setting a not NULL nor Zero value. MySQL configuration has NO_ZERO_DATES. For reference see http://stackoverflow.com/questions/35565128/mysql-incorrect-datetime-value-0000-00-00-000000 [^] File: testlink-code/lib/functions/database.class.php Lines: >885 <code> function db_null_timestamp() { $db_type = $this->db->databaseType; // $nullValue = NULL; $nullValue = " '1970-01-01' "; switch($db_type) { case 'mysql': // is not an error i put single quote on value // $nullValue = " '0000-00-00 00:00:00' "; $nullValue = " '1970-01-01' "; break; } return $nullValue; } </code> ---- This would cause the need to call db_null_timestamp in all comparisons with NULL or Zero dates, at least in files: requirement_mgr.class.php and requirement_spec_mgr.class.php <code> [testlink@vm-testlink functions]$ grep -n 0000-00-00 requirement* requirement_mgr.class.php:3075: // MySQL NULL DATE -> "0000-00-00 00:00:00" requirement_mgr.class.php:3080: if( ($rs[$ap]['modification_ts'] != '0000-00-00 00:00:00') && !is_null($rs[$ap]['modification_ts']) ) requirement_spec_mgr.class.php:2066: // MySQL NULL DATE -> "0000-00-00 00:00:00" requirement_spec_mgr.class.php:2071: if( ($rs[$ap]['modification_ts'] != '0000-00-00 00:00:00') && !is_null($rs[$ap]['modification_ts']) ) </code> Existing data would also need to be migrated, for example: UPDATE `req_versions` SET `modification_ts`='1970-01-01', `log_message`='reset field modification_ts' WHERE `modification_ts` < '1970-01-01'; |
(0026225) fman (administrator) 2017-03-29 10:06 |
Solution by @hguilherme66 is not acceptable for stable code. |
(0026496) Pavlik (reporter) 2017-06-19 11:13 edited on: 2017-06-19 11:14 |
@fman, @daronz: What is the matter with the switch block at the lines 893-897 in /lib/functions/database.class.php? switch($db_type) { case 'mysql': // is not an error i put single quote on value $nullValue = " '0000-00-00 00:00:00' "; break; } Is it this distinguish by $db_type that doesn´t work and need the assignment (from temp fix) for $nullValue outside of the switch block? |
(0026506) Pavlik (reporter) 2017-06-21 07:36 |
The temp fix from 0007668:0025410 doesn´t work in TestLink 1.9.3 under 5.7.1.7 MySQL Server :-( |
(0026508) fman (administrator) 2017-06-21 09:21 |
1.9.3 is not supported anymore |
(0027046) hmaier (reporter) 2017-12-01 08:58 |
Is removing the sql-mode for Testlink only an option? sql-mode="" |
(0027051) fman (administrator) 2017-12-04 16:51 |
@hmaier: you can try |
(0027062) hmaier (reporter) 2017-12-05 07:45 |
@fman: It is working for me. I wanted to ask if there are known side effects. |
(0027063) fman (administrator) 2017-12-05 07:47 |
AFAIK no side effects regards |
(0027073) hmaier (reporter) 2017-12-05 14:47 |
@fman: Thank you. No problems on our side either, I'll keep you informed. |
(0028290) Rulqu (reporter) 2018-11-30 14:45 |
We had this datetime problem after updating from old version to 1.9.18 and we couldn't edit any test cases or requirements. Solution from @hguilherme66 was perfect. |
(0028291) fman (administrator) 2018-11-30 14:48 |
Great! |
![]() |
|||
Date Modified | Username | Field | Change |
2016-09-13 10:06 | daronz | New Issue | |
2016-09-13 10:06 | daronz | File Added: screenshot.zip | |
2016-09-13 10:24 | mbar | Note Added: 0025401 | |
2016-09-13 11:45 | mbar | Note Added: 0025402 | |
2016-09-13 12:16 | mbar | Note Added: 0025403 | |
2016-09-13 12:19 | mbar | Note Added: 0025404 | |
2016-09-13 12:27 | mbar | Note Added: 0025405 | |
2016-09-14 17:27 | fman | Note Added: 0025408 | |
2016-09-14 18:05 | daronz | Note Added: 0025410 | |
2016-09-14 19:04 | fman | Note Added: 0025411 | |
2016-09-14 19:07 | fman | Note Edited: 0025411 | View Revisions |
2016-09-15 02:08 | daronz | Note Added: 0025412 | |
2017-03-21 09:57 | hguilherme66 | Note Added: 0026150 | |
2017-03-21 09:58 | hguilherme66 | File Added: bug_on_testlink_lib_requirements_reqEdit.php.html.zip | |
2017-03-21 10:05 | fman | Note Added: 0026151 | |
2017-03-21 11:40 | hguilherme66 | Note Added: 0026152 | |
2017-03-21 11:40 | hguilherme66 | Note Edited: 0026152 | View Revisions |
2017-03-21 12:08 | hguilherme66 | Note Edited: 0026152 | View Revisions |
2017-03-29 10:06 | fman | Note Added: 0026225 | |
2017-03-29 19:56 | fman | QA Team - Task Workflow Status | => TBD |
2017-03-29 19:56 | fman | Summary | DB Access Error when saving Requirements => DB Access Error when saving Requirements due to difference in data management fo MySQL Versions |
2017-06-19 11:13 | Pavlik | Note Added: 0026496 | |
2017-06-19 11:14 | Pavlik | Note Edited: 0026496 | View Revisions |
2017-06-21 07:36 | Pavlik | Note Added: 0026506 | |
2017-06-21 09:21 | fman | Note Added: 0026508 | |
2017-12-01 08:58 | hmaier | Note Added: 0027046 | |
2017-12-04 16:51 | fman | Note Added: 0027051 | |
2017-12-05 07:45 | hmaier | Note Added: 0027062 | |
2017-12-05 07:47 | fman | Note Added: 0027063 | |
2017-12-05 14:47 | hmaier | Note Added: 0027073 | |
2018-11-30 14:45 | Rulqu | Note Added: 0028290 | |
2018-11-30 14:48 | fman | Note Added: 0028291 | |
2018-12-17 21:00 | fman | Status | new => closed |
2018-12-17 21:00 | fman | Assigned To | => fman |
2018-12-17 21:00 | fman | Resolution | open => fixed |
Copyright © 2000 - 2019 MantisBT Team |