Comment 3 for bug 1364457

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

It seems we still miss something here:

[openxs@chief p5.5]$ bin/mysql --no-defaults test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.39-36.0 MySQL Community Server (GPL)

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create table tpk1(id bigint(20) primary key, c1 int) engine=InnoDB;
Query OK, 0 rows affected (0.14 sec)

mysql> create table tpk2(id bigint(20) primary key, c1 int) engine=InnoDB;
Query OK, 0 rows affected (0.08 sec)

mysql> CREATE TABLE `tablename` (
    -> `objectid` bigint(20) NOT NULL AUTO_INCREMENT,
    -> `employeeobjectid` bigint(20) NOT NULL,
    -> `clusterobjectid` bigint(20) NOT NULL,
    -> `date` date NOT NULL,
    -> `durationclienttime` int(11) NOT NULL DEFAULT '0',
    -> `durationworked` int(11) NOT NULL DEFAULT '0',
    -> `durationcontractfixed` int(11) NOT NULL DEFAULT '0',
    -> `durationcontractvar` int(11) NOT NULL DEFAULT '0',
    -> `durationtimesheet` int(11) NOT NULL DEFAULT '0',
    -> `durationworkedorig` int(11) NOT NULL DEFAULT '0',
    -> `durationmodifiediome` int(11) NOT NULL DEFAULT '0',
    -> `counterrors` int(11) NOT NULL DEFAULT '0',
    -> `countunverified` int(11) NOT NULL DEFAULT '0',
    -> `durationtravel` int(11) NOT NULL DEFAULT '0',
    -> `durationsickleave` int(11) NOT NULL DEFAULT '0',
    -> `durationvacation` int(11) NOT NULL DEFAULT '0',
    -> `expenseday` int(11) NOT NULL DEFAULT '0',
    -> `expensedistance` int(11) NOT NULL DEFAULT '0',
    -> `durationPLBLeave` int(11) NOT NULL DEFAULT '0',
    -> `countunverifiedexpenses` int(11) NOT NULL DEFAULT '0',
    -> PRIMARY KEY (`objectid`),
    -> UNIQUE KEY `unique_tablename` (`employeeobjectid`,`date`),
    -> KEY `IX_tablename_clusterobjectid_date` (`clusterobjectid`,`date`),
    -> KEY `IX_tablename_date` (`date`),
    -> CONSTRAINT `tablename_ibfk_1` FOREIGN KEY (`employeeobjectid`) REFERENCES `tpk1` (`id`) ON DELETE CASCADE,
    -> CONSTRAINT `tablename_ibfk_2` FOREIGN KEY (`clusterobjectid`) REFERENCES `tpk2` (`id`) ON DELETE CASCADE
    -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.10 sec)

mysql> alter table `tablename` add version bigint not null default '0';
Query OK, 0 rows affected (0.17 sec)
Records: 0 Duplicates: 0 Warnings: 0

No assertion failures. Please, send your my.cnf file content to double check.