Ignore:
Timestamp:
07/31/18 21:07:26 (6 years ago)
Author:
tbretz
Message:
Read duplicate as a vector of strings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/root2sql.cc

    r19110 r19114  
    6666        ("engine",         var<string>(""),           "Database engine to be used when a new table is created")
    6767        ("row-format",     var<string>(""),           "Defines the ROW_FORMAT keyword for table creation")
    68         ("duplicate",      var<string>(""),           "Specifies an assignment_list for an 'ON DUPLICATE KEY UPDATE' expression")
     68        ("duplicate",      vars<string>(""),          "Specifies an assignment_list for an 'ON DUPLICATE KEY UPDATE' expression")
    6969        ("ignore-errors",  po_switch(),               "Adds the IGNORE keyword to the INSERT query (turns errors into warnings, ignores rows with errors)")
    7070        ;
     
    310310    const string engine          = conf.Get<string>("engine");
    311311    const string row_format      = conf.Get<string>("row-format");
    312     const string duplicate       = conf.Get<string>("duplicate");
     312
     313    const vector<string> duplicate = conf.Vec<string>("duplicate");
    313314
    314315    const bool ignore_errors     = conf.Get<bool>("ignore-errors");
     
    586587
    587588    if (!duplicate.empty())
    588         query += "\nON DUPLICATE KEY UPDATE\n   " + duplicate;
     589        query += "\nON DUPLICATE KEY UPDATE\n   " + boost::join(duplicate, ",\n   ");
    589590
    590591    if (verbose>0)
Note: See TracChangeset for help on using the changeset viewer.