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

[DOISSCUSS]“key=value” or “key value” or both of them? #1775

Closed
Benxiaohai001 opened this issue Nov 17, 2023 · 3 comments
Closed
Assignees
Milestone

Comments

@Benxiaohai001
Copy link
Member

Describe the issue
A clear and concise description of issue.
In the current environment, we set an attribute in two ways: key value or key=value. But you can only use one of them.
as follow:

public ❯ create database db002 with ttl '2d';
Query took 0.003 seconds.
public ❯ alter tenant t_002 drop_after '2d';
422 Unprocessable Entity, details: {"error_code":"010009","error_message":"sql parser error: Expected ADD, REMOVE, SET, UNSET, found: drop_after"}
public ❯ alter tenant t_002 set drop_after '2d';
422 Unprocessable Entity, details: {"error_code":"010009","error_message":"sql parser error: Expected =, found: '2d'"}
public ❯ alter tenant t_002 set drop_after='2d';
Query took 0.004 seconds.
public ❯ create tenant t_004 with drop_after '2d';
422 Unprocessable Entity, details: {"error_code":"010009","error_message":"sql parser error: Expected =, found: '2d'"}
public ❯ create tenant t_004 with drop_after='2d';
Query took 0.003 seconds.
public ❯ create database db003 with ttl='2d';
422 Unprocessable Entity, details: {"error_code":"010009","error_message":"sql parser error: Expected a value, found: ="}
public ❯ 

Are there any special considerations for this different setup? If there are no special requirements, it is recommended that we support both settings at the same time, which will make it more convenient to use. What do you think?

What you like us to do
Please give us some advices

Additional context
Add any other context about the issue here.

@lutengda
Copy link
Collaborator

mysql: support space and equal, no colon
pg: support space and equal, no colon

@roseboy-liu
Copy link
Contributor

mysql: support space and equal, no colon pg: support space and equal, no colon

This is a standard practice.

@roseboy-liu roseboy-liu added this to the V2.4.1 milestone Jan 10, 2024
lutengda added a commit to lutengda/cnosdb that referenced this issue Jan 27, 2024
lutengda added a commit to lutengda/cnosdb that referenced this issue Jan 27, 2024
lutengda added a commit to lutengda/cnosdb that referenced this issue Feb 20, 2024
roseboy-liu pushed a commit that referenced this issue Feb 23, 2024
* feat: sqloption support space and equal(#1775)

* test: modify 'CREATE TENANT t12 WITH comment;' error info in sqllogicaltests

* test: modify 'create user u7 with comment;' error info in sqllogicaltests
@lutengda lutengda assigned Benxiaohai001 and unassigned lutengda Mar 5, 2024
@Benxiaohai001
Copy link
Member Author

The modification covers a wide range of areas, and subsequent automated use cases will be carried out to take care of relevant functions.

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

No branches or pull requests

3 participants