• Monty's avatar
    MDEV-13916 Enforce check constraint on JSON type · 0f489494
    Monty authored
    When creating a field of type JSON, it will be automatically
    converted to TEXT with CHECK (json_valid(`a`)), if there wasn't any
    previous check for the column.
    
    Additional things:
    - Added two bug fixes that was found while testing JSON. These bug
      fixes has also been pushed to 10.3 (with a test case), but as they
      where minimal and needed to get this task done and tested, the fixes
      are repeated here.
      - CREATE TABLE ... SELECT drops constraints for columns that
        are both in the create and select part.
      - If one has both a default expression and check constraint for a
        column, one can get the error "Expression for field `a` is refering
        to uninitialized field `a`.
    - Removed some duplicate MYSQL_PLUGIN_IMPORT symbols
    0f489494
sql_yacc.yy 542 KB