SELECT 'String ConstConst';
SELECT bin('Hello') == bin(bitShiftRight('Hello', 0));
SELECT 0, 'Hello',bin(bitShiftRight('Hello', 0));
SELECT 1, 'Hello',bin(bitShiftRight('Hello', 1));
SELECT 2, 'Hello',bin(bitShiftRight('Hello', 2));
SELECT 3, 'Hello',bin(bitShiftRight('Hello', 3));
SELECT 4, 'Hello',bin(bitShiftRight('Hello', 4));
SELECT 5, 'Hello',bin(bitShiftRight('Hello', 5));
SELECT 6, 'Hello',bin(bitShiftRight('Hello', 6));
SELECT 7, 'Hello',bin(bitShiftRight('Hello', 7));
SELECT 8, 'Hello',bin(bitShiftRight('Hello', 8));
SELECT 9, 'Hello',bin(bitShiftRight('Hello', 9));
SELECT 10,'Hello',bin(bitShiftRight('Hello', 10));
SELECT 11,'Hello',bin(bitShiftRight('Hello', 11));
SELECT 12,'Hello',bin(bitShiftRight('Hello', 12));
SELECT 13,'Hello',bin(bitShiftRight('Hello', 13));
SELECT 14,'Hello',bin(bitShiftRight('Hello', 14));
SELECT 15,'Hello',bin(bitShiftRight('Hello', 15));
SELECT 16,'Hello',bin(bitShiftRight('Hello', 16));
SELECT 17,'Hello',bin(bitShiftRight('Hello', 17));
SELECT 18,'Hello',bin(bitShiftRight('Hello', 18));
SELECT 19,'Hello',bin(bitShiftRight('Hello', 19));
SELECT 20,'Hello',bin(bitShiftRight('Hello', 20));
SELECT 21,'Hello',bin(bitShiftRight('Hello', 21));
SELECT 22,'Hello',bin(bitShiftRight('Hello', 22));
SELECT 23,'Hello',bin(bitShiftRight('Hello', 23));
SELECT 24,'Hello',bin(bitShiftRight('Hello', 24));
SELECT 25,'Hello',bin(bitShiftRight('Hello', 25));
SELECT 26,'Hello',bin(bitShiftRight('Hello', 26));
SELECT 27,'Hello',bin(bitShiftRight('Hello', 27));
SELECT 28,'Hello',bin(bitShiftRight('Hello', 28));
SELECT 29,'Hello',bin(bitShiftRight('Hello', 29));
SELECT 30,'Hello',bin(bitShiftRight('Hello', 30));
SELECT 31,'Hello',bin(bitShiftRight('Hello', 31));
SELECT 32,'Hello',bin(bitShiftRight('Hello', 32));
SELECT 33,'Hello',bin(bitShiftRight('Hello', 33));
SELECT 34,'Hello',bin(bitShiftRight('Hello', 34));
SELECT 35,'Hello',bin(bitShiftRight('Hello', 35));
SELECT 36,'Hello',bin(bitShiftRight('Hello', 36));
SELECT 37,'Hello',bin(bitShiftRight('Hello', 37));
SELECT 38,'Hello',bin(bitShiftRight('Hello', 38));
SELECT 39,'Hello',bin(bitShiftRight('Hello', 39));
SELECT 40,'Hello',bin(bitShiftRight('Hello', 40));

SELECT 'FixedString ConstConst';
SELECT bin(toFixedString('Hello', 10)) == bin(bitShiftRight(toFixedString('Hello', 10), 0));
SELECT 0, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 0));
SELECT 1, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 1));
SELECT 2, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 2));
SELECT 3, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 3));
SELECT 4, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 4));
SELECT 5, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 5));
SELECT 6, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 6));
SELECT 7, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 7));
SELECT 8, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 8));
SELECT 9, toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 9));
SELECT 10,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 10));
SELECT 11,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 11));
SELECT 12,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 12));
SELECT 13,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 13));
SELECT 14,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 14));
SELECT 15,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 15));
SELECT 16,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 16));
SELECT 17,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 17));
SELECT 18,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 18));
SELECT 19,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 19));
SELECT 20,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 20));
SELECT 21,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 21));
SELECT 22,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 22));
SELECT 23,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 23));
SELECT 24,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 24));
SELECT 25,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 25));
SELECT 26,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 26));
SELECT 27,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 27));
SELECT 28,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 28));
SELECT 29,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 29));
SELECT 30,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 30));
SELECT 31,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 31));
SELECT 32,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 32));
SELECT 33,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 33));
SELECT 34,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 34));
SELECT 35,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 35));
SELECT 36,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 36));
SELECT 37,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 37));
SELECT 38,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 38));
SELECT 39,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 39));
SELECT 40,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 40));
SELECT 41,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 41));
SELECT 42,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 42));
SELECT 77,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 77));
SELECT 78,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 78));
SELECT 79,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 79));
SELECT 80,toFixedString('Hello', 10), bin(bitShiftRight(toFixedString('Hello', 10), 80));

DROP TABLE IF EXISTS test_bit_shift_right_string_integer;

CREATE TABLE test_bit_shift_right_string_integer (str String, fixedStr FixedString(10), id Int64) engine=Log;

INSERT INTO test_bit_shift_right_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(bitShiftRight('Hello', 40));  --A blank line
SELECT 'String VectorVector';
SELECT id as shift_right_bit,str as arg,bin(bitShiftRight(str, id)) as string_res FROM test_bit_shift_right_string_integer;
SELECT id as shift_right_bit,str as arg,bin(bitShiftRight(str, id)) as string_res FROM test_bit_shift_right_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(bitShiftRight('Hello', 40));
SELECT 'FixedString VectorVector';
SELECT id as shift_right_bit,fixedStr as arg,bin(bitShiftRight(fixedStr, id)) as fixed_string_res FROM test_bit_shift_right_string_integer;
SELECT id as shift_right_bit,fixedStr as arg,bin(bitShiftRight(fixedStr, id)) as fixed_string_res FROM test_bit_shift_right_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(bitShiftRight('Hello', 40));  --A blank line
SELECT 'String VectorConst';
SELECT 7 as shift_right_bit,str as arg,bin(bitShiftRight(str, 7)) as string_res FROM test_bit_shift_right_string_integer;
SELECT 8 as shift_right_bit,str as arg,bin(bitShiftRight(str, 8)) as string_res FROM test_bit_shift_right_string_integer;

SELECT bin(bitShiftRight('Hello', 40));  --A blank line
SELECT 'FixedString VectorConst';
SELECT 7 as shift_right_bit,fixedStr as arg,bin(bitShiftRight(fixedStr, 7)) as fixed_string_res FROM test_bit_shift_right_string_integer;
SELECT 8 as shift_right_bit,fixedStr as arg,bin(bitShiftRight(fixedStr, 8)) as fixed_string_res FROM test_bit_shift_right_string_integer;

SELECT bin(bitShiftRight('Hello', 40));  --A blank line
SELECT 'String ConstVector';
SELECT id as shift_right_bit,'Hello' as arg,bin(bitShiftRight('Hello', id)) as string_res FROM test_bit_shift_right_string_integer;
SELECT id as shift_right_bit,'Hel' as arg,bin(bitShiftRight('Hel', id)) as string_res FROM test_bit_shift_right_string_integer WHERE id <= 8 * 3;

SELECT bin(bitShiftRight('Hello', 40));  --A blank line
SELECT 'FixedString ConstVector';
SELECT id as shift_right_bit,toFixedString('Hello', 10) as arg,bin(bitShiftRight(toFixedString('Hello', 10), id)) as fixed_string_res FROM test_bit_shift_right_string_integer;
SELECT id as shift_right_bit,toFixedString('Hel', 10) as arg,bin(bitShiftRight(toFixedString('Hel', 10), id)) as fixed_string_res FROM test_bit_shift_right_string_integer;

DROP TABLE IF EXISTS test_bit_shift_right_string_integer;
