OSDN Git Service

Use pg_strcasecmp instead of strcasecmp for the sake of portability
authorArthur Zakirov <z-arthur@yandex.ru>
Thu, 2 Nov 2017 13:00:09 +0000 (16:00 +0300)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Mon, 6 Nov 2017 05:08:18 +0000 (14:08 +0900)
Back patched to branches PG93-96 and PG10.

pg_hint_plan.c

index 3469500..7069e3c 100644 (file)
@@ -1655,7 +1655,7 @@ parse_hints(HintState *hstate, Query *parse, const char *str)
                        char   *keyword = parser->keyword;
                        Hint   *hint;
 
-                       if (strcasecmp(buf.data, keyword) != 0)
+                       if (pg_strcasecmp(buf.data, keyword) != 0)
                                continue;
 
                        hint = parser->create_func(head, keyword, parser->hint_keyword);
@@ -2468,9 +2468,9 @@ ParallelHintParse(ParallelHint *hint, HintState *hstate, Query *parse,
        if (length == 3)
        {
                const char *modeparam = (const char *)list_nth(name_list, 2);
-               if (strcasecmp(modeparam, "hard") == 0)
+               if (pg_strcasecmp(modeparam, "hard") == 0)
                        force_parallel = true;
-               else if (strcasecmp(modeparam, "soft") != 0)
+               else if (pg_strcasecmp(modeparam, "soft") != 0)
                {
                        hint_ereport(modeparam,
                                                 ("enforcement must be soft or hard: %s",