Commit fa5cd7c
committed
MDEV-10526: Add binary string support to bitwise operators
Bitwise operators (&, |, ^, ~, <<, >>) previously cast all
arguments to BIGINT, silently truncating values wider than
64 bits. This broke operations on BINARY, VARBINARY, BLOB,
INET6, and UUID columns.
Introduces binary_mode detection in fix_length_and_dec().
When any non-literal argument has STRING_RESULT with binary
charset, operators switch to byte-by-byte processing via
a new Handler_str subclass, returning LONGBLOB of the same
length as the input.
Bare hex literals (x'FF', 0xFF) and bit literals (b'1010')
retain integer mode for backward compatibility.
Existing int/decimal handler classes for Item_func_bit_or
and Item_func_bit_and are moved from item_cmpfunc.cc to
item_func.cc for consistency.
New error codes:
ER_INVALID_BITWISE_OPERANDS_SIZE
ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE
Aggregate function support (BIT_AND/BIT_OR/BIT_XOR) to
follow in a subsequent commit.
Closes: MDEV-105261 parent f29bd54 commit fa5cd7c
4 files changed
Lines changed: 620 additions & 69 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4920 | 4920 | | |
4921 | 4921 | | |
4922 | 4922 | | |
4923 | | - | |
4924 | | - | |
4925 | | - | |
4926 | | - | |
4927 | | - | |
4928 | | - | |
4929 | | - | |
4930 | | - | |
4931 | | - | |
4932 | | - | |
4933 | | - | |
4934 | | - | |
4935 | | - | |
4936 | | - | |
4937 | | - | |
4938 | | - | |
4939 | | - | |
4940 | | - | |
4941 | | - | |
4942 | | - | |
4943 | | - | |
4944 | | - | |
4945 | | - | |
4946 | | - | |
4947 | | - | |
4948 | | - | |
4949 | | - | |
4950 | | - | |
4951 | | - | |
4952 | | - | |
4953 | | - | |
4954 | | - | |
4955 | | - | |
4956 | | - | |
4957 | | - | |
4958 | | - | |
4959 | | - | |
4960 | | - | |
4961 | | - | |
4962 | | - | |
4963 | | - | |
4964 | | - | |
4965 | | - | |
4966 | | - | |
4967 | | - | |
4968 | | - | |
4969 | | - | |
4970 | | - | |
4971 | | - | |
4972 | | - | |
4973 | | - | |
4974 | | - | |
4975 | | - | |
4976 | | - | |
4977 | | - | |
4978 | | - | |
4979 | | - | |
4980 | | - | |
4981 | | - | |
4982 | | - | |
4983 | | - | |
4984 | | - | |
4985 | | - | |
4986 | | - | |
4987 | | - | |
4988 | | - | |
4989 | | - | |
4990 | | - | |
4991 | 4923 | | |
4992 | 4924 | | |
4993 | 4925 | | |
| |||
0 commit comments