MySQL 8.0.41
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Related Pages
Here is a list of all related documentation pages:
[detail level 12345678]
 Getting Started
 Coding GuidelinesThis section shows the guidelines that MySQL developers follow when writing new code
 General Development GuidelinesWe use Git for source management
 DBUG Tags
 Infrastructure
 Client/Server Protocol
 Protocol BasicsThis is a description of the basic building blocks used by the MySQL protocol:
 Basic Data TypesThe protocol has a few basic types that are used throughout the protocol:
 MySQL PacketsIf a MySQL client or server wants to send data, it:
 Generic Response PacketsFor most commands the client sends to the server, the server returns one of these packets in response:
 Character SetMySQL has a very flexible character set support as documented in Character Set Support
 CompressionCompression is:
 TLSThe MySQL Protocol also supports encryption and authentication via TLS
 Expired PasswordSince MySQL 5.6.7, a MySQL account can be expired
 Connection LifecycleThe MySQL protocol is a stateful protocol
 Connection PhaseThe Connection Phase performs these tasks:
 Command PhaseIn the command phase, the client sends a command packet with the sequence-id [00]:
 Replication ProtocolReplication uses binlogs to ship changes done on the master to the slave and can be written to Binlog File and sent over the network as Binlog Network Stream
 X Protocol
 Life CycleTopics in this section:
 AuthenticationTopics in this section:
 MessagesTopics in this section:
 ExpectationsTopics in this section:
 NoticesTopics in this section:
 Implementation of the X Protocol by the X PluginTopics in this section:
 Use CasesTopics in this section:
 Implementation NotesTopics in this section:
 Comparison to MySQL C/S Protocol
 How to build a Community ConnectorMySQL provides a set of official MySQL Connectors for several popular development frameworks and languages like Node.js, .Net, Python, Java, C, C++ and more
 SQL Query Execution
 SQL OptimizerThe task of query optimizer is to determine the most efficient means for executing queries
 The Optimizer Trace
 Stored Programs
 TransactionsSee trans_begin, trans_commit, trans_rollback
 Data Storage
 Innodb data lock instrumentationInnodb Performance Schema data lock instrumentation
 Innodb redo log
 Redo log bufferWhen mtr commits, data has to be moved from internal buffer of the mtr to the redo log buffer
 Background redo log threadsThree background log threads are responsible for writes of new data to disk:
 Format of redo log
 Innodb Lock-sys
 Innodb utilsUseful data structures:
 TempTable storage engineThe TempTable storage engine is designed to be used by the Optimizer for creating temporary tables internally when dealing with complex queries
 GlossaryFollowing is a list of the terms used in the TempTable storage engine source code
 Row formatThe handler interface uses two different formats
 ReplicationHow replication of field metadata works.
 SecurityAuthorization IDs, roles and users Keyring Component
 Authorization IDs, roles and users
 Keyring Component
 Keyring Component Implementation
 Common Keyring Implementation InfrastructureKeyring_common library includes modules that can be used in various keyring implementation
 MonitoringPerformance Schema
 Performance SchemaMySQL PERFORMANCE_SCHEMA implementation
 Instrumentation interfaceMySQL performance schema instrumentation interface
 AggregatesPerformance schema aggregates
 Performance schema data locks
 Implementing a new performance_schema tableTo implement a new performance schema table, two independent problems need to be resolved:
 Notification service
 Resource group service
 Plugin table servicePerformance Schema plugin table service is a mechanism which provides plugins/components a way to expose their own tables in Performance Schema
 Performance schema TLS channels instrumentation
 Extending MySQL
 Component SubsystemThe component subsystem is designed to overcome some of the architectural issues of the plugin subsystem, namely:
 Component Subsystem ConceptsThese are the building blocks of the component subsystem:
 Plugins
 Plugin Services
 Plugin Service AnathomyA "service" is a struct of C function pointers
 How to add a new serviceA "plugin service" is in its core a C struct containing one or more function pointers
 What defines a "good" plugin service ?The following is an attempt to explain what is a good plugin service
 User Defined Functions
 Available servicesTable Access service Server telemetry traces service
 Table Access serviceThe TABLE ACCESS service allows components to read and write to MySQL tables owned by the component
 Server telemetry traces servicePerformance Schema server telemetry traces service is a mechanism which provides plugins/components a way to get notifications related to SQL statements lifetime
 Service IntroductionThis service is named mysql_server_telemetry_traces_v1 and it exposes three major methods:
 Service InterfaceThis interface is provided to plugins/components, using which they can receive notifications related to statement lifetime events
 Example componentComponent/plugin that implements telemetry tracing, typically also uses other services within the callbacks to inspect and filter out the traced statements according to its needs
 Server tools
 MySQL RouterMySQL Router
 MySQL Server Mock
 Client toolsSee mysqldump.cc mysql.cc
 Testing Tools
 The MySQL Test FrameworkThis manual describes the MySQL test framework, consisting of the test driver and the test script language
 PrefaceMySQL distributions include a set of test cases and programs for running them
 Introduction to the MySQL Test FrameworkMySQL distributions include a test suite: a set of test cases and programs for running them
 MySQL Test Framework Components
 Running Test CasesTypically, you run the test suite either from within a source tree (after MySQL has been built), or on a host where the MySQL server distribution has been installed
 Writing Test Cases
 MySQL Test Programs
 mysqltest Language Reference
 Creating and Executing Unit Tests
 Plugins for Testing Plugin ServicesMySQL server plugins have access to server “services”, as described in MySQL Services for Plugins
 Component unit testing using the minimal chasissThis framework allows testing components without loading them into the server
 Development Tools
 Lock OrderMySQL LOCK ORDER
 Code pathsThis section details how the server executes some statements, to illustrate how different parts work together
 CREATE TABLE
 Deprecated List