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

Stop SQL parser when an error occurs #3964

Closed
ImeevMA opened this issue Feb 5, 2019 · 0 comments
Closed

Stop SQL parser when an error occurs #3964

ImeevMA opened this issue Feb 5, 2019 · 0 comments
Assignees
Labels
bug Something isn't working sql
Milestone

Comments

@ImeevMA
Copy link
Collaborator

ImeevMA commented Feb 5, 2019

Tarantool version: 2.1.1-210-g4df4a78

OS version: Ubuntu 16.04.5 LTS

Bug description: Some errors can be overwritten because the SQL parser continues to work after an error occurs during the parsing.

Steps to reproduce:

box.cfg{}
box.schema.space.create('t12')
box.sql.execute("insert into \"t12\" values(1) 'last'")
box.error.last()

Output:

...
tarantool> box.sql.execute("insert into \"t12\" values(1) 'last'")
---
- error: 'near "''last''": syntax error'
...

tarantool> box.error.last()
---
- SQL does not support space without format
...
@kyukhin kyukhin added bug Something isn't working sql labels Feb 5, 2019
@kyukhin kyukhin added this to the 2.1.1 milestone Feb 5, 2019
@kyukhin kyukhin modified the milestones: 2.1.2, 2.2.0 Mar 20, 2019
@kyukhin kyukhin added the prio2 label Apr 8, 2019
ImeevMA added a commit that referenced this issue May 6, 2019
Currently, it is possible to set a syntax error, even if there has
already been another error before.

For example:
box.execute("insert into not_exist values(1) a")

The first error is "Space 'NOT_EXIST' does not exist", but "Syntax
error near 'a'" is displayed.

After this patch, all syntax errors will be set only if there have
been no errors before.

Closes #3964
ImeevMA added a commit that referenced this issue May 15, 2019
This patch stops the parser if any error occurs. Prior to this
patch, it was possible to replace the error with another one,
since the parser may continue to work, even if an error occurred.

For example:
box.execute("insert into not_exist values(1) a")

The first error is "Space 'NOT_EXIST' does not exist", but "Syntax
error near 'a'" is displayed.

After this patch, the first error will be displayed.

Closes #3964
ImeevMA added a commit that referenced this issue May 15, 2019
This patch stops the parser if any error occurs. Prior to this
patch, it was possible to replace the error with another one,
since the parser may continue to work, even if an error occurred.

For example:
box.execute("insert into not_exist values(1) a")

The first error is "Space 'NOT_EXIST' does not exist", but "Syntax
error near 'a'" is displayed.

After this patch, the first error will be displayed.

Closes #3964
Closes #4195
@kyukhin kyukhin added the tmp label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql
Projects
None yet
Development

No branches or pull requests

2 participants