Madhan Neethiraj created RANGER-655:
---------------------------------------

             Summary: Review DB schema for max key length restrictions - MySQL
                 Key: RANGER-655
                 URL: https://issues.apache.org/jira/browse/RANGER-655
             Project: Ranger
          Issue Type: Bug
          Components: admin
    Affects Versions: 0.5.0
            Reporter: Madhan Neethiraj


Ranger DB schema creation failed with error "Specified key was too long; max 
key length is 767 bytes", while installing ranger-0.5 against MySQL 5.5 with 
Tungsten Replication enabled. 

{quote}
2015-09-10 14:03:43,123 I Executing patch on ranger from file: 
009-updated_schema.sql 
Error executing: CREATE TABLE `x_service` ( `id` bigint(20) NOT NULL 
AUTO_INCREMENT , `guid` varchar(1024) DEFAULT NULL, `create_time` datetime 
DEFAULT NULL, `update_time` datetime DEFAULT NULL, `added_by_id` bigint(20) 
DEFAULT NULL, `upd_by_id` bigint(20) DEFAULT NULL, `version` bigint(20) DEFAULT 
NULL, `type` bigint(20) DEFAULT NULL, `name` varchar(512) DEFAULT NULL, 
`policy_version` bigint(20) DEFAULT NULL, `policy_update_time`datetime DEFAULT 
NULL, `description` varchar(1024) DEFAULT NULL, `is_enabled` tinyint(1) NOT 
NULL DEFAULT '0', primary key (`id`), UNIQUE KEY `X_service_name` (`name`), KEY 
`x_service_added_by_id` (`added_by_id`), KEY `x_service_upd_by_id` 
(`upd_by_id`), KEY `x_service_cr_time` (`create_time`), KEY `x_service_up_time` 
(`update_time`), KEY `x_service_type` (`type`), CONSTRAINT 
`x_service_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES 
`x_portal_user` (`id`), CONSTRAINT `x_service_FK_upd_by_id` FOREIGN KEY 
(`upd_by_id`) REFERENCES `x_portal_user` (`id`), CONSTRAINT `x_service_FK_type` 
FOREIGN KEY (`type`) REFERENCES `x_service_def` (`id`) ); 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was 
too long; max key length is 767 bytes 
SQLException : SQL state: 42000 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was 
too long; max key length is 767 bytes ErrorCode: 1071 
2015-09-10 14:03:43,787 E 009-updated_schema.sql import failed!
{quote}

To get the installation to succeed, ranger databases were pre-created by 
explicitly specifying 'latin1' CHARACTER SET, as shown below:
{quote}
create database ranger CHARACTER SET=latin1;
create database ranger_audit CHARACTER SET=latin1;
{quote}

Ranger DB schema (and/or schema documentation or creation scripts) should be 
reviewed to address this issue.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to