Today I reserved some hours to test again Odbc Driver with Mysql.
My first test was to try create one column, and received this error message:
Incorrect index name 'PRIMARY'
In my searches, I saw the 'bug' openning MyODBC log, when DF try to create temporary table with a index type UNIQUE named PRIMARY (reserved word).
Create SQL original table:
Code:
CREATE TABLE `MyTable` (
`recnum` int(11) NOT NULL AUTO_INCREMENT,
`codigo` int(11) NOT NULL DEFAULT '0',
`descricao` varchar(60) NOT NULL DEFAULT ' ',
PRIMARY KEY (`recnum`),
UNIQUE KEY `MyTable_INDEX01` (`codigo`),
UNIQUE KEY `MyTable_INDEX02` (`descricao`,`recnum`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Whe DF try to create a temporay table with this SQL:
Code:
CREATE TABLE `TF73398E`
(`RECNUM` bigint auto_increment NOT NULL,
`codigo` integer DEFAULT 0 NOT NULL,
`descricao` varchar(60) DEFAULT ' ' NOT NULL,
`DATAHORA` varchar(19) DEFAULT '' NOT NULL,
UNIQUE INDEX `PRIMARY` (`RECNUM`)) ENGINE = InnoDB;
The error [ Incorrect index name 'PRIMARY' ] occours because one index type UNIQUE is created with PRIMARY name.
If I create table directely by DataBase Builer, the primary index is named other way, with 'MyTable000' and not occours errors.
In my case, the table already exist from mysql database and I cant to change column name or index name.
Database builder OR Structure's commands returns same erros result.
I tried to use DF_STRUCTEND_OPT_IN_PLACE argument at Structure_end , to avoid create temp table, but returns same error as well.
ODBC_DRV: 6.3.0.15
MYODBC: 8.0.20.0
MySQL: 8.0.12
DF 18.2 - 19.1
So, I hope to contribute something