Bit-Operation Incompatibilities with MySQL 5.7 do not use binary-string evaluation if all bit arguments are unadorned hexadecimal literals, bit literals, or NULL  literals. (This does not apply to such literals if they are written with a  _binary  introducer,  BINARY operator, or other way of specifying them explicitly as binary strings.) The literal handling just described is the same as prior to MySQL 8.0. Examples: •These bit operations evaluate the literals in numeric context and produce a  BIGINT  result: •These bit operations evaluate  NULL  in numeric context and produce a  BIGINT  result that has a  NULL value: b’0001’ | b’0010’ X’0008’ << 8 NULL & NULL NULL >> 4 _binary b’0001’ | b’0010’ _binary X’0008’ << 8 BINARY NULL & NULL BINARY NULL >> 4 In MySQL 8.0, you can cause those operations to evaluate the arguments in binary-string context by indicating explicitly that at least one argument is a binary string: The result of the last two expressions is  NULL , just as without the  BINARY  operator, but the data type of the result is a binary string type rather than an integer type. Bit-Operation Incompatibilities with MySQL 5.7 Because bit operations can handle binary string arguments natively in MySQL 8.0, some expressions produce a different result in MySQL 8.0 than in 5.7. The five problematic expression types to watch out for are: Those expressions return  BIGINT  in MySQL 5.7, binary string in 8.0. Explanation of notation: nonliteral_binary  { & | ^ }  binary binary { & | ^ }  nonliteral_binary nonliteral_binary  { << >> }  anything ~  nonliteral_binary AGGR_BIT_FUNC ( nonliteral_binary ) • {  op1 op2  ... } : List of operators that apply to the given expression type. • binary : Any kind of binary string argument, including a hexadecimal literal, bit literal, or  NULL  literal. • nonliteral_binary : An argument that is a binary string value other than a hexadecimal literal, bit literal, or  NULL  literal. • AGGR_BIT_FUNC : An aggregate function that takes bit-value arguments:  BIT_AND() ,  BIT_OR() , BIT_XOR() . For information about how to prepare in MySQL 5.7 for potential incompatibilities between MySQL 5.7 and 8.0, see Bit Functions and Operators, in MySQL 5.7 Reference Manual. The following list describes available bit functions and operators: 2267