View Single Post
  #1  
Old 07-18-2010, 08:24 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default BaseGuildManager::DBSetGuild()

Using quest::SetGuild() to change a character's guild ends up putting them in multiple guilds. From what I understand, this is because DBSetGuild() uses 'REPLACE INTO' in the query and the guild_members table doesn't have a PRIMARY KEY or UNIQUE index.

This is from the MySQL reference manual on REPLACE INTO:
Quote:
Note that unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE statement makes no sense. It becomes equivalent to INSERT, because there is no index to be used to determine whether a new row duplicates another.
Reply With Quote