View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 1547 | RackTables | default | public | 2015-12-08 16:17 | 2016-09-02 18:02 |
| Reporter | mikemol | Assigned To | |||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | unable to reproduce | ||
| Platform | Linux | OS | CentOS | OS Version | 6 |
| Product Version | 0.20.10 | ||||
| Summary | 1547: usePreparedSelectBlade query fails when run against MySQL 5.7.10 | ||||
| Description | Upgraded database from 5.1 to 5.5, then 5.5 to 5.6, then 5.6 to 5.7.10. At the end of the day, one of my IP ranges throws a PDO exception when viewed: Partial stack trace (proprietary info if I go any further down) Pdo exception: PDOException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'container_id' in 'where clause' (42S22)
at file /usr/share/RackTables/wwwroot/inc/database.php, line 3979
/usr/share/RackTables/wwwroot/inc/database.php:3979 execute(Array
(
[0] => object
[1] => 7
)
)
/usr/share/RackTables/wwwroot/inc/database.php:590 usePreparedSelectBlade('SELECT tag_id, TagStorage.user as tag_user, UNIX_TIMESTAMP(TagStorage.date) AS tag_time, RackObject.id, RackObject.name, RackObject.label, RackObject.asset_no, RackObject.objtype_id, (SELECT MIN(rack_id) FROM RackSpace WHERE object_id = RackObject.id) as rack_id, (SELECT MIN(parent_entity_id) FROM EntityLink WHERE child_entity_type='object' AND child_entity_id = RackObject.id AND parent_entity_type = 'rack') as rack_id_2, (SELECT MIN(parent_entity_id) FROM EntityLink WHERE child_entity_type='object' AND child_entity_id = RackObject.id AND parent_entity_type = 'object') as container_id, (SELECT name FROM RackObject WHERE id = container_id) as container_name, (SELECT objtype_id FROM RackObject WHERE id = container_id) as container_objtype_id, RackObject.has_problems, RackObject.comment, (SELECT COUNT(*) FROM Port WHERE object_id = RackObject.id) as nports, (SELECT domain_id FROM VLANSwitch WHERE object_id = id LIMIT 1) as 8021q_domain_id, (SELECT template_id FROM VLANSwitch WHERE object_id = id LIMIT 1) as 8021q_template_id FROM RackObject LEFT JOIN TagStorage on entity_realm = ? and entity_id = RackObject.id WHERE RackObject.id = ? ORDER BY tag_id', Array
(
[0] => object
[1] => 7
)
)
/usr/share/RackTables/wwwroot/inc/interface-lib.php:1066 spotEntity('object', '7')
/usr/share/RackTables/wwwroot/inc/interface.php:2939 makeIPAllocLink('
*#?', Array
(
[type] => regular
[name] => snmp
[object_id] => 7
[object_name] => erg
)
, 1)
/usr/share/RackTables/wwwroot/inc/interface.php:2850 renderIPv4NetworkAddresses(Array
(It looks like the container_id subselect isn't visible to subsequent subselects in the query. I suspect some semantic changed between MySQL 5.1 and MySQL 5.7.10 that affects that visibility. Query gets chopped off in the PDO exception, so I can't just feed it into MySQL and start taking it apart to see what's happening. I can pull the full query once I enable the general query log, but I've got other priorities right now. | ||||
| Tags | No tags attached. | ||||
| related to | 1635 | closed | infrastation | Pdo exception: PDOException |
|
I'm unable to reproduce this issue. Please provide more details and ideally specific steps to reproduce. Until then, this issue will be considered "on hold pending user data". |
|
|
a GET request (while logged into MantisBT) to http://f.q.d.n/racktables/index.php?page=ipv4net&id=3 is the URI I used to trigger the the exception. Short of a full database dump, I really don't know what more I can offer you. We're about to replace this particular MySQL 5.7 instance with a Percona 5.6 instance. In the mean time, maybe try your unit test suite against MySQL 5.7, if you haven't? |
|
Full query:SELECT
tag_id,
TagStorage.user AS tag_user,
UNIX_TIMESTAMP(TagStorage.date) AS tag_time,
RackObject.id,
RackObject.name,
RackObject.label,
RackObject.asset_no,
RackObject.objtype_id,
(SELECT
MIN(rack_id)
FROM
RackSpace
WHERE
object_id = RackObject.id) AS rack_id,
(SELECT
MIN(parent_entity_id)
FROM
EntityLink
WHERE
child_entity_type = 'object'
AND child_entity_id = RackObject.id
AND parent_entity_type = 'rack') AS rack_id_2,
(SELECT
MIN(parent_entity_id)
FROM
EntityLink
WHERE
child_entity_type = 'object'
AND child_entity_id = RackObject.id
AND parent_entity_type = 'object') AS container_id,
(SELECT
name
FROM
RackObject
WHERE
id = container_id) AS container_name,
(SELECT
objtype_id
FROM
RackObject
WHERE
id = container_id) AS container_objtype_id,
RackObject.has_problems,
RackObject.comment,
(SELECT
COUNT(*)
FROM
Port
WHERE
object_id = RackObject.id) AS nports,
(SELECT
domain_id
FROM
VLANSwitch
WHERE
object_id = id
LIMIT 1) AS 8021q_domain_id,
(SELECT
template_id
FROM
VLANSwitch
WHERE
object_id = id
LIMIT 1) AS 8021q_template_id
FROM
RackObject
LEFT JOIN
TagStorage ON entity_realm = 'object'
AND entity_id = RackObject.id
WHERE
RackObject.id = '7'
ORDER BY tag_idWhen run against Percona 5.6, this works fine. When run against MySQL 5.7 with the same dataset, this fails. |
|
| I can confirm, that this mistake is appeared only in MySQL 5.7.X | |
| This probably has to do with MySQL SQL mode changes in versions 5.7.x. | |
|
No issues so far with MySQL 5.7.12. I just removed "NO_ZERO_DATE" from 5.7 default modes, so RT install works file my.cnf [mysqld] sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" |
|
| If you try to click a row one of the queries will fail because of ONLY_FULL_GROUP_BY. I would like to avoid managing the MySQL server if possible. | |
|
I clicked some rows but all looks fine. I also can execute the full query in mysql without errors. (Empty Set of course) If i change RackObject.id i get some rows. |
|
| A user on the mailing list has experienced the issue I meant. | |
| The solution to bug 1635 may have worked around this bug too, it would be great if anybody could check and update. I have not seen this bug reproducing. | |
| Could anybody test if the original issue still reproduces with the change mentioned in the previous comment applied? Thank you. | |
| This query does not fail on my MySQL server version 5.7.12. To work on this bug it is necessary to see how to reproduce it. | |
| If anybody can provide exact instructions how to reproduce this issue, please reopen. | |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2015-12-08 16:17 | mikemol | New Issue | |
| 2015-12-09 00:06 | adoom42 | Note Added: 0003043 | |
| 2015-12-09 00:06 | adoom42 | Status | new => feedback |
| 2015-12-10 16:23 | mikemol | Note Added: 0003045 | |
| 2015-12-10 16:23 | mikemol | Status | feedback => new |
| 2015-12-10 20:56 | mikemol | Note Added: 0003047 | |
| 2016-01-19 15:44 | Axenow | Note Added: 0003109 | |
| 2016-05-19 17:09 | infrastation | Note Added: 0003201 | |
| 2016-06-02 15:15 | racktabler | Note Added: 0003217 | |
| 2016-06-02 15:50 | infrastation | Note Added: 0003219 | |
| 2016-06-02 16:40 | racktabler | Note Added: 0003221 | |
| 2016-06-04 00:27 | infrastation | Note Added: 0003223 | |
| 2016-06-04 00:29 | infrastation | Relationship added | related to 1635 |
| 2016-06-10 11:08 | infrastation | Status | new => acknowledged |
| 2016-06-14 17:48 | infrastation | Note Added: 0003233 | |
| 2016-06-22 16:16 | infrastation | Note Added: 0003243 | |
| 2016-06-22 16:16 | infrastation | Status | acknowledged => feedback |
| 2016-06-29 18:35 | infrastation | Note Added: 0003277 | |
| 2016-08-10 23:11 | infrastation | Note Added: 0003425 | |
| 2016-08-10 23:11 | infrastation | Status | feedback => closed |
| 2016-08-10 23:11 | infrastation | Resolution | open => unable to reproduce |
| 2016-09-02 18:04 | hclima | Issue cloned: 1681 |