Skip to content

Commit

Permalink
Use the same "current_timestamp" function for both sides of round trip
Browse files Browse the repository at this point in the history
this test was using sysdate() and current_timestamp() together
in conjunction with a truncation to DAY, however for four hours
on saturday night (see commit time :) ) these two values will
have a different value if one side is EDT and the other is UTC.

tox does not transmit environment variables including TZ by
default, so even if the server is set up for EDT, running tox
will not set TZ and at least Oracle client seems to use this
value, producing UTC for session time but the database on CI
was configured for EDT, producing EDT for sysdate.

Change-Id: I56602d2402a475a0c4fdf61c1c5fc2618c82f915
  • Loading branch information
zzzeek committed Oct 21, 2018
1 parent 1963fdc commit ac358a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/sql/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def process_bind_param(self, value, dialect):
sa.select(
[
func.trunc(
func.sysdate(), sa.literal_column("'DAY'"),
func.current_timestamp(),
sa.literal_column("'DAY'"),
type_=sa.Date)]))
assert isinstance(ts, datetime.date) and not isinstance(
ts, datetime.datetime)
Expand All @@ -182,7 +183,8 @@ def process_bind_param(self, value, dialect):
type_=sa.Date)
def1 = currenttime
def2 = func.trunc(
sa.text("sysdate"), sa.literal_column("'DAY'"), type_=sa.Date)
sa.text("current_timestamp"),
sa.literal_column("'DAY'"), type_=sa.Date)

deftype = sa.Date
elif use_function_defaults:
Expand Down

0 comments on commit ac358a0

Please sign in to comment.