You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by "Andy Kurth (JIRA)" <ji...@apache.org> on 2015/08/12 21:46:45 UTC

[jira] [Created] (VCL-898) Update utils.pm::insert_request to add an entry to the log table

Andy Kurth created VCL-898:
------------------------------

             Summary: Update utils.pm::insert_request to add an entry to the log table
                 Key: VCL-898
                 URL: https://issues.apache.org/jira/browse/VCL-898
             Project: VCL
          Issue Type: Sub-task
          Components: vcld (backend)
            Reporter: Andy Kurth
            Assignee: Andy Kurth
             Fix For: 2.5


A constraint was (_correctly_) added to _request.logid_ which causes *utils.pm::insert_request* to fail.  *insert_request* is called from:
* *image.pm::setup_capture_base_image*
* *utils.pm::insert_reload_request*

*insert_request* does not currently attempt to insert an entry to the log table before inserting into the request table but it does accept a _log.id_ argument.  However, _log.id_ is specified as 0 in both locations where it is called.  Since there is no entry in the log table with id=0, the following error is generated when attempting to insert into the request table:
{noformat}Cannot add or update a child row: a foreign key constraint fails (`vcl`.`request`, CONSTRAINT `request_ibfk_18` FOREIGN KEY (`logid`) REFERENCES `log` (`id`) ON UPDATE CASCADE){noformat}

*insert_request* needs to be updated to first add a row to the log table.  This subroutine should also probably be renamed to *insert_reservation* and reworked.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)