diff --git a/test/engine/replica_join.result b/test/engine/replica_join.result index 73d82ab7f366a992189087f91b65dd922b0b91b9..aab48022bcec40ec7ae2f2ada7c3132eccbc8b3f 100644 --- a/test/engine/replica_join.result +++ b/test/engine/replica_join.result @@ -31,6 +31,12 @@ space2 = box.schema.space.create('test2', { id = 99998, engine = engine}) _ = space2:create_index('primary', { parts = {1, 'unsigned', 2, 'string'}}) --- ... +space3 = box.schema.space.create('test3', { id = 99997, engine = engine}) +--- +... +_ = space3:create_index('primary', { parts = {{1, 'string', collation = 'unicode_s1'}}}) +--- +... box.snapshot() --- - ok @@ -59,6 +65,14 @@ box.space.test.index.secondary:select() --- - [] ... +box.space.test2:select() +--- +- [] +... +box.space.test3:select() +--- +- [] +... test_run:cmd('switch default') --- - true @@ -89,6 +103,24 @@ _ = box.space.test2:upsert({2, 'test2', 20}, {{'=', 3, 20}}) _ = box.space.test2:insert{3, 'test3', 30} --- ... +_ = box.space.test3:insert{'Ðж'} +--- +... +_ = box.space.test3:insert{'ель'} +--- +... +_ = box.space.test3:insert{'Юла'} +--- +... +_ = box.space.test3:insert{'Ðль'} +--- +... +_ = box.space.test3:insert{'ёлка'} +--- +... +_ = box.space.test3:insert{'йогурт'} +--- +... -- replica join test_run:cmd("deploy server replica") --- @@ -149,6 +181,15 @@ box.space.test2:select() - [2, 'test2', 20] - [3, 'test3', 30] ... +box.space.test3:select() +--- +- - ['Ðж'] + - ['ёлка'] + - ['ель'] + - ['йогурт'] + - ['Ðль'] + - ['Юла'] +... test_run:cmd('switch default') --- - true @@ -225,6 +266,15 @@ box.space.test2:select() - [2, 'test2', 20] - [3, 'test3', 30] ... +box.space.test3:select() +--- +- - ['Ðж'] + - ['ёлка'] + - ['ель'] + - ['йогурт'] + - ['Ðль'] + - ['Юла'] +... test_run:cmd('switch default') --- - true @@ -252,6 +302,15 @@ _ = box.space.test2:update({2, 'test2'}, {{'+', 3, 2}}) _ = box.space.test2:delete{3, 'test3'} --- ... +_ = box.space.test3:upsert({'ёж', 123}, {{'!', 2, 123}}) +--- +... +_ = box.space.test3:update('ÐЛЬ', {{'!', 2, 456}}) +--- +... +_ = box.space.test3:delete('ёлка') +--- +... box.snapshot() --- - ok @@ -299,6 +358,14 @@ box.space.test2:select() - - [1, 'test1', 11] - [2, 'test2', 22] ... +box.space.test3:select() +--- +- - ['Ðж', 123] + - ['ель'] + - ['йогурт'] + - ['Ðль', 456] + - ['Юла'] +... test_run:cmd('switch default') --- - true @@ -323,6 +390,10 @@ _ = space:create_index('primary', { type = index}) _ = space:insert{12345} --- ... +-- truncate space +space3:truncate() +--- +... -- replica join test_run:cmd("deploy server replica") --- @@ -352,6 +423,10 @@ box.space.test2:select() - - [1, 'test1', 11] - [2, 'test2', 22] ... +box.space.test3:select() +--- +- [] +... test_run:cmd('switch default') --- - true @@ -369,6 +444,9 @@ space:drop() space2:drop() --- ... +space3:drop() +--- +... box.snapshot() --- - ok diff --git a/test/engine/replica_join.test.lua b/test/engine/replica_join.test.lua index 0fe78536279b61b0f717f8a381ee028e29ee9310..cf151cac1d653f043dd7c12970f9ee4ae6e491d0 100644 --- a/test/engine/replica_join.test.lua +++ b/test/engine/replica_join.test.lua @@ -9,6 +9,8 @@ _ = space:create_index('primary', { type = index}) _ = space:create_index('secondary', { type = index, unique = false, parts = {2, 'unsigned'}}) space2 = box.schema.space.create('test2', { id = 99998, engine = engine}) _ = space2:create_index('primary', { parts = {1, 'unsigned', 2, 'string'}}) +space3 = box.schema.space.create('test3', { id = 99997, engine = engine}) +_ = space3:create_index('primary', { parts = {{1, 'string', collation = 'unicode_s1'}}}) box.snapshot() -- replica join @@ -18,6 +20,8 @@ test_run:wait_lsn('replica', 'default') test_run:cmd('switch replica') box.space.test:select() box.space.test.index.secondary:select() +box.space.test2:select() +box.space.test3:select() test_run:cmd('switch default') test_run:cmd("stop server replica") _ = test_run:cmd("cleanup server replica") @@ -29,6 +33,12 @@ _ = box.space.test2:insert{1, 'test1', 1} _ = box.space.test2:upsert({1, 'test1', 10}, {{'=', 3, 10}}) _ = box.space.test2:upsert({2, 'test2', 20}, {{'=', 3, 20}}) _ = box.space.test2:insert{3, 'test3', 30} +_ = box.space.test3:insert{'Ðж'} +_ = box.space.test3:insert{'ель'} +_ = box.space.test3:insert{'Юла'} +_ = box.space.test3:insert{'Ðль'} +_ = box.space.test3:insert{'ёлка'} +_ = box.space.test3:insert{'йогурт'} -- replica join test_run:cmd("deploy server replica") @@ -38,6 +48,7 @@ test_run:cmd('switch replica') box.space.test:select() box.space.test.index.secondary:select() box.space.test2:select() +box.space.test3:select() test_run:cmd('switch default') test_run:cmd("stop server replica") _ = test_run:cmd("cleanup server replica") @@ -53,6 +64,7 @@ test_run:cmd('switch replica') box.space.test:select() box.space.test.index.secondary:select() box.space.test2:select() +box.space.test3:select() test_run:cmd('switch default') test_run:cmd("stop server replica") _ = test_run:cmd("cleanup server replica") @@ -63,6 +75,9 @@ for k = 9, 16 do box.space.test:delete(k) end _ = box.space.test2:upsert({1, 'test1', 11}, {{'+', 3, 1}}) _ = box.space.test2:update({2, 'test2'}, {{'+', 3, 2}}) _ = box.space.test2:delete{3, 'test3'} +_ = box.space.test3:upsert({'ёж', 123}, {{'!', 2, 123}}) +_ = box.space.test3:update('ÐЛЬ', {{'!', 2, 456}}) +_ = box.space.test3:delete('ёлка') box.snapshot() -- replica join @@ -73,6 +88,7 @@ test_run:cmd('switch replica') box.space.test:select() box.space.test.index.secondary:select() box.space.test2:select() +box.space.test3:select() test_run:cmd('switch default') test_run:cmd("stop server replica") _ = test_run:cmd("cleanup server replica") @@ -82,6 +98,8 @@ space:drop() space = box.schema.space.create('test', { id = 12345, engine = engine }) _ = space:create_index('primary', { type = index}) _ = space:insert{12345} +-- truncate space +space3:truncate() -- replica join test_run:cmd("deploy server replica") @@ -91,12 +109,14 @@ test_run:cmd('switch replica') box.space.test.id box.space.test:select() box.space.test2:select() +box.space.test3:select() test_run:cmd('switch default') test_run:cmd("stop server replica") _ = test_run:cmd("cleanup server replica") space:drop() space2:drop() +space3:drop() box.snapshot() space = box.schema.space.create('test', { id = 99998, engine = engine })