[BUG FIX] Uninitialized var fargtypes used.

2019-11-11 Thread Ranier Vilela
Hi, Can anyone check this bug fix? Thanks. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\event_trigger.c Mon Sep 30 17:06:55 2019 +++ event_trigger.c Mon Nov 11 13:52:35 2019 @@ -171,7 +171,7 @@ HeapTuple tuple; Oid funcoid

RE: [PATCH] Improve AtSubCommit_childXids

2019-11-13 Thread Ranier Vilela
if (s->childXids != NULL) // Check null pointer! pfree(s->childXids); /* We must reset these to avoid double-free if fail later in commit */ s->childXids = NULL; // ever set to 0 s->nChildXids = 0; // ever set to 0 s->ma

[PATCH] Improve AtSubCommit_childXids

2019-11-13 Thread Ranier Vilela
Xids" is > 0, naturally. That way we can improve the function and avoid calling and setting unnecessarily! Bonus: silent compiler warning potential null pointer derenferencing. Best regards, Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\transam\xact.cMon Sep 30 17:06:55

[PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
Hi, ExecClearTuple don't check por NULL pointer arg and according TupIsNull slot can be NULL. Can anyone check this buf fix? --- \dll\postgresql-12.0\a\backend\executor\nodeUnique.cMon Sep 30 17:06:55 2019 +++ nodeUnique.cTue Nov 12 09:54:34 2019 @@ -74,7 +74,8 @@

RE: [BUG FIX] Uninitialized var fargtypes used.

2019-11-12 Thread Ranier Vilela
] = {InvalidOid}; /* dummy */ Oid evtowner = GetUserId(); ListCell *lc; List *tags = NULL; De: Michael Paquier Enviado: terça-feira, 12 de novembro de 2019 03:31 Para: Ranier Vilela Cc: pgsql-hackers@lists.postgresql.org Assunto: Re: [BUG FIX] Uninitialized var

RE: [PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
2 more possible cases, envolving ExecClearTuple: nodeFunctionscan.c and nodeWindowAgg.c Best regards, Ranier Vilela De: Daniel Gustafsson Enviado: terça-feira, 12 de novembro de 2019 13:43 Para: Ranier Vilela Cc: PostgreSQL Hackers Assunto: Re: [PATCH

[PATCH][BUG FIX] Potential uninitialized vars used.

2019-11-12 Thread Ranier Vilela
Hi, Var TargetEntry *tle; Have several paths where can it fail. Can anyone check this bug fix? --- \dll\postgresql-12.0\a\backend\parser\parse_expr.c Mon Sep 30 17:06:55 2019 +++ parse_expr.cTue Nov 12 12:43:07 2019 @@ -349,6 +349,7 @@

[PATCH][BUG FIX] Unsafe access pointers.

2019-11-15 Thread Ranier Vilela
Hi, Last time, I promise. It's probably not happening, but it can happen, I think. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\brin\brin_validate.c Mon Sep 30 17:06:55 2019 +++ brin_validate.c Fri Nov 15 08:14:58 2019 @@ -57,8 +57,10 @@ /* Fetch opclass

RE: [PATCH][BUG FIX] Unsafe access pointers.

2019-11-15 Thread Ranier Vilela
Hi, Thank you for the explanation. Best regards. Ranier Vilela De: Daniel Gustafsson Enviado: sexta-feira, 15 de novembro de 2019 11:58 Para: Ranier Vilela Cc: pgsql-hackers@lists.postgresql.org Assunto: Re: [PATCH][BUG FIX] Unsafe access pointers

[PATCH][BUG FIX] Pointer arithmetic with NULL

2019-11-22 Thread Ranier Vilela
Hi, Pointer addition with NULL, is technically undefined behavior. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\transam\xlog.cMon Sep 30 17:06:55 2019 +++ xlog.c Fri Nov 22 13:57:17 2019 @@ -1861,7 +1861,7 @@ { Assert

[PATCH][BUG FIX] Pointer var initilialized with boolean.

2019-11-22 Thread Ranier Vilela
Hi, Typo mystake? Pointer var initilialized with boolean. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\trigger.c Mon Sep 30 17:06:55 2019 +++ trigger.c Fri Nov 22 14:20:56 2019 @@ -2536,7 +2536,7 @@ TupleTableSlot *slot

[PATCH][BUG FIX] Uninitialized variable parsed

2019-11-22 Thread Ranier Vilela
Hi, Typo mystake? Memset only fill a pointer size, not the size of struct. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\rmgrdesc\xactdesc.c Mon Sep 30 17:06:55 2019 +++ xactdesc.c Fri Nov 22 13:40:13 2019 @@ -35,7 +35,7 @@ { char *data = ((char

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
(ERRCODE_SYNTAX_ERROR), errmsg("conflicting or redundant options"), parser_errposition(pstate, defel->location))); best regards. Ranier Vilela

[PATCH] Tiny optmization or is a bug?

2019-11-22 Thread Ranier Vilela
Hi, Maybe this is a real bug. The assignment has no effect, or forget dereferencing it? Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\lockcmds.c Mon Sep 30 17:06:55 2019 +++ lockcmds.c Fri Nov 22 18:45:01 2019 @@ -285,7 +285,7 @@ LockViewRecurse_walker

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
Hi, Redudant because he it's been dereferenced here: line 3410: cstate = BeginCopy(pstate, true, rel, NULL, InvalidOid, attnamelist, options); Best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 22:05 Para

[PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
Hi, Maybe it doesn't matter, but, I think it's worth discussing. The expression "if(pstate)" is redundant or is possible null dereference. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\copy.c Mon Sep 30 17:06:55 2019 +++ copy.c Fri Nov 22 18:

[PATCH] Tiny optimization.

2019-11-22 Thread Ranier Vilela
Hi, Remove redutant test. best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\executor\execExpr.c Mon Sep 30 17:06:55 2019 +++ execExpr.c Fri Nov 22 18:50:32 2019 @@ -2426,7 +2426,7 @@ { desc = parent->scandesc; - if (parent && pare

[BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

2019-11-22 Thread Ranier Vilela
Hi, This is real bug? firsttupleslot == NULL. \backend\executor\nodeGroup.c if (TupIsNull(firsttupleslot)) { outerslot = ExecProcNode(outerPlanState(node)); if (TupIsNull(outerslot)) { /* empty input, so

RE: [PATCH] Tiny optmization or a bug?

2019-11-22 Thread Ranier Vilela
Hi, I just wanted to help a little bit, sorry for the out balls. Maybe, I got one or two right. Anyway, thank you very much for your attention and patience. best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 23:25

RE: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

2019-11-22 Thread Ranier Vilela
Hi, Sorry, you are right. Had not seen this line: firsttupleslot = node->ss.ss_ScanTupleSlot; Best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 22:54 Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto:

RE: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

2019-11-22 Thread Ranier Vilela
erslot = ExecProcNode(outerPlanState(node)); if (TupIsNull(outerslot)) best regards. Ranier Vilela

[PATCH] Tiny optmization or a bug?

2019-11-22 Thread Ranier Vilela
Hi, Hi, Maybe this is a real bug. The assignment has no effect, or forget dereferencing it? Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\optimizer\plan\initsplan.c Mon Sep 30 17:06:55 2019 +++ initsplan.c Fri Nov 22 19:48:42 2019 @@ -1718,7 +1718,7

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-09 Thread Ranier Vilela
De: Kyotaro Horiguchi Enviado: segunda-feira, 9 de dezembro de 2019 03:40 >The file-scoped variable is needed to be process-persistent in any >way. If we inhibit them, the upper-modules need to create the >persistent area instead, for example, by calling XLogInitGlobals() or >such, which makes

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-08 Thread Ranier Vilela
es >and I really appreciate it, so later tonight I'll try to come >back, split your patch for you as described, add an entry to >the commitfest if you haven't already, and mark myself as a >reviewer. I appreciate your help. >Thanks again for the hard work and the patch! You are welcome. regards, Ranier Vilela -- Mark Dilger

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-08 Thread Ranier Vilela
ld be a better choice? Or maybe >make the local variables be all-lower-case "redorecptr", which would >fit well in context in places like pRedoRecPtr, It's perfect for me. regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-06 Thread Ranier Vilela
har **synchronous_commit backend/commands/subscriptioncmds.c global var declared here: /include/access/xact.h(82) One question, is it better to submit the patch on this topic, or create a new one? regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-09 Thread Ranier Vilela
>I'll create the commitfest entry based on this email once >this has been sent. Can you add the patch attached? regards, Ranier Vilela diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 8b2a2be1c0..e12f41cea4 100644 --- a/src/backend/repli

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-09 Thread Ranier Vilela
This the second version of the global unshadow patch. Taking into consideration made. In case anyone else revises. regards Ranier Vileladiff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6bc1a6b46d..83be23d77b 100644 --- a/src/backend/access/transam/xlog.c

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-10 Thread Ranier Vilela
New version the global patch, with the considerations. Unfortunately WalReceiverConn cannot be used because it is currently the typedef name for the structure. I switched to WalReceiverConnection, it was long but it looks good. RedoRecPtr proper name has no consensus yet, so it was still

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-10 Thread Ranier Vilela
this alone. Ok. In such cases, it doesn't hurt today. But for future reasons, it would be better to fix everything, imo. >As before: let's rename the file-level static instead. "sentPtr" is not >a good name. gsent_Ptr or pg_sentPtr? regards, Ranier Vilela

RE: [PATCH] Memory leak, at src/common/exec.c

2019-12-16 Thread Ranier Vilela
-existing functions, and seeks to correctly emulate the functioning of the POSIX setenv, but has not yet been tested. If this work is not acceptable then it is finished. And two memory leaks and a possible access beyond heap bounds, reported and not fixed. regards, Ranier Vilela [1] https

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-16 Thread Ranier Vilela
correct at least part of an extensive work. Best regards, Ranier Vilela

RE: [PATCH] Windows port add support to BCryptGenRandom

2019-12-16 Thread Ranier Vilela
De: Michael Paquier Enviadas: Terça-feira, 17 de Dezembro de 2019 03:43 Para: Ranier Vilela Cc: pgsql-hackers@lists.postgresql.org Assunto: Re: [PATCH] Windows port add support to BCryptGenRandom >And looking at this page, it is said that the minimum version >supported by this function is W

RE: [PATCH] Memory leak, at src/common/exec.c

2019-12-16 Thread Ranier Vilela
rror prone, better replace by setenv. As a result, set_pglocale_pgservice, is much simpler and more readable. regards, Ranier Vilela diff --git a/src/common/exec.c b/src/common/exec.c index 92dc3134a1..82e94b4df1 100644 --- a/src/common/exec.c +++ b/src/common/exec.c @@ -72,14 +72,15 @@ validate_exec(

RE: Windows port minor fixes

2019-12-17 Thread Ranier Vilela
sted. The Dr.Memory, reported 3794 potential unaddressable access at WIN32 block, pipe_read_line function, wich call validade_exec. Best regards, Ranier Vilela

RE: [PATCH] Windows port add support to BCryptGenRandom

2019-12-17 Thread Ranier Vilela
itional use of BCryptGenRandom. Best regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-11 Thread Ranier Vilela
the changes beyond "let's just change these to be different >to avoid shadowing globals" isn't really a good way to go about >addressing these cases and has a good chance of making things more >confusing, not less. This is totally contrary to what I think about it. regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-11 Thread Ranier Vilela
New version the global patch unshadow. * names more consistent and readable. * without big changes. * goal,, unshadow all global variables, only, even the simplest. regards, Ranier Vilela diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6bc1a6b46d

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-11 Thread Ranier Vilela
pose, in my opinion, are consistent, readable and break nothing. >I agree with fixing collisions, but not in a rote way like this. Glad you think alike about fixing collisions. regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-11 Thread Ranier Vilela
rpet. And that is absolutely what I want. >From your point of view and from John, the fact that the compiler warns us of >the dangers of collisions is much better than simply turning them off by >renaming them. Seeing that, I have to accept. 1.So I would like to ask you if at least what has consensus could be used. Or is it better to leave everything as it is? 2.About local shadow variables, would you find it safe to do redundant declaration removals of the type: int i? Is it worth it to work on that? Best regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-05 Thread Ranier Vilela
e in Unix environment, because there are so many cases. -Wshadow with GCC can show the alerts. >It might be a good idea to>try to clean up some/many cases of shadowed >>variables, though. Interested in submitting the msvc 2017 report? Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-06 Thread Ranier Vilela
ing the name. If it was to use the global variable, it will affect the behavior of the function, I believe. regards, Ranier Vilela

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-07 Thread Ranier Vilela
This is the first part of the variable shadow fixes. Basically it consists of renaming the variables in collision with the global ones, with the minimum change in the semantics. make check pass all the tests. regards, Ranier Vileladiff --git a/src/backend/access/transam/xlog.c

[Proposal] Level4 Warnings show many shadow vars

2019-12-03 Thread Ranier Vilela
Level3 level, development is no longer checking and correcting shadow variables. Any comments? Best regards, Ranier Vilela

Windows port minor fixes

2019-12-16 Thread Ranier Vilela
Hi, According to microsoft documentation at: https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom The function CryptGenRandom is deprecated, and may can be removed in future release. Considering that postgres only supports windows versions that have the new API,

[PATCH] Windows port add support to BCryptGenRandom

2019-12-16 Thread Ranier Vilela
Hi, According to microsoft documentation at: https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom The function CryptGenRandom is deprecated, and may can be removed in future release. This patch add support to use BCryptGenRandom. BCryptGenRandom apparently works

[PATCH] Memory leak, at src/common/exec.c

2019-12-16 Thread Ranier Vilela
Hi, On exec.c, have two memory leaks, and a possible access beyond heap bounds, the patch tries to fix them. According to documentation at: https://en.cppreference.com/w/c/experimental/dynamic/strdup "The returned pointer must be passed to free to avoid a memory leak. " regards, Ranier

RE: [PATCH] Windows port add support to BCryptGenRandom

2019-12-16 Thread Ranier Vilela
Forget Mkvcbuild_v1.patch regards, Ranier Vileladiff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 275f3bb699..33dc9bf5ad 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -65,7 +65,7 @@ my @frontend_uselibpgcommon = ( my $frontend_extralibs

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-10 Thread Ranier Vilela
ber of days. >Please at least be consistent within the patch itself. I'm trying. regards, Ranier Vilela

RE: [PATCH] Remove twice assignment with var pageop (nbtree.c).

2019-11-26 Thread Ranier Vilela
Same case on nbtpage.c at line 1637, with var opaque. make check, passed all 195 tests here with all commits. Ranier Vileladiff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 268f869a36..144fefccad 100644 --- a/src/backend/access/nbtree/nbtpage.c +++

[PATCH] Remove twice assignment with var pageop (nbtree.c).

2019-11-26 Thread Ranier Vilela
Hi, The var pageop has twice assigment, maybe is a mistake? The assigned in the line 593, has no effect? Ranier Vileladiff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index 44f6283950..29c7b41c8c 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++

RE: [PATCH] Style: fix function declaration

2019-11-24 Thread Ranier Vilela
kers, haven't been good. Ask questions, about the code, have not had good acceptance.. Best regards. Ranier Vilela

RE: [PATCH] Possible arithmetic with NULL pointer or test "stack_base_ptr != NULL" is irrelevant.

2019-11-24 Thread Ranier Vilela
>In practice, this code >works fine on every platform that Postgres is ever likely to support, >so I see no need to change it. Of course, I trust your judgment. Thank you for the review. Best regards, Ranier Vilela

RE: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

2019-11-24 Thread Ranier Vilela
>Could you please at least take the time to produce a patch that actually >applies properly? Yes of course. Thank you. Ranier Vilela

RE: [PATCH] Fix possible underflow in expression (maxoff - 1)

2019-11-24 Thread Ranier Vilela
member this hidden danger. > Sanitization needs to happen at some central choke point. Surely that would be the best solution. But this is not a function of a static analysis tool. >I strongly suggest confining all of this to a single thread, and >stating your reasoning upfront. I don't know what that means. Best regards. Ranier Vilela

RE: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

2019-11-24 Thread Ranier Vilela
>I have not tested your patch, but it looks right to me. Thanks for review. Best regards. Ranier Vilela

RE: [PATCH] Fix possible underflow in expression (maxoff - 1)

2019-11-24 Thread Ranier Vilela
here are you getting this stuff from? Are you using a static analysis tool? Yes,two static tools, but reviewed by me. Best regards. Ranier Vilela -- Peter Geoghegan

[PATCH] Fix possible underflow in expression (maxoff - 1)

2019-11-24 Thread Ranier Vilela
Hi, The var OffsetNumber maxoff it's like uint16, see at include/storage/off.h typedef uint16 OffsetNumber; Within the function _bt_afternewitemoff, at line 641, maxoff is used in an dangerous expression, without protection.: (maxoff - 1) The function: PageGetMaxOffsetNumber that initializes

[PATCH] Style, remove redudant test "if (zeropadlen > 0)"

2019-11-24 Thread Ranier Vilela
Hi, The test "if (zeropadlen > 0)" is redundant and can be salely removed. It has already been tested in the same path. Best regards, Ranier Vilela --- \dll\postgresql\a\port\snprintf.c 2019-11-23 13:19:20.0 -0300 +++ snprintf.c 2019-11-24 13:02:45.510806400 -0300 @@ -122

[PATCH] Fix possible string overflow with sscanf (xlog.c)

2019-11-25 Thread Ranier Vilela
Hi, I know it's very hard, but is possible. Just someone with the knowledge to do. Here a proof of concept: #include #include #define MAXPGPATH 256 int main(int argc, char ** argv) { chartbsoid[MAXPGPATH]; charstr[MAXPGPATH]; int

RE: [Incident report]Backend process crashed when executing 2pc transaction

2019-11-28 Thread Ranier Vilela
;_vstart" buffer, is not multiple size of the type long. Maybe it's filling more than it should. Ranier Vilela

[PATCH] Fix var declaration according scanf specification,

2019-11-24 Thread Ranier Vilela
Hi, According to specification of scanf: %x argument must be unsigned. http://www.cplusplus.com/reference/cstdio/scanf/ I think that sscanf must follow scanf specification. Best regards. Ranier Vilela --- \dll\postgresql\a\backend\utils\adt\mac.c 2019-11-23 13:19:20.0 -0300 +++ mac.c

[PATCH] Style: fix function declaration

2019-11-24 Thread Ranier Vilela
Hi, Fix function declaration . Best regards, Ranier Vilela --- \dll\postgresql\a\backend\utils\adt\mac8.c 2019-11-23 13:19:20.0 -0300 +++ mac8.c 2019-11-24 09:41:34.200458700 -0300 @@ -35,7 +35,7 @@ #define lobits(addr) \ ((unsigned long)(((addr)->e<<24) | ((add

[PATCH] Possible arithmetic with NULL pointer or test "stack_base_ptr != NULL" is irrelevant.

2019-11-24 Thread Ranier Vilela
is relevant, substraction with NULL pointer is technically,undefined behavior.. Best regards. Ranier Vilela --- \dll\postgresql\a\backend\tcop\postgres.c 2019-11-23 13:19:20.0 -0300 +++ postgres.c 2019-11-24 11:13:34.131437500 -0300 @@ -3303,7 +3303,10 @@ /* * Compute di

RE: [PATCH] Windows port add support to BCryptGenRandom

2019-12-18 Thread Ranier Vilela
about: 1. This break MingW? 2. Legacy API, have to stay? 3. Perl support, pgbench specifically. If legacy API, have to stay, I have no doubt that it needs to be guarded by conditionals. Best regards, Ranier Vilela 1.

RE: [Proposal] Level4 Warnings show many shadow vars

2019-12-18 Thread Ranier Vilela
in this case, >something which could be more adapted is to remove the argument from >usage() because progname is a global variable, initialized from the >beginning in pg_restore. Yeah, this is good hint about how improve the patch. Best regards, Ranier Vilela

RE: [PATCH] Fix possible underflow in expression (maxoff - 1)

2019-12-18 Thread Ranier Vilela
f latches, it would be a warning that something is not good in the patch. Unfortunately, that would not show where in the code the problem would be. regards, Ranier Vilela

RE: [PATCH] Remove twice assignment with var pageop (nbtree.c).

2019-12-19 Thread Ranier Vilela
decent compiler, will remove, maybe, msvc not, but that's another story... Best regards, Ranier Vilela

[PATCH] Fix expressions always false

2019-12-19 Thread Ranier Vilela
dex is declared long. . Comparison with int limits is always false. 4. src/backend/utils/adt/network.c ip_addrsize is macro and awlays return 4 or 16 regards, Ranier Vilela diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index dbed597816..f0ad9f23e5 100

Re: [PATCH] Fix expressions always false

2019-12-19 Thread Ranier Vilela
platforms than just Windows. Thank you for point me, about this. regards, Ranier Vilela Em qui., 19 de dez. de 2019 às 20:58, Dagfinn Ilmari Mannsåker < ilm...@ilmari.org> escreveu: > Ranier Vilela writes: > > > More about expressions always false. > > 2. src/ba

RE: Windows port minor fixes

2019-12-18 Thread Ranier Vilela
is replying to. I can't tell if it's me doing something wrong or if live outlook can't organize it the right way. Anyway, I will switch to gmail, ranier...@gmail.com, to see if it looks better. regards, Ranier Vilela

Re: [PATCH] libpq improvements and fixes

2020-02-13 Thread Ranier Vilela
Em qua., 12 de fev. de 2020 às 22:25, Tom Lane escreveu: > Ranier Vilela writes: > > Coverity detected a dead code in the src / interfaces / libpq / fe-auth.c > > file, to correct it, a simplification was made and the oom_error goto was > > removed, since it is clea

Re: Postgres 32 bits client compilation fail. Win32 bits client is supported?

2020-02-10 Thread Ranier Vilela
Em seg., 10 de fev. de 2020 às 10:53, Craig Ringer escreveu: > On Mon, 10 Feb 2020 at 20:14, Ranier Vilela wrote: > > > > "adminpack.obj : error LNK2019: sφmbolo externo indefinido > _Int64GetDatum referenciado na funτπo _pg_file_write > [C:\dll\postgres\adminp

[REPORT] Possible Memory Leak Postgres Windows

2020-02-29 Thread Ranier Vilela
Hi, I'm sending this report from DrMemory, which shows some leaks from the current postgres. DrMemory is it is a reliable tool, but it is not perfect. ( https://drmemory.org/) regards, Ranier Vilela Dr. Memory version 2.2.0 build 1 built on Jul 1 2019 00:42:20 Windows version: WinVer=105;Rel

Re: Broken resetting of subplan hash tables

2020-03-01 Thread Ranier Vilela
a waste if possible, resetting it. By analogy, I have code with arrays where, I reuse them, with only one line, instead of reconstructing them. a->nelts = 0; / * reset array * / If possible, doing the same for hashtables would be great. regards, Ranier Vilela

Re: [PATCH] Windows port, fix some resources leaks

2020-01-21 Thread Ranier Vilela
ehand. The free function with variable NULL, has no effect and can be called without problems. 7. /src/backend/libpq/auth.c In case of failure, it was necessary to release the handlers properly. regards, Ranier Vilela postmaster_resource_leak.patch Description: Binary data win32_shmem_resource_leak.p

Re: [PATCH] Windows port, fix some resources leaks

2020-01-24 Thread Ranier Vilela
Em sex., 24 de jan. de 2020 às 04:13, Michael Paquier escreveu: > On Wed, Jan 22, 2020 at 05:51:51PM -0300, Ranier Vilela wrote: > > After review the patches and build all and run regress checks for each > > patch, those are the ones that don't break. > > There is some

Re: [PATCH] Windows port, fix some resources leaks

2020-01-24 Thread Ranier Vilela
Last time improvement to restricted_token.c regards, Ranier Vilela restricted_token_leaks.patch Description: Binary data

Re: [PATCH] Windows port, fix some resources leaks

2020-01-28 Thread Ranier Vilela
ybe it didn't bother anyone, because the Windows port is much less used. Anyway, I believe that freeing the memory before returning false, will not bring down the service, changing the patch to LOG, instead of FATAL. The primary error of the patch was to use FATAL. regards, Ranier Vilela

Re: [PATCH] Windows port, fix some resources leaks

2020-01-28 Thread Ranier Vilela
end/port/win32_shmem.c. On line 575 in src / backend / port / win32_shmem.c, there is a comment that tells to not use FATAL. "Don't use FATAL since we're running in the postmaster." regards, Ranier Vilela

Postgres 32 bits client compilation fail. Win32 bits client is supported?

2020-02-07 Thread Ranier Vilela
ostgres \ src \ tools \ msvc / Mkvcbuild.pm line 842. Question: Will Postgres continue to support 32-bit client? regards, Ranier Vilela

[PATCH] /src/backend/access/transam/xlog.c, tiny improvements

2020-01-24 Thread Ranier Vilela
. 3. At function KeepLogSeg (line 9357) the test if (slotSegNo <= 0), the var slotSegNo is uint64 and not can be < 0. As it is a critical file, even though small, these improvements, I believe are welcome, because they improve readability. regards, Ranier Vilela xlog.patch Description:

Re: [PATCH] Windows port, fix some resources leaks

2020-01-27 Thread Ranier Vilela
Em dom., 26 de jan. de 2020 às 23:04, Michael Paquier escreveu: > On Fri, Jan 24, 2020 at 09:37:25AM -0300, Ranier Vilela wrote: > > Em sex., 24 de jan. de 2020 às 04:13, Michael Paquier < > mich...@paquier.xyz> > > escreveu: > >> There is some progress. You sho

Re: [PATCH] /src/backend/access/transam/xlog.c, tiny improvements

2020-01-27 Thread Ranier Vilela
Em dom., 26 de jan. de 2020 às 23:48, Mark Dilger < mark.dil...@enterprisedb.com> escreveu: > > On Jan 24, 2020, at 12:48 PM, Ranier Vilela wrote: > > > > 3. At function KeepLogSeg (line 9357) the test if (slotSegNo <= 0), the > var slotSegNo is uint64 and not can

Re: Postgres 32 bits client compilation fail. Win32 bits client is supported?

2020-02-10 Thread Ranier Vilela
, i will have to live with 32 bits clients for a long time yet. I still have customers using Windows XP yet ... best regards, Ranier Vilela

[PATCH] libpq improvements and fixes

2020-02-12 Thread Ranier Vilela
. It makes more sense to do the basic checks, only to start communicating with the server afterwards. These changes are passing the regression tests and are in use in libpq.dll, used in production by my customers. regards, Ranier Vilela libpq.patch Description: Binary data

Re: [PATCH] libpq improvements and fixes

2020-02-14 Thread Ranier Vilela
Em sex., 14 de fev. de 2020 às 03:13, Michael Paquier escreveu: > On Thu, Feb 13, 2020 at 02:22:36PM -0300, Ranier Vilela wrote: > > I just kept it, even if I duplicated the error message, the style was > kept > > and in my opinion it is much more coherent and readable. >

Re: Postgres 32 bits client compilation fail. Win32 bits client is supported?

2020-02-11 Thread Ranier Vilela
Em ter., 11 de fev. de 2020 às 18:08, Andrew Dunstan < andrew.duns...@2ndquadrant.com> escreveu: > > On 2/10/20 7:13 AM, Ranier Vilela wrote: > > > > > > Unfortunately, i will have to live with 32 bits clients for a long > > time yet. > > I

[PATCH] Windows port, fix some resources leaks

2020-01-19 Thread Ranier Vilela
Hi, greetings everyone. Continuing the process of improving windows port, I'm trying to fix some leaks. best regards, Ranier Vilela win_resource_leak.patch Description: Binary data

[PATCH] Windows port, fix some missing locks

2020-01-19 Thread Ranier Vilela
Hi, Two possible race condition found. 1. src\backend\port\win32\signal.c (line 82) The var "pg_signal_queue", is accessed eleswhere with lock. 2. src\backend\postmaster\syslogger.c The var "rotation_requested" is accessed elsewhere with lock. regards, Ranier Vilela win

Re: [PATCH] src\backend\utils\adt\numeric.c copy and past error

2020-01-19 Thread Ranier Vilela
Hi, Yes, but the comment it does not clarify that the return of the variable "const_one" is intentional, instead of "const_zero". Anybody with reads the source, can think which is a copy and paste mistake. regards Ranier Vilela Em dom., 19 de jan. de 2020 às 21:22, Tom Lane

[PATCH] src\backend\utils\adt\numeric.c copy and past error

2020-01-19 Thread Ranier Vilela
Hi, Possible copy and past error, found in numeric.c. I believe I believe that the author's intention was to return const_zero. regards, Ranier Vilela numeric.patch Description: Binary data

Re: [PATCH] Windows port, fix some resources leaks

2020-01-22 Thread Ranier Vilela
Hi, After review the patches and build all and run regress checks for each patch, those are the ones that don't break. Not all leaks detected by Coverity are fixed. regards, Ranier Vilela auth_leak.patch Description: Binary data logging_leaks.patch Description: Binary data

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-15 Thread Ranier Vilela
Em qua., 15 de abr. de 2020 às 15:28, Juan José Santamaría Flecha < juanjo.santama...@gmail.com> escreveu: > > > On Wed, Apr 15, 2020 at 4:46 PM Ranier Vilela wrote: > >> Em qua., 15 de abr. de 2020 às 03:08, davinder singh < >> davindersingh2...@gmail.com&

Re: [PATCH'] Variables assigned with values that is never used.

2020-04-16 Thread Ranier Vilela
Em sáb., 28 de mar. de 2020 às 10:33, Ranier Vilela escreveu: > Hi, > > Theses variables, are assigned with values that never is used and, can > safely have their values removed. > 1. https://github.com/postgres/postgres/commit/f0ca378d4c139eda99ef14998115c1674dac3fc5 diff --gi

[PATCH] Tiny optimization on nbtinsert.c

2020-04-16 Thread Ranier Vilela
Hi, Avoiding some calls and set vars, when it is not necessary. best regards, Ranier Vilela nbtinsert_tiny_optimization.patch Description: Binary data

[PATCH] Fix possible overflow on tuplesort.c

2020-04-16 Thread Ranier Vilela
Hi, When multiplying variables, the overflow will take place anyway, and only then will the meaningless product be explicitly promoted to type int64. It is one of the operands that should have been cast instead to avoid the overflow. regards, Ranier Vilela

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-18 Thread Ranier Vilela
en = wcslen(test_locale); + if (GetLocaleInfoEx(pStr, LOCALE_SENGLISHCOUNTRYNAME, + test_locale + len, LOCALE_NAME_MAX_LENGTH - len) > 0) + { + WCHAR **argv = (WCHAR **) lparam; + + if (wcsncmp(argv[0], test_locale, len) == 0) + { + wcscpy(argv[1], pStr); + return FALSE; + } + } + } + return TRUE; +} regards, Ranier Vilela

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-19 Thread Ranier Vilela
able. > > The attached results (WindowsNLSLocales.ods) come from Windows 10 (1903) > and Visual C++ build 1924, 64-bit. > > On Sat, Apr 18, 2020 at 1:43 PM Ranier Vilela wrote: > >> I have some observations about this patch, related to style, if you will >> allow m

Re: PG compilation error with Visual Studio 2015/2017/2019

2020-04-21 Thread Ranier Vilela
is found for a locale with the format * _. * The order for search locale is essential: * Find LCType first as LOCALE_SNAME, if not found try LOCALE_SENGLISHLANGUAGENAME and * finally LOCALE_SENGLISHCOUNTRYNAME, before return. */ Typo "enumarating". 2. Maybe the fail has here: if (hyphen == NULL || underscore == NULL) Change || to &&, the logical is wrong? 3. Why iso_lc_messages[0] = '\0'? If we go call strchr, soon after, it's a waste. regards, Ranier Vilela

  1   2   3   4   5   6   7   8   9   >