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

Inconsistency between ALTER from BIT to VARCHAR and from BIT to TEXT

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
    • 10.2(EOL)
    • Data types
    • None

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a BIT(8),b BIT(8));
      INSERT INTO t1 VALUES (123,123);
      ALTER TABLE t1 MODIFY a TEXT, MODIFY b VARCHAR(10);
      SELECT * FROM t1;

      +------+------+
      | a    | b    |
      +------+------+
      | {    | 123  |
      +------+------+

      Notice different results.

      Attachments

        Activity

          A similar problem is observed in this script:

          DROP TABLE IF EXISTS t1;
          CREATE TABLE t1 (src BIT(8),a TEXT, b VARCHAR(10));
          INSERT INTO t1 (src) VALUES (123);
          UPDATE t1 SET a=src,b=src;
          SELECT a,b FROM t1;

          +------+------+
          | a    | b    |
          +------+------+
          | {    | 123  |
          +------+------+

          bar Alexander Barkov added a comment - A similar problem is observed in this script: DROP TABLE IF EXISTS t1; CREATE TABLE t1 (src BIT(8),a TEXT, b VARCHAR(10)); INSERT INTO t1 (src) VALUES (123); UPDATE t1 SET a=src,b=src; SELECT a,b FROM t1; +------+------+ | a | b | +------+------+ | { | 123 | +------+------+

          And in this script:

          DROP TABLE IF EXISTS t1,t2;
          CREATE TABLE t1 (src BIT(8));
          CREATE TABLE t2 (a TEXT, b VARCHAR(10));
          INSERT INTO t1 (src) VALUES (123);
          INSERT INTO t2 SELECT src,src FROM t1;
          SELECT a,b FROM t2;

          +------+------+
          | a    | b    |
          +------+------+
          | {    | 123  |
          +------+------+

          bar Alexander Barkov added a comment - And in this script: DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 (src BIT(8)); CREATE TABLE t2 (a TEXT, b VARCHAR(10)); INSERT INTO t1 (src) VALUES (123); INSERT INTO t2 SELECT src,src FROM t1; SELECT a,b FROM t2; +------+------+ | a | b | +------+------+ | { | 123 | +------+------+

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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