View Issue Details

IDProjectCategoryView StatusLast Update
1417RackTables802.1Q VLANspublic2016-03-27 12:13
Reportertomium Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformx64OSLinuxOS VersionSuse 13.1
Product Version0.20.10 
Target Version0.20.11Fixed in Version0.20.11 
Summary1417: PDO-Exception, for instance when adding switch templates in Tab 802.1Q
DescriptionWhen adding a switch template, Racktables fails with a PDO-Exception:
---->
Pdo exception: PDOException
SQLSTATE[HY000]: General error: 1364 Field 'mutex_rev' doesn't have a default value (HY000)

at file /srv/www/htdocs/racktables/inc/database.php, line 3926

/srv/www/htdocs/racktables/inc/database.php:3926 execute(Array
(
    [0] => gfsfdg
)
)
/srv/www/htdocs/racktables/inc/ophandlers.php:3633 usePreparedInsertBlade('VLANSwitchTemplate', Array
(
    [description] => gfsfdg
)
)
tableHandler()
/srv/www/htdocs/racktables/index.php:230 call_user_func('tableHandler')

Error info:

Array
(
    [0] => HY000
    [1] => 1364
    [2] => Field 'mutex_rev' doesn't have a default value
)
<---

A similar thing happens, when I try to alter a row of racks: Racktables throws a PDO-Exception and complains about a Column that is not set:
"Column 'has_problems' cannot be null"
Steps To Reproduce- Add a switch template or alter properties of a row.
- It only seems to happen, when running a newer version of MariaDB (5.5.33 OpenSuse in our case) or MySQL and/or where "sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES" is set in my.cnf
Additional InformationWe have several databases on our mysql server, therefore we can not simply change the setting in my.cnf to work around this issue.
TagsNo tags attached.

Activities

infrastation

infrastation

2015-02-12 13:58

administrator   ~0002695

What does the following query return?

SHOW CREATE TABLE VLANSwitchTemplate;
infrastation

infrastation

2015-02-12 14:12

administrator   ~0002697

OK, I see now, it is the strict SQL mode and missing values for non-NULL column(s): http://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_trans_tables

It shouldn't be hard to fix this given you keep feeding back the test results, as this is the first case of running RackTables in the strict SQL mode.
tomium

tomium

2015-02-13 11:22

reporter   ~0002701

OK, how can I help to fix this issue?
infrastation

infrastation

2015-02-18 18:42

administrator   ~0002715

A developer would need time to provide a patch for testing. Hopefully you can wait.
tomium

tomium

2015-02-19 14:16

reporter   ~0002721

We added a line in racktables/inc/pre-init.php below line 67 to work around this issue:

65 try
66 {
67 $dbxlink = new PDO ($pdo_dsn, $db_username, $db_password, $drvoptions);
68 $dbxlink->query("set session sql_mode = '';");
69 }


This helps so far, but we are still testing. I'm not sure that it is a proper solution.
infrastation

infrastation

2016-03-27 12:13

administrator   ~0003143

Maik Ehinger had fixed the original issue in commit 935d0211 on 2015-04-29, which became available in release 0.20.11 on 2016-02-07. If you continue to use unmodified RackTables code with mysqld configured for SQL strict mode and run into similar errors, please reopen this issue to fix any other incompatibilities with the strict mode. Thank you.

Issue History

Date Modified Username Field Change
2015-02-12 13:15 tomium New Issue
2015-02-12 13:15 tomium Status new => assigned
2015-02-12 13:15 tomium Assigned To => infrastation
2015-02-12 13:58 infrastation Note Added: 0002695
2015-02-12 14:12 infrastation Note Added: 0002697
2015-02-13 11:22 tomium Note Added: 0002701
2015-02-18 18:42 infrastation Note Added: 0002715
2015-02-19 14:16 tomium Note Added: 0002721
2016-03-27 12:13 infrastation Note Added: 0003143
2016-03-27 12:13 infrastation Assigned To infrastation =>
2016-03-27 12:13 infrastation Status assigned => closed
2016-03-27 12:13 infrastation Resolution open => fixed
2016-03-27 12:13 infrastation Fixed in Version => 0.20.11
2016-03-27 12:13 infrastation Target Version => 0.20.11