i think that's the important part that we could check / maybe develop a tool for it:
1)in frm file, it's saved as CONNECT engine?
a)what is write in file (via notepad or nano or vim)? (there's a tool to check this without mysqld running? something like:
mysqld_read_frm_information frm_file_name.frm
FILE: frm_file_name.frm
FILE FORMAT WITHOUT MYSQLD: (it's a function external of mysqld code, like a external tool)
ENGINE: ARIA PARTITIONED
CREATE TIME: xxxxx
others .frm informations: xxxxx
FILE FORMAT READ BY MYSQLD: (it's the same function of mysqld we are running - 10.0.2 in this case)
ENGINE: CONNECT PARTITIONED
just to help us in debug
maybe we could put it in mariadb.org/file-format.php, where we can send a .frm file (max of 100kb) and get information about it without a mysqld running)
i will create a MDEV for it
2) what SHOW CREATE TABLE use to rewrite the CREATE TABLE SQL?
it's using the frm file information?
why SHOW CREATE TABLE report right ARIA engine, and SHOW TABLE STATUS report CONNECT engine?
they use two different functions?
3)frm file with wrong format could crash server???
that's the main problem, think about a file being copied to mariadb filesystem and it crash the server!
server should mark it as UNKNOWN file format and leave it in filesystem and don't report it as a table
the same happen when a frm file crash (maybe no energy or other problem) and mysqld crash too
verrrry strange:
show create table est_mov_v2:
results:
CREATE TABLE `est_mov_v2` (
`unidade_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`lote_tipo` enum('v','c','i','tv','tc','ti') NOT NULL DEFAULT 'v',
`lote_spa` decimal(12,1) NOT NULL DEFAULT '0.0',
`item_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`item_id_red` int(11) NOT NULL DEFAULT '0',
`mov_id` char(30) NOT NULL DEFAULT '0',
`oe_tipo` enum('op','oe','tr','ex','bx','bx-tr','rp-tr','custo','conserto') NOT NULL DEFAULT 'oe',
`oe` bigint(20) NOT NULL DEFAULT '0',
`oe_seq` int(11) NOT NULL DEFAULT '0',
`table_partition` tinyint(4) NOT NULL DEFAULT '0',
`lote_data` date NOT NULL DEFAULT '0000-00-00',
`lote` smallint(5) unsigned NOT NULL DEFAULT '0',
`lote_sif_data` date NOT NULL DEFAULT '0000-00-00',
`lote_sif` varchar(8) NOT NULL DEFAULT '0',
`estoque_entrada_proprietario_tipo` enum('f','j') NOT NULL DEFAULT 'f',
`estoque_entrada_proprietario_id` int(11) NOT NULL DEFAULT '0',
`estoque_entrada_pess_tipo` enum('f','j','p') NOT NULL DEFAULT 'f',
`estoque_entrada_pess_id` int(10) unsigned NOT NULL DEFAULT '0',
`estoque_entrada_org` smallint(5) unsigned NOT NULL DEFAULT '0',
`estoque_entrada_org_red` mediumint(9) NOT NULL DEFAULT '0',
`estoque_saida_proprietario_tipo` enum('f','j') NOT NULL DEFAULT 'f',
`estoque_saida_proprietario_id` int(11) NOT NULL DEFAULT '0',
`estoque_saida_pess_tipo` enum('f','j') NOT NULL DEFAULT 'f',
`estoque_saida_pess_id` int(10) unsigned NOT NULL DEFAULT '0',
`estoque_saida_org` smallint(5) unsigned NOT NULL DEFAULT '0',
`estoque_saida_org_red` mediumint(9) NOT NULL DEFAULT '0',
`quant_mov_un` char(5) NOT NULL DEFAULT 'un',
`quant` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pecas` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pbruto` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pliq` decimal(17,5) NOT NULL DEFAULT '0.00000',
`vbruto` decimal(17,5) NOT NULL DEFAULT '0.00000',
`vliq` decimal(17,5) NOT NULL DEFAULT '0.00000',
`data_etiqueta` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_producao` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_processamento` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_validade` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_estoque` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_estoque_origem` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`data_estoque_destino` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`destino_confirmado` enum('Y','N') NOT NULL DEFAULT 'Y',
`rastreabilidade_interna` char(25) NOT NULL DEFAULT '',
`rastreabilidade_externa` char(25) NOT NULL DEFAULT '',
`rastreabilidade_pallet` char(25) NOT NULL DEFAULT '',
`externa_tipo` char(25) NOT NULL DEFAULT '',
`valor_bruto_total` decimal(17,5) NOT NULL DEFAULT '0.00000',
`valor_liq_total` decimal(17,5) NOT NULL DEFAULT '0.00000',
`custo_medio_origem` decimal(17,5) NOT NULL DEFAULT '0.00000',
`custo_medio_destino` decimal(17,5) NOT NULL DEFAULT '0.00000',
`custo_patrimonio_origem` decimal(17,5) NOT NULL DEFAULT '0.00000',
`custo_patrimonio_destino` decimal(17,5) NOT NULL DEFAULT '0.00000',
`margem_venda_estimada` decimal(17,5) NOT NULL DEFAULT '0.00000' COMMENT 'para relatorio de venda, custo estimado pode variar no tempo',
`cfop_id` smallint(6) NOT NULL DEFAULT '0',
`cfop_id_red` mediumint(9) NOT NULL DEFAULT '0',
`contrato_producao` char(25) NOT NULL DEFAULT '',
`quant_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pecas_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pliq_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`pbruto_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`vliq_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`vbruto_real` decimal(17,5) NOT NULL DEFAULT '0.00000',
`usuario` char(25) NOT NULL DEFAULT '',
`sessao` char(41) NOT NULL DEFAULT '',
`lote_rendimento_data` date NOT NULL DEFAULT '0000-00-00',
`lote_rendimento_numero` smallint(5) unsigned NOT NULL DEFAULT '0',
`ponto_movimentacao` mediumint(9) NOT NULL DEFAULT '0',
`rendimento` enum('Y','N') NOT NULL DEFAULT 'N',
`custo_rendimento` enum('Y','N') NOT NULL DEFAULT 'N',
`custo_medio_anterior_rendimento` decimal(17,5) NOT NULL DEFAULT '0.00000' COMMENT 'sempre vai acontecer quando origem=destino',
`custo_patrimonio_anterior_rendimento` decimal(17,5) NOT NULL DEFAULT '0.00000' COMMENT 'sempre vai acontecer quando origem=destino',
`operacao` smallint(5) unsigned NOT NULL DEFAULT '0',
`data_estoque_ts` decimal(21,7) NOT NULL DEFAULT '0.0000000',
`codigo_vinculo_crossdocking` decimal(20,7) unsigned NOT NULL DEFAULT '0.0000000',
`crossdock_unidade_id` int(11) NOT NULL DEFAULT '0',
`crossdock_lote_tipo` enum('v','c','i','tv','tc','ti') NOT NULL DEFAULT 'v',
`crossdock_lote_spa` decimal(12,1) NOT NULL DEFAULT '0.0',
`crossdock_oe` int(11) NOT NULL DEFAULT '0',
`crossdock_oe_seq` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`unidade_id`,`lote_tipo`,`lote_spa`,`item_id`,`item_id_red`,`mov_id`,`oe_tipo`,`oe`,`oe_seq`,`table_partition`)
) ENGINE=Aria DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (table_partition)
(PARTITION p0 VALUES LESS THAN (1) ENGINE = Aria,
PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = Aria) */