MariaDB 13.1 GA: DENY, Auto Partitioning, JSON_TABLE

MariaDB 13.1 GA introduces DENY negative grants, automatic range partitioning, nested JSON_TABLE, InnoDB adaptive hash index table-level control

Table of contents
  1. 1.Introduction & Core Highlights
  2. 2.Key Features & Parameter Comparison
  3. 3.Deep Dive & Operational Details
  4. 3.1.Privilege Model Restructuring: DENY Statement & Negative Authorization in Practice
  5. 3.2.Automatic Range Partitioning: INTERVAL Clause Eliminates Manual Ops
  6. 3.3.InnoDB Fine-Grained Tuning & utf8mb4 Migration Pitfalls
  7. 4.Scenario-Based Selection & Pitfall Checklist
  8. 5.FAQ
  9. 6.Sources & References
MariaDB 13.1 GA: DENY, Auto Partitioning, JSON_TABLE

Introduction & Core Highlights

The MariaDB Foundation announced on November 26, 2026 that MariaDB 13.1 has reached General Availability (GA) as the latest stable rolling release. This version focuses on enhanced database management capabilities. Core highlights include the introduction of the DENY statement (negative authorization) to simplify complex privilege models, automatic range partitioning to eliminate manual partition maintenance, extended MySQL-compatible JSON operators and nested JSON_TABLE support, finer-grained InnoDB adaptive hash index control and tablespace capacity warnings, and the utf8 character set alias now defaulting to utf8mb4 for full Unicode support. Released simultaneously, MariaDB 13.2.1 RC1 previews standard SQL features such as ANY_VALUE(), FILTER clause, and atomic CREATE OR REPLACE TABLE. For production environments seeking the latest stable features, 13.1 is the direct upgrade target; users preferring long-term maintenance cycles may continue with 12.3 LTS.

Key Features & Parameter Comparison

Feature / Change MariaDB 13.1 (GA) MariaDB 13.2.1 (RC1) Impact Scope & Risk Notes
DENY Statement (Negative Authorization) New, explicitly denies specific privileges, takes precedence over existing and future GRANTs Inherited Simplifies complex ACL management; audit existing privilege matrix before upgrade to prevent accidental blocking
Automatic Range Partitioning (INTERVAL Clause) New, creates partitions automatically as data arrives Inherited Eliminates manual ADD PARTITION ops; test write-path performance jitter on large tables
JSON Compatibility Enhancements Supports ->, ->> operators; JSON_TABLE() supports nested objects/arrays Inherited Reduces MySQL migration rewrite cost; verify execution plans for nested queries
InnoDB Adaptive Hash Index Control Table-level, index-level granularity configurable Inherited Allows tuning for hotspot indexes; incorrect disable may degrade point-lookup performance
InnoDB Tablespace Capacity Warning Configurable threshold triggers warning Inherited New ops monitoring metric; integrate with alerting to prevent disk-full
Optimizer Context Recorder New, captures optimizer context for replay on another instance Inherited Facilitates cross-environment execution plan reproduction; assess overhead before enabling in production
utf8 Alias Mapping Change Breaking Change: utf8 → utf8mb4 (formerly utf8mb3) Inherited Implicit full-database charset upgrade; existing utf8mb3 tables may hit char truncation or index length limits; full compatibility testing mandatory before upgrade
ANY_VALUE() Function Not included New, MySQL-compatible Resolves non-aggregated column selection under ONLY_FULL_GROUP_BY
FILTER Clause (Conditional Aggregation) Not included New, SQL Standard Simplifies conditional aggregation syntax, replaces CASE WHEN SUM pattern
Atomic CREATE OR REPLACE TABLE Not included New DDL atomicity guarantee, avoids intermediate state visibility issues
MEMORY Engine BLOB Support Not included New Extends in-memory table use cases; note memory consumption and persistence limits
Semi-sync Replication (InnoDB binlog) Not included New Improves replication durability; evaluate primary commit latency impact

Deep Dive & Operational Details

Privilege Model Restructuring: DENY Statement & Negative Authorization in Practice

MariaDB 13.1 introduces the DENY statement implementing a negative authorization mechanism, allowing DBAs to explicitly prohibit specific objects or operations after granting broad privileges. Syntax follows DENY privilege_type ON object TO user; deny rules take priority over any existing or future GRANTs. This is valuable in multi-tenant or microservice shared-database scenarios: grant app_user all privileges on db.*, then DENY DROP ON db.core_table TO app_user to prevent accidental core table drops without splitting roles. When upgrading existing instances, export mysql.db, mysql.tables_priv, and other privilege tables to a test environment first; simulate the new DENY rule effective matrix to avoid application errors like ERROR 1142 (42000): Access denied. Note: DENY does not support column-level granularity and is not recorded in information_schema.USER_PRIVILEGES; auditing requires querying the new mysql.global_grants and mysql.object_grants tables.

Automatic Range Partitioning: INTERVAL Clause Eliminates Manual Ops

The new PARTITION BY RANGE INTERVAL (expr) (PARTITION p0 VALUES LESS THAN (start_val)) syntax enables MariaDB to automatically create new partitions at a specified interval when inserted data exceeds the highest existing partition boundary. Typical use case: daily-partitioned log table: PARTITION BY RANGE INTERVAL (1 DAY) (PARTITION p0 VALUES LESS THAN ('2026-01-01')); subsequent inserts for 2026-12-01 automatically generate the corresponding partition, no cron ALTER TABLE ... ADD PARTITION needed. Three operational caveats: first, the INTERVAL expression must be a constant or deterministic function; non-deterministic functions like NOW() are unsupported. Second, auto-created partitions follow p<sequence> naming; manually creating a same-named partition throws ERROR 1526 (HY000): Partition name already exists. Third, automatic partitioning on large tables may cause metadata lock contention during write peaks; pair with innodb_online_alter_log_max_size to reserve sufficient online DDL buffer, and set a partition count ceiling (implicitly limited by MAX_PARTITIONS) to prevent metadata bloat.

InnoDB Fine-Grained Tuning & utf8mb4 Migration Pitfalls

InnoDB adds three table/index-level controls: ALTER TABLE t SET (adaptive_hash_index = OFF) disables adaptive hash index for a specific table, suitable for write-heavy, read-sparse tables to reduce lock contention; ALTER TABLE t SET (full_table_scan_lock = SHARED) makes full table scans acquire a shared table lock instead of intention locks, reducing blocking when combined with long-transaction isolation; ALTER TABLESPACE ts SET (capacity_warning_threshold = 85) writes a warning to the error log when tablespace usage hits 85%. The most insidious breaking change is the utf8 alias remap: starting 13.1, CREATE TABLE ... CHARSET=utf8 actually creates a utf8mb4 table, causing VARCHAR(255) CHARSET utf8 column max byte length to jump from 765 to 1020 bytes, potentially triggering Row size too large (> 8126) or Specified key was too long; max key length is 3072 bytes. Pre-upgrade must run a full-database scan: SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, CHARACTER_SET_NAME, CHARACTER_MAXIMUM_LENGTH FROM information_schema.COLUMNS WHERE CHARACTER_SET_NAME = 'utf8mb3' to locate all utf8mb3 columns, assess ALTER TABLE ... CONVERT TO CHARACTER SET utf8mb4 lock time and disk space amplification, and use pt-online-schema-change for online migration if needed.

Scenario-Based Selection & Pitfall Checklist

  1. Multi-tenant SaaS Privilege Convergence: Prefer DENY statements over complex column-level GRANT/REVOKE combos; establish a privilege change audit pipeline (monitor mysql.global_grants changes) to prevent developers from accidentally adding DENY causing service outage.
  2. Time-series Log/Monitoring Data Auto-partitioning: Enable RANGE INTERVAL to replace cron jobs; at table creation specify MAX_ROWS and DATA DIRECTORY to place hot partitions on NVMe and cold partitions on HDD, avoiding single tablespace file size hitting filesystem limits.
  3. MySQL 8.0 Migration Projects: Leverage ->/->> and nested JSON_TABLE to reuse original queries directly; compare EXPLAIN ANALYZE to verify optimizer pushdown capability on nested paths; add FORCE INDEX or rewrite as materialized view if necessary.
  4. Existing utf8mb3 Instances Upgrading to 13.1: Strictly forbid direct in-place upgrade of production primary. Procedure: upgrade replica → validate charset behavior → failover → upgrade former primary. Reserve 2x data directory space for CONVERT TO CHARSET table rebuilds; disable foreign_key_checks to accelerate FK table migration.
  5. Cross-Environment Execution Plan Reproduction: Enable Optimizer Context Recorder (SET SESSION optimizer_record_context = ON) to export .optctx file; on test instance SET SESSION optimizer_replay_context = ON to replay, troubleshooting production-specific statistics skew causing plan regression.

FAQ

After upgrading to MariaDB 13.1, will existing utf8 tables automatically convert to utf8mb4?

No automatic conversion of table storage format occurs. The utf8 alias only affects newly created tables/columns’ default charset parsing; existing utf8mb3 tables retain their original encoding. However, if an application runs ALTER TABLE ... MODIFY COLUMN without explicitly specifying a charset, it may implicitly convert per the new alias to utf8mb4, changing row length. Recommendation: after upgrade, explicitly specify CHARACTER SET utf8mb3 to preserve old behavior, or migrate the entire database to utf8mb4 on a planned schedule.

Can a DENY statement be revoked? Does it replicate to replicas?

A DENY can be overridden by GRANTing the same privilege (since GRANT has lower priority; tested requires FLUSH PRIVILEGES to take effect), or physically deleted via DELETE FROM mysql.global_grants WHERE ... followed by a flush. DENY rules are written to mysql.global_grants/mysql.object_grants system tables and replicate to replicas via binary log, keeping primary-replica privileges consistent.

What happens when automatic range partitioning reaches the maximum partition count?

The source did not disclose an explicit limit or error code. Per MariaDB partitioning architecture, partition count is constrained by partition_limit (default 8192); exceeding it is expected to throw ERROR 1506 (HY000): Too many partitions, causing writes to fail. Production monitoring should alert when partition count reaches ~7000 for manual intervention: archive or adjust interval.

Sources & References

Spotted outdated pricing, stock, or expired coupons?See methodology & report an update →

Related articles