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

Add Timestamp sql parameter. #2355

Merged
merged 1 commit into from
Sep 6, 2015
Merged

Add Timestamp sql parameter. #2355

merged 1 commit into from
Sep 6, 2015

Conversation

vivekmenezes
Copy link
Contributor

Allow casting of integer to interval type.

Get rid of sql/driver -> sql/parser dependency.

Fixes #2328.

}

func TestinConnectionSettings(t *testing.T) {
func TestConnectionSettings(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was disabled by mistake!

Copy link
Contributor

Choose a reason for hiding this comment

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

👌

@petermattis
Copy link
Collaborator

@vivekmenezes You should reference the issue in your commit messages (e.g. See #2328 or Fixes #2328) so that the PR is tied to the issue and the issue is automatically closed.

@tamird
Copy link
Contributor

tamird commented Sep 4, 2015

@petermattis @vivekmenezes I edited the PR descriptor so that #2328 is referenced.

// ***** This test has been disabled ********
// TODO(vivek): Fix/Rewrite this flaky test.
// Fix issue https://github.com/cockroachdb/cockroach/issues/2366
func DisabledTestOverlappingTransactions(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wont merge this in before this test is fixed. I just want this PR to be ready so when the test it fixed I can merge it.

@@ -192,3 +195,52 @@ func rollbackTxnAndReturnResultWithError(planMaker *planner, err error) driver.R
errProto.SetResponseGoError(err)
return driver.Result{Error: &errProto}
}

// GetParameters returns the Params slice as a `parameters`.
func GetParameters(r driver.Request) Parameters {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove and inline this function. It kind of made sense as a method but now it's totally useless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Allow casting of integer to interval type.

Get rid of sql/driver -> sql/parser dependency.
@tamird
Copy link
Contributor

tamird commented Sep 5, 2015

LGTM

param.BytesVal = time
// Send absolute time devoid of time-zone.
t := Datum_Timestamp{Sec: value.Unix(), Nsec: uint32(value.Nanosecond())}
param.TimeVal = &t
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see much purpose in the temporary:

  param.TimeVal = &Datum_Timestamp{
    Sec: value.Unix(),
    Nsec: uint32(value.Nanosecond()),
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I have this change made locally in #2375

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks!

@petermattis
Copy link
Collaborator

LGTM

vivekmenezes added a commit that referenced this pull request Sep 6, 2015
@vivekmenezes vivekmenezes merged commit c14db08 into master Sep 6, 2015
@vivekmenezes vivekmenezes deleted the vivek/timeparam branch September 6, 2015 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants