Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix VLANSwitch table for mysql 5.7 #172

Open
wants to merge 1 commit into
base: maintenance-0.20.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wwwroot/inc/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,10 +1171,10 @@ function get_pseudo_file ($name)
`mutex_rev` int(10) unsigned NOT NULL default '0',
`out_of_sync` enum('yes','no') NOT NULL default 'yes',
`last_errno` int(10) unsigned NOT NULL default '0',
`last_change` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_push_started` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_push_finished` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_error_ts` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_change` timestamp NULL default NULL,
`last_push_started` timestamp NULL default NULL,
`last_push_finished` timestamp NULL default NULL,
`last_error_ts` timestamp NULL default NULL,
UNIQUE KEY `object_id` (`object_id`),
KEY `domain_id` (`domain_id`),
KEY `template_id` (`template_id`),
Expand Down
6 changes: 1 addition & 5 deletions wwwroot/inc/pre-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ function connectDB()
$drvoptions = array
(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
// Cancel one specific SQL mode option that RackTables has been non-compliant
// with but which used to be off by default until MySQL 5.7. As soon as
// respective SQL queries and table columns become compliant with those options
// stop changing @@SQL_MODE but still keep SET NAMES in place.
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES "utf8", @@SQL_MODE = REPLACE(@@SQL_MODE, "NO_ZERO_DATE", "")',
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES "utf8"',
);
if (isset ($pdo_bufsize))
$drvoptions[PDO::MYSQL_ATTR_MAX_BUFFER_SIZE] = $pdo_bufsize;
Expand Down
12 changes: 12 additions & 0 deletions wwwroot/inc/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,18 @@ function getUpgradeBatch ($batchid)
$query[] = "ALTER TABLE LDAPCache MODIFY COLUMN last_retry timestamp NULL DEFAULT NULL";
$query[] = "DELETE FROM LDAPCache";

$query[] = "ALTER TABLE VLANSwitch MODIFY COLUMN last_change timestamp NULL DEFAULT NULL";
$query[] = "UPDATE VLANSwitch set last_change = NULL WHERE last_change = '0000-00-00 00:00:00";

$query[] = "ALTER TABLE VLANSwitch MODIFY COLUMN last_push timestamp NULL DEFAULT NULL";
$query[] = "UPDATE VLANSwitch set last_push = NULL WHERE last_push = '0000-00-00 00:00:00";

$query[] = "ALTER TABLE VLANSwitch MODIFY COLUMN last_push_finished timestamp NULL DEFAULT NULL";
$query[] = "UPDATE VLANSwitch set last_push_finish = NULL WHERE last_push_finish = '0000-00-00 00:00:00";

$query[] = "ALTER TABLE VLANSwitch MODIFY COLUMN last_error_ts timestamp NULL DEFAULT NULL";
$query[] = "UPDATE VLANSwitch set last_error_ts = NULL WHERE last_error_ts = '0000-00-00 00:00:00";

$query[] = "INSERT INTO ObjectParentCompat (parent_objtype_id, child_objtype_id) VALUES (1787,4)";

$port_trigger_body = <<<ENDOFTRIGGER
Expand Down