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

DEFAULT function not working with status column #6221

Closed
luisfmcalado opened this issue May 25, 2020 · 0 comments · Fixed by #6224
Closed

DEFAULT function not working with status column #6221

luisfmcalado opened this issue May 25, 2020 · 0 comments · Fixed by #6224
Milestone

Comments

@luisfmcalado
Copy link
Contributor

Overview of the Issue

It fails when inserting records with the DEFAULT function receiving the column name status.

Reproduction Steps

Steps to reproduce this issue:

  1. Deploy the following vschema:
{
  "sharded": true,
  "vindexes": {
    "unicode_loose_md5": {
      "type": "unicode_loose_md5"
    }
  },
  "tables": {
    "user": {
      "column_vindexes": [
        {
          "column": "username",
          "name": "unicode_loose_md5"
        }
      ]
    }
  }
}
  1. Deploy the following schema:
CREATE TABLE `user` (
  username varchar(128) NOT NULL,
  `status` varchar(128) NOT NULL DEFAULT "UNKNOWN"
);
  1. Run INSERT INTO user(username, status) VALUES ("Chuck", DEFAULT(`status`))
  2. It shows the following error:
ERROR 1105 (HY000) at line 1: vtgate: http://vtgate-865353cb-55c58f5bbf-6l6b7:15000/: execInsertSharded: target: live.80-.master, used tablet: zone1-3423003548 (172.31.29.20): vttablet: rpc error: code = InvalidArgument desc = syntax error at position 73 near 'status' (CallerID: user1)

Operating system and Environment details

Using vitess operator with Kubernetes version 1.15
MariaDB 10.3.22
Running with:

vtctld: vitess/lite:v6.0.20-20200429
vtgate: vitess/lite:v6.0.20-20200429
vttablet: vitess/lite:v6.0.20-20200429
vtbackup: vitess/lite:v6.0.20-20200429

Log Fragments

I didn't see any log related to the error.

@luisfmcalado luisfmcalado changed the title DEFAULT function not working with status column DEFAULT function not working with status column May 25, 2020
systay added a commit to systay/vitess that referenced this issue May 26, 2020
Fixes vitessio#6221

Signed-off-by: Andres Taylor <andres@planetscale.com>
@deepthi deepthi added this to the v7.0 milestone Jun 15, 2020
deepthi pushed a commit to planetscale/vitess that referenced this issue Jun 16, 2020
Fixes vitessio#6221

Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: deepthi <deepthi@planetscale.com>
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 a pull request may close this issue.

2 participants