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

ALTER TABLE fails with bogus "BLOB/TEXT column '(null)' can't have a default value"

    XMLWordPrintable

Details

    Description

      Support for default values for blobs was added in scope of MDEV-10134. So now this works:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (i INT);
      ALTER TABLE t1 ADD COLUMN b1 BLOB NULL;
      ALTER TABLE t1 ALTER COLUMN b1 SET DEFAULT NULL;
      

      MariaDB [test]> ALTER TABLE t1 ALTER COLUMN b1 SET DEFAULT NULL;
      Query OK, 0 rows affected (0.00 sec)
      Records: 0  Duplicates: 0  Warnings: 0
      

      But this does not work:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (i INT);
      ALTER TABLE t1 ADD COLUMN b2 BLOB NULL, ALTER COLUMN b2 SET DEFAULT NULL;
      

      MariaDB [test]> ALTER TABLE t1 ADD COLUMN b2 BLOB NULL, ALTER COLUMN b2 SET DEFAULT NULL;
      ERROR 1101 (42000): BLOB/TEXT column '(null)' can't have a default value
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.