set tidb_cost_model_version=1; select 1 + 1, 1 + 3.1, 1 + "123.1", 1 + "123"; 1 + 1 1 + 3.1 1 + "123.1" 1 + "123" 2 4.1 124.1 124 select 1 * 1, 1 * 3.1, 1 * "123.1", 1 * "123"; 1 * 1 1 * 3.1 1 * "123.1" 1 * "123" 1 3.1 123.1 123 select 1 / 1, 1 / 3.1, 1 / "123.1", 1 / "123"; 1 / 1 1 / 3.1 1 / "123.1" 1 / "123" 1.0000 0.3226 0.008123476848090984 0.008130081300813009 select 1 - 1, 1 - 3.1, 1 - "123.1", 1 - "123"; 1 - 1 1 - 3.1 1 - "123.1" 1 - "123" 0 -2.1 -122.1 -122 select !1 + 1, 1 && "123", 1 & "123"; !1 + 1 1 && "123" 1 & "123" 1 1 1 select not 1 and 2 or 3, 1 ^ "123"; not 1 and 2 or 3 1 ^ "123" 1 122 select 3.12 and 1, 2.1 << 1, 2.1 >> 1; 3.12 and 1 2.1 << 1 2.1 >> 1 1 4 1 select 1 / 0; 1 / 0 NULL select 1 > 1, 1 >= 1, 1 < 1, 1 <= 1, 1 != 1, 1 = 1; 1 > 1 1 >= 1 1 < 1 1 <= 1 1 != 1 1 = 1 0 1 0 1 0 1 select 1.0 > 1.0, 1.0 >= 1.0, 1.0 < 1.0, 1.0 <= 1.0, 1.0 != 1.0, 1.0 = 1.0; 1.0 > 1.0 1.0 >= 1.0 1.0 < 1.0 1.0 <= 1.0 1.0 != 1.0 1.0 = 1.0 0 1 0 1 0 1 select "123" + "123", "123" * "123", "123" * 10, "123" / 10; "123" + "123" "123" * "123" "123" * 10 "123" / 10 246 15129 1230 12.3 select "123" = 123, "123" >= 123, "123" <= 123, "1234" > "234", "1234" > 234; "123" = 123 "123" >= 123 "123" <= 123 "1234" > "234" "1234" > 234 1 1 1 0 1 select ~1, ~1.1, ~"1", ~-1, ~+1; ~1 ~1.1 ~"1" ~-1 ~+1 18446744073709551614 18446744073709551614 18446744073709551614 0 18446744073709551614 select --1, ++1, -+1, +~1, -+!1, !-+~-1; --1 1 -+1 +~1 -+!1 !-+~-1 1 1 -1 18446744073709551614 0 1 select 1 != 0, 1 <> 0, 1 != 1, 1 <> 1; 1 != 0 1 <> 0 1 != 1 1 <> 1 1 1 0 0 select 10 div 2, 3.12 div 2, 10 div -11, 3.1212 div -9, -11 div 2; 10 div 2 3.12 div 2 10 div -11 3.1212 div -9 -11 div 2 5 1 0 0 -5 select 1 and 0, null and 0, 1 and 1, 0 and null, null and null; 1 and 0 null and 0 1 and 1 0 and null null and null 0 0 1 0 NULL select 1 and not 0, 1 or not 0; 1 and not 0 1 or not 0 1 1 select 1 xor 0, 0 xor 0, 1 xor 1, 1 xor null, 0 xor null; 1 xor 0 0 xor 0 1 xor 1 1 xor null 0 xor null 1 0 0 NULL NULL select 100 mod 3, -100 mod 3, 100 % 3, 100 % -3, 100 mod 0, 3.12 % 3; 100 mod 3 -100 mod 3 100 % 3 100 % -3 100 mod 0 3.12 % 3 1 -1 1 1 NULL 0.12 select 1 is true, 1 is false, 1 is not true, 1 is not false; 1 is true 1 is false 1 is not true 1 is not false 1 0 0 1 select 0 is true, 0 is false, 0 is not true, 0 is not false; 0 is true 0 is false 0 is not true 0 is not false 0 1 1 0 select null is true, null is false, null is not true, null is not false; null is true null is false null is not true null is not false 0 0 1 1 select 1 is unknown, 1 is not unknown, 0 is unknown, 0 is not unknown, null is unknown, null is not unknown; 1 is unknown 1 is not unknown 0 is unknown 0 is not unknown null is unknown null is not unknown 0 1 0 1 1 0 select sum(22) between 28 and null a, sum(22) not between 28 and null b, sum(22) between 10 and 28 c, sum(22) not between 10 and 28 d; a b c d 0 1 1 0 select 0x10 + 1, x'10' + 1, X'11' + 1, 0x10 * 10, 0x10 / 10, -0x10 + 10; 0x10 + 1 x'10' + 1 X'11' + 1 0x10 * 10 0x10 / 10 -0x10 + 10 17 17 18 160 1.6000 -6 select -cast("123" as binary), +cast("123" as binary), cast("123" as binary) + 1; -cast("123" as binary) +cast("123" as binary) cast("123" as binary) + 1 -123 123 124