Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>,
	Chris Sosnin <k.sosnin@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box: remove unicode_ci for functions
Date: Sun, 1 Dec 2019 15:36:02 +0100	[thread overview]
Message-ID: <13437800-f8ec-1964-f7d7-a01581e242ad@tarantool.org> (raw)
In-Reply-To: <20191130203439.GA23478@atlas>

Hi, thanks for the review!

On 30/11/2019 21:34, Konstantin Osipov wrote:
> * Chris Sosnin <k.sosnin@tarantool.org> [19/11/30 07:03]:
>> Unicode_ci collation breaks the general
>> rule for objects naming, so we remove it
>> in version 2.3.1
> 
> The code works according to RFC.
> 
> There is a justification for this behaviour in RFC.
> 
> 

Yeah, RFC is cool and all, but 'this is in an RFC' is not
a good justification, don't you think? Especially taking
into account, that this is our own RFC. It is not a
standard or something.

With Chris we did a little investigation, and here is what
we've found:

- The RFC does not explain why we need a case-insensitive
  index. This has nothing to do with conflicts. SQL always
  is and will be able to choose one name - the uppercased
  one;

- Despite the index is case insensitive, I still get an error
  when call a not uppercased function from SQL:

      box.cfg{}
      box.schema.func.create('func1', {language = 'Lua', is_deterministic = true,
                                       body = 'function(a) return a end',
                                       param_list = {'any'}, returns = 'string',
                                       exports = {'LUA', 'SQL'}})
      box.execute('SELECT func1(\'str\')')
      ---
      - null
      - Function 'FUNC1' does not exist
      ...

      box.execute('SELECT "func1"(\'str\')')
      ---
      - metadata:
        - name: '"func1"(''str'')'
          type: string
        rows:
        - ['str']
      ...

  As you can see, the index's case does not matter. It is
  insensitive, but I still need to write functions in a
  special register.

- Lua box.func.* is also case sensitive:

      tarantool> box.schema.func.create('func1')
      ---
      ...

      tarantool> box.schema.func.create('FUNC1')
      ---
      - error: Function 'FUNC1' already exists
      ...

      tarantool> box.func['FUNC1']
      ---
      - null
      ...

  The error message is really confusing. It says, that
  such a function already exists, but nonetheless I can't
  get it. This is ridiculous.

- As Peter said, _func behaves inconsistent with all the
  other system spaces.

- As Peter said, we did it just for SQL, but it affects
  non-SQL front ends. As you can see from the box.func.*
  example.

On the summary, this collation is clearly useless - its
case insensitivity does not help any of the listed problems.
Therefore, it is a bug.

I think the collation should be dropped.

  parent reply	other threads:[~2019-12-01 14:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 23:39 Chris Sosnin
2019-11-30 20:34 ` Konstantin Osipov
2019-12-01 14:12   ` k.sosnin
2019-12-01 14:36   ` Vladislav Shpilevoy [this message]
2019-12-02  7:07     ` Konstantin Osipov
2019-12-02 14:36       ` Nikita Pettik
2019-12-02 14:49         ` Konstantin Osipov
2019-12-06 11:42       ` Kirill Yukhin
2019-12-06 20:17         ` Konstantin Osipov
2019-12-09 11:06           ` Kirill Yukhin
2019-12-09 11:24             ` Konstantin Osipov
2019-12-09 13:25               ` Kirill Yukhin
2019-12-09 13:39                 ` Konstantin Osipov
2019-12-09 14:07                   ` Nikita Pettik
2019-12-09 23:09                   ` Vladislav Shpilevoy
2019-12-10  8:19                     ` Konstantin Osipov
2019-12-10 12:44                       ` 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=13437800-f8ec-1964-f7d7-a01581e242ad@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=k.sosnin@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: remove unicode_ci for functions' \
    /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