Skip to content

Conversation

@gfphoenix78
Copy link
Contributor

@gfphoenix78 gfphoenix78 commented Jul 26, 2024

When running ICW tests, the following command has a strange behavior.

psql ... <<EOF
$(cat prehook inputfile)
EOF

The command has an issue on some platforms that will input unexpected data stream to psql. For example, The following first line will become to the second line:
"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонка 10" int, "колонка 11" int,

"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонЀ�а 10" int, "колонка 11" int,

It's unknown why the input stream is changed. The other similar commands will have correct data stream to psql,
like

cat prehook inputfile | psql ...

or for a single input file

psql ... < inputfile

In this commit, we convert the original command to

psql ... -f prehook -f inputfile --ignore-log-file

The new option --ignore-log-file will ignore the logging prefix for psql and filename, so the program psql will log like no input filename is provided.

fix #482

Contributor's Checklist

Here are some reminders and checklists before/when submitting your pull request, please check them:

  • Make sure your Pull Request has a clear title and commit message. You can take git-commit template as a reference.
  • Sign the Contributor License Agreement as prompted for your first-time contribution(One-time setup).
  • Learn the coding contribution guide, including our code conventions, workflow and more.
  • List your communication in the GitHub Issues or Discussions (if has or needed).
  • Document changes.
  • Add tests for the change
  • Pass make installcheck
  • Pass make -C src/test installcheck-cbdb-parallel
  • Feel free to request cloudberrydb/dev team for review and approval when your PR is ready🥳

When running ICW tests, the following command has a strange behavior.
```shell
psql ... <<EOF
$(cat prehook inputfile)
EOF
```
The command has an issue on some platforms that will input
unexpected data stream to psql. For example, The following first
line will become to the second line:
`"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонка 10" int, "колонка 11" int,`

`"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонЀ�а 10" int, "колонка 11" int,`

It's unknown why the input stream is changed. The other similar
commands will have correct data stream to psql, like
`cat prehook inputfile | psql ...`
or for a single input file
`psql ... < inputfile`

In this commit, we convert the original command to
```shell
psql ... -f prehook -f inputfile --ignore-log-file
```

The new option `--ignore-log-file` will ignore the logging prefix
for psql and filename, so the program psql will log like no input
filename is provided.
@my-ship-it my-ship-it merged commit d7b5762 into apache:main Jul 29, 2024
foreyes pushed a commit to foreyes/cloudberrydb that referenced this pull request Sep 20, 2024
…che#535)

When running ICW tests, the following command has a strange behavior.
shell
psql ... <<EOF
$(cat prehook inputfile)
EOF

The command has an issue on some platforms that will input
unexpected data stream to psql. For example, The following first
line will become to the second line:
"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонка 10" int, "колонка 11" int,
"колонка 6" int, "колонка 7" int, "колонка 8" int, "колонка 9" int, "колонЀ�а 10" int, "колонка 11" int,

It's unknown why the input stream is changed. The other similar
commands will have correct data stream to psql, like
cat prehook inputfile | psql ...
or for a single input file
psql ... < inputfile

In this commit, we convert the original command to
shell
psql ... -f prehook -f inputfile --ignore-log-file

The new option --ignore-log-file will ignore the logging prefix
for psql and filename, so the program psql will log like no input
filename is provided.
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.

[Bug] [UOS1050a, UOS1060e] invalid byte sequence for encoding "UTF8": 0xba when create table

3 participants