Keira3 icon indicating copy to clipboard operation
Keira3 copied to clipboard

SQL Standards for Flags and Bits

Open ghost opened this issue 3 years ago • 5 comments

When I was changing creature_template the query was not in sync with the SQL standards implemented. Would be nice to get the job done using Keira instead of manually changing the query 😀

Wrong example:

UPDATE `creature_template` SET `mechanic_immune_mask` = 617299803 WHERE `entry` = 7727;

Good example:

-- Adding flags
UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|64|256|1024 WHERE `entry` = 7727;

-- Removing flags
UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`&~(64|256|1024) WHERE `entry` = 7727;

Link: https://www.azerothcore.org/wiki/sql-standards#flags-amp-bits


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ghost avatar Jun 21 '21 14:06 ghost

yep, we need to do this

Helias avatar Jun 21 '21 17:06 Helias

Been caught by this as well, definitely support this idea.

Azcobu avatar Jun 22 '21 00:06 Azcobu

Any eta on this https://www.azerothcore.org/wiki/sql-standards#flags-amp-bits

much safer way of dealing with flags

Kitzunu avatar Oct 14 '21 18:10 Kitzunu

no ETA because I'm very busy, if someone wants to help and implement it would be welcome of course

FrancescoBorzi avatar Oct 15 '21 10:10 FrancescoBorzi

@claudiodfc why closing?

FrancescoBorzi avatar Mar 12 '22 16:03 FrancescoBorzi