[patches] [PATCH 1/7] collation: introduce coll_is_case_sensitive function
Konstantin Osipov
kostja at tarantool.org
Thu Mar 29 17:29:08 MSK 2018
* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [18/02/28 22:41]:
> It is needed in SQL to get column meta.
>
> Needed for #2620
>
> Signed-off-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
> ---
> src/box/coll.c | 7 +++++++
> src/box/coll.h | 8 ++++++++
> 2 files changed, 15 insertions(+)
How does JDBC define case-sensitive? Are you sure
accent-insesitive collation is still case sensitive in JDBC terms?
Writing this down in a comment for this function (a rationale for
it) would be nice.
This is OK to push assuming you need this flag for JDBC.
I even believe the patch is already pushed.
>
> diff --git a/src/box/coll.c b/src/box/coll.c
> index 97e1c306e..e0c9ee143 100644
> --- a/src/box/coll.c
> +++ b/src/box/coll.c
> @@ -233,6 +233,13 @@ coll_icu_destroy(struct coll *coll)
> ucol_close(coll->icu.collator);
> }
>
> +bool
> +coll_is_case_sensitive(const struct coll *coll)
> +{
> + UCollationStrength strength = ucol_getStrength(coll->icu.collator);
> + return strength != UCOL_SECONDARY && strength != UCOL_PRIMARY;
> +}
> +
> /**
> * Create a collation by definition.
> * @param def - collation definition.
> diff --git a/src/box/coll.h b/src/box/coll.h
> index aa0e4c01a..f171e582c 100644
> --- a/src/box/coll.h
> +++ b/src/box/coll.h
> @@ -78,6 +78,14 @@ struct coll {
> char name[0];
> };
>
> +/**
> + * Return true, if a collation is case sensitive.
> + * @param coll Collation to check.
> + * @retval Case sensitivity.
> + */
> +bool
> +coll_is_case_sensitive(const struct coll *coll);
> +
> /**
> * Create a collation by definition.
> * @param def - collation definition.
> --
> 2.14.3 (Apple Git-98)
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list