[patches] [PATCH 1/7] collation: introduce coll_is_case_sensitive function
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Wed Feb 28 22:36:48 MSK 2018
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(+)
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)
More information about the Tarantool-patches
mailing list