• Vicențiu Ciorbaru's avatar
    MDEV-18323 Convert MySQL JSON type to MariaDB TEXT in mysql_upgrade · f6549e95
    Vicențiu Ciorbaru authored
    This patch solves two key problems.
    1. There is a type number clash between MySQL and MariaDB. The number
       245, used for MariaDB Virtual Fields is the same as MySQL's JSON.
       This leads to corrupt FRM errors if unhandled. The code properly
       checks frm table version number and if it matches 5.7+ (until 10.0+)
       it will assume it is dealing with a MySQL table with the JSON
       datatype.
    2. MySQL JSON datatype uses a proprietary format to pack JSON data. The
       patch introduces a datatype plugin which parses the format and convers
       it to its string representation.
    
    The intended conversion path is to only use the JSON datatype within
    ALTER TABLE <table> FORCE, to force a table recreate. This happens
    during mysql_upgrade or via a direct ALTER TABLE <table> FORCE.
    f6549e95