Date: Fri, 7 Sep 2018 01:55:11 +1200 From: Thomas Munro <munro@ip9.org> To: freebsd-hackers@freebsd.org Subject: Tracking CLDR version in collation definitions Message-ID: <CADLWmXWY0doSQ-7uoBC0JUzCgZTx9iw-k_viYWB7ze8Pi7R8gw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--000000000000638e370575343de6 Content-Type: text/plain; charset="UTF-8" Hello FreeBSD hackers, An occasional problem run into by PostgreSQL users (and probably other database-like systems) is that collation definitions change and on-disk indexes become corrupted. This was one motivation for PostgreSQL to adopt optional support for ICU, and to track ucol_getVersion() and detect when it changes so that the user can be warned that dependent indexes need to be rebuilt. However, for various reason many users prefer to use the OS collation support, which remains the default, and PostgreSQL supports both ways. I'd like to be able to track collation definition versions for libc collations too. There doesn't currently seem to be a good way to do that. Am I missing something? Here's the idea I had: 1. Add a new option -V to localedef(1) so that an arbitrary version string can be stored in some spare space in the header of LC_COLLATE files. 2. Add a new libc function: const char *querylocaleversion(int mask, locale_t locale). 3. Modify the perl scripts under tools/tools/locale/tools/... to invoke localedef(1) either with a version set by the maintainer in unicode.conf (eg "30.0.3"), or perhaps extracted from CLDR data files directly. I've attached a proof-of-concept patch which has a very rough implementation of steps 1 and 2. It probably needs better bounds checking, more thought about how to report lack of version string ("" or NULL?), and other details. Before doing any further work on that I thought I'd check if people think the idea has legs, or knows of an existing way to get this information. I also considered less invasive approaches to detect collation changes: using a checksum (ie program needs to know how to find the LC_COLLATE files), or using the FreeBSD version on the basis that collations should only change when the base system is upgraded (generating false positives). I don't really like those approaches much. I'd be grateful for any feedback, flames etc. Thanks, Thomas Munro --000000000000638e370575343de6 Content-Type: application/octet-stream; name="0001-Add-querylocaleversion.patch" Content-Disposition: attachment; filename="0001-Add-querylocaleversion.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jlqmkirr0 RnJvbSBhY2ExOTM2OTYyZTQyYzQyODYxYjk4Zjk5NmU5YzMyYmZiZDJhNzcyIE1vbiBTZXAgMTcg MDA6M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CX0KIApkaWZmIC0tZ2l0IGEvdXNyLmJpbi9s b2NhbGVkZWYvbG9jYWxlZGVmLmggYi91c3IuYmluL2xvY2FsZWRlZi9sb2NhbGVkZWYuaAppbmRl eCA0MzY3YTE5ZTJlOC4uNmNhNTBlMTk4ZjEgMTAwNjQ0Ci0tLSBhL3Vzci5iaW4vbG9jYWxlZGVm L2xvY2FsZWRlZi5oCisrKyBiL3Vzci5iaW4vbG9jYWxlZGVmL2xvY2FsZWRlZi5oCkBAIC01Myw2 ICs1Myw4IEBAIGV4dGVybiBpbnQgdW5kZWZvazsJLyogbW9zdGx5IGlnbm9yZSB1bmRlZmluZWQg c3ltYm9scyAqLwogZXh0ZXJuIGludCB3YXJub2s7CiBleHRlcm4gaW50IHdhcm5pbmdzOwogCitl eHRlcm4gY2hhciAqdmVyc2lvbjsKKwogaW50IHl5bGV4KHZvaWQpOwogdm9pZCB5eWVycm9yKGNv bnN0IGNoYXIgKik7CiBfTm9yZXR1cm4gdm9pZCBlcnJmKGNvbnN0IGNoYXIgKiwgLi4uKSBfX3By aW50Zmxpa2UoMSwgMik7Ci0tIAoyLjE4LjAKCg== --000000000000638e370575343de6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLWmXWY0doSQ-7uoBC0JUzCgZTx9iw-k_viYWB7ze8Pi7R8gw>