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

fix: avoid connection failure when DateStyle is set to ISO #1081

Merged
merged 1 commit into from Jan 21, 2018

Conversation

Projects
None yet
3 participants
@vlsi
Member

vlsi commented Jan 20, 2018

Default PostgreSQL configuration is DateStyle='iso, dmy',
however just iso would be fine.

Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.

fixes #1080

fix: avoid connection failure when DateStyle is set to ISO
Default PostgreSQL configuration is DateStyle='iso, dmy',
however just iso would be fine.

Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.

fixes #1080

@vlsi vlsi added this to the 42.2.1 milestone Jan 20, 2018

@codecov-io

This comment has been minimized.

codecov-io commented Jan 20, 2018

Codecov Report

Merging #1081 into master will increase coverage by 0.07%.
The diff coverage is 50%.

@@             Coverage Diff              @@
##             master    #1081      +/-   ##
============================================
+ Coverage      67.2%   67.27%   +0.07%     
- Complexity     3662     3665       +3     
============================================
  Files           170      170              
  Lines         15622    15623       +1     
  Branches       2523     2524       +1     
============================================
+ Hits          10498    10510      +12     
+ Misses         3937     3928       -9     
+ Partials       1187     1185       -2
@@ -2593,7 +2593,8 @@ public void receiveParameterStatus() throws IOException, SQLException {
value), PSQLState.CONNECTION_FAILURE);
}
if (name.equals("DateStyle") && !value.startsWith("ISO,")) {
if (name.equals("DateStyle") && !value.startsWith("ISO")
&& !value.toUpperCase().startsWith("ISO")) {

This comment has been minimized.

@jorsol

jorsol Jan 21, 2018

Contributor

It looks redundant to check startsWith() first and toUpperCase().startsWith() later.

This comment has been minimized.

@vlsi

vlsi Jan 21, 2018

Member

The first one is an optimization

@vlsi vlsi merged commit e442db1 into pgjdbc:master Jan 21, 2018

2 checks passed

codecov/project 67.27% (+0.07%) compared to 0d51370
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

rhavermans added a commit to bolcom/pgjdbc that referenced this pull request Jul 13, 2018

fix: avoid connection failure when DateStyle is set to ISO (pgjdbc#1081)
Default PostgreSQL configuration is DateStyle='iso, dmy', however pgjdbc should not raise errors
if DateStyle is just ISO

Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.

fixes pgjdbc#1080

rhavermans added a commit to bolcom/pgjdbc that referenced this pull request Jul 13, 2018

fix: avoid connection failure when DateStyle is set to ISO (pgjdbc#1081)
Default PostgreSQL configuration is DateStyle='iso, dmy', however pgjdbc should not raise errors
if DateStyle is just ISO

Note: PostgreSQL prints DateStyle value in upper case, and toUpperCase
was added just in case.

fixes pgjdbc#1080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment