Summary | SQL Syntax error or access violation updating Horde_History DB schema |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | |
Requester | lp.allard.1 (at) gmail (dot) com |
Created | 07/25/2013 (4371 days ago) |
Due | |
Updated | 01/02/2024 (558 days ago) |
Assigned | 07/25/2013 (4371 days ago) |
Resolved | 08/02/2013 (4363 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Can someone give me the right sql command to fix the upgrade?
I use this:
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `horde_histories` (
`history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`object_uid` varchar(255) NOT NULL,
`history_action` varchar(32) NOT NULL,
`history_ts` bigint(20) NOT NULL,
`history_desc` text DEFAULT NULL,
`history_who` varchar(255) DEFAULT NULL,
`history_extra` text DEFAULT NULL,
`history_modseq` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`history_id`),
KEY `history_action_idx` (`history_action`),
KEY `history_ts_idx` (`history_ts`),
KEY `history_uid_idx` (`object_uid`),
KEY `index_horde_histories_on_history_modseq` (`history_modseq`),
KEY `index_horde_histories_on_object_uid` (`object_uid`),
KEY `history_modseq_idx` (`history_modseq`)
) ENGINE=MyISAM AUTO_INCREMENT=14715533 DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
:-)
Arnold
New Attachment: profile.html.html
State ⇒ Resolved
commit 0e4a486e140a43a63adc9b9357b0f0c0a7d80283
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri Aug 2 17:02:31 2013 -0400
Only remove index if we have the current index name.
Bug: 12498.../History/4_horde_history_add_compositeindex.php | 14 +++++++++++-
.../5_horde_history_remove_compositeindex.php | 14 +++++++++++-
.../History/6_horde_history_fix_botchedindexes.php | 21 +++++++++++++++++--
3 files changed, 42 insertions(+), 7 deletions(-)
http://git.horde.org/horde-git/-/commit/0e4a486e140a43a63adc9b9357b0f0c0a7d80283
table except the "PRIMARY key" this is what I did, I deleted all
columns except the primary key.
I do not know what is to do now.
in phpmyadmin, going into the horde_db then navigting in
horde_histories table then clicking on the SQL (Run SQL Query) and
copy paste the commands you provided, I get
When you said "I use phpmyadmin to delete all indexes in the horde_histories
table except the "PRIMARY key" this is what I did, I deleted all
columns except the primary key.
I guess I confused indexes and columns...
Can I just recreate the columns and then run your commands? I am
afraid to keep screwing around with that, since I dont know what Im
doing...
in phpmyadmin, going into the horde_db then navigting in
horde_histories table then clicking on the SQL (Run SQL Query) and
copy paste the commands you provided, I get
New Attachment: ISS8.jpeg
I am not sure exactly how to execute these SQL commands .. I tried in
phpmyadmin, going into the horde_db then navigting in horde_histories
table then clicking on the SQL (Run SQL Query) and copy paste the
commands you provided, I get
#1064- You have an error in your SQL syntax; check the manual thatcorresponds to your MySQL server version for the right syntax to use
near 'ALTER TABLE `hordedb`.`horde_histories` ADD INDEX
`index_horde_histories_on_hist' at line 2
I tried one by one thinking SQL didnt like the back-to-back with
multiple commands in the same query (I know it can do many commands in
one query but...)
and I got:
#1072- Key column 'history_ts' doesn't exist in tableNot sure how to push these commands in SQL. Can you help ?
Very aprpeciated!
to try to fix this?
* horde-db-migrate show Horde_History schema version: 4 and the SQL error.
* comment out the up function in the following files
(/usr/share/php/data/Horde_History/migration):
5_horde_history_remove_compositeindex.php
6_horde_history_fix_botchedindexes.php
* run horde-db-migrate to update to Horde_History schema version: 6
* I use phpmyadmin to delete all indexes in the horde_histories table
except the "PRIMARY key
* at last add the indexes with the following commands
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX
`index_horde_histories_on_history_action` ( `history_action` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX
`index_horde_histories_on_history_ts` ( `history_ts` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX
`index_horde_histories_on_history_modseq` ( `history_modseq` )
ALTER TABLE `HORDE_DB_NAME`.`horde_histories` ADD INDEX
`index_horde_histories_on_object_uid` ( `object_uid` )
I hope this helps.
some point in the past so that when we generate the name of the
index to drop, it doesn't match the name it was created with in the
past.
We probably need to catch the error and try to remove the old name
explicitly when this happens.
try to fix this?
some point in the past so that when we generate the name of the index
to drop, it doesn't match the name it was created with in the past.
We probably need to catch the error and try to remove the old name
explicitly when this happens.
Can someone give me the right sql command to fix the upgrade?
--
-- Tabellenstruktur für Tabelle `horde_histories`
--
CREATE TABLE IF NOT EXISTS `horde_histories` (
`history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`object_uid` varchar(255) NOT NULL,
`history_action` varchar(32) NOT NULL,
`history_ts` int(11) NOT NULL,
`history_desc` longtext,
`history_who` varchar(255) DEFAULT NULL,
`history_extra` longtext,
`history_modseq` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`history_id`),
KEY `history_action_idx` (`history_action`),
KEY `history_ts_idx` (`history_ts`),
KEY `history_uid_idx` (`object_uid`),
KEY `index_horde_histories_on_history_modseq_and_object_uid`
(`history_modseq`,`object_uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=74754 ;
Horde_History from 2.1.1 to 2.1.5 we have the very same error.
Or can i simply create a index with this name and let the schema
upgrade remove it?
Migrating to HordeHistoryRemoveCompositeIndex (5)
== 5 HordeHistoryRemoveCompositeIndex: migrating
==============================
-- removeIndex('horde_histories', 'history_modseq')
QUERY FAILED: Can't DROP 'index_horde_histories_on_history_modseq';
check that column/key exists
DROP INDEX `index_horde_histories_on_history_modseq` ON `horde_histories`
upgrade of the History package you ran the migration before the
final correct fix was in place. The migration might have succeeded
enough to remove the index but no update the schema version.
Try migrating to version 4 and then back up to 6. If that fails, you
can edit the migration files and comment out the
$this->removeIndex() line in the 6 migration.
Horde_History from 2.1.1 to 2.1.5 we have the very same error.
Or can i simply create a index with this name and let the schema
upgrade remove it?
State ⇒ Feedback
upgrade of the History package you ran the migration before the final
correct fix was in place. The migration might have succeeded enough to
remove the index but no update the schema version.
Try migrating to version 4 and then back up to 6. If that fails, you
can edit the migration files and comment out the $this->removeIndex()
line in the 6 migration.
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ SQL Syntax error or access violation updating Horde_History DB schema
Type ⇒ Bug
Queue ⇒ Horde Framework Packages
update, the configuration page displays that the DB schema as outdated
for Horde_History but displays the following message when trying to
update its schema:
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP
'index_horde_histories_on_history_modseq'; check that column/key exists
Horde database created by H4 about a year ago, reused by H5.1.1 now.