Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8605

MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.1.67, 5.2.14, 5.3.12, 5.5, 10.0, 10.1
    • 10.1.10
    • Triggers
    • Linux
    • 10.1.9-3, 10.1.10

    Description

      MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column.

      Expected similar behavior as for AUTOINCREMENT and would be usefull for generation right value in trigger.
      http://stackoverflow.com/questions/15473654/mariadb-before-insert-trigger-for-uuid

      Of course in described example much better if MariaDB would support UUID data type and generate automaticaly UUID for AUTOINCREMENT fields.

      But I think it would be good idea if MariaDB would allow use any function for default value it would be good replacement of generators.

      For example:

      CREATE TABLE `c` (
        `id` VARBINARY(36) NOT NULL DEFAULT UUID(),
        PRIMARY KEY (`id`)
      ) ENGINE=INNODB DEFAULT CHARSET=utf8

      And it would here appropriate analogy with the behavior of AUTOINCREMENT

      And if make possible to work with property table autoincrement into functions would be generally be a bomb. It would be possible create complicated ID with concatenation static identifier if schema and autoincrement.

      For example:
      A-1
      A-2
      A-3
      A-5

      and on another schema for same table
      B-1
      B-2
      B-3
      B-4

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              mikhail Mikhail Gavrilov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.