MariaDB in Google Summer of Code 2016

And for the fourth year in a row, MariaDB Foundation participates in the Google Summer of Code! The MariaDB Organization in GSoC is an umbrella organization for all projects that belongs to the MariaDB ecosystem, be it MariaDB Server, MariaDB Connectors, or MariaDB MaxScale. The complete list of our suggested project ideas is in MariaDB Jira. This year we were granted 10 student slots (as compared to 8 last year, 5 in 2014, and 3 in 2013). And it was good, as applicants this year were exceptionally strong. Our students have chosen these projects:

For the server:

  • MDEV-7773 Aggregate Stored Functions
  • student: Varun Raiko, mentors: Sanja Byelkin and Vicențiu Ciorbaru

  • MDEV-8947 Cassandra connector support for 2.x
  • student: Charles Muurmu, mentor: Sergey Petrunia
    blog: https://cassandrastorageenginev2.wordpress.com/

  • MDEV-4989 Support for GTID in mysqlbinlog
  • student: Becca Tucker, mentors: Lixun Peng and Colin Charles

  • MDEV-9711 NO PAD collations
  • student: Daniil Medvedev, mentor: Alexander Barkov

  • MDEV-9197 Pushdown conditions into non-mergeable views/derived tables
  • student: Galina Shalygina, mentors: Igor Babaev and Sergey Petrunia
    blog: http://gsocmariadbshagalla.blogspot.ru/

  • MDEV-371 Unique indexes for blobs (server-side implementation) and adaptive hashing for generated hash
  • student: Sachin Setiya, mentor: Sergei Golubchik

  • MDEV-371 Unique indexes for blobs (in MyISAM, Aria, InnoDB, and XtraDB)
  • student: Shubham Barai, mentors: Jan Lindström and Sergei Golubchik

For the MariaDB Connector/C:

For the MariaDB MaxScale:

For the Master High Availability Manager for MySQL:

Many projects have two mentors to ensure that the student always gets a quick answer to his questions and someone is always available to help even if one of the mentors is, for example, on vacations. …

The State of SSL in MariaDB

Usually when one says “SSL” or “TLS” it means not a specific protocol but a family of protocols. Wikipedia article has the details, but in short — SSL 2.0 and SSL 3.0 are deprecated and should not be used anymore (the well-known POODLE vulnerability exploits the flaw in SSL 3.0). TLS 1.0 is sixteen years old and while it’s still being used, new security standards (for example PCI DSS v3.1) require TLS 1.1 or, preferably, TLS 1.2.

MySQL used to support TLS 1.0 since 2001. Which means MariaDB supported it from the day one, and never supported weaker SSL 2.0 or SSL 3.0. …

MariaDB 10.1.1: triggers for RBR

Sometimes users ask for something that doesn’t really make sense. On the first glance. But then you start asking and realize that the user was right, you were wrong, and it is, actually, a perfectly logical and valid use case.

I’ve had one of these moments when I’ve heard about a request of making triggers to work on the slave in the row-based replication. Like, really? In RBR all changes made by triggers are replicated from the master to slaves as row events. If triggers would be fired on the slave they would do their changes twice. And anyway, assuming that one only has triggers one the slave (why?) in statement-based replication triggers would run on the slave normally, wouldn’t they? …

MariaDB 10.1.1: engine_condition_pushdown flag deprecated

Let me start with a little story. You sit in your house near the fireplace in the living room and need a book from the library… Eh, no, sorry, wrong century. You’re building a robotic arm that will open your beer or brew your coffee or supply you with whatever other drinks of your choice… while you’ll be building the next robotic arm. So, you — soldering iron in one hand and Arduino in another — ask your little brother to bring a box with specific resistors (that you unexpectedly run out of) from the cellar. The problem — your brother is small and cannot tell a resistor from a respirator. …

MariaDB 10.1.1: system variables and their metadata

I don’t think it’ll surprise anybody if I say that MariaDB or MySQL server knows a lot more about server system variables, then just their values. Indeed, every variable can be session or global only, read-only or writable, it has an associated help text (that is printed on mysqld –help –verbose), certain variables only accept values from a given set of strings (this set of allowed values is also printed in mysqld –help –verbose since MariaDB 10.1.0), numeric variables have lower and upper range boundaries of valid values (that are never printed anywhere), and so on. I always thought it’s kind of a waste that there is no way to query this information. …

MariaDB 10.1.1: FLUSH and SHOW for plugins

One of the most popular plugin types both in MariaDB and MySQL is INFORMATION_SCHEMA plugin type. INFORMATION_SCHEMA plugins add new tables to the INFORMATION_SCHEMA. There are lots of INFORMATION_SCHEMA plugins, because they can be used to show just anything to the user and are very easy to write.

MariaDB 10.1.1 comes with nine INFORMATION_SCHEMA plugin:

  • Feedback — shows the anonymised server usage information and can optionally send it to the configured url.
  • Locales — lists compiled-in server locales, implemented by Roberto Spadim
  • METADATA_LOCK_INFO — Lists metadata locks in the server.

MariaDB 10.1.1: Compound statements

Every now and then there is a need to execute certain SQL statements conditionally. Easy, if you do it from your PHP (or Java or whatever) application. But if all you have is pure SQL? There are two techniques that MariaDB and MySQL use in the mysql_fix_privilege_tables.sql script (applied by mysql_upgrade tool).

  1. Create a stored procedure with IF statements inside, call it once and drop it. This requires the user to have the CREATE ROUTINE privilege and mysql.proc table must exist and be usable (which is not necessarily true — we’re doing it from mysql_upgrade, right?).
  2. Use dynamic SQL, like
    SET @str = IF (@have_csv = ‘YES’,
    ‘CREATE TABLE IF NOT EXISTS general_log (
    event_time TIMESTAMP(6) NOT NULL,
    user_host MEDIUMTEXT NOT NULL,
    thread_id BIGINT(21) UNSIGNED NOT NULL,
    server_id INTEGER UNSIGNED NOT NULL,
    command_type VARCHAR(64) NOT NULL,
    argument MEDIUMTEXT NOT NULL
    ) engine=CSV CHARACTER SET utf8 comment=”General log”‘,
    ‘SET @dummy = 0’);

MariaDB 10.1.1: no more .frm’s for performance_schema tables

Yes! In MariaDB 10.1.1 tables in PERFORMANCE_SCHEMA do not use .frm files. These files are not created, not read — in fact, PERFORMANCE_SCHEMA tables never touch the disk at all.

This became possible due to a lesser-known feature of MariaDB — new table discovery (“old table discovery” was implemented in MySQL for NDB Cluster in 2004), implemented in MariaDB 10.0.2. Instead of reading and parsing .frm files, MariaDB simply asks PERFORMANCE_SCHEMA table, what structure it has, and because these tables always have a fixed structure, the table directly returns it to MariaDB with no need for any external data dictionary. …