Skip to main content

Posts

Showing posts from 2025

Why TLS for MySQL is difficult

The internet has changed to a place where most protocols like HTTP etc now use secure connections with TLS by default. While both HTTP and the MySQL Protocol use TLS for secure connections there are still many differences which make it difficult for MySQL to benefit from the same advancements as HTTP has seen in the last so many years. What is TLS? TLS stands for Transport Layer Security and is the successor of SSL (Socket Layer Security). SSL and TLS are often used interchangably, while this isn’t correct strictly speaking. What TLS provides is a standardized way to encrypt in transit traffic and authenticate the other end of the connection. TLS when used together with HTTP is known as HTTPS, for secure HTTP. How TLS works in HTTPS The client (webbrowser) connects to a server on port 443. Then negitiation is done to agree on what encryption method is to be used. The server presents the client with a certificate, which the client then verifies against the system trust store. For ...

Decoding MySQL's GTID_TAGGED_LOG_EVENT

This is a follow-up for MySQL GTID tags and binlog events , but you don’t need to read that first. One of the recent innovations in MySQL was the addition of Tagged GTID’s. These tagged GTID’s take the format of <uuid>:<tag>:<transaction_id> . And this change means that the GTID_LOG_EVENT ’s in the binary logs needed to be changed. The MySQL team at Oracle decided to not change the existing format, but introduce a new event: GTID_TAGGED_LOG_EVENT . Initially I assumed that decoding the new event would me mostly identical to the original event, but with just a single field added. But this isn’t the case as Oracle MySQL deciced to use a new serialization format (Yes, more innovation) and use it for this new event. The new serialization format is documented here . Oracle MySQL did their best to document the library and the format, but I guess the target audience is people using this library to encode and decode the format and not people working on implementations in...

The Potential of Query Attributes in MySQL

Introduction Query Attributes are a relatively new feature of the MySQL Protocol. This is availble since MySQL 8.0.23. Before Query Attributes were introduced there already was already another similar feature: Connetion Attributes, which provides per-connection metadata in the form of key/value pairs. This is what connection attributes look like: mysql > SELECT ATTR_NAME, ATTR_VALUE -> FROM performance_schema.session_connect_attrs -> WHERE PROCESSLIST_ID = 64 ; +------------------+---------------------+ | ATTR_NAME | ATTR_VALUE | +------------------+---------------------+ | _platform | amd64 | | _runtime_version | go1.23.4 | | _client_version | (devel) | | _client_role | binary_log_listener | | _client_name | go-mysql | | _os | linux | +------------------+---------------------+ 6 rows in set (0.00 sec) Connection attributes are set by connectors (wi...