Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Bug in GT/SQL/Driver.pm ??

Quote Reply
Bug in GT/SQL/Driver.pm ??
Trying to use drop_unique ( $uniquekey ) in a plugin I get the error message (in $GT::SQL::error):
"Failed to execute query: 'ALTER TABLE lsql_SearchLog DROP INDEX Term2' Reason: Can't DROP 'Term2'. Check that column/key exists"

Which seems to indicate that instead of dropping a UNIQUE key, drop_unique attempts to drop in INDEX column.

In my version of Driver.pm (LSQL 2.1.2) line 489 confirms this as it says DROP INDEX where it should say DROP UNIQUE - I guess !?

Anybody knows if this really is a bug, if it has been corrected and a new version of Driver.pm exists?

Regards
Jacob
Quote Reply
Re: [alive2learn] Bug in GT/SQL/Driver.pm ?? In reply to
Hi,

What database are you using? For MySQL, DROP INDEX will drop any index (unique or not), and in fact DROP UNIQUE isn't valid:

http://dev.mysql.com/.../en/alter-table.html

Does the index really exist? Maybe the add failed?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [alive2learn] Bug in GT/SQL/Driver.pm ?? In reply to
Hi Jacob,

"DROP INDEX" is the correct syntax - a unique index is still an index, and is dropped using the same syntax as dropping a non-unique index. The error in this case appears to be a case of attempting to drop an index that doesn't exist.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Alex] Bug in GT/SQL/Driver.pm ?? In reply to
Ahaa - this makes much more sense to me now. I am using mySQL. Thanks for your replies Alex and Jagerman

Jacob