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

Nullable Timestamp Column Fix #7740

Merged
merged 5 commits into from
Mar 30, 2021
Merged

Conversation

GuptaManan100
Copy link
Member

Description

Running a query like

create table foo (
    id int primary key,
    a varchar(255) null,
    b varchar(255) null default 'foo',
    c timestamp null default current_timestamp()
)

on vitess got rewritten to

create table foo (
    id int primary key,
    a varchar(255),
    b varchar(255) default 'foo',
    c timestamp default current_timestamp()
)

but this is incorrect because by default timestamp column is not nullable. This PR fixes this issue.

Related Issue(s)

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

go/vt/sqlparser/ast.go Outdated Show resolved Hide resolved
GuptaManan100 and others added 2 commits March 25, 2021 17:01
Signed-off-by: GuptaManan100 <[email protected]>
go/vt/sqlparser/ast.go Outdated Show resolved Hide resolved
Signed-off-by: GuptaManan100 <[email protected]>
@systay systay merged commit 2fcfe29 into vitessio:master Mar 30, 2021
@systay systay deleted the nullable-timestamp branch March 30, 2021 06:22
@askdba askdba added this to the v10.0 milestone Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Nullable value in timestamp column
4 participants