> On Thu, Jan 9, 2025 at 9:27 PM Ryo Kanbayashi <kanbayashi....@gmail.com> > wrote: > > > On 2025/01/09 20:34, Ryo Kanbayashi wrote: > > > Dear Tom, Fujii-san, Kuroda-san, > > > > > > I saw comments of yours and recognized that better fix is below. > > > > > > - Fix of first attached patch which does not change warning message > > > > > > And I created patch entry of commitfest :) > > > https://commitfest.postgresql.org/52/5497/ > > > > > > What should I do additionally? > > > Do I need to write patches for current supporting versions? (12.x - 17.x) > > > > Testing the patch across all supported versions would be helpful. > > If adjustments are needed for specific versions, creating separate > > patches for those would also be appreciated. Since v12 is no longer > > supported, back-patching to it isn't necessary. > > thanks. > I try these :) > > > BTW, regarding the discussion on the list, please avoid top-posting; > > bottom-posting is the preferred style on this mailing list. > > I understand. > I'll be careful from now on :) > > (Please Ignore: I attach renamed patch file for updating patch file on > commitfest system)
I wrote a patch for release v13 - v17 additionally and tested it for each release branch :) As a result, two patch is needed for this fix. copy_from_stdin_no_warning_for_master3.patch -> patch for master branch copy_from_stdin_no_warning_for_stables.patch -> patch for v13 - v17 check_patches.sh -> utility script for testing above two patches on each target branches patch_checking_note_cf.txt -> checking result by check_patches.sh and etc other files -> files which are needed for testing with check_patches.sh [commitfest entry] https://commitfest.postgresql.org/52/5497/ It would be helpful if someone could review patches I wrote :) -- Best regards, Ryo Kanbayashi https://github.com/ryogrid
ryo@DESKTOP-IOASPN6:~/work/postgres$ uname -a Linux DESKTOP-IOASPN6 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ryo@DESKTOP-IOASPN6:~/work/postgres$ gcc --version gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ryo@DESKTOP-IOASPN6:~/work/postgres$ bison --version bison (GNU Bison) 3.5.1 Written by Robert Corbett and Richard Stallman. Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ryo@DESKTOP-IOASPN6:~/work/postgres$ lex --version flex 2.6.4 ryo@DESKTOP-IOASPN6:~/work/postgres$ perl --version This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi (with 60 registered patches, see perl -V for more detail) Copyright 1987-2019, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. ryo@DESKTOP-IOASPN6:~/work/postgres$ bash check_patches.sh ------------------------------ Checking branch: master ------------------------------ [HEAD] commit ca87c415e2fccf81cec6fd45698dde9fae0ab570 Author: Peter Eisentraut <pe...@eisentraut.org> Date: Sat Jan 11 10:45:17 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_master3.patch patching file src/interfaces/ecpg/preproc/ecpg.addons [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch master. Cleaning up... Branch master checks complete. Moving on. ------------------------------ Checking branch: REL_13_STABLE ------------------------------ [HEAD] commit 84b8f6d9f59aa2d40ffb8edccb3f1eacff32b6c0 Author: Daniel Gustafsson <dgustafs...@postgresql.org> Date: Fri Jan 10 22:02:58 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_stables.patch patching file src/interfaces/ecpg/preproc/ecpg.addons [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch REL_13_STABLE. Cleaning up... Branch REL_13_STABLE checks complete. Moving on. ------------------------------ Checking branch: REL_14_STABLE ------------------------------ [HEAD] commit 83ffb9f20f06120273304332594b7fab159f738f Author: Daniel Gustafsson <dgustafs...@postgresql.org> Date: Fri Jan 10 22:02:58 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_stables.patch patching file src/interfaces/ecpg/preproc/ecpg.addons Hunk #1 succeeded at 248 (offset 14 lines). [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch REL_14_STABLE. Cleaning up... Branch REL_14_STABLE checks complete. Moving on. ------------------------------ Checking branch: REL_15_STABLE ------------------------------ [HEAD] commit 830215a4c8879dbed6aeec2ae67be050ec9b7d60 Author: Daniel Gustafsson <dgustafs...@postgresql.org> Date: Fri Jan 10 22:02:58 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_stables.patch patching file src/interfaces/ecpg/preproc/ecpg.addons Hunk #1 succeeded at 248 (offset 14 lines). [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch REL_15_STABLE. Cleaning up... Branch REL_15_STABLE checks complete. Moving on. ------------------------------ Checking branch: REL_16_STABLE ------------------------------ [HEAD] commit c35bbdfbc0d30fee6037b7859501b68b28d68c34 Author: Daniel Gustafsson <dgustafs...@postgresql.org> Date: Fri Jan 10 22:02:58 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_stables.patch patching file src/interfaces/ecpg/preproc/ecpg.addons Hunk #1 succeeded at 248 (offset 14 lines). [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch REL_16_STABLE. Cleaning up... Branch REL_16_STABLE checks complete. Moving on. ------------------------------ Checking branch: REL_17_STABLE ------------------------------ [HEAD] commit 8ed9bf0a3217c5fb18e9bba43a655b0a947f6f36 Author: Daniel Gustafsson <dgustafs...@postgresql.org> Date: Fri Jan 10 22:02:58 2025 +0100 Applying patch: ./copy_from_stdin_no_warning_for_stables.patch patching file src/interfaces/ecpg/preproc/ecpg.addons Hunk #1 succeeded at 248 (offset 14 lines). [Confirmation 1] Start building... Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1 Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1 [Confirmation 2] Running regression tests... [Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc [Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc All checks passed on branch REL_17_STABLE. Cleaning up... Branch REL_17_STABLE checks complete. Moving on. All branches have been checked successfully!
copy_from_stdin_no_warning_for_master3.patch
Description: Binary data
copy_from_stdin_no_warning_for_stables.patch
Description: Binary data
#!/usr/bin/env bash # -------------------------------------- # This script checks multiple branches for certain conditions. # It is meant to be run within a git repository. # -------------------------------------- # list of branches to check. # "master" and "REL_13_STABLE" through "REL_17_STABLE". BRANCHES=( "master" "REL_13_STABLE" "REL_14_STABLE" "REL_15_STABLE" "REL_16_STABLE" "REL_17_STABLE" ) MASTER_PATCH_FILE="./copy_from_stdin_no_warning_for_master3.patch" STABLES_PATCH_FILE="./copy_from_stdin_no_warning_for_stables.patch" # mapping from branch to patch file path. declare -A PATCH_FILES=( ["master"]="$MASTER_PATCH_FILE" ["REL_13_STABLE"]="$STABLES_PATCH_FILE" ["REL_14_STABLE"]="$STABLES_PATCH_FILE" ["REL_15_STABLE"]="$STABLES_PATCH_FILE" ["REL_16_STABLE"]="$STABLES_PATCH_FILE" ["REL_17_STABLE"]="$STABLES_PATCH_FILE" ) # -------------------------------------- # other constants. # -------------------------------------- SHOULD_BE_WARNED_PGC_SOURCE="copy_from_should_be_warned.pgc" SHOULD_NOT_BE_WARNED_PGC_SOURCE="copy_from_ok.pgc" # -------------------------------------- # commands for confirmation checks. # -------------------------------------- # Confirmation 1: Two-step build commands (only check the exit code of the second one). BUILD_CMD_1="./configure --enable-cassert --enable-tap-tests --prefix=$HOME/work/postgres/local_install >/dev/null 2>&1" BUILD_CMD_2="make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1" # Confirmation 2: Regression test command. REGRESSION_TEST_CMD="make check >/dev/null 2>&1" # Confirmation 3: The command line whose output must match a hard-coded string. CMD_LINE_1="./local_install/bin/ecpg $SHOULD_BE_WARNED_PGC_SOURCE" EXPECTED_OUTPUT_FOR_CMD_LINE_1=" COPY FROM STDIN is not implemented" # Confirmation 4: The command line which should produce no output at all. CMD_LINE_2="./local_install/bin/ecpg $SHOULD_NOT_BE_WARNED_PGC_SOURCE" # -------------------------------------- # Function to apply patch # -------------------------------------- apply_patch() { local patch_file_path="$1" # Apply the patch with patch -p0 < "patch_file_path" if [[ -f "$patch_file_path" ]]; then echo "Applying patch: $patch_file_path" patch -p1 < "$patch_file_path" if [[ $? -ne 0 ]]; then echo "Error: Failed to apply patch $patch_file_path" exit 1 fi else echo "Error: Patch file not found ($patch_file_path)" exit 1 fi } # -------------------------------------- # Main processing # -------------------------------------- for branch in "${BRANCHES[@]}"; do echo "------------------------------" echo "Checking branch: $branch" echo "------------------------------" # 1) Checkout the branch # ------------------------------ # Switch to the branch we want to check. git checkout "$branch" >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "Error: Failed to check out branch $branch" exit 1 fi echo "[HEAD]" git log | head -n 3 # 2) Apply the patch corresponding to this branch # ------------------------------ apply_patch "${PATCH_FILES[$branch]}" # 3) Confirmation 1: Two-step build (check exit code of the second command) # ------------------------------ echo "[Confirmation 1] Start building..." echo " Running: $BUILD_CMD_1" eval "$BUILD_CMD_1" echo " Running: $BUILD_CMD_2" eval "$BUILD_CMD_2" if [[ $? -ne 0 ]]; then echo "Error: Build command (second step) failed on branch $branch." exit 1 fi # 4) Confirmation 2: Regression test command # ------------------------------ echo "[Confirmation 2] Running regression tests..." cd src/interfaces/ecpg eval "$REGRESSION_TEST_CMD" if [[ $? -ne 0 ]]; then echo "Error: Regression test failed on branch $branch." exit 1 fi cd ../../.. # 5) Confirmation 3: check output of warning needed execution # ------------------------------ echo "[Confirmation 3] Checking output for command: $CMD_LINE_1" OUTPUT_1="$($CMD_LINE_1 2>&1)" CUTED_OUTPUT_1=$(echo "${OUTPUT_1}" | cut -d':' -f4) if [[ "$CUTED_OUTPUT_1" != "$EXPECTED_OUTPUT_FOR_CMD_LINE_1" ]]; then echo "Error: Output mismatch for $CMD_LINE_1 on branch $branch." echo " Expected: $EXPECTED_OUTPUT_FOR_CMD_LINE_1" echo " Got: $CUTED_OUTPUT_1" exit 1 fi # 6) Confirmation 4: check output of no warning needed execution # ------------------------------ echo "[Confirmation 4] Checking no output for command: $CMD_LINE_2" OUTPUT_2="$($CMD_LINE_2 2>&1)" if [[ -n "$OUTPUT_2" ]]; then echo "Error: Command $CMD_LINE_2 produced unexpected output on branch $branch." echo " Output was: $OUTPUT_2" exit 1 fi # 7) If we reach here, all confirmations passed for this branch. # Then clean up and ensure no local modifications. # ------------------------------ echo "All checks passed on branch $branch. Cleaning up..." make distclean >/dev/null 2>&1 # Ensure no local modifications remain (so next branch starts clean). git reset --hard HEAD >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "Error: Failed to reset branch $branch to a clean state." exit 1 fi echo "Branch $branch checks complete. Moving on." done echo "All branches have been checked successfully!" exit 0
copy_from_should_be_warned.pgc
Description: Binary data
copy_from_ok.pgc
Description: Binary data