Skip to content

Instantly share code, notes, and snippets.

@neikeq
Last active August 29, 2015 14:18
Show Gist options
  • Save neikeq/59aed9e0f778e10158e6 to your computer and use it in GitHub Desktop.
Save neikeq/59aed9e0f778e10158e6 to your computer and use it in GitHub Desktop.
Selects invalid items in the table.
-- check days-based expiration items where the days left to expire is greater than the expiration-type limit
select * from items where expiration = 9201007 and timestampdiff(day, current_timestamp, timestamp_expire) > 7;
select * from items where expiration = 9201030 and timestampdiff(day, current_timestamp, timestamp_expire) > 30;
-- check usage items with more usages left than its limit
select * from items where expiration = 9101010 and usages > 10;
select * from items where expiration = 9101050 and usages > 50;
select * from items where expiration = 9101100 and usages > 100;
-- check if there is a default-cloth item
select * from items where floor(item_id / 10000) = 100;
-- check bonuses for items
select * from items where floor(item_id / 10000) = 101 and (floor(bonus_one / 100000) != 18 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 102 and (floor(bonus_one / 100000) != 15 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 103 and (floor(bonus_one / 100000) != 19 or floor(bonus_two / 100000) != 13);
select * from items where floor(item_id / 10000) = 104 and (floor(bonus_one / 100000) != 20 or floor(bonus_two / 100000) != 12);
select * from items where floor(item_id / 10000) = 105 and (floor(bonus_one / 100000) != 14 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 106 and (floor(bonus_one / 100000) != 11 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 107 and (floor(bonus_one / 100000) != 24 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 111 and (floor(bonus_one / 100000) != 22 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 112 and (floor(bonus_one / 100000) != 17 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 113 and (floor(bonus_one / 100000) != 16 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 121 and (floor(bonus_one / 100000) != 21 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 122 and (floor(bonus_one / 100000) != 23 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 125 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 126 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 202 and (floor(bonus_one / 100000) != 33 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 203 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 204 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 205 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 206 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 209 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 210 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 211 and (floor(bonus_one / 100000) != 11 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 212 and (floor(bonus_one / 100000) != 12 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 213 and (floor(bonus_one / 100000) != 13 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 214 and (floor(bonus_one / 100000) != 15 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 215 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 216 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 217 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 218 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 219 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 220 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 221 and (floor(bonus_one / 100000) != 18 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 222 and (floor(bonus_one / 100000) != 19 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 223 and (floor(bonus_one / 100000) != 20 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 301 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 302 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 303 and (floor(bonus_one / 100000) != 34 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 304 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 305 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 306 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 309 and (floor(bonus_one / 100000) != 0 or floor(bonus_two / 100000) != 0);
-- check bonuses for masks and soda-type items
select * from items where floor(item_id / 10000) = 124 and ((floor(bonus_one / 100000) != 0 and (floor(bonus_one / 100000) < 14 or floor(bonus_one / 100000) > 24)) or floor(bonus_two / 100000) != 0);
select * from items where floor(item_id / 10000) = 201 and ((floor(bonus_one / 100000) != 31 and floor(bonus_one / 100000) != 32) or (floor(bonus_two / 100000) != 0 and floor(bonus_two / 100000) != 31 and floor(bonus_two / 100000) != 32));
-- check rows with duplicate inventory ids for a player
select player_id, inventory_id, count(*) from items group by player_id, inventory_id having count(*) > 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment