Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed Ubuntu 20.04 build issues and changed Travis CI to test builds on it#41

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
dura0ok wants to merge1 commit intopostgrespro:masterfromdura0ok:pg16-fixes

Conversation

dura0ok
Copy link

No description provided.

@dura0okdura0ok mentioned this pull requestAug 2, 2023
Copy link
Contributor

@esabolesabol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks fantastic!

Should@df7cb's commits to add support for PostgreSQL 16 be merged here or separately in PR#39?

I also recommend changing the title of the PR to something like "Fix Ubuntu 20.04 build issues and change Travis CI to test builds on it". It's long, but it's a better description.

dura0ok reacted with thumbs up emoji
@dura0okdura0ok changed the titleTry to fix travis tests.Fix Ubuntu 20.04 build issues and change Travis CI to test builds on itAug 2, 2023
@dura0ok
Copy link
Author

Looks fantastic!

Thank you!!

Should@df7cb's commits to add support for PostgreSQL 16 be merged here or separately in PR#39?

I think it question for@vitcpp

esabol reacted with thumbs up emoji

@df7cb
Copy link
Contributor

Either way is fine with me as long as PG16 gets fixed. :)

dura0ok reacted with thumbs up emoji

@vitcpp
Copy link
Contributor

@stepan-neretin7 thank you for the fix. Concerning cherry-pick, I would like to see@df7cb contribution in a separate PR because the current change is independent. I looked at the spheretrans_out and I see that it should be improved. I propose to use psprintf function or try to find some API functions in postgres core for building strings. Personally speaking, I do not like some magic constants to define the buffer size.

esabol reacted with thumbs up emoji

@esabol
Copy link
Contributor

Yeah, I agree with@vitcpp. So this PR should only include the change to the.travis.yml file to test on focal instead of bionic and whatever the correct fix is tospheretrans_out() insrc/output.c. Then, after this PR is merged, PR#39 can be rebased on master and merged.

@esabol
Copy link
Contributor

esabol commentedAug 4, 2023
edited
Loading

@vitcpp: Do you prefer the titles of the PRs to use past tense verbs or present tense verbs? There seems to be a mixture, but most PR titles seem to use past tense. If past tense is preferred, then the title of this PR should be changed to "Fixed Ubuntu 20.04 build issues and changed Travis CI to test builds on it" for consistency.

@vitcpp
Copy link
Contributor

@esabol I have no preferences concerning past or present tenses. I got used to using the past tense when I described what was done. If you advise me to use the present tense, I will accept it. Thank you.

esabol reacted with thumbs up emoji

Copy link
Contributor

@vitcppvitcpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Make this PR independent from PR#39. Try to improve, please, spheretrans_out function. Include only the fix in output.c please.

esabol reacted with thumbs up emoji
@esabol
Copy link
Contributor

@vitcpp wrote:

@esabol I have no preferences concerning past or present tenses. I got used to using the past tense when I described what was done. If you advise me to use the present tense, I will accept it. Thank you.

I have no preference other than consistency. Since most of the other PRs use past tense, I propose changing the title of this PR to "Fixed Ubuntu 20.04 build issues and changed Travis CI to test builds on it", but it's really no big deal.

@dura0okdura0ok changed the titleFix Ubuntu 20.04 build issues and change Travis CI to test builds on itFixed Ubuntu 20.04 build issues and changed Travis CI to test builds on itAug 6, 2023
@esabol
Copy link
Contributor

@stepan-neretin7 , can you please make the following requested changes to this PR:

Thanks!

@dura0okdura0okforce-pushed thepg16-fixes branch 2 times, most recently from7efc77b to30d1017CompareAugust 9, 2023 07:07
@vitcpp
Copy link
Contributor

@esabol It seems github uses the present tense. I've found some instructions how to write good commit messages. There are some instructions in the Internet with the recommendation to use the present tense. So, I propose to adopt github style. It seems it was my fault to add commits with in past tense.

@esabol
Copy link
Contributor

@esabol It seems github uses the present tense. I've found some instructions how to write good commit messages. There are some instructions in the Internet with the recommendation to use the present tense. So, I propose to adopt github style. It seems it was my fault to add commits with in past tense.

OK with me. I just think it's best to be consistent. 👍

@vitcpp
Copy link
Contributor

@stepan-neretin7 Are you still going to complete the fix? I propose to change sphere_output_precision type to int instead of short int. It may fix compiler warnings related to sprintf. I would also propose to keep spheretrans_out unchanged because I'm not sure that the proposed solution significantly improves this function. Thank you in advance!

@esabol
Copy link
Contributor

@vitcpp wrote:

I would also propose to keep spheretrans_out unchanged because I'm not sure that the proposed solution significantly improves this function.

You don't like thepsprintf() solution? I guess it is probably less efficient than thechar buf[###]/sprintf() version.

@vitcpp
Copy link
Contributor

You don't like thepsprintf() solution? I guess it is probably less efficient than thechar buf[###]/sprintf() version.

Well, I see no profit in using psprintf solution in the current implementation:

  • It is less efficient.
  • The output has limited length (strans has 3 numbers, output is short).
  • The result buffer is limited by 255 bytes and there is no overflow check.

I think the warnings can be fixed by some other means. A better idea may be to use a string builder but i'm do not know whether postgresql code has such functionality.

@esabol
Copy link
Contributor

@vitcpp wrote:

I think the warnings can be fixed by some other means.

@stepan-neretin7 already fixed the warnings initially by makingbuf bigger. So go back to the first solution?

A better idea may be to use a string builder but i'm do not know whether postgresql code has such functionality.

There's nothing like that that I could find, and I spent some time looking. I looked up the implementation ofpsprintf(), and I don't think it's quite as bad as you have characterized (it checks for overflow and reallocs if it needs to be bigger than 255), but I agree it is less efficient. I'm OK with the initial solution of just makingbuf bigger to avoid the compiler warning.

@vitcpp
Copy link
Contributor

@esabol I guess that the problem is not the too-small buffer size. The sprintf template contains the symbol '*' that defines the precision of the floating value, but the precision is passed as an argument in the arg list of sprintf. The corresponding parameter should be of int type, but the variable sphere_output_precision is of short int type instead. I think that changing the variable type to int will fix the warnings.

@vitcpp
Copy link
Contributor

I'm not sure that psprintf improves the situation because the output is limited by the precision. We can define max precision which is supported. Not sure that 100 digits is the meaningful precision value. In this case buffers in the stack are enought for intermediate calculations. What I would propose is to work without intermediate buffers. Once we palloced the buffer, sprintf is enough for us if we are confident that the output is limited by some length. Just some simple pointer math is needed.

@esabol
Copy link
Contributor

@vitcpp wrote:

I guess that the problem is not the too-small buffer size. The sprintf template contains the symbol '*' that defines the precision of the floating value, but the precision is passed as an argument in the arg list of sprintf. The corresponding parameter should be of int type, but the variable sphere_output_precision is of short int type instead. I think that changing the variable type to int will fix the warnings.

To be honest, I really don't see how, seeing as how the possible range of a short int is smaller than an int's, but maybe I'm being dumb. Would you submit your proposed solution as a separate PR so that we can see?

@esabol
Copy link
Contributor

esabol commentedAug 13, 2023
edited
Loading

Not sure that 100 digits is the meaningful precision value.

It's not. What is relevant isDBL_DIG since that's the maximum number of digits of precision a user can set usingset_sphere_output_precision(), right? And that's 15, I think?

@vitcpp
Copy link
Contributor

@esabol Yes, sure. There is the maximal number of meaningful digits for double. It is about that what you mentioned. I just wanted to say that 100 meaningful digits is the not real number for double. It was an ironic statement from my side.

BTW, I've made a test PR. Lets see how it goes.

@esabol
Copy link
Contributor

esabol commentedAug 16, 2023
edited
Loading

With the mergings of PR#51 and PR#39, this PR is no longer necessary and can be closed without merging.

vitcpp reacted with thumbs up emoji

@vitcpp
Copy link
Contributor

Closed as#51 and#39 are completed.

@vitcppvitcpp closed thisAug 17, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vitcppvitcppvitcpp requested changes

@esabolesabolesabol approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@dura0ok@df7cb@vitcpp@esabol

[8]ページ先頭

©2009-2025 Movatter.jp