Skip to content

Constraint names and database names with spaces.#7745

Merged
harshit-gangal merged 2 commits intovitessio:masterfrom
planetscale:constraint-name
Mar 26, 2021
Merged

Constraint names and database names with spaces.#7745
harshit-gangal merged 2 commits intovitessio:masterfrom
planetscale:constraint-name

Conversation

@GuptaManan100
Copy link
Contributor

@GuptaManan100 GuptaManan100 commented Mar 25, 2021

Description

Running a query like

ALTER TABLE `Post With Space` DROP FOREIGN KEY `Post With Space_ibfk_1`

got rewritten to

ALTER TABLE `Post With Space` DROP FOREIGN KEY Post With Space_ibfk_1

by the parser. This issue arises because the name field was stored as a string rather than a ColIdent. Similar issues were also there in the database name fields. This PR addresses this issue.

After the changes, there is 1 extra shift-reduce conflict that has arisen. It has been verified that MySQL also has the shift reduce conflict and Vitess's behaviour emulates what MySQL does.

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

…and constraints

Signed-off-by: GuptaManan100 <manan@planetscale.com>
Signed-off-by: GuptaManan100 <manan@planetscale.com>
@harshit-gangal harshit-gangal merged commit ee5cb86 into vitessio:master Mar 26, 2021
@harshit-gangal harshit-gangal deleted the constraint-name branch March 26, 2021 05:38
@askdba askdba added this to the v10.0 milestone Mar 26, 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.

Constraint Names with Spaces do not work with Vitess

3 participants