Skip to content
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

incorrect parsing of timestamp offset for time zones with non integer offset #135

Closed
ehrt74 opened this issue Mar 8, 2022 · 0 comments · Fixed by #167
Closed

incorrect parsing of timestamp offset for time zones with non integer offset #135

ehrt74 opened this issue Mar 8, 2022 · 0 comments · Fixed by #167
Labels
bug Something isn't working

Comments

@ehrt74
Copy link

ehrt74 commented Mar 8, 2022

Hi!

in connection.go 499 it is assumed that the time zone offset of vertica is an integer number of hours. for time zones like india (+530) this code fails. attempts after that to read a timestamp from the database fail because the appended time zone information is incomplete.

a fix would be something like:

func getTimeZoneOffset(str string) string {
    for i := len(str) - 1; i >= 0 && i >= len(str)-8; i-- {
	ch := str[i]
	if ch == '+' || ch == '-' {
		return str[i:]
	}
    }
    return "+00"
}

many thanks!

@sitingren sitingren added the bug Something isn't working label Mar 10, 2022
sitingren pushed a commit that referenced this issue May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants