June 19, 2013

Post: MySQL Indexing Best Practices: Webinar Questions Followup

… TBL WHERE hash=crc32(‘string‘) AND string=’string‘ The other thing you need to consider is string comparison in MySQL is case insensitive by default while hash comparison will be done case sensitive unless you lowercase string before… UUID it is at least good to convert it in binary form and store as VARBINARY(16) for performance reasons. In…

Post: Lost innodb tables, xfs and binary grep

…, some facts about the system and how data was lost: MySQL had a dedicated partition on XFS file system Server was… grep won’t match binary strings. This isn’t new, I kind of knew grep couldn’t look for binary “junk”, but I… one, I have just converted number 837492636 to it’s binary representation 0x31EB1F9C and ran “bgrep 31EB1F9C /dir” – there were only…

Post: MySQL opening .frm even when table is in table definition cache

…”) check if it’s a view by doing a string compare for “TYPE=VIEW\n” being the first bytes …query inside the FRM file instead of the normal binary format FRM. some legacy check for a generic … and in the table_definition_cache). Further reading: MySQL Forge Internals document on the FRM file format …

Post: Common MySQL traps webinar questions followup

… durability (innodb_flush_log_at_trx_commit) disable binary logging if it’s not useful look at…’, ‘shipped’, ‘canceled’ or ‘archived’. If you use a string, a VARCHAR(15) could be good to store…: Are these recommendations true of all versions of MySQL? If not which versions? The recommendations I made…

Post: SQL Injection Questions Followup

… content into an SQL string is potentially an injection risk.  If you have binary data, you could interpolate the binary bytes, so it… contains non-printing characters. The standard API function mysql_real_escape_string() is aware of binary bytes, and will escape appropriately.  SQL also…

Post: Be careful when joining on CONCAT

… at MySQL manual and here’s a short quote about CONCAT: …If all arguments are non-binary strings, the result is a non-binary string. If the arguments include any binary strings, the result is a binary string. A numeric argument…

Post: How to obtain the "LES" (Last Executed Statement) from an Optimized Core Dump?

… (release) binaries: debug symbols have been stripped out. In non-optimized binaries, the query would…we inspect the mysql_execute_command frame: (gdb) frame 21 #21 0x00000000005a30af in mysql_execute_… query string is hiding (query_string > string > str), we can use: (gdb) p thd->query_string.string….

Comment: Idea: Couple of more string types

Peter, > BINARY in MySQL means different. This means the string is processed as byte string rather > than character string – so for example it is case insensitive and there are also > differences end spaces handling. Binary strings are indeed case sensitive. I assume, it was just a typo :)

Post: Idea: Couple of more string types

MySQL has a lot of string data types – CHAR, VARCHAR, BLOB, TEXT, ENUM and bunch of … deal with strings like that in MySQL. Either you store them as strings and waste space or you spend them as binary and deal with inconvenience of having not readable strings in the…