• unknown's avatar
    WL#1036 (print the db in slave error messages). · ab34adf6
    unknown authored
    I extended the task to cleaning error messages, making them look nicer,
    and making the output of SHOW SLAVE STATUS (column Last_error) be as complete
    as what's printed on the .err file;
    previously we would have, for a failure of a replicated LOAD DATA INFILE:
    - in the .err, 2 lines:
    "duplicate entry 2708 for key 1"
    "failed loading SQL_LOAD-5-2-2.info"
    - and in SHOW SLAVE STATUS, only:
    "failed loading SQL_LOAD-5-2-2.info".
    Now SHOW SLAVE STATUS will contain the concatenation of the 2 messages.
    
    
    sql/log_event.cc:
      Print the default database when replication stops because of an error. Previously, we had:
      "error "Duplicate entry 87987 for key 1", query 'insert into t values(87987)'", ie the db
      was not mentioned, making it hard for cases where the same table name is used in
      several databases.
      Lengthened some error messages (for failing replication of LOAD DATA: mention the table
      and the db).
      Changes so that SHOW SLAVE STATUS reports as complete errors as the .err file.
    sql/slave.cc:
      Removed a useless declaration (the rewrite_db() function is already declared in slave.h).
      Added missing ')' in error messages.
      Tried to make error messages look nicer (previously we had
      "do START SLAVE;, error_code=1062"
      now we'll have
      "do START SLAVE; . Error_code=1062".
      This form has been discussed, I agree it's no panacea, but it's still more readable
      like this. To be improved in the future :)
    sql/slave.h:
      declarations.
    ab34adf6
log_event.cc 63.7 KB