Databases

MariaDB 13.1 New Features Tested: DENY, JSON Arrows, utf8mb4

A DENY statement that overrides any GRANT is the headline among the MariaDB 13.1 new features, and it is the one you will probably try first. It is not the one that bites during an upgrade, though. That job falls to utf8, which now means utf8mb4, and to mariadb-dump, which stopped writing the values of generated columns. Both changed quietly on our test server, and neither produced a warning.

Original content from computingforgeeks.com - post 196673

We installed the GA build fresh, upgraded a populated 12.3 LTS server in place, and ran every feature below against real tables, including the errors you’ll hit when the syntax is slightly off. MariaDB 13.1.2 went onto Debian 13, Ubuntu 26.04 and Rocky Linux 10 in November 2026, and the feature tests and the upgrade ran on the Debian box.

Decide between MariaDB 13.1 and 12.3 LTS

Start with the support model, because it decides more than the features do. 13.1 is an innovation release, and MariaDB’s release model page is blunt about what that means: once an innovation release is stable it gets no further patch releases apart from emergencies, and users are expected to move to the next innovation release instead. A new one lands every third month, so a 13.1 server is a server you’ll upgrade four times a year.

12.3 is the LTS line, maintained for three years from its GA. MariaDB’s 12.3 announcement pitches it as the stable line for production that needs long-term maintenance, and we agree. If you run 13.1 you sign up for an upgrade every quarter, and the features below will land in the next LTS anyway. Pick by what you need:

  • Stay on 12.3 LTS for production databases you patch and forget, Galera clusters and anything an auditor looks at
  • Run 13.1 if you need DENY, JSON arrows or interval partitions now
  • Test 13.1 on a copy if you plan to adopt the next LTS

For the LTS path, the full install guides cover MariaDB 12.3 LTS on Debian 13, 12.3 on Ubuntu 26.04 and 24.04 and 12.3 on Rocky Linux and AlmaLinux 10. Whichever line you pick, check you’re past the fix for CVE-2026-92262 before the server faces anything untrusted.

Get a 13.1 test server running

None of the three distros we tested ships 13.1 yet. Ubuntu 26.04 offers 11.8 from its own archive and Rocky Linux 10 offers 10.11 and 11.8 from AppStream, so the packages come from MariaDB’s repository. The steps below are the minimum: the repository, the install and a version check. Securing the root account and opening the firewall work exactly as they do on 12.3, so follow the LTS guides above for those.

Debian 13 and Ubuntu 26.04

Download MariaDB’s signing key into the apt keyring directory first. Our cloud images shipped with curl, but a minimal install may need sudo apt install -y curl before this works:

sudo curl -o /etc/apt/keyrings/mariadb-keyring.asc 'https://mariadb.org/mariadb_release_signing_key.pgp'

Then create a deb822 source file for the repository:

sudo vim /etc/apt/sources.list.d/mariadb.sources

The file below is for Debian 13. On Ubuntu 26.04, change the URIs path to end in /ubuntu and set Suites to resolute:

X-Repolib-Name: MariaDB
Types: deb
URIs: https://deb.mariadb.org/13.1/debian
Suites: trixie
Components: main
Signed-By: /etc/apt/keyrings/mariadb-keyring.asc

Refresh the package index and install the server and client:

sudo apt update
sudo apt install -y mariadb-server mariadb-client

Ask the running server what it is. Querying VERSION() beats reading the package version, because it proves the new binary actually started:

sudo mariadb -t -e "SELECT VERSION();"

On Ubuntu the repository’s candidate replaced the archive’s 11.8 build, and the server reported the ubu2604 suffix:

MariaDB 13.1 installed from the MariaDB repository on Ubuntu 26.04 with SELECT VERSION() output

Debian 13 behaves the same way and reports a version string ending in -deb13. The service is enabled and started by the package, so there is nothing else for you to switch on.

Rocky Linux 10

On the RHEL family the repository is a plain .repo file:

sudo vim /etc/yum.repos.d/MariaDB.repo

Paste the following. The $releasever and $basearch variables resolve to 10 and x86_64 on our VM:

[mariadb]
name = MariaDB 13.1
baseurl = https://rpm.mariadb.org/13.1/rhel/$releasever/$basearch
gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1

Install the packages and start the service. Unlike Debian, the RPM does not start anything on its own, so you enable the unit yourself:

sudo dnf install -y MariaDB-server MariaDB-client
sudo systemctl enable --now mariadb

The capital-M MariaDB-* packages didn’t conflict with AppStream’s lowercase mariadb packages, because nothing from AppStream was installed. SELinux stayed in enforcing mode and pulled in mysql-selinux as a dependency, so the default datadir needed no relabelling:

MariaDB 13.1 RPM packages on Rocky Linux 10 with SELinux enforcing

Fedora users get the same repository layout, and the MariaDB on Fedora guide covers the distro packages and the MariaDB repository side by side. The rest of this article uses the Debian 13 server we upgraded from 12.3, so the tables carry real history.

You’ll want the same test tables if you’re following along. We created legacy on 12.3 before the upgrade and shop on 13.1 afterwards. On a fresh 13.1 server legacy.notes comes out as utf8mb4, for reasons the utf8 section explains:

sudo mariadb -e "CREATE DATABASE legacy; CREATE TABLE legacy.notes (id INT PRIMARY KEY, body VARCHAR(100)) CHARSET=utf8;"
sudo mariadb -e "CREATE TABLE legacy.items (id INT PRIMARY KEY, price DECIMAL(8,2), qty INT, total DECIMAL(10,2) AS (price*qty) STORED); INSERT INTO legacy.items (id,price,qty) VALUES (1,9.50,4),(2,3.25,10);"
sudo mariadb -e "CREATE DATABASE shop; CREATE TABLE shop.events (id INT PRIMARY KEY, doc JSON); INSERT INTO shop.events VALUES (1, JSON_OBJECT('user', JSON_OBJECT('name','Alice','age',31), 'tags', JSON_ARRAY('a','b'), 'items', JSON_ARRAY(JSON_OBJECT('sku','X1','qty',2), JSON_OBJECT('sku','Y2','qty',1)))), (2, JSON_OBJECT('user', JSON_OBJECT('name','Bob','age',42), 'tags', JSON_ARRAY(), 'items', JSON_ARRAY(JSON_OBJECT('sku','Z9','qty',5)))), (3, JSON_OBJECT('user', JSON_OBJECT('name','Carol','age',28), 'tags', JSON_ARRAY('c'), 'items', JSON_ARRAY()));"
sudo mariadb -e "CREATE TABLE shop.orders (id INT PRIMARY KEY, item VARCHAR(30)); CREATE TABLE shop.payroll (id INT PRIMARY KEY, employee VARCHAR(30), salary INT); INSERT INTO shop.orders VALUES (1,'keyboard'); INSERT INTO shop.payroll VALUES (1,'Alice',5000);"
sudo mariadb -e "CREATE TABLE shop.docs (id INT PRIMARY KEY, emb VECTOR(3) NOT NULL, VECTOR INDEX (emb));"

Three customers in a JSON column, a payroll table worth hiding and a generated column are enough to hit every change that matters below.

Block access with DENY

Before 13.1, MariaDB privileges only added up. If you gave a user SELECT on a whole database and then wanted one table kept from them, you had to drop the database grant and grant every other table one by one. Every table created later then needed its own grant too. DENY fixes that: it subtracts a privilege, and it wins over any GRANT at any level.

Our test user alice gets read access to the whole shop database, then loses the payroll table:

sudo mariadb -e "CREATE USER alice@localhost IDENTIFIED BY 'Alice#Lab2026'; GRANT SELECT ON shop.* TO alice@localhost; DENY SELECT ON shop.payroll TO alice@localhost;"

Logged in as alice, the orders table still reads fine and payroll returns ERROR 1142. More interesting is what’s missing. Payroll does not appear in SHOW TABLES at all, and alice’s own SHOW GRANTS lists the database grant but not the DENY that blocks her:

MariaDB 13.1 DENY SELECT: alice gets ERROR 1142 on shop.payroll, the table is hidden from SHOW TABLES and her SHOW GRANTS omits the deny

That hidden line matters for support work. A developer who runs SHOW GRANTS to debug their own access sees a grant that should work and an error that says it doesn’t. Denies only show up for an account with SELECT on the mysql schema, so root sees the full picture, while scripts built on the show grants for all users approach only see them when they run with that privilege.

There is no separate deny table. The server stores denies inside the account’s JSON row in mysql.global_priv, which is handy if you audit accounts with SQL and want your report to include denies:

sudo mariadb -t -e "SELECT User, Host, Priv FROM mysql.global_priv WHERE User='alice'\G"

The denies array names the object and a privilege bitmask, where 1 is SELECT. The password hash is masked here:

*************************** 1. row ***************************
User: alice
Host: localhost
Priv: {"access":0,"version_id":130102,"plugin":"mysql_native_password","authentication_string":"*[hash]","password_last_changed":1795714602,"denies":[{"type":"table","db":"shop","table":"payroll","bits":1}]}

The version_id of 130102 also tells you the row was written by the 13.1 server. Because the denies live inside that JSON, an audit query that only reads tables_priv or columns_priv will miss them, so point your reports at global_priv or at SHOW GRANTS run as an admin.

Remove a deny with REVOKE DENY

A GRANT on the exact table doesn’t override the deny, and a plain REVOKE SELECT removes the grant while leaving the deny in place. Only REVOKE DENY lifts it:

sudo mariadb -t -e "REVOKE DENY SELECT ON shop.payroll FROM alice@localhost;"

We tried all three in order, and the screenshot shows how alice’s view changed at each step:

MariaDB 13.1 SHOW GRANTS lists the DENY line, a later GRANT does not override it and REVOKE DENY restores access

Running REVOKE DENY a second time fails with ERROR 1147 (42000): There is no such grant defined for user 'alice' on host 'localhost' on table 'payroll'. The message says “grant” even though it’s looking for a deny, so don’t let it send you hunting for a missing GRANT. In practice you’ll see it when a cleanup script runs twice, because the first run already removed the deny. Check SHOW GRANTS as root before you assume something is broken, since a missing DENY line means the second revoke had nothing left to do.

Deny at database and column level

A deny on shop.* beats grants made afterwards on single tables and even on single columns. We denied the database, then granted shop.orders and two payroll columns, and both reads still failed with ERROR 1142. The reverse also works: deny a single column and the rest of the table stays readable:

sudo mariadb -e "DENY SELECT (salary) ON shop.payroll TO alice@localhost;"
mariadb -ualice -p'Alice#Lab2026' -e "SELECT salary FROM shop.payroll;"

Alice could still select id and employee, while the salary column came back with a column-level error:

ERROR 1143 (42000) at line 1: SELECT command denied to user 'alice'@'localhost' for column 'salary' in table 'payroll'

On 12.3 the same DENY statement is a syntax error (ERROR 1064 near DENY SELECT). Keep that in mind on replication: a 13.1 primary will write DENY statements to the binary log that a 12.3 replica can’t parse, so upgrade replicas first. The same applies to tools that replay SQL, such as schema migration frameworks that keep a history of grants. If one of them can target both versions, keep DENY statements out of shared migrations until every server runs 13.1, because a single 12.3 target will fail the whole run.

Query JSON with the -> and ->> operators

MySQL has had the arrow operators for years, and their absence was one of the more irritating porting gaps. 13.1 adds both, with the same meaning MySQL gives them. doc->'$.path' is shorthand for JSON_EXTRACT(doc, '$.path'), and doc->>'$.path' adds JSON_UNQUOTE() on top. We loaded three small order documents into a JSON column and queried them:

sudo mariadb -t -e "SELECT id, doc->'$.user.name' AS quoted, doc->>'$.user.name' AS plain FROM shop.events;"

The single arrow keeps the JSON quotes and the double arrow strips them. Filters in WHERE work as you’d expect, and a parenthesised arrow can feed a second one:

mariadb json arrow operators and ->> operators returning quoted and unquoted values, a WHERE filter and the ERROR 1064 on a computed path” class=”wp-image-196666″/>

Note that doc->>'$.user.age' > 30 compared correctly as a number even though ->> returns text, because MariaDB converts the string for the comparison. For an indexed lookup on a large table, a generated column over the path is still the better tool.

ERROR 1064 near CONCAT with the arrow operator

The path after an arrow must be a string literal. A computed path such as doc->CONCAT('$.','user'), a user variable like doc->@p and an unparenthesised chain like doc->'$.user'->'$.name' all fail with ERROR 1064. The fixes are simple:

  • Computed or variable paths go through JSON_EXTRACT(doc, CONCAT('$.','user')), which still works
  • Chains need parentheses: (doc->'$.items[0]')->>'$.sku'
  • Better still, write the full path once: doc->>'$.items[0].sku'

On a 12.3 server even the simple form fails with ERROR 1064 near >'$.a', which is the fastest way to tell which server an application is really talking to.

Return arrays from JSON_TABLE with FORMAT JSON

The quieter JSON change is in JSON_TABLE. A normal PATH column only extracts scalars, so pointing one at an array returned NULL for every row in our test. The new FORMAT JSON PATH column type returns the array or object as JSON text instead:

sudo mariadb -t -e "SELECT e.id, jt.name, jt.tags, jt.items FROM shop.events e, JSON_TABLE(e.doc, '$' COLUMNS (name VARCHAR(20) PATH '$.user.name', tags VARCHAR(100) FORMAT JSON PATH '$.tags', items VARCHAR(200) FORMAT JSON PATH '$.items')) AS jt;"

Each row now carries its tags and line items as JSON, including the empty arrays:

+----+-------+------------+----------------------------------------------------+
| id | name  | tags       | items                                              |
+----+-------+------------+----------------------------------------------------+
|  1 | Alice | ["a", "b"] | [{"sku": "X1", "qty": 2}, {"sku": "Y2", "qty": 1}] |
|  2 | Bob   | []         | [{"sku": "Z9", "qty": 5}]                          |
|  3 | Carol | ["c"]      | []                                                 |
+----+-------+------------+----------------------------------------------------+

The column you declare must be a string type. Declaring it as INT FORMAT JSON PATH fails with ERROR 1221 (HY000): Incorrect usage of FORMAT JSON and non-string JSON_TABLE column, so give it a character type such as VARCHAR.

Let INTERVAL partitioning add partitions

If you run time-series tables, you probably also run a cron job that adds next month’s partition before anyone notices it is missing. 13.1 can do that itself for RANGE COLUMNS interval partitioning. You define the first partition and an interval, and the server creates the rest:

sudo mariadb -e "CREATE TABLE shop.metrics (id INT AUTO_INCREMENT, taken DATE NOT NULL, val INT, PRIMARY KEY (id, taken)) ENGINE=InnoDB PARTITION BY RANGE COLUMNS (taken) INTERVAL 1 MONTH (PARTITION p0 VALUES LESS THAN ('2026-09-01'));"

Right after the CREATE, the table had only p0. The first INSERT made the server add p1 to p3, up to the partition covering the current month. Then we tried a row dated March 2027:

MariaDB 13.1 INTERVAL 1 MONTH partitioning adds p1 to p3 up to the current month, ERROR 1526 for a future row and ERROR 4267 for MAXVALUE

Plan around that behaviour, because the server adds partitions up to the clock, not up to the value you insert. The interval partitioning reference says the same thing, so it’s by design rather than a bug. SHOW CREATE TABLE keeps the INTERVAL 1 MONTH clause and lists every partition generated so far, so a dump and restore rebuilds the same layout.

ERROR 1526: Table has no partition for value from column_list

Any row dated after the newest generated partition fails with this error. It hits applications that write scheduled or forward-dated records, such as subscription renewals or planned maintenance windows. There are two ways out:

  • Keep future-dated rows in a separate, unpartitioned table
  • Stay on classic RANGE partitioning with a MAXVALUE catch-all and your existing rotation job

You cannot combine the two. Defining a MAXVALUE partition on an interval table fails with ERROR 4267 (HY000): MAXVALUE is not allowed in range partitioning with interval. The Oracle-style INTERVAL (NUMTOYMINTERVAL(1, 'MONTH')) spelling is accepted too and produced the same monthly layout in our test, which helps if you’re porting DDL from Oracle.

Check what utf8 means after the upgrade

Since 10.6, utf8 in MariaDB has been an alias for the three-byte utf8mb3, controlled by the UTF8_IS_UTF8MB3 flag in old_mode. On our 12.3 server that flag was the default. 13.1 drops it from the default, so utf8 now means four-byte utf8mb4. Our upgraded server came up with an empty old_mode because nothing in its config set the flag explicitly.

Existing tables do not change. The upgrade converts nothing, so a table created as CHARSET=utf8 on 12.3 stays utf8mb3, while the same DDL run today creates utf8mb4. One schema can end up with both, and the emoji test shows where that hurts:

MariaDB 13.1 after upgrade: old_mode empty, old utf8mb3 table rejects an emoji with ERROR 1366 while the new utf8 table stores it as utf8mb4

The notes3 table in that list was created with UTF8_IS_UTF8MB3 added back to the session’s old_mode, which is how you keep the old meaning for a migration script that must reproduce 12.3 tables exactly:

sudo mariadb -e "SET SESSION old_mode=CONCAT(@@old_mode, ',UTF8_IS_UTF8MB3'); CREATE TABLE legacy.notes3 (id INT PRIMARY KEY, body VARCHAR(100)) CHARSET=utf8;"

To restore the 12.3 behaviour server-wide, set old_mode=UTF8_IS_UTF8MB3 in the [mariadbd] section of a config file. The old_mode reference documents the flag. The same page marks the flag deprecated from 13.1, so setting it raises a warning and buys you time, nothing more. We’d rather move forward, though, and convert the old tables. Pinning the old meaning only postpones the problem, because every new table keeps getting the three-byte character set and the next person to store an emoji hits the same wall. A mixed schema is also harder to reason about than one that is all utf8mb4, so treat the flag as a stopgap for the upgrade window.

ERROR 1366: Incorrect string value ‘\xF0\x9F\x9A\x80’

An application gets this error when it writes a four-byte character, here a rocket emoji, into a column that is still utf8mb3. Under the default strict sql_mode the INSERT fails. With sql_mode set to an empty string it’s only a warning, and the row is stored as ship it ?, which is worse because the data is silently damaged.

Find every table you still have on the old character set before your application team finds them for you:

sudo mariadb -t -e "SELECT table_schema, table_name, table_collation FROM information_schema.TABLES WHERE table_collation LIKE 'utf8mb3%';"

Each table it lists can be converted with ALTER TABLE ... CONVERT TO CHARACTER SET utf8mb4. That is a full table rebuild, so schedule it the way you would any other large ALTER.

Try the smaller changes

The rest of the release is a long list of server variables and functions, and most of them you can ignore until you need them. These are the ones we checked on the upgraded server, with the values it reported:

ChangeWhat we sawWhy you’d use it
ADAPTIVE_HASH_INDEX table optionAccepted and shown in SHOW CREATE TABLE, but no effect while innodb_adaptive_hash_index is OFFTurn the hash index on for one hot lookup table
information_schema.VECTOR_INDEXESReports dimensions, index size (49152 bytes for an empty 3-dimension index) and cached nodesMonitor vector index size without guessing
innodb_table_lock_on_full_scanDefault OFF, can be set at runtimeTake one table lock instead of row locks for locking full scans
innodb_tablespace_size_warning_pct and _thresholdDefaults 85 and 0, so off until you set a thresholdWarn before a tablespace fills up
log_slow_max_query_lengthDefault 4294967295Leave statements longer than the limit out of the slow log entirely (they’re skipped, not truncated)
XXH3() and XXH32()Both return integersFast non-cryptographic hashes for checksums
parsec_iterationsAppears only after INSTALL SONAME 'auth_parsec', default 1024Tune the PARSEC password hashing cost

The table-level hash index is the one you should try first. The global switch has been OFF by default for a while, so most servers lost the benefit for the few tables that had it. There’s a catch, though. Our server accepted the table option with the global switch OFF, but accepting it isn’t the same as using it. The release notes say YES only takes effect when innodb_adaptive_hash_index is ON or set to the new IF_SPECIFIED value, which limits the hash index to tables and indexes marked YES. So put innodb_adaptive_hash_index=IF_SPECIFIED under [mariadbd] first, then mark the hot lookup tables:

sudo mariadb -e "CREATE TABLE shop.ahi (id INT PRIMARY KEY, v INT) ADAPTIVE_HASH_INDEX=YES;"

The vector index view needs nothing more than a table with a VECTOR INDEX. We created a three-dimension index and queried it:

sudo mariadb -t -e "SELECT * FROM information_schema.VECTOR_INDEXES\G"

Each vector index gets one row. Watch INDEX_SIZE and CACHED_NODES once real embeddings arrive:

*************************** 1. row ***************************
    TABLE_CATALOG: def
     TABLE_SCHEMA: shop
       TABLE_NAME: docs
       INDEX_NAME: emb
VECTOR_DIMENSIONS: 3
       INDEX_SIZE: 49152
      TOTAL_NODES: 1
     CACHED_NODES: 0
     DELETED_ROWS: 0
  SUBDIST_ENABLED: NO
      MEMORY_SIZE: 0

Even this tiny index reports 49152 bytes, so the numbers only get interesting at scale. Check the view again after you load real embeddings, because INDEX_SIZE against CACHED_NODES shows whether the index still fits in the cache you gave it.

mariadbd: unknown option ‘–validate-config’

MariaDB’s “Feature in Focus” post from July, written while 13.1 was still a preview, describes a mariadbd --validate-config option that checks a config file without starting the server. We wanted it for the upgrade, since a typo in a 60-series cnf file is a classic reason a server won’t come back. The GA deb binary rejected the option outright. Our test file held three settings under a [mariadb] header (port=3306, max_conections=250 and innodb_buffer_pool_size=1G), with max_connections misspelled, and we stopped the service first so the datadir wasn’t locked:

sudo systemctl stop mariadb
sudo -u mysql mariadbd --defaults-file=/tmp/bad.cnf --validate-config; echo exit=$?

After the usual InnoDB start-up notes, the last lines named our typo and then the missing option:

2026-11-26 17:34:41 0 [ERROR] mariadbd: unknown variable 'max_conections=250'
2026-11-26 17:34:41 0 [ERROR] mariadbd: unknown option '--validate-config'
2026-11-26 17:34:41 0 [ERROR] Aborting
exit=2

The 13.1.2 release notes don’t list the option, and its ticket, MDEV-31527, is now marked fixed in 13.2.2, so expect it in the 13.2 series rather than 13.1. Until then, a stopped server started by hand reports unknown variables before it aborts, which works as a crude config check. It isn’t a dry run, though. It’s a real InnoDB startup against the live datadir, and a valid file simply starts the server in the foreground. Only run it with the service stopped. Also, --defaults-file replaces the normal config set, so it checks only the file you name. Start the service again when you’re done.

Upgrade a 12.3 server to 13.1

We upgraded a Debian 13 server running 12.3 from MariaDB’s repository, with the test tables above already in place. The in-place upgrade cost about five seconds of downtime, from shutdown to ready for connections. Take a logical dump first, because MariaDB does not support downgrading in place and that dump is your only road back to 12.3:

sudo mariadb-dump --all-databases --routines --events > ~/pre-13.1.sql

Ours came to 3.2 MB. Next, point the existing source file at the 13.1 repository and refresh the index. If you followed the 12.3 Debian or Ubuntu guide, the file is already in deb822 format:

sudo sed -i 's|/12.3/|/13.1/|' /etc/apt/sources.list.d/mariadb.sources #https://mariadb.com/docs/release-notes/community-server/13.1/13.1.2
sudo apt update

Check that apt now offers 13.1 for every MariaDB package, not just the server:

apt list --upgradable 2>/dev/null | grep -i mariadb

All eight packages moved from the 12.3 build to the 13.1 build:

libmariadb3/trixie 1:13.1.2+maria~deb13 amd64 [upgradable from: 1:12.3.4+maria~deb13]
mariadb-client-compat/trixie 1:13.1.2+maria~deb13 all [upgradable from: 1:12.3.4+maria~deb13]
mariadb-client-core/trixie 1:13.1.2+maria~deb13 amd64 [upgradable from: 1:12.3.4+maria~deb13]
mariadb-client/trixie 1:13.1.2+maria~deb13 amd64 [upgradable from: 1:12.3.4+maria~deb13]
mariadb-common/trixie 1:13.1.2+maria~deb13 all [upgradable from: 1:12.3.4+maria~deb13]
mariadb-server-compat/trixie 1:13.1.2+maria~deb13 all [upgradable from: 1:12.3.4+maria~deb13]
mariadb-server-core/trixie 1:13.1.2+maria~deb13 amd64 [upgradable from: 1:12.3.4+maria~deb13]
mariadb-server/trixie 1:13.1.2+maria~deb13 amd64 [upgradable from: 1:12.3.4+maria~deb13]

Install over the top. The package stops 12.3, swaps the binaries and starts 13.1 in one go:

sudo apt install -y mariadb-server mariadb-client

Two lines in the output are worth reading. The first confirms the package found the old datadir, and the second means the stock server config was replaced:

/var/lib/mysql: found previous version 12.3
Installing new version of config file /etc/mysql/mariadb.conf.d/50-server.cnf ...

We hadn’t edited 50-server.cnf, so dpkg replaced it silently. If you had, dpkg stops to ask, which is one more reason to keep local settings in a separate 60- file under /etc/mysql/mariadb.conf.d/.

mariadb-upgrade has already run

Older upgrade guides end with “now run mariadb-upgrade”. On Debian you’ll find it already done. The unit’s ExecStartPost runs /etc/mysql/debian-start, which upgrades the system tables on the first start, and mariadb_upgrade_info already held the new version when we looked:

MariaDB 12.3 to 13.1 upgrade on Debian 13: service running 13.1 and mariadb-upgrade reporting no need to run again

If you run it by hand, it only says there is no need. mariadb-upgrade --force repeats the eight phases and checked our tables OK, which is harmless but slow on a big server. We only upgraded the Debian server in place. On an RPM install, read /var/lib/mysql/mariadb_upgrade_info after the restart and run sudo mariadb-upgrade if it still shows the old version. On a Galera cluster behind HAProxy, stay on 12.3. A rolling release that wants an upgrade every quarter is a poor fit for a cluster you upgrade one node at a time.

mariadb-dump no longer writes generated column values

Of all the upgrade changes, this one is the most likely to break your backup pipeline. On 12.3, mariadb-dump wrote the computed value of a stored generated column into every INSERT, such as (1,9.50,4,38.00). On 13.1 the same table dumps as DEFAULT, and --complete-insert leaves the column out of the column list altogether:

MariaDB 13.1 mariadb-dump writes DEFAULT for a stored generated column and the restore recomputes the totals

The restore recomputes the values, so a 13.1 dump restored on 13.1 is correct. Restoring our 12.3 dump on 13.1 also worked, because the dump header relaxes sql_mode while it loads. The breakage is elsewhere. Any tool that parses dump files for the computed values, such as a diff job or a data-masking step, now sees DEFAULT and nothing else.

ERROR 1906: The value specified for generated column has been ignored

Hand-edited SQL is the other casualty. If you keep seed scripts from the 12.3 days, an old INSERT that names a value for the generated column is rejected under the default strict mode:

ERROR 1906 (HY000) at line 1: The value specified for generated column 'total' in table 'items' has been ignored

Replace the value with DEFAULT, or list the real columns and leave the generated one out. Grep your seed files and fixtures for INSERTs into tables with generated columns before the upgrade, not after the first failed deploy. The error only fires under strict mode, so a test database running with a relaxed sql_mode will pass while production fails. Run the check against a server configured exactly like production, because that is where the deploy will actually break.

That is the pattern across 13.1. The new features work as documented, and the risk sits in defaults that changed under existing data. Test the upgrade on a copy, and keep the 12.3 dump until your application has run a full cycle on the new server.

Keep reading

Install PostgreSQL 18 on Debian 13 / 12 Databases Install PostgreSQL 18 on Debian 13 / 12 Install DBeaver on Ubuntu 26.04 / 24.04 and Debian 13 Databases Install DBeaver on Ubuntu 26.04 / 24.04 and Debian 13 Install SQL Server 2025 Developer Edition on Windows Server 2025 Databases Install SQL Server 2025 Developer Edition on Windows Server 2025 MariaDB CVE-2026-92262: Check If You Are Affected and Patch Databases MariaDB CVE-2026-92262: Check If You Are Affected and Patch Valkey CVE-2026-130822 and Cluster Overflow: Check and Patch Databases Valkey CVE-2026-130822 and Cluster Overflow: Check and Patch Install PostgreSQL on Void Linux Databases Install PostgreSQL on Void Linux

Leave a Comment

Press ESC to close