Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix compiler warnings due to new checks in PostgreSQL 16 #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2022
Merged

Conversation

MarinaPolyakova
Copy link

See the commit 0fe954c28584169938e5c0738cfaa9930ce77577 (Add -Wshadow=compatible-local to the standard compilation flags) in PostgreSQL 16.

src/ruminsert.c: In function ‘rumHeapTupleBulkInsert’:
src/ruminsert.c:533:51: warning: declaration of ‘attr’ shadows a previous local [-Wshadow=compatible-local]
  533 |                                 Form_pg_attribute attr = RumTupleDescAttr(
      |                                                   ^~~~
src/ruminsert.c:505:27: note: shadowed declaration is here
  505 |         Form_pg_attribute attr = buildstate->rumstate.addAttrs[attnum - 1];
      |                           ^~~~
src/rumget.c: In function ‘startScanEntry’:
src/rumget.c:635:41: warning: declaration of ‘page’ shadows a previous local [-Wshadow=compatible-local]
  635 |                         Page            page;
      |                                         ^~~~
src/rumget.c:548:25: note: shadowed declaration is here
  548 |         Page            page;
      |                         ^~~~
src/rumget.c: In function ‘entryGetNextItemList’:
src/rumget.c:1054:33: warning: declaration of ‘page’ shadows a previous local [-Wshadow=compatible-local]
 1054 |                 Page            page;
      |                                 ^~~~
src/rumget.c:986:25: note: shadowed declaration is here
  986 |         Page            page;
      |                         ^~~~

See the commit 0fe954c28584169938e5c0738cfaa9930ce77577 (Add
-Wshadow=compatible-local to the standard compilation flags) in PostgreSQL 16.

src/ruminsert.c: In function ‘rumHeapTupleBulkInsert’:
src/ruminsert.c:533:51: warning: declaration of ‘attr’ shadows a previous local
[-Wshadow=compatible-local]
  533 |                                 Form_pg_attribute attr =
RumTupleDescAttr(
      |                                                   ^~~~
src/ruminsert.c:505:27: note: shadowed declaration is here
  505 |         Form_pg_attribute attr = buildstate->rumstate.addAttrs[attnum
- 1];
      |                           ^~~~
src/rumget.c: In function ‘startScanEntry’:
src/rumget.c:635:41: warning: declaration of ‘page’ shadows a previous local
[-Wshadow=compatible-local]
  635 |                         Page            page;
      |                                         ^~~~
src/rumget.c:548:25: note: shadowed declaration is here
  548 |         Page            page;
      |                         ^~~~
src/rumget.c: In function ‘entryGetNextItemList’:
src/rumget.c:1054:33: warning: declaration of ‘page’ shadows a previous local
[-Wshadow=compatible-local]
 1054 |                 Page            page;
      |                                 ^~~~
src/rumget.c:986:25: note: shadowed declaration is here
  986 |         Page            page;
      |                         ^~~~
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #115 (702d215) into stable (884bd51) will increase coverage by 8.96%.
The diff coverage is 100.00%.

❗ Current head 702d215 differs from pull request most recent head 43465cb. Consider uploading reports for the commit 43465cb to get more accurate results

@@            Coverage Diff             @@
##           stable     #115      +/-   ##
==========================================
+ Coverage   44.76%   53.73%   +8.96%     
==========================================
  Files          33       29       -4     
  Lines       12033     9419    -2614     
==========================================
- Hits         5387     5061     -326     
+ Misses       6646     4358    -2288     
Impacted Files Coverage Δ
src/rumget.c 88.05% <ø> (ø)
src/ruminsert.c 86.92% <100.00%> (ø)
src/rum_ts_utils.c 87.81% <0.00%> (-0.15%) ⬇️
src/rumsort.c 87.68% <0.00%> (-0.09%) ⬇️
src/rumutil.c 86.89% <0.00%> (-0.04%) ⬇️
pg_bin/include/postgresql/server/postgres.h 100.00% <0.00%> (ø)
pg_bin/include/postgresql/server/nodes/pg_list.h 100.00% <0.00%> (ø)
pg_bin/include/postgresql/server/access/tableam.h 100.00% <0.00%> (ø)
src/tuplesort14.c
pg_bin/include/postgresql/server/common/hashfn.h
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kovdb75
Copy link
Contributor

kovdb75 commented Nov 21, 2022

Probably some changes (vanilla changes?) caused the test "test array" to fail (see Travis CI result).
Can we fix this test in current task or we should create a new one?

@kovdb75
Copy link
Contributor

kovdb75 commented Nov 22, 2022

I'll ask developers about travis-ci.

@kovdb75 kovdb75 merged commit 7e641a8 into stable Nov 22, 2022
@MarinaPolyakova
Copy link
Author

Thank you! I reproduced this problem manually on the previous commit 884bd51 with REL_15_BETA1:

diff -U3 /home/marina/rum/expected/array.out /home/marina/rum/results/array.out
--- /home/marina/rum/expected/array.out	2022-11-21 14:11:54.423452310 +0300
+++ /home/marina/rum/results/array.out	2022-11-22 13:55:19.820341443 +0300
@@ -527,10 +527,10 @@
 SELECT * FROM test_array WHERE i && '{1}' ORDER BY add_info <=> '2016-05-16 14:21:25' LIMIT 10;
      i     |         add_info         
 -----------+--------------------------
- {1}       | Thu May 19 14:21:25 2016
- {1,2}     | Fri May 20 14:21:25 2016
- {1,2,3}   | Sat May 21 14:21:25 2016
  {1,2,3,4} | Sun May 22 14:21:25 2016
+ {1,2,3}   | Sat May 21 14:21:25 2016
+ {1,2}     | Fri May 20 14:21:25 2016
+ {1}       | Thu May 19 14:21:25 2016
 (4 rows)
 
 DROP INDEX idx_array;

BTW IMO it's better to check rum with REL_15_1 or REL_15_STABLE..

@sokolcati sokolcati deleted the PGPRO-7444 branch October 29, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants