Log in

View Full Version : Error 1054


Nightrider84
03-12-2015, 01:30 AM
Everytime I login to my GM account this is the error I see. I know that one of the new features sends this to gms to sort the problem but im not sure how to actually fix this. I found where the colum is but it says last_login and im not sure changing it will mess up the db or fix the problem any help would be great

[MySQL Error] 1054: Unknown column 'c.timelaston' in 'field list' SELECT
c.id,c.name,c.class,c.level,c.timelaston,c.zoneid,
g.guild_id,g.rank,g.tribute_enable,g.total_tribute ,g.last_tribute,g.banker,g.public_note,g.alt
FROM vwBotCharacterMobs AS c LEFT JOIN vwGuildMembers as g ON c.id=g.char_id
AND c.mobtype = b.mobtype WHERE g.guild_id=1

Huppy
03-13-2015, 04:44 AM
Not sure if this will cure your problem, but save this to sql and source in to db.
I did it to get rid of a different error regarding the vwBotCharacterMobs table.

DROP VIEW IF EXISTS `vwBotCharacterMobs`;
CREATE VIEW `vwBotCharacterMobs` AS
select _utf8'C' AS `mobtype`,
`c`.`id` AS `id`,
`c`.`name` AS `name`,
`c`.`class` AS `class`,
`c`.`level` AS `level`,
`c`.`last_login` AS `timelaston`,
`c`.`zone_id` AS `zoneid`
from `character_data` `c`
union all
select _utf8'B' AS `mobtype`,
`b`.`BotID` AS `id`,
`b`.`Name` AS `name`,
`b`.`Class` AS `class`,
`b`.`BotLevel` AS `level`,
0 AS `timelaston`,
0 AS `zoneid`
from `bots` `b`;

DELIMITER $$

DROP FUNCTION IF EXISTS `GetMobType` $$
CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)
BEGIN
DECLARE Result CHAR(1);

SET Result = NULL;

IF (select count(*) from character_data where name = mobname) > 0 THEN
SET Result = 'C';
ELSEIF (select count(*) from bots where Name = mobname) > 0 THEN
SET Result = 'B';
END IF;

RETURN Result;
END $$

DELIMITER ;


DROP VIEW IF EXISTS `vwGroups`;
CREATE VIEW `vwGroups` AS
select g.groupid as groupid,
GetMobType(g.name) as mobtype,
g.name as name,
g.charid as mobid,
ifnull(c.level, b.BotLevel) as level
from group_id as g
left join character_data as c on g.name = c.name
left join bots as b on g.name = b.Name;

DROP VIEW IF EXISTS `vwBotGroups`;
CREATE VIEW `vwBotGroups` AS
select g.BotGroupId,
g.BotGroupName,
g.BotGroupLeaderBotId,
b.Name as BotGroupLeaderName,
b.BotOwnerCharacterId,
c.name as BotOwnerCharacterName
from botgroup as g
join bots as b on g.BotGroupLeaderBotId = b.BotID
join character_data as c on b.BotOwnerCharacterID = c.id
order by b.BotOwnerCharacterId, g.BotGroupName;