Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008719TestLinkTest Plan (builds, milestones, test assign)public2019-07-08 12:592019-07-29 15:39
Reporterheju 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionunable to reproduce 
PlatformOSOS Version
Product Version 
Fixed in Version 
Summary0008719: DB Access Error in case (optional) Milestone start date is empty
DescriptionDear TestLink team,
in 1.9.20 a DB Access Error is generated in case the milestone start date is left blank. Happens both on create and modify of milestone.

==============================================================================

 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(INSERT INTO milestones (testplan_id,name,a,b,c,target_date) VALUES (16874,'test1',100,100,100, '2019-07-10' )) called at [/var/www/html/testlink-1.9.20/lib/functions/testplan.class.php:8487]
Steps To ReproduceCreate new milestone with start date left blank.
TagsNo tags attached.
Database (MySQL,Postgres,etc)Mysql
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Files

- Relationships

-  Notes
(0029002)
fman (administrator)
2019-07-10 20:23

tested on MariaDB worked OK, unable to reproduce
(0029007)
heju (reporter)
2019-07-11 05:57

Hi fman,
tried to execute the sql manually, the error is:

ERROR 1364 (HY000): Field 'start_date' doesn't have a default value

Should the default value indicating "no date" be added in the php code, or as a database field default.

Another question: Is there a way to display the mysql error message directly in the browser in case there is an error? This way it would not be necessary to execute the sql manually again to find out what's wrong
(0029009)
fman (administrator)
2019-07-11 08:20

IMHO the issue is on YOUR DB => I can do nothing

>> Another question: Is there a way to display the mysql error message directly in the browser >>in case there is an error? This way it would not be necessary to execute the sql manually >>again to find out what's wrong

not for security reasons as is stated CLEARLY in the message

ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)
(0029010)
heju (reporter)
2019-07-11 08:46

>> not for security reasons as is stated CLEARLY in the message

Yes, I read the message! However I interpreted it as a Warning, in the sense of: There is an option to enable more debug output, but be warned: this is a security risk.

Understood, there is NO option at all to enable more debug output.

As our system runs in a very restricted env, debug output would not be a risk, but helpful.
(0029011)
fman (administrator)
2019-07-11 09:01

if you want commercial support you can request an offer
(0029012)
heju (reporter)
2019-07-12 05:07

In case someone faces the same problem I will describe shortly what I did to workaround it:
In the milestones table, the field start_date (in contrast to target_date) does not allow NULL values. I manually set NULL allowed for start_date as well that in the db. Seems all working now.


In my humble opinion (not an sql expert though), this behaviour seems to be introduced by the testlink_create_tables.sql script when creating the database as it sets NULL allowed for target_date, and does not allow NULL for start_date, which is contrary to the GUI behaviour (target is mandatory, start is optional)


CREATE TABLE /*prefix*/milestones (
  id int(10) unsigned NOT NULL auto_increment,
  testplan_id int(10) unsigned NOT NULL default '0',
  target_date date NULL,
  start_date date NOT NULL,
  a tinyint(3) unsigned NOT NULL default '0',
  b tinyint(3) unsigned NOT NULL default '0',
  c tinyint(3) unsigned NOT NULL default '0',
  name varchar(100) NOT NULL default 'undefined',
  PRIMARY KEY (id),
  KEY /*prefix*/testplan_id (`testplan_id`),
  UNIQUE KEY /*prefix*/name_testplan_id (`name`,`testplan_id`)
) DEFAULT CHARSET=utf8;
(0029013)
fman (administrator)
2019-07-12 06:32

the issue is that start_date needs in addition to not null a default value and seems this has been removed by error in the paste.

some kind of comments are better to be avoided => (not an sql expert though), adds no value and smells as some not polite comments.
(0029014)
heju (reporter)
2019-07-12 06:45

I am sorry if my the comment can be misinterpreted, my intention was to point out, that in case someone else faces similar problem, he/she should *not* follow my hint blindly as it may cause unexpected trouble as I am not that experienced with sql.

> the issue is that start_date needs in addition to not null a default value and seems this has been removed by error in the paste.

I checked github again, did not miss anything in the paste to the previous comment
(0029015)
fman (administrator)
2019-07-12 09:56

typo error => paste WRONG => PASTE , I'm talkinh about some error done by me while coding

- Issue History
Date Modified Username Field Change
2019-07-08 12:59 heju New Issue
2019-07-10 20:23 fman Note Added: 0029002
2019-07-10 20:23 fman Assigned To => fman
2019-07-10 20:23 fman Status new => feedback
2019-07-11 05:57 heju Note Added: 0029007
2019-07-11 05:57 heju Status feedback => assigned
2019-07-11 08:20 fman Note Added: 0029009
2019-07-11 08:20 fman QA Team - Task Workflow Status => TBD
2019-07-11 08:20 fman Status assigned => resolved
2019-07-11 08:20 fman Resolution open => unable to reproduce
2019-07-11 08:46 heju Note Added: 0029010
2019-07-11 09:01 fman Note Added: 0029011
2019-07-12 05:07 heju Note Added: 0029012
2019-07-12 06:32 fman Note Added: 0029013
2019-07-12 06:45 heju Note Added: 0029014
2019-07-12 09:56 fman Note Added: 0029015
2019-07-29 15:39 user18337 Note Added: 0029057
2019-07-29 16:12 fman Note Deleted: 0029057



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker