MySQL++

Ticket Change Details
Login
Overview

Artifact ID: f30f248cce8c3e1f469725661c14ca2902cf487afe10a6d5fab3275304ee0c33
Ticket: eab08a87eddde94ba8998f018d876e70a96e35d4
A Connection with options can't be duplicated.
User & Date: anonymous 2018-05-23 14:44:59
Changes

  1. foundin changed to: "3.2.2+pristine-2ubuntu3"
  2. icomment:
    If you call Connection::set_option(Option*), then Connection::connect(), then copy the Connection,
    the copy constructor for the new Connection object will try to connect.
    However, the connection attempt will likely fail.
    
    Connection's copy constructor calls DBDriver's copy constructor, which calls DBDriver::copy().
    
    DBDriver::copy() calls DBDriver::connect(MYSQL&), which calls DBDriver::connect_prepare().
    
    DBDriver::connect_prepare() tries to apply any pending options. 
    However, if the original Connection has already connected, 
    it discarded the pending options in its DBDriver, 
    so the new Connection's DBDriver will not have any options applied. 
    This makes it very likely that the new object's connect() will fail.
    
  3. login: "anonymous"
  4. mimetype: "text/x-fossil-plain"
  5. private_contact changed to: "35b1faba21feb11a7c4f02d66fbf280c2fbfa91e"
  6. severity changed to: "Important"
  7. status changed to: "Open"
  8. title changed to: "A Connection with options can't be duplicated."
  9. type changed to: "Code Defect"