BLOBvalues can't ``reliably'' be used in
DISTINCT. Only the first
max_sort_lengthbytes (default 1024) are used when comparing
BLOBbs in these cases. This can be changed with the
-O max_sort_lengthoption to
mysqld. A workaround for most cases is to use a substring:
SELECT DISTINCT LEFT(blob,2048) FROM tbl_name.
DOUBLE(both are normally 64 bits long). It depends on the function which precision one gets. The general rule is that bit functions are done with
DOUBLEprecision and the rest with
DOUBLEprecision. One should try to avoid using bigger unsigned long long values than 63 bits (9223372036854775807) for anything else than bit fields!
TEXTcolumns, automatically have all trailing spaces removed when retrieved. For
CHARtypes this is okay, and may be regarded as a feature according to ANSI SQL92. The bug is that in MySQL,
VARCHARcolumns are treated the same way.
SETcolumns in one table.
safe_mysqldre-directs all messages from
mysqldlog. One problem with this is that if you execute
mysqladmin refreshto close and reopen the log,
stderrare still redirected to the old log. If you use
--logextensively, you should edit
safe_mysqldto log to `'hostname'.err' instead of `'hostname'.log' so you can easily reclaim the space for the old log by deleting the old one and executing
UPDATEstatement, columns are updated from left to right. If you refer to a updated column, you will get the updated value instead of the original value. For example:
mysql> UPDATE tbl_name SET KEY=KEY+1,KEY=KEY+1
2 instead of with
select * from temporary_table, temporary_table as t2;
The following is known bugs in earlier versions of MySQL:
UPDATEthat updated a key with a
WHEREon the same key may have failed because the key was used to search for records and the same row may have been found multiple times:
UPDATE tbl_name SET KEY=KEY+1 WHERE KEY > 100;
A workaround is to use:
mysql> UPDATE tbl_name SET KEY=KEY+1 WHERE KEY+0 > 100;
This will work because MySQL will not use index on expressions in the
For platform-specific bugs, see the sections about compiling and porting.