This would remove the need for an INSERT query, which is a small simplification of the code, but more importantly, it handles incrementing the serial ID field, so this code that's far too close to database internals could be removed completely:

  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $new_mlid = NULL;
      break;
    case 'pgsql':
      $new_mlid = db_result(db_query("SELECT nextval('{mail_logger_mlid_seq}')"));
      break;
  }

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new1.7 KB

Depends on #1239398: don't use MySQL reserved words for column names, as drupal_write_record() chokes if any column names are reserved keywords.

Here's a patch that's cumulative on the one at #1239398: don't use MySQL reserved words for column names.

fizk’s picture

Issue summary: View changes
Status: Needs review » Fixed

Fixed, thanks!

  • Commit 7decb66 on 6.x-1.x authored by joachim, committed by fizk:
    #1239074: Use drupal_write_record() to save log item.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.