Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE f AS
- SELECT b'000000001' AS a, x'01' AS b;
- `a` varbinary(2) NOT NULL,
- `b` varbinary(1) NOT NULL
- SELECT a=0, b=0, a=b, a<>b FROM f;
- +-----+-----+-----+------+
- | a=0 | b=0 | a=b | a<>b |
- +-----+-----+-----+------+
- | 1 | 1 | 0 | 1 |
- +-----+-----+-----+------+
- SELECT a=0, b=0, -- numeric comparisons
- a=b, a<>b -- BLOB comparisons; length matters
- FROM f;
- SELECT
- a = 0,
- a = cast( 0 AS BINARY ),
- cast(a as SIGNED),
- cast(a as SIGNED) = 0,
- b,
- b = 0,
- b = cast( 0 AS BINARY ),
- cast(b as SIGNED),
- b = cast(b as SIGNED) = 0,
- a = b,
- a <> b
- FROM
- f;
Add Comment
Please, Sign In to add comment