Ticket #1485070 (closed Bugs: worksforme)
SQL Strict Mode Identities issue
| Reported by: | bpat1434 | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2-alpha |
| Component: | Client Scripts | Version: | 0.1.1 |
| Severity: | major | Keywords: | SQL Strict identities identity |
| Cc: |
Description
If your SQL server has "Strict Mode" enabled, then identities are not auto-created for them because the column definitions declare "not null" in the identities table. There is an easy solution (well, 2 options really):
(1) Make the table columns "NULL" (2) Edit the identity creation SQL to be: {{{ $DB->query(
"INSERT INTO ".get_table_name('identities')."
(identity_id, user_id, del, standard, name, email, organizatoin, reply-to, bcc, signature, html_signature)
VALUES (NULL, ?, 0, 1, ?, ?, , , , , )",
$user_id, strip_newlines($user_name), preg_replace('/@/', $user . '@', $sql_arr[0]));}}}
Either way will work. The code modification works on MySQL 5 using "SET sql_mode='TRADITIONAL'" as the strict mode enabler.
