Merge pull request #71861 from pamarcos/fix-bitshift-test

Fix bitShift test after backport
This commit is contained in:
Pablo Marcos 2024-11-13 13:44:32 +01:00 committed by GitHub
commit 3b65e148f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 50 deletions

View File

@ -41,8 +41,6 @@ String ConstConst
38 Hello 00010010000110010101101100011011000110111100000000000000000000000000000000000000
39 Hello 00100100001100101011011000110110001101111000000000000000000000000000000000000000
40 Hello
41 Hello
42 Hello
FixedString ConstConst
1
0 Hello\0\0\0\0\0 01001000011001010110110001101100011011110000000000000000000000000000000000000000
@ -92,10 +90,8 @@ FixedString ConstConst
78 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
79 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
80 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
81 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
String VectorVector
-1 Hello
0 Hello 0100100001100101011011000110110001101111
1 Hello 000000001001000011001010110110001101100011011110
7 Hello 001001000011001010110110001101100011011110000000
@ -112,8 +108,6 @@ String VectorVector
33 Hello 00000000100100001100101011011000110110001101111000000000000000000000000000000000
39 Hello 00100100001100101011011000110110001101111000000000000000000000000000000000000000
40 Hello
41 Hello
42 Hello
7 Hel 00100100001100101011011000000000
8 Hel 01001000011001010110110000000000
9 Hel 0000000010010000110010101101100000000000
@ -125,7 +119,6 @@ String VectorVector
9 Hel 0000000010010000110010101101100000000000
FixedString VectorVector
-1 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
0 Hello\0\0\0\0\0 01001000011001010110110001101100011011110000000000000000000000000000000000000000
1 Hello\0\0\0\0\0 10010000110010101101100011011000110111100000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
@ -142,8 +135,6 @@ FixedString VectorVector
33 Hello\0\0\0\0\0 11011110000000000000000000000000000000000000000000000000000000000000000000000000
39 Hello\0\0\0\0\0 10000000000000000000000000000000000000000000000000000000000000000000000000000000
40 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
41 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
42 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
8 Hel\0\0\0\0\0\0\0 01100101011011000000000000000000000000000000000000000000000000000000000000000000
9 Hel\0\0\0\0\0\0\0 11001010110110000000000000000000000000000000000000000000000000000000000000000000
@ -171,9 +162,6 @@ String VectorConst
7 Hello 001001000011001010110110001101100011011110000000
7 Hello 001001000011001010110110001101100011011110000000
7 Hello 001001000011001010110110001101100011011110000000
7 Hello 001001000011001010110110001101100011011110000000
7 Hello 001001000011001010110110001101100011011110000000
7 Hello 001001000011001010110110001101100011011110000000
7 Hel 00100100001100101011011000000000
7 Hel 00100100001100101011011000000000
7 Hel 00100100001100101011011000000000
@ -193,9 +181,6 @@ String VectorConst
8 Hello 010010000110010101101100011011000110111100000000
8 Hello 010010000110010101101100011011000110111100000000
8 Hello 010010000110010101101100011011000110111100000000
8 Hello 010010000110010101101100011011000110111100000000
8 Hello 010010000110010101101100011011000110111100000000
8 Hello 010010000110010101101100011011000110111100000000
8 Hel 01001000011001010110110000000000
8 Hel 01001000011001010110110000000000
8 Hel 01001000011001010110110000000000
@ -217,9 +202,6 @@ FixedString VectorConst
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
@ -239,15 +221,11 @@ FixedString VectorConst
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
8 Hel\0\0\0\0\0\0\0 01100101011011000000000000000000000000000000000000000000000000000000000000000000
8 Hel\0\0\0\0\0\0\0 01100101011011000000000000000000000000000000000000000000000000000000000000000000
8 Hel\0\0\0\0\0\0\0 01100101011011000000000000000000000000000000000000000000000000000000000000000000
String ConstVector
-1 Hello
0 Hello 0100100001100101011011000110110001101111
1 Hello 000000001001000011001010110110001101100011011110
7 Hello 001001000011001010110110001101100011011110000000
@ -264,12 +242,9 @@ String ConstVector
33 Hello 00000000100100001100101011011000110110001101111000000000000000000000000000000000
39 Hello 00100100001100101011011000110110001101111000000000000000000000000000000000000000
40 Hello
41 Hello
42 Hello
7 Hello 001001000011001010110110001101100011011110000000
8 Hello 010010000110010101101100011011000110111100000000
9 Hello 00000000100100001100101011011000110110001101111000000000
-1 Hel
0 Hel 010010000110010101101100
1 Hel 00000000100100001100101011011000
7 Hel 00100100001100101011011000000000
@ -280,20 +255,11 @@ String ConstVector
17 Hel 000000001001000011001010110110000000000000000000
23 Hel 001001000011001010110110000000000000000000000000
24 Hel
25 Hel
31 Hel
32 Hel
33 Hel
39 Hel
40 Hel
41 Hel
42 Hel
7 Hel 00100100001100101011011000000000
8 Hel 01001000011001010110110000000000
9 Hel 0000000010010000110010101101100000000000
FixedString ConstVector
-1 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
0 Hello\0\0\0\0\0 01001000011001010110110001101100011011110000000000000000000000000000000000000000
1 Hello\0\0\0\0\0 10010000110010101101100011011000110111100000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
@ -310,12 +276,9 @@ FixedString ConstVector
33 Hello\0\0\0\0\0 11011110000000000000000000000000000000000000000000000000000000000000000000000000
39 Hello\0\0\0\0\0 10000000000000000000000000000000000000000000000000000000000000000000000000000000
40 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
41 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
42 Hello\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
7 Hello\0\0\0\0\0 00110010101101100011011000110111100000000000000000000000000000000000000000000000
8 Hello\0\0\0\0\0 01100101011011000110110001101111000000000000000000000000000000000000000000000000
9 Hello\0\0\0\0\0 11001010110110001101100011011110000000000000000000000000000000000000000000000000
-1 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
0 Hel\0\0\0\0\0\0\0 01001000011001010110110000000000000000000000000000000000000000000000000000000000
1 Hel\0\0\0\0\0\0\0 10010000110010101101100000000000000000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
@ -332,8 +295,6 @@ FixedString ConstVector
33 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
39 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
40 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
41 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
42 Hel\0\0\0\0\0\0\0 00000000000000000000000000000000000000000000000000000000000000000000000000000000
7 Hel\0\0\0\0\0\0\0 00110010101101100000000000000000000000000000000000000000000000000000000000000000
8 Hel\0\0\0\0\0\0\0 01100101011011000000000000000000000000000000000000000000000000000000000000000000
9 Hel\0\0\0\0\0\0\0 11001010110110000000000000000000000000000000000000000000000000000000000000000000

View File

@ -41,8 +41,6 @@ SELECT 37,'Hello',bin(bitShiftLeft('Hello', 37));
SELECT 38,'Hello',bin(bitShiftLeft('Hello', 38));
SELECT 39,'Hello',bin(bitShiftLeft('Hello', 39));
SELECT 40,'Hello',bin(bitShiftLeft('Hello', 40));
SELECT 41,'Hello',bin(bitShiftLeft('Hello', 41));
SELECT 42,'Hello',bin(bitShiftLeft('Hello', 42));
SELECT 'FixedString ConstConst';
SELECT bin(toFixedString('Hello', 10)) == bin(bitShiftLeft(toFixedString('Hello', 10), 0));
@ -93,40 +91,39 @@ SELECT 77,toFixedString('Hello', 10), bin(bitShiftLeft(toFixedString('Hello', 10
SELECT 78,toFixedString('Hello', 10), bin(bitShiftLeft(toFixedString('Hello', 10), 78));
SELECT 79,toFixedString('Hello', 10), bin(bitShiftLeft(toFixedString('Hello', 10), 79));
SELECT 80,toFixedString('Hello', 10), bin(bitShiftLeft(toFixedString('Hello', 10), 80));
SELECT 81,toFixedString('Hello', 10), bin(bitShiftLeft(toFixedString('Hello', 10), 81));
DROP TABLE IF EXISTS test_bit_shift_left_string_integer;
CREATE TABLE test_bit_shift_left_string_integer (str String, fixedStr FixedString(10), id Int64) engine=Log;
INSERT INTO test_bit_shift_left_string_integer VALUES('Hello','Hello',-1)('Hello','Hello',0),('Hello','Hello',1),('Hello','Hello',7),('Hello','Hello',8),('Hello','Hello',9),('Hello','Hello',15),('Hello','Hello',16),('Hello','Hello',17),('Hello','Hello',23),('Hello','Hello',24),('Hello','Hello',25),('Hello','Hello',31),('Hello','Hello',32),('Hello','Hello',33),('Hello','Hello',39),('Hello','Hello',40),('Hello','Hello',41),('Hello','Hello',42),('Hel','Hel',7),('Hel','Hel',8),('Hel','Hel',9);
INSERT INTO test_bit_shift_left_string_integer VALUES('Hello','Hello',0),('Hello','Hello',1),('Hello','Hello',7),('Hello','Hello',8),('Hello','Hello',9),('Hello','Hello',15),('Hello','Hello',16),('Hello','Hello',17),('Hello','Hello',23),('Hello','Hello',24),('Hello','Hello',25),('Hello','Hello',31),('Hello','Hello',32),('Hello','Hello',33),('Hello','Hello',39),('Hello','Hello',40),('Hel','Hel',7),('Hel','Hel',8),('Hel','Hel',9);
SELECT bin(bitShiftLeft('Hello', 42)); --A blank line
SELECT bin(bitShiftLeft('Hello', 40)); --A blank line
SELECT 'String VectorVector';
SELECT id as shift_right_bit,str as arg,bin(bitShiftLeft(str, id)) as string_res FROM test_bit_shift_left_string_integer;
SELECT id as shift_right_bit,str as arg,bin(bitShiftLeft(str, id)) as string_res FROM test_bit_shift_left_string_integer WHERE (str='Hello' AND (id=23 OR id=24 OR id=25)) OR (str='Hel' AND (id=7 OR id=8 OR id=9));
SELECT bin(bitShiftLeft('Hello', 42));
SELECT bin(bitShiftLeft('Hello', 40));
SELECT 'FixedString VectorVector';
SELECT id as shift_right_bit,fixedStr as arg,bin(bitShiftLeft(fixedStr, id)) as fixed_string_res FROM test_bit_shift_left_string_integer;
SELECT id as shift_right_bit,fixedStr as arg,bin(bitShiftLeft(fixedStr, id)) as fixed_string_res FROM test_bit_shift_left_string_integer WHERE (str='Hello' AND (id=23 OR id=24 OR id=25)) OR (str='Hel' AND (id=7 OR id=8 OR id=9));
SELECT bin(bitShiftLeft('Hello', 42)); --A blank line
SELECT bin(bitShiftLeft('Hello', 40)); --A blank line
SELECT 'String VectorConst';
SELECT 7 as shift_right_bit,str as arg,bin(bitShiftLeft(str, 7)) as string_res FROM test_bit_shift_left_string_integer;
SELECT 8 as shift_right_bit,str as arg,bin(bitShiftLeft(str, 8)) as string_res FROM test_bit_shift_left_string_integer;
SELECT bin(bitShiftLeft('Hello', 42)); --A blank line
SELECT bin(bitShiftLeft('Hello', 40)); --A blank line
SELECT 'FixedString VectorConst';
SELECT 7 as shift_right_bit,fixedStr as arg,bin(bitShiftLeft(fixedStr, 7)) as fixed_string_res FROM test_bit_shift_left_string_integer;
SELECT 8 as shift_right_bit,fixedStr as arg,bin(bitShiftLeft(fixedStr, 8)) as fixed_string_res FROM test_bit_shift_left_string_integer;
SELECT bin(bitShiftLeft('Hello', 42)); --A blank line
SELECT bin(bitShiftLeft('Hello', 40)); --A blank line
SELECT 'String ConstVector';
SELECT id as shift_right_bit,'Hello' as arg,bin(bitShiftLeft('Hello', id)) as string_res FROM test_bit_shift_left_string_integer;
SELECT id as shift_right_bit,'Hel' as arg,bin(bitShiftLeft('Hel', id)) as string_res FROM test_bit_shift_left_string_integer;
SELECT id as shift_right_bit,'Hel' as arg,bin(bitShiftLeft('Hel', id)) as string_res FROM test_bit_shift_left_string_integer WHERE id <= 8 * 3;
SELECT bin(bitShiftLeft('Hello', 42)); --A blank line
SELECT bin(bitShiftLeft('Hello', 40)); --A blank line
SELECT 'FixedString ConstVector';
SELECT id as shift_right_bit,toFixedString('Hello', 10) as arg,bin(bitShiftLeft(toFixedString('Hello', 10), id)) as fixed_string_res FROM test_bit_shift_left_string_integer;
SELECT id as shift_right_bit,toFixedString('Hel', 10) as arg,bin(bitShiftLeft(toFixedString('Hel', 10), id)) as fixed_string_res FROM test_bit_shift_left_string_integer;