From 5a258d26896de0f47b08658dc8fa914ad453eeab Mon Sep 17 00:00:00 2001 From: Ash Blade <68803840+ashenBlade@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:19:10 +0300 Subject: [PATCH] Save 'strlen' value in variable (#270) --- columnar/src/backend/columnar/columnar_planner_hook.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/columnar/src/backend/columnar/columnar_planner_hook.c b/columnar/src/backend/columnar/columnar_planner_hook.c index 07097ba..a7a266a 100644 --- a/columnar/src/backend/columnar/columnar_planner_hook.c +++ b/columnar/src/backend/columnar/columnar_planner_hook.c @@ -408,11 +408,12 @@ static bool IsCreateTableAs(const char *query) { char *c, *t, *a; - char *haystack = (char *) palloc(strlen(query) + 1); - int16 i; + size_t query_len = strlen(query); + char *haystack = (char *) palloc(query_len + 1); + int32 i; /* Create a lower case copy of the string. */ - for (i = 0; i < strlen(query); i++) + for (i = 0; i < query_len; i++) { haystack[i] = tolower(query[i]); }