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

ruby-monetdb-sql gem fails for negative timezone offset (USA, etc.) #3985

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed
Labels
bug Something isn't working Client interfaces normal

Comments

@monetdb-team
Copy link

Date: 2016-04-20 01:49:18 +0200
From: Clint Cummins <>
To: clients devs <>
Version: 11.21.19 (Jul2015-SP4)

Last updated: 2016-06-23 10:24:27 +0200

Comment 22064

Date: 2016-04-20 01:49:18 +0200
From: Clint Cummins <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Build Identifier:

When trying to run a SQL query from Ruby to MonetDB using the ruby-monetdb-sql gem, the query fails at an early point, when trying to set the timezone offset, if the timezone offset is negative (in USA, etc.).

Reproducible: Always

Steps to Reproduce:

  1. gem 'ruby-monetdb-sql' in Gemfile
  2. require 'MonetDB' in ruby code
  3. db = MonetDB.new
  4. db.conn(...connnection parameters...)
  5. res = db.query("select * from tbl")

Actual Results:

Error message with traceback to MonetDBConnection.rb line 403, in set_timezone().
I didn't save the actual error message, since I have a working code fix for it, below.

Expected Results:

res filled with query results.

Code change which fixes this bug:

Code was (clients/ruby/lib/MonetDBConnection.rb line 402):

 if tz_offset <= 9  verify minute count!

Change to:

  verify minute count!	
 if tz_offset <= -10
   tz_offset = "'" + tz_offset.to_s + ":00'"
 elsif tz_offset < 0
  tz_offset = -tz_offset
   tz_offset = "'-0" + tz_offset.to_s + ":00'"
 elsif tz_offset <= 9

After this, ruby runs great with MonetDB in the USA!

Comment 22065

Date: 2016-04-20 10:12:05 +0200
From: MonetDB Mercurial Repository <>

Changeset 5247c923260e made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=5247c923260e

Changeset description:

Fix setting time zone for negative offsets.
This fixes bug #3985.

Comment 22066

Date: 2016-04-20 10:16:33 +0200
From: MonetDB Mercurial Repository <>

Changeset b4cf00b05ef1, made by Sjoerd Mullender sjoerd@acm.org in the monetdb-ruby repo, refers to this bug.

For complete details, see http://dev.monetdb.org/hg/monetdb-ruby?cmd=changeset;node=b4cf00b05ef1

Changeset description:

Fix setting time zone for negative offsets.

Port of changesets [5247c923260e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5247c923260e)  and [084abef09d5d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=084abef09d5d)  from MonetDB.
This fixes bug #3985.

Comment 22068

Date: 2016-04-20 10:23:52 +0200
From: @sjoerdmullender

Thanks for the fix. It'll be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Client interfaces normal
Projects
None yet
Development

No branches or pull requests

2 participants