diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua index 6db1c3f36734bbe6dd4a999da2860b91c752adc2..77241b831c5cf0fbed3ae3a2c0086144de395f12 100644 --- a/src/box/lua/schema.lua +++ b/src/box/lua/schema.lua @@ -521,6 +521,9 @@ local function update_index_parts(space_id, parts) elseif k == 'collation' then -- find ID by name local coll = box.space._collation.index.name:get{v} + if not coll then + coll = box.space._collation.index.name:get{v:lower()} + end if not coll then box.error(box.error.ILLEGAL_PARAMS, "options.parts[" .. i .. "]: collation was not found by name '" .. v .. "'") diff --git a/test/box/misc.result b/test/box/misc.result index b202d493d7daa29ee9046afceb1c6e2e14897871..5616c01ad9ff0606958c2b2ffa355242ac65c6e9 100644 --- a/test/box/misc.result +++ b/test/box/misc.result @@ -1001,3 +1001,22 @@ test_run:grep_log("default", "password") --- - password ... +-- some collation test +s = box.schema.space.create('test') +--- +... +not not s:create_index('test1', {parts = {{1, 'string', collation = 'Unicode'}}}) +--- +- true +... +not not s:create_index('test2', {parts = {{2, 'string', collation = 'UNICODE'}}}) +--- +- true +... +not not s:create_index('test3', {parts = {{3, 'string', collation = 'UnIcOdE'}}}) -- I'd prefer to panic on that +--- +- true +... +s:drop() +--- +... diff --git a/test/box/misc.test.lua b/test/box/misc.test.lua index 8dc8da8191815d81bb56d8e237ec4f79707e7a3b..c3d515454a6bdc840336d13fc1e6ab19e302d94c 100644 --- a/test/box/misc.test.lua +++ b/test/box/misc.test.lua @@ -272,3 +272,10 @@ test_run:cmd("clear filter") -- test test_run:grep_log() require('log').info('Incorrect password supplied') test_run:grep_log("default", "password") + +-- some collation test +s = box.schema.space.create('test') +not not s:create_index('test1', {parts = {{1, 'string', collation = 'Unicode'}}}) +not not s:create_index('test2', {parts = {{2, 'string', collation = 'UNICODE'}}}) +not not s:create_index('test3', {parts = {{3, 'string', collation = 'UnIcOdE'}}}) -- I'd prefer to panic on that +s:drop() diff --git a/test/engine/iterator.result b/test/engine/iterator.result index 29b2e332c668aa15b0419fb5009818204163610b..58f2abce7220f4bf978d29518f191e85615b7e25 100644 --- a/test/engine/iterator.result +++ b/test/engine/iterator.result @@ -4211,7 +4211,7 @@ s:replace{35} ... state, value = gen(param,state) --- -- error: 'builtin/box/schema.lua:955: usage: next(param, state)' +- error: 'builtin/box/schema.lua:958: usage: next(param, state)' ... value ---