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

If user does not have SELECT privilege, syntax error occurs when creating table #32044

Open
RaigorJiang opened this issue Jul 9, 2024 · 0 comments

Comments

@RaigorJiang
Copy link
Contributor

RaigorJiang commented Jul 9, 2024

Bug Report

Which version of ShardingSphere did you use?

master 8fa4725

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

Create table successfully and no error

Actual behavior

If user does not have SELECT privilege, create table successfully but prompts syntax error

REGISTER STORAGE UNIT ds_0 (
    URL="jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="jeffrey",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
);

CREATE TABLE `t_order` (
  `order_id` bigint(20) NOT NULL,
  `user_id` int(11) NOT NULL,
  `status` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`order_id`)
);
image

User prifilege

CREATE USER 'jeffrey' IDENTIFIED BY '123456';

grant create,drop on *.* to 'jeffrey';

show grants for 'jeffrey';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant