Bit-Operation Incompatibilities with MySQL 5.7 • | •Binary-string evaluation occurs when the arguments have a binary string type, and at least one of them is not a hexadecimal literal, bit literal, or  NULL  literal. Numeric evaluation occurs otherwise, with argument conversion to unsigned 64-bit integers as necessary. •Binary-string evaluation produces a binary string of the same length as the arguments. If the arguments have unequal lengths, an  ER_INVALID_BITWISE_OPERANDS_SIZE  error occurs. Numeric evaluation produces an unsigned 64-bit integer. • & •Binary-string evaluation occurs when the arguments have a binary string type, and at least one of them is not a hexadecimal literal, bit literal, or  NULL  literal. Numeric evaluation occurs otherwise, with argument conversion to unsigned 64-bit integers as necessary. •Binary-string evaluation produces a binary string of the same length as the arguments. If the arguments have unequal lengths, an  ER_INVALID_BITWISE_OPERANDS_SIZE  error occurs. Numeric evaluation produces an unsigned 64-bit integer. • ^ •Binary-string evaluation occurs when the arguments have a binary string type, and at least one of them is not a hexadecimal literal, bit literal, or  NULL  literal. Numeric evaluation occurs otherwise, with argument conversion to unsigned 64-bit integers as necessary. Bitwise OR. The result type depends on whether the arguments are evaluated as binary strings or numbers: For more information, see the introductory discussion in this section. If bitwise OR is invoked from within the  mysql  client, binary string results display using hexadecimal notation, depending on the value of the  --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . The result type depends on whether the arguments are evaluated as binary strings or numbers: Bitwise AND. For more information, see the introductory discussion in this section. mysql>  SELECT 29 & 15; If bitwise AND is invoked from within the  mysql  client, binary string results display using hexadecimal notation, depending on the value of the  --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . Bitwise XOR. The result type depends on whether the arguments are evaluated as binary strings or numbers: 2268 -> 13 mysql>  SELECT HEX(_binary X’FF’ & b’11110000’); -> ’F0’ mysql>  SELECT 29 | 15; -> 31 mysql>  SELECT _binary X’40404040’ | X’01020304’; -> ’ABCD’