DROP TABLE IF EXISTS items;
CREATE TABLE items (
name VARCHAR(255),
flags BIT(12),
INDEX (flags)
) DEFAULT CHARSET=utf8mb4;
INSERT INTO items VALUES ('000000000000',
b'000000000000');
INSERT INTO items VALUES ('000000000010',
b'000000000010');
INSERT INTO items VALUES ('000000100000',
b'000000100000');
INSERT INTO items VALUES ('010000100000',
b'010000100000');
SELECT name, BIN(flags) FROM items WHERE flags = b'000000100000';
name	BIN(flags)
000000100000	100000
DROP TABLE items;
