Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja.osipov@gmail.com>
To: tarantool-patches@freelists.org
Cc: "n.pettik" <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 1/2] sql: derive collation for built-in functions
Date: Mon, 11 Mar 2019 11:04:58 +0300	[thread overview]
Message-ID: <20190311080458.GE3101@chai> (raw)
In-Reply-To: <cc7727e6-2421-a417-35c7-beeea01cd6a4@tarantool.org>

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/03/07 17:44]:
> It contradicts with your way of collation return. If PSQL states
> that collation is a part of string-like type, then it is
> possible to implement a function doing something like this:
> 
>     function my_func()
>         if (rand() % 2 == 0) then
>             return 'abc' collate 'unicode_ci';
>         return 'abc' collate 'unicode';
>     end;
> 
> (I do not know PSQL syntax - the code above is pseudo- ).

It would be impossible in SQL/PSM, since a function return value
is strictly typed, so there would be a type error or automatic
coercion to return type collation.

> As I see, now we have no runtime defined collations at all -
> all of them are known during compilation. Struct Mem, storing
> function return value, even has no collation member. I guess,
> we can not implement runtime collations now.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2019-03-11  8:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 18:01 [tarantool-patches] [PATCH 0/2] Add collation to built-in funcs and fix HAVING clause with aggregate Nikita Pettik
2019-02-21 18:01 ` [tarantool-patches] [PATCH 1/2] sql: derive collation for built-in functions Nikita Pettik
2019-02-25 12:58   ` [tarantool-patches] " Vladislav Shpilevoy
2019-02-25 18:32     ` n.pettik
2019-03-07 14:40       ` Vladislav Shpilevoy
2019-03-11  8:04         ` Konstantin Osipov [this message]
2019-02-21 18:01 ` [tarantool-patches] [PATCH 2/2] sql: fix code generation for aggregate in HAVING clause Nikita Pettik
2019-02-25 12:58   ` [tarantool-patches] " Vladislav Shpilevoy
2019-02-25 18:33     ` n.pettik
2019-03-04 12:14       ` n.pettik
2019-03-04 12:52         ` Vladislav Shpilevoy
2019-03-07 14:40 ` [tarantool-patches] Re: [PATCH 0/2] Add collation to built-in funcs and fix HAVING clause with aggregate Vladislav Shpilevoy
2019-03-11 15:49 ` 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=20190311080458.GE3101@chai \
    --to=kostja.osipov@gmail.com \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 1/2] sql: derive collation for built-in 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