title: Why is AES_DECRYPT returning null?
body: <p>I've found similar questions, but no clear answer for this question. I have this table:</p>
  
  <pre><code>CREATE DATABASE testDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 
  
  CREATE TABLE testTable
  (
  firstName binary(32) not null,
  lastName binary(32) not null
  /* Other non-binary fields omitted */
  )
  engine=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  </code></pre>
  
  <p>This statement executes just fine:</p>
  
  <pre><code>INSERT INTO testTable (firstName) VALUES (AES_ENCRYPT('Testname', 'test'));
  </code></pre>
  
  <p>But, this returns NULL:</p>
  
  <pre><code>SELECT AES_DECRYPT(firstName, 'test') FROM testTable;
  </code></pre>
  
  <p>Why does this return NULL?</p>
  
  <p>Fwiw, this returns "testValue" as expected:</p>
  
  <pre><code>SELECT AES_DECRYPT(AES_ENCRYPT('testValue','thekey'), 'thekey');
  </code></pre>