6.0.0-beta1
8/11/25

[#7971] rampage table index error
Summary rampage table index error
Queue Kronolith
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester horde (at) smartsector (dot) hu
Created 02/09/2009 (6027 days ago)
Due
Updated 02/11/2009 (6025 days ago)
Assigned 02/10/2009 (6026 days ago)
Resolved 02/10/2009 (6026 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/11/2009 01:53:59 AM Michael Rubinsky Comment #8 Reply to this comment
And which one is incorrect? The SQL part of us, or the xml file?
What is incorrect is your interpretation of the XML schema file.  You 
turned a two column unique index into a single column unique index.
Wouldn't be more simple an sql script like upgrade and install scripts?
No, it wouldn't.



You should use the scripts located in framework/admintools to create 
the tables from the schema files.  If you need further assistance, 
please ask on the appropriate mailing list.
02/10/2009 10:22:26 PM horde (at) smartsector (dot) hu Comment #7 Reply to this comment
*sigh*

That is NOT the correct SQL statement.
And which one is incorrect? The SQL part of us, or the xml file?

Wouldn't be more simple an sql script like upgrade and install scripts?
02/10/2009 12:38:38 AM Michael Rubinsky Comment #6
Taken from Chuck Hagenbuch
State ⇒ Not A Bug
Reply to this comment
*sigh*



That is NOT the correct SQL statement.
02/10/2009 12:34:03 AM horde (at) smartsector (dot) hu Comment #5 Reply to this comment
the type id is the same:

+-----------+-----------------------------------------------+---------+

| object_id | object_name                                   | type_id |

+-----------+-----------------------------------------------+---------+

|         1 | 20090209224113.11603rqwzfxp9iih@myip |       2 |

|         2 | 20090209234236.14139w80iit4xxss@myip |       2 |

+-----------+-----------------------------------------------+---------+



I simply drop the index:

alter table rampage_objects drop index rampage_objects_type_object_name;



the creation method was not very professional :)

i create the SQL command by hand form the xml becasue this looked like 
the fastest way for me.



CREATE TABLE `rampage_objects` (

   `object_id` int(10) unsigned NOT NULL auto_increment,

   `object_name` varchar(255) NOT NULL,

   `type_id` int(10) unsigned NOT NULL,

   PRIMARY KEY  (`object_id`),

   UNIQUE KEY `rampage_objects_type_object_name` (`type_id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8;


02/10/2009 12:19:21 AM Michael Rubinsky Comment #4
Assigned to Michael Rubinsky
State ⇒ Feedback
Assigned to Chuck Hagenbuch
Reply to this comment
Can you please try this with a fresh set of rampage tables and post 
the *exact* steps that you took to produce this error?



If I understand your error correctly, after you removed the 'unique' 
flag and ran it again, you have two entries for the same event in the 
rampage_objects table (two entries where object_name and type_id are 
equal)? Not really sure how that would happen as the object_name is a 
UID...
02/09/2009 11:40:15 PM horde (at) smartsector (dot) hu Comment #3 Reply to this comment
Please pick the correct version.
sorry. my mistake. that's end of the list, and i do not notice. i will 
keep my eyes on that!
02/09/2009 11:31:31 PM Jan Schneider Comment #2
Version ⇒ Git master
Reply to this comment
Please pick the correct version.
02/09/2009 11:27:19 PM horde (at) smartsector (dot) hu Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Kronolith
Summary ⇒ rampage table index error
Type ⇒ Bug
Reply to this comment
the bug related with #7948



after we created the tables the 7948 errors gone away.



but when i add the 2. event to the calendar i recive the following error:

Fatal error: Uncaught exception 'Horde_Db_Exception' with message 
'QUERY FAILED: Duplicate entry '2' for key 2 INSERT INTO 
`rampage_objects` (object_name, type_id) VALUES 
('20090209234236.14139w80iit4xxss@195.70.38.187', 2)' in 
/usr/share/php/Horde/Db/Adapter/Mysqli.php:299 Stack trace: #0 
/usr/share/php/Horde/Db/Adapter/Mysqli.php(324): 
Horde_Db_Adapter_Mysqli->execute('INSERT INTO `ra...', NULL, NULL) #1 
/usr/share/horde/content/lib/Objects/Manager.php(122): 
Horde_Db_Adapter_Mysqli->insert('INSERT INTO `ra...') #2 
/usr/share/horde/content/lib/Tagger.php(703): 
Content_Objects_Manager->ensureObjects('20090209234236....', 2) #3 
/usr/share/horde/content/lib/Tagger.php(186): 
Content_Tagger->_ensureObject(Array) #4 
/usr/share/horde/kronolith/lib/Tagger.php(122): 
Content_Tagger->removeTagFromObject(Array, Array) #5 
/usr/share/horde/kronolith/lib/Tagger.php(160): 
Kronolith_Tagger->untag('20090209234236....', Array, 'event') #6 
/usr/share/horde/kronolith/lib/Driver/sql.php(516): 
Kronolith_Tagger->replaceTags('20090209234236.... in 
/usr/share/php/Horde/Db/Adapter/Mysqli.php on line 299



the xml part abut this index:

    <index>

     <name>rampage_objects_type_object_name</name>

     <unique>true</unique>

     <field>

      <name>type_id</name>

      <sorting>ascending</sorting>

     </field>

     <field>

      <name>object_name</name>

      <sorting>ascending</sorting>

     </field>

    </index>



our solution is simply:

drop the unique index and it's work perfectly.

Saved Queries