Merge pull request #8425 from Icinga/bugfix/hosts-128-characters-7472

IDO MySQL: support larger host and service names
This commit is contained in:
Alexander Aleksandrovič Klimov 2021-07-16 18:34:29 +02:00 committed by GitHub
commit 89472a9e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 3 deletions

View File

@ -23,7 +23,7 @@ REGISTER_STATSFUNCTION(IdoMysqlConnection, &IdoMysqlConnection::StatsFunc);
const char * IdoMysqlConnection::GetLatestSchemaVersion() const noexcept
{
return "1.15.0";
return "1.15.1";
}
const char * IdoMysqlConnection::GetCompatSchemaVersion() const noexcept

View File

@ -866,8 +866,8 @@ CREATE TABLE IF NOT EXISTS icinga_objects (
object_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
instance_id bigint unsigned default 0,
objecttype_id bigint unsigned default 0,
name1 varchar(128) character set latin1 collate latin1_general_cs default '',
name2 varchar(128) character set latin1 collate latin1_general_cs default NULL,
name1 varchar(255) character set latin1 collate latin1_general_cs default '',
name2 varchar(255) character set latin1 collate latin1_general_cs default NULL,
is_active smallint default 0,
PRIMARY KEY (object_id),
KEY objecttype_id (objecttype_id,name1,name2)

View File

@ -0,0 +1,23 @@
-- -----------------------------------------
-- upgrade path for Icinga 2.13.0
--
-- -----------------------------------------
-- Icinga 2 | (c) 2021 Icinga GmbH | GPLv2+
--
-- Please check https://docs.icinga.com for upgrading information!
-- -----------------------------------------
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- ----------------------------------------
-- #7472 Support hosts with >128 characters
-- ----------------------------------------
ALTER TABLE icinga_objects
MODIFY COLUMN name1 varchar(255) character set latin1 collate latin1_general_cs default '',
MODIFY COLUMN name2 varchar(255) character set latin1 collate latin1_general_cs default NULL;
-- -------------
-- set dbversion
-- -------------
INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.15.1', NOW(), NOW()) ON DUPLICATE KEY UPDATE version='1.15.1', modify_time=NOW();