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

SHOW CREATE TABLE ordering fields is out of sync INFORMATION_SCHEMA and SHOW COLUMNS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.0.15
    • Fix Version/s: N/A
    • Component/s: OTHER
    • Labels:
      None
    • Environment:
      Linux Fedora

      Description

      show create table synergy.`appl_products`
      
      CREATE TABLE `appl_products` (
        `id_product` int(10) NOT NULL AUTO_INCREMENT,
        `description` varchar(30) DEFAULT NULL COMMENT 'описание',
        `id_process` int(10) unsigned DEFAULT NULL COMMENT 'процесс',
        `id_template` int(10) unsigned DEFAULT NULL COMMENT 'шаблон',
        `appl_type` int(10) DEFAULT NULL COMMENT 'активен ли продукт',
        `active` int(10) DEFAULT NULL COMMENT 'тип заявки',
        `id_role` int(10) DEFAULT NULL COMMENT 'роль',
        PRIMARY KEY (`id_product`),
        KEY `id_process` (`id_process`),
        KEY `id_template` (`id_template`),
        KEY `appl_type` (`active`),
        KEY `appl_type_2` (`appl_type`),
        CONSTRAINT `appl_products_ibfk_2` FOREIGN KEY (`id_process`) REFERENCES `workflow_processes` (`id_process`),
        CONSTRAINT `appl_products_ibfk_3` FOREIGN KEY (`id_template`) REFERENCES `appl_templates` (`id_template`),
        CONSTRAINT `appl_products_ibfk_4` FOREIGN KEY (`appl_type`) REFERENCES `appl_types` (`appl_type`)
      ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8
      
      select
      column_name 
      ,ordinal_position
      from `information_schema`.`COLUMNS`
      where table_schema = 'BPLnew' AND table_name = 'appl_products' 
      
      column_name  ordinal_position  
      -----------  ------------------
      id_product                    1
      description                   2
      id_process                    3
      id_template                   4
      active                        5
      appl_type                     6
      id_role                       7
      
      SHOW COLUMNS FROM `BPLnew`.appl_products;
      
      Field        Type              Null    Key     Default  Extra           
      -----------  ----------------  ------  ------  -------  ----------------
      id_product   int(10)           NO      PRI     (NULL)   auto_increment  
      description  varchar(30)       YES             (NULL)                   
      id_process   int(10) unsigned  YES     MUL     (NULL)                   
      id_template  int(10) unsigned  YES     MUL     (NULL)                   
      active       int(10)           YES     MUL     (NULL)                   
      appl_type    int(10)           YES     MUL     (NULL)                   
      id_role      int(10)           YES             (NULL)           
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Hi Mikhail,

            Are you sure you are looking at the same table?
            You ran SHOW CREATE for the table in `synergy` schema, but your other queries are for the table in `BPLnew`.

            Show
            elenst Elena Stepanova added a comment - Hi Mikhail, Are you sure you are looking at the same table? You ran SHOW CREATE for the table in `synergy` schema, but your other queries are for the table in `BPLnew`.
            Hide
            mikhail Mikhail Gavrilov added a comment -

            I am so sorry.
            It's my mistake.
            Please close this issue.

            Show
            mikhail Mikhail Gavrilov added a comment - I am so sorry. It's my mistake. Please close this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                mikhail Mikhail Gavrilov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: