From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Ivan Koptelov <ivan.koptelov@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 2/2] sql: rename instr to position & add collation usage
Date: Thu, 28 Mar 2019 15:57:12 +0300 [thread overview]
Message-ID: <D4D9DBF6-BFF4-448C-A957-575A08284622@tarantool.org> (raw)
In-Reply-To: <A0804AF2-7C4E-492F-ACA8-515C6208F3C3@tarantool.org>
[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]
>>> +
>>> +-- Collation is set in space format and also in position() -
>>> +-- for both arguments. Arguments have different explicit
>>> +-- collations thus an error is expected.
>>> +
>>> +test:do_catchsql_test(
>>> + "position-1.75",
>>> + [[
>>> + CREATE TABLE test1 (s1 VARCHAR(5) PRIMARY KEY COLLATE "unicode_ci");
>>> + INSERT INTO test1 VALUES('à');
>>> + SELECT POSITION('a' COLLATE "unicode_ci", s1 COLLATE "unicode") FROM test1;
>>> + ]], {
>>> + 1, "Illegal mix of collations"
>>> + }
>>> +)
>>> +
>>> +test:do_catchsql_test(
>>> + "position-1.76",
>>> + [[
>>> + DROP TABLE test1;
>>> + CREATE TABLE test1 (s1 VARCHAR(5) PRIMARY KEY COLLATE "unicode_ci");
>>> + INSERT INTO test1 VALUES('qwèrty');
>>> + SELECT POSITION('er' COLLATE "unicode_ci", s1 COLLATE "unicode") FROM test1;
>>> + DROP TABLE test1;
>>> + ]], {
>>> + 1, "Illegal mix of collations"
>>> + }
>>> +)
>>> +
>>> +test:do_catchsql_test(
>>> + "position-1.77",
>>> + [[
>>> + DROP TABLE test1;
>>> + CREATE TABLE test1 (s1 VARCHAR(5) PRIMARY KEY COLLATE "unicode_ci");
>>> + INSERT INTO test1 VALUES('qwèrtÿ');
>>> + SELECT POSITION('Y' COLLATE "unicode_ci", s1 COLLATE "unicode") FROM test1;
>>> + ]], {
>>> + 1, "Illegal mix of collations"
>>> + }
>>> +)
>>
>> Add test cases on: explicitly set incompatible collations,
>> explicitly set compatible collations.
>>
>>
>
> Don’t we already have such tests? From the end of position.test.lua:
>
> -- Collation is set in space format and also in position() -
> -- for both arguments. Arguments have the same collations.
Oh, I meant ‘implicitly set’. Still can’t find such tests.
[-- Attachment #2: Type: text/html, Size: 6103 bytes --]
next prev parent reply other threads:[~2019-03-28 12:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 11:11 [tarantool-patches] [PATCH 0/2] sql: add better coll. determination & position func Ivan Koptelov
2019-03-20 11:11 ` [tarantool-patches] [PATCH 1/2] sql: add better collation determination in functions Ivan Koptelov
2019-03-25 19:26 ` [tarantool-patches] " n.pettik
2019-03-27 13:38 ` i.koptelov
2019-03-28 12:50 ` n.pettik
2019-03-28 14:08 ` i.koptelov
2019-03-29 9:57 ` n.pettik
2019-03-20 11:11 ` [tarantool-patches] [PATCH 2/2] sql: rename instr to position & add collation usage Ivan Koptelov
2019-03-20 12:59 ` [tarantool-patches] Re: [PATCH 1/2] " i.koptelov
2019-03-26 12:32 ` [tarantool-patches] Re: [PATCH 2/2] " n.pettik
2019-03-27 13:39 ` i.koptelov
2019-03-28 12:57 ` n.pettik [this message]
2019-04-01 14:15 ` [tarantool-patches] Re: [PATCH 0/2] sql: add better coll. determination & position func Kirill Yukhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D4D9DBF6-BFF4-448C-A957-575A08284622@tarantool.org \
--to=korablev@tarantool.org \
--cc=ivan.koptelov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH 2/2] sql: rename instr to position & add collation usage' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox