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 Nullable value in timestamp column #7739

Closed
GuptaManan100 opened this issue Mar 25, 2021 · 0 comments · Fixed by #7740
Closed

Incorrect Nullable value in timestamp column #7739

GuptaManan100 opened this issue Mar 25, 2021 · 0 comments · Fixed by #7740

Comments

@GuptaManan100
Copy link
Member

Overview of the Issue

Consider the following SQL statement

CREATE TABLE foo(
    id int primary key,
    a  varchar(255) null,
    b  varchar(255) null default 'foo',
    c  timestamp    null default current_timestamp()
);

Running this on vitess creates the table but the column c is not nullable. This is verified by running the following SQL statement

SELECT column_name              column_name,
       data_type                data_type,
       column_type              full_data_type,
       column_default           column_default,
       is_nullable              is_nullable
FROM information_schema.columns
WHERE table_name = 'foo'
ORDER BY ordinal_position;

Vitess results show that the column is not nullable but running the same queries on MySQL results in a nullable column

Reproduction Steps

Steps to reproduce this issue, example:

  1. Run the vttestserver image and run the above queries to see the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants