title: Cannot edit MySQL table from Excel
body: <p>I've got a table in MySQL with a non-null primary key field. I've selected within an Excel file the option to edit the database table. When entering data into a cell and selecting to "Commit" my changes, I get an error and the change does not go through.</p>
  
  <p>I've tried deleting the tab and trying again, or trying with a completely new Excel file, and neither approach works.</p>
  
  <p>When looking at the SQL string which is sent to the database it is very confusing to me. Essentially, the statement is a standard </p>
  
  <pre><code>UPDATE db_name.table_name 
  SET 'change_col' = "new_val"
  WHERE &lt;where clause&gt;
  </code></pre>
  
  <p>except that the <code>&lt;where clause&gt;</code> is nuts. The first operand is what I'd like, i.e. equality of the primary key on the value corresponding to the edited row, but then a huge mess of nested conjunctions and disjunctions on the other fields follows. And it isn't what you might expect. For example, I've got a <code>trans_num</code> field and on the edited row its value is <code>22</code>. So for some reason the <code>&lt;where-clause&gt;</code> contains </p>
  
  <pre><code>AND ((22 IS NULL AND `trans_num` IS NULL) OR `trans_num`=22) 
  </code></pre>
  
  <p>which is quite bizarre.</p>
  
  <p>I haven't seen any questions like this online, so I'm not sure what could be causing this behavior or how it can be fixed.</p>