[MDEV-7303] SHOW CREATE TABLE ordering fields is out of sync INFORMATION_SCHEMA and SHOW COLUMNS Created: 2014-12-11  Updated: 2014-12-15  Due: 2014-12-26  Resolved: 2014-12-15

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.0.15
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Mikhail Gavrilov Assignee: Unassigned
Resolution: Not a Bug Votes: 0
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)           



 Comments   
Comment by Elena Stepanova [ 2014-12-12 ]

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`.

Comment by Mikhail Gavrilov [ 2014-12-15 ]

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

Generated at Thu Feb 08 07:18:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.