Details
Description
Keyword subgroupID’s are used when determining differences between the temporary upload and perpetual keyword tables, but aren't being updated when setting the tmp values to the keyword table ie the subgroup id is found and used in selection and initial insert statements, but not in on duplicate key update section:
insert into biz_function_location.keywords(keyword, matchType,
keywordListID, isGeoMod, isGeoTarget, isMobile, isNegative,
subGroupID) select distinct keyword, matchType, l.id, isGeoMod,
isGeoTarget, isMobile, isNegative, subGroupID from (select t.keyword,
t.matchType, t.isGeoMod, t.isGeoTarget, t.isMobile, t.isNegative,
t.businessFunctionID, t.subGroupID from
biz_function_location.keywordImport_tmp t left join
(biz_function_location.keywordLists l join
biz_function_location.keywords k on(l.id = k.keywordListID)) on
(l.businessFunctionID = t.businessFunctionID and t.keyword = k.keyword
and t.matchType = k.matchType and t.isGeoMod = k.isGeoMod and
t.isGeoTarget = k.isGeoTarget and t.isMobile = k.isMobile and
t.isNegative = k.isNegative and t.subGroupID = k.subGroupID) where
k.id is null) as x join keywordLists l on(l.businessFunctionID =
x.businessFunctionID) on duplicate key update
biz_function_location.keywords.isGeoMod = x.isGeoMod,
biz_function_location.keywords.isGeoTarget=x.isGeoTarget, biz_function_location.keywords.isMobile=x.isMobile,
biz_function_location.keywords.isNegative = x.isNegative
This is causing problems when removing or updating subgroups from keywords. Optus currently assumes only one subgroup, and we've been updating keyword files to only have one subgroup. However, this bug means that all keywords undergoing this change will subsequently be determined as changed and require the customers with its Business Area to be redeployed during the automatic upload and validate keywords service run that occurs at 8:00pm each day.