Commenting on my previous post on MySQL Query Cache Gerry pokes me as I'm all wrong and both comments and whitespace are fixed in MySQL 5.0. This was not what I remember seeing in production so I decided to do some tests on the matter:
I did the test two ways. First using command line client and second using little PHP script which just does the same query. I did this as command line client is known to optimize queries sometimes by skipping "unnecessary" comments.
So here is the command line run:
PLAIN TEXT SQL:
- mysql> SELECT /* my little comment */ count(*) FROM fact WHERE val LIKE "%c%";
- +----------+
- | count(*) |
- +----------+
- | 0 |
- +----------+
- 1 row IN SET (8.77 sec)
- …