std::string get_duckdb_collation(const CHARSET_INFO *cs, std::string &warn_msg)
{ /* DuckDB stores all strings as UTF-8 internally and uses ICU for collationsupport.ThesourceMariaDBcharsetdoesnotmatter— onlythecollationbehavior(case/accentsensitivity)isrelevant.
Map using CHARSET_INFO flags which work for any charset. */
/* _bin Collation */ if (cs->state & MY_CS_BINSORT) return COLLATION_BINARY;
/* utf8mb3_tolower_ci is _as_ci actually */ if (cs->state & MY_CS_LOWER_SORT) return COLLATION_NOCASE;
/* In MariaDB levels_for_order is a bitmask of weight levels: bit0(primary)-alwaysset bit1(secondary)-accentsensitivity bit2(tertiary)-casesensitivity
DuckDB only distinguishes case and accent, so map accordingly. */ bool accent_sensitive=
cs->levels_for_order & (1 << MY_CS_LEVEL_BIT_SECONDARY); bool case_sensitive= cs->levels_for_order & (1 << MY_CS_LEVEL_BIT_TERTIARY);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.