Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f90b1d

Browse files
committed
Use libc version as a collation version on glibc systems.
Using glibc's version number to detect potential collation definitionchanges is not 100% reliable, but it's better than nothing.Author: Thomas MunroReviewed-by: Peter EisentrautDiscussion:https://postgr.es/m/4b76c6d4-ae5e-0dc6-7d0d-b5c796a07e34%402ndquadrant.com
1 parentb8e19b9 commit9f90b1d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
#include<unicode/ucnv.h>
7171
#endif
7272

73+
#ifdef__GLIBC__
74+
#include<gnu/libc-version.h>
75+
#endif
76+
7377
#ifdefWIN32
7478
/*
7579
* This Windows file defines StrNCpy. We don't need it here, so we undefine
@@ -1499,7 +1503,7 @@ pg_newlocale_from_collation(Oid collid)
14991503
char*
15001504
get_collation_actual_version(charcollprovider,constchar*collcollate)
15011505
{
1502-
char*collversion;
1506+
char*collversion=NULL;
15031507

15041508
#ifdefUSE_ICU
15051509
if (collprovider==COLLPROVIDER_ICU)
@@ -1523,7 +1527,13 @@ get_collation_actual_version(char collprovider, const char *collcollate)
15231527
}
15241528
else
15251529
#endif
1526-
collversion=NULL;
1530+
if (collprovider==COLLPROVIDER_LIBC)
1531+
{
1532+
#if defined(__GLIBC__)
1533+
/* Use the glibc version because we don't have anything better. */
1534+
collversion=pstrdup(gnu_get_libc_version());
1535+
#endif
1536+
}
15271537

15281538
returncollversion;
15291539
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp