????????5???Bug
?????????????? ???????[ 2016/9/12 11:47:11 ] ?????????????????? ??????
????????????????????У???????????????н??????????????????α??????????????????????????????????????????????????????????????????????????????????“??????????”?????????????????????????????????????????5???bug???????????mysql??????????
???????????????????????????????????????????????У???
???????????????????????????????в?????У???????id??activity_id???????uuid??player_uuid????????????apply_no??????Щ?????????????????
???????????????????????????????????????????????apply_total_num?????????????????????????????е?apply_no??
???????????????д??????????????????????????????????????????ж??????????????
????awards = {
????1: 1??
????2: 15??
????3: 50??
????...
????}
????????????????????????????????apply_total_num???????????sum(awards.values())??????????????????????????????apply_no???С???????10000??????????????????1000??????????п??????????μ????????1000??apply_no?????У?
????lucky_apply_nos = [234?? 123?? 1356?? 8765?? 12?? ...]
???????????MySQL??????????lucky_apply_nos?????uuid??
????lucky_uuids = SELECT player_uuid FROM world_lottery WHERE apply_no IN lucky_apply_nos;
???????lucky_uuids???????awards??????佱????lucky_uuids[0]???1?????lucky_uuids[1]~lucky_uuids[15]???2??????????????
??????????????????ɡ?????????????SELECT??????????????????????????????????????lucky_uuids????????lucky_apply_nos?е??????μ?????????????????MySQL????????????
????· ???????ORDER BY????SELECT????????????????????????й??
????· ????MyISAM????????????????????????洢???
????· ????InnoDB???????????????????????????????
???????????????????????????????IN???????б?lucky_apply_nos???????……
???????嵽???????????????????????????InnoDB????????player_uuid???????????lucky_uuids??????palyer_uuid???????
???????????????????????
??????????????uuid???С?????????????????????????????lucky_apply_nos???????????????ü?????1?????????????????????????????????0.1^4????????0.0001^4??
????????淨(jìng)?????????????????н???????????????н??????????????bug????????????????????λ??У??????????????????????????????????????????????????????????????????????λ??????м??θ???????????????
???????????????????????????????lucky_uuids???????????shuffle???ɡ?
???????
????MySQL??????ORDER BY????SELECT??????????????????
????· ????MyISAM????????????????????????洢???
????· ????InnoDB???????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11