Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-24-2014, 08:31 AM
tarwyn
Fire Beetle
 
Join Date: Aug 2007
Posts: 7
Thumbs down DB Dump of 20140223 - group_leaders table issue

User tables are currently defined as such

user_tables_2014-02-23-02_01.sql:
Code:
CREATE TABLE `group_leaders` (
  `gid` int(4) NOT NULL,
  `leadername` varchar(64) NOT NULL,
  `marknpc` varchar(64) NOT NULL DEFAULT '',
  `leadershipaa` tinyblob NOT NULL,
  `maintank` varchar(64) NOT NULL DEFAULT '',
  `assist` varchar(64) NOT NULL,
  `puller` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`gid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
It defines the column "leadershipaa" as NOT NULL but does not provide a default value for it. Likewise it asks for the column "assist" to be NOT NULLable but fails to provide a default.

This will cause an error in database.cpp @ 2048 in the function

Code:
void Database::SetGroupLeaderName(uint32 gid, const char* name) {
	char errbuf[MYSQL_ERRMSG_SIZE];
	char *query = 0;

	if (!RunQuery(query, MakeAnyLenString(&query, "Replace into group_leaders set gid=%lu, leadername='%s'",(unsigned long)gid,name), errbuf))
		printf("Unable to set group leader: %s\n",errbuf);

	safe_delete_array(query);
}
This SQL Statement will fail because it cannot create a record due to the leadershipaa/assist column requirements.

If this function fails, the group_leader record is never created and successive code that queries that table in order to function will not work correctly: groups do no longer function across zones. Additionally if grouped with a merc, you're technically in a group without a leader, and you couldn't invite anyone else into the group.

To fix, the table definition must change:
Code:
CREATE TABLE `group_leaders` (
  `gid` int(4) NOT NULL,
  `leadername` varchar(64) NOT NULL,
  `marknpc` varchar(64) NOT NULL DEFAULT '',
  `leadershipaa` tinyblob NULL,
  `maintank` varchar(64) NOT NULL DEFAULT '',
  `assist` varchar(64) NOT NULL DEFAULT '',
  `puller` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`gid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:12 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3