Menu

#1116 Invalid default values in SQL (improperly (un)quoted)

2.2.0
closed
Denis
SQL (5)
Core/OQL
Critical
2.2.0-beta
defect
2015-08-03
2015-08-03
Denis
No

When trying to install TeemIP (with IPv6), the setup produces the following SQL error:

MySQLException: Failed to issue SQL query: query = CREATE TABLE `ipconfig` (`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `org_id` INT(11) DEFAULT 0, INDEX (`org_id`), `name` VARCHAR(255) DEFAULT 'IP Settings', `requestor_id` INT(11) DEFAULT 0, INDEX (`requestor_id`), `ipv4_block_min_size` INT(11) DEFAULT 256, `ipv4_block_cidr_aligned` ENUM('bca_no','bca_yes') DEFAULT 'bca_yes', `reserve_subnet_IPs` ENUM('reserve_no','reserve_yes') DEFAULT 'reserve_no', `ipv4_gateway_ip_format` ENUM('broadcastip_minus_1','free_setup','subnetip_plus_1') DEFAULT 'subnetip_plus_1', `subnet_low_watermark` INT(11) DEFAULT 60, `subnet_high_watermark` INT(11) DEFAULT 80, `iprange_low_watermark` INT(11) DEFAULT 60, `iprange_high_watermark` INT(11) DEFAULT 80, `ip_allow_duplicate_name` ENUM('ipdup_no','ipdup_yes') DEFAULT 'ipdup_no', `mac_address_format` ENUM('colons','dots','hyphens') DEFAULT 'colons', `ping_before_assign` ENUM('ping_no','ping_yes') DEFAULT 'ping_no', `ipv6_block_min_prefix` ENUM('48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64') DEFAULT 64, `ipv6_block_cidr_aligned` ENUM('bca_no','bca_yes') DEFAULT 'bca_yes', `ipv6_gateway_ip_format` ENUM('free_setup','lastip','subnetip_plus_1') DEFAULT 'subnetip_plus_1') ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_unicode_ci, mysql_error = Invalid default value for 'ipv6_block_min_prefix', mysql_errno = 1067

Note that if you change the default value from 64 (as a number) to '64' (as a string), then it works.

Discussion

  • Denis

    Denis - 2015-08-03
    • Milestone: Unassigned --> 2.2.0
    • Component: User Interface --> Core/OQL
     
  • Denis

    Denis - 2015-08-03
    • labels: --> SQL
    • status: new --> closed
    • assigned_to: Denis
     

Log in to post a comment.