mysql - CREATE TABLE does not works to InnoDB, but works to MyISAM -


i have table:

create table `peso_tec_dt_aj` (   `idade` int(11) default null,   `tecnico` varchar(50) default null,   `obt` double default null,   `pad` decimal(4,3) default null,   `aves_peso` int(11) default null,   `data_domingo` datetime default null,   `data_domingo_ajustada` varchar(10) character set utf8mb4 collate utf8mb4_unicode_ci default null,   key `peso_tec_dt_aj_idade_tecnico_index` (`idade`,`tecnico`) ) engine=innodb default charset=latin1; 

the query below works if use create statement engine=mysam, not if use engine innodb.

it works if dont make aggregations or if remove column field data_domingo (datetime) @ group by:

create table bucket_15.resultado (     select      peso_tec_dt_aj.idade,     peso_tec_dt_aj.tecnico,      (         round(             sum(peso_tec_dt_aj.obt * peso_tec_dt_aj.aves_peso) /             sum(peso_tec_dt_aj.aves_peso), 3             )     ) campo_computeado     bucket_15.peso_tec_dt_aj      group      peso_tec_dt_aj.idade,     peso_tec_dt_aj.tecnico,     peso_tec_dt_aj.data_domingo ); 

after run query, mysql doesn't show errors. query without create table runs ok.

however, query above simple. why mysql can't create table columns , data?

mysql version: 5.7

here screenshots show same query, no results if engine not myisam.

first image: run query use on statement create select using both engines: myisam , innodb.

enter image description here

second image: run query without engine=myisam. result above expected on new table resultado, not: without errors.

enter image description here

third image: engine=myisam - table resultado magically created

enter image description here

this create table works fine version 5.6.35 without errors

create table `peso_tec_dt_aj` (   `idade` int(11) default null,   `tecnico` varchar(50) default null,   `obt` double default null,   `pad` decimal(4,3) default null,   `aves_peso` int(11) default null,   `data_domingo` datetime default null,   `data_domingo_ajustada` varchar(10) character set utf8mb4 collate utf8mb4_unicode_ci default null,   key `peso_tec_dt_aj_idade_tecnico_index` (`idade`,`tecnico`) ) engine=myisam default charset=latin1;  create table resultado (     select      peso_tec_dt_aj.idade,     peso_tec_dt_aj.tecnico,      (         round(             sum(peso_tec_dt_aj.obt * peso_tec_dt_aj.aves_peso) /             sum(peso_tec_dt_aj.aves_peso), 3             )     ) campo_computeado     bucket_15.peso_tec_dt_aj      group      peso_tec_dt_aj.idade,     peso_tec_dt_aj.tecnico,     peso_tec_dt_aj.data_domingo ) engine=myisam default charset=latin1; 

about second query if not work mysql should log error int terminal or log file.

in second create query had dot in name. reason why did not work.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -