Skip to content

Commit 30527cc

Browse files
authored
Merge pull request IvorySQL#1190 from yasir-hussain-shah/fix/remove-v5-warnings
Fix/remove v5 warnings
2 parents c88f29a + b822be0 commit 30527cc

4 files changed

Lines changed: 15 additions & 16 deletions

File tree

src/backend/utils/adt/varlena.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3994,7 +3994,8 @@ SplitGUCList(char *rawstring, char separator,
39943994
char *new_name;
39953995

39963996
new_name = identifier_case_transform(curname, strlen(curname));
3997-
strncpy(curname, new_name, strlen(new_name));
3997+
memcpy(curname, new_name, strlen(new_name));
3998+
curname[strlen(new_name)] = '\0';
39983999
pfree(new_name);
39994000
}
40004001

src/bin/psql/common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,6 +2895,7 @@ ExecQueryUsingCursor(const char *query, double *elapsed_msec)
28952895
int flush_error;
28962896

28972897
*elapsed_msec = 0;
2898+
INSTR_TIME_SET_ZERO(before);
28982899

28992900
/* initialize print options for partial table output */
29002901
my_popt.topt.start_table = true;

src/pl/plisql/src/pl_package.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,12 +2730,13 @@ static void
27302730
plisql_remove_function_references(PLiSQL_function *func, PackageCacheItem *item)
27312731
{
27322732
PLiSQL_package *psource = (PLiSQL_package *) item->source;
2733-
int pre_len = list_length(psource->source.funclist);
27342733

2734+
if (!list_member_ptr(psource->source.funclist, func))
2735+
{
2736+
Assert(false);
2737+
return;
2738+
}
27352739
psource->source.funclist = list_delete_ptr(psource->source.funclist, (void *) func);
2736-
2737-
Assert(pre_len == list_length(psource->source.funclist) + 1);
2738-
27392740
psource->source.use_count--;
27402741

27412742
/*
@@ -3628,7 +3629,6 @@ plisql_subproc_should_change_return_type(FuncExpr *fexpr,
36283629
{
36293630
/* only one out-parameter, change the rettype to be out-parameter type */
36303631
ListCell *lc;
3631-
bool found = false;
36323632

36333633
foreach (lc, subprocfunc->arg)
36343634
{
@@ -3637,15 +3637,14 @@ plisql_subproc_should_change_return_type(FuncExpr *fexpr,
36373637
if (argitem->argmode == ARGMODE_OUT ||
36383638
argitem->argmode == ARGMODE_INOUT)
36393639
{
3640-
found = true;
36413640
result = true;
36423641
*rettype = argitem->type->typoid;
36433642
*typmod = argitem->type->atttypmod;
36443643
*collationoid = argitem->type->collation;
36453644
break;
36463645
}
36473646
}
3648-
Assert(found);
3647+
Assert(result);
36493648
}
36503649
return result;
36513650
}

src/pl/plisql/src/pl_subproc_function.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,6 @@ plisql_dynamic_compile_subproc(FunctionCallInfo fcinfo,
30243024
static void
30253025
plsql_init_glovalvar_from_stack(PLiSQL_execstate * estate, int dno, int *start_level)
30263026
{
3027-
bool match = false;
30283027
int connected;
30293028
PLiSQL_execstate *parestate;
30303029
PLiSQL_function *func;
@@ -3042,11 +3041,11 @@ plsql_init_glovalvar_from_stack(PLiSQL_execstate * estate, int dno, int *start_l
30423041
if (dno >= parestate->ndatums)
30433042
continue;
30443043
plisql_assign_in_global_var(estate, parestate, dno);
3045-
match = true;
30463044
*start_level = connected;
3047-
break;
3045+
3046+
return;
30483047
}
3049-
Assert(match);
3048+
Assert(false);
30503049
return;
30513050
}
30523051

@@ -3056,7 +3055,6 @@ plsql_init_glovalvar_from_stack(PLiSQL_execstate * estate, int dno, int *start_l
30563055
static void
30573056
plsql_assign_out_glovalvar_from_stack(PLiSQL_execstate * estate, int dno, int *start_level)
30583057
{
3059-
bool match = false;
30603058
int connected;
30613059
PLiSQL_execstate *parestate;
30623060
PLiSQL_function *func;
@@ -3075,10 +3073,10 @@ plsql_assign_out_glovalvar_from_stack(PLiSQL_execstate * estate, int dno, int *s
30753073
continue;
30763074
plisql_assign_out_global_var(estate, parestate, dno, connected);
30773075
*start_level = connected;
3078-
match = true;
3079-
break;
3076+
3077+
return;
30803078
}
3081-
Assert(match);
3079+
Assert(false);
30823080
return;
30833081
}
30843082

0 commit comments

Comments
 (0)