title: Mysql Bug? Inverting 0 is inconsistent
body: <p>So really I'm just curious as to what the cause of this is or if this is truly a bug that needs to be submitted to the MySQL development team.</p>
  
  <p>These Queries should be equivalent (they can be hard to read):</p>
  
  <pre><code>SELECT !0, !!0, !!!0, !!!!0, !!!!!0, !!!!!!0;
  SELECT NOT 0, NOT NOT 0, NOT NOT NOT 0, NOT NOT NOT NOT 0, NOT NOT NOT NOT NOT 0, NOT NOT NOT NOT NOT NOT 0;
  SELECT !(0), !(!(0)), !(!(!(0))), !(!(!(!(0)))), !(!(!(!(!(0))))), !(!(!(!(!(!(0))))));
  </code></pre>
  
  <p>I would expect these to return:</p>
  
  <pre><code>true, false, true, false, true, false
  </code></pre>
  
  <p>The first 2 do, but the last returns:</p>
  
  <pre><code>true, true, false, false, true, true
  </code></pre>
  
  <p>Can anyone explain this?</p>
  
  <hr>
  
  <p>If anyone is curious, this originated from a question posed to me. Because 0 is treated as false and 1 as true, you can use a field - lets call it bool_field - like this: </p>
  
  <pre><code>SELECT * FROM something WHERE bool_field
  </code></pre>
  
  <p>or</p>
  
  <pre><code>SELECT * FROM something WHERE !bool_field
  </code></pre>
  
  <p>Frequently, if I want to make sure something is treated as a boolean (generically not language specific), but do not want to invert it's value, I write it as this:</p>
  
  <pre><code>SELECT * FROM something WHERE !!bool_field
  </code></pre>
  
  <p>This lead to a really weird pattern and finally to the question above.</p>
  
  <hr>
  
  <p>MySQL version is 5.5.4</p>