View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
381 | RackTables | default | public | 2010-12-07 18:00 | 2011-01-04 23:50 |
Reporter | Assigned To | andriyanov | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.18.5 | ||||
Fixed in Version | 0.19.0 | ||||
Summary | 381: The 'Refcnt' counter on Configuration: Dictionary: Chapter 'XXX' for some chapter is broken | ||||
Description | Let imagine there are some object types having the same attribute(s) (i.e. CPU Model) in Racktables i.e (Server, Laptop & Desktop PC). In such situation a value for the attribute apearing on the "Main page: Configuration: Dictionary: Chapter 'CPU Model'" page is multiply by number of the object type this attribute appear in (in our example by 3). After tracing the problem lay in following PHP/SQL code/query (from inc/database.php - line 1979) causing the problem: // Find the list of all assigned values of dictionary-addressed attributes, each with // chapter/word keyed reference counters. $query = "select uint_value, count(object_id) as refcnt " . "from Attribute as a inner join AttributeMap as am on a.id = am.attr_id " . "inner join AttributeValue as av on a.id = av.attr_id " . "inner join Dictionary as d on am.chapter_id = d.chapter_id and av.uint_value = d.dict_key " . "where a.type = 'dict' and am.chapter_id = ? group by uint_value"; break; The first join return 3 row not 1: mysql> SELECT * FROM Attribute AS a INNER JOIN AttributeMap AS am ON a.id = am.attr_id WHERE a.type = 'dict' AND am.chapter_id = 10004 ; +-------+------+-----------+------------+---------+------------+ | id | type | name | objtype_id | attr_id | chapter_id | +-------+------+-----------+------------+---------+------------+ | 10012 | dict | CPU Model | 4 | 10012 | 10004 | | 10012 | dict | CPU Model | 50000 | 10012 | 10004 | | 10012 | dict | CPU Model | 50001 | 10012 | 10004 | +-------+------+-----------+------------+---------+------------+ 3 rows in set (0.00 sec) Any idea how to fix it? (And, yes we are using Racktables to inventory boxes out of Server rooms). | ||||
Tags | No tags attached. | ||||
The issue has been recreated on the DEMO website: http://demo.racktables.org/index.php?page=chapter&chapter_no=10001 |
|
I see. May be, you already know, how to fix this best? | |
Fixed in 0.19.0 (SVN commit 4076). | |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-12-07 18:00 |
|
New Issue | |
2010-12-08 11:03 |
|
Note Added: 0000200 | |
2010-12-08 18:00 | infrastation | Note Added: 0000201 | |
2010-12-08 18:00 | infrastation | Status | new => acknowledged |
2011-01-04 23:48 | andriyanov | Status | acknowledged => assigned |
2011-01-04 23:48 | andriyanov | Assigned To | => andriyanov |
2011-01-04 23:50 | andriyanov | Note Added: 0000213 | |
2011-01-04 23:50 | andriyanov | Status | assigned => closed |
2011-01-04 23:50 | andriyanov | Resolution | open => fixed |
2011-01-04 23:50 | andriyanov | Fixed in Version | => 0.19.0 |