May 26, 2012

Post: Trailing spaces in MySQL

In the past life was easy in MySQL. Both CHAR and VARCHAR types meant the same, only being difference in the sense of fixed or dynamic row length used. Trailing spaces were removed in both cases. With MySQL 5.0 however things changed so now VARCHAR keeps trailing spaces while CHAR…

Post: Why audit logging with triggers in MySQL is bad for replication

… I was tasked with investigating slippage between master and slave in a standard replication setup. The client was using Maatkit’s… an audit table for changes to the Foo table. The trail is kept using two triggers on that table. select trigger… you can see from the above, the updates were performed in a different order, with the inserts being assigned a different…

Comment: Upgrading MySQL

MySQL 5.0.3, trailing spaces are retained when values are stored and retrieved, in conformance with standard SQL. Before MySQL 5.0.3, trailing… directly from MySQL 4.1 to 5.1. This occurs due to an incompatible change in the MyISAM table index format in MySQL 5.0. Upgrade from MySQL 4.1 to 5.0…

Comment: Trailing spaces in MySQL

…, you compare using BINARY: mysql> SELECT “a ” = “a”; +————+ | “a ” = “a” | +————+ | 1 | +————+ 1 row in set (0.00 sec) mysql> SELECT BINARY “a ” = BINARY… row in set (0.00 sec) I think, however, a best practice would be to have the application strip trailing spaces before…

Post: To pack or not to pack - MyISAM Key compression

… understand performance implications of this approach. Note trailing spaces for strings are not stored in the index even if it is not packed. Compressed blocks need to be treated differently. For uncompressed index blocks MySQL can do binary search inside the page – kind of jumping in the middle and looking at…

Comment: Making the impossible: 3 nodes intercontinental replication

…continue Harrison’s trail, it now depends on what you are comparing against whether… answer is that you have a readonly datacenter with mysql slaves, and all writes are directed to one master … world). If the answer is that you already write in multiple data centers, for instance using a “Master of …

Comment: MySQL Installation and upgrade scripts.

…” did not trigger table repairs (bad, varchar string comparison with trailing spaces might return different from expected results), no problems with…, with “check for upgrade” repairs, problems with auto_increment values in the replication binlogs (bug #24432) 5.0.36sp1 – slow, with… to 5.0.36sp1 (MySQL Enperprise) it seems to be the most stable release, it’s still in the tests, who knows…