@@ -29,21 +29,37 @@ def download_jdbc(version):
2929 resp .raise_for_status ()
3030 target .write_bytes (resp .content )
3131
32-
3332def create_user ():
3433 requests .post (
3534 "http://localhost:8000/v1/query/" ,
3635 auth = HTTPBasicAuth ("root" , "" ),
3736 headers = {"Content-Type" : "application/json" },
38- json = {"sql" : "CREATE USER IF NOT EXISTS databend IDENTIFIED BY 'databend' " },
37+ json = {"sql" : "DROP USER IF EXISTS databend" },
3938 ).raise_for_status ()
4039 requests .post (
4140 "http://localhost:8000/v1/query/" ,
4241 auth = HTTPBasicAuth ("root" , "" ),
4342 headers = {"Content-Type" : "application/json" },
44- json = {"sql" : "GRANT ALL ON *.* TO databend" },
43+ json = {"sql" : "CREATE USER IF NOT EXISTS databend IDENTIFIED BY 'databend' with default_role='test_jdbc'" },
44+ ).raise_for_status ()
45+ requests .post (
46+ "http://localhost:8000/v1/query/" ,
47+ auth = HTTPBasicAuth ("root" , "" ),
48+ headers = {"Content-Type" : "application/json" },
49+ json = {"sql" : "CREATE ROLE IF NOT EXISTS test_jdbc" },
50+ ).raise_for_status ()
51+ requests .post (
52+ "http://localhost:8000/v1/query/" ,
53+ auth = HTTPBasicAuth ("root" , "" ),
54+ headers = {"Content-Type" : "application/json" },
55+ json = {"sql" : "GRANT ALL ON *.* TO ROLE test_jdbc" },
56+ ).raise_for_status ()
57+ requests .post (
58+ "http://localhost:8000/v1/query/" ,
59+ auth = HTTPBasicAuth ("root" , "" ),
60+ headers = {"Content-Type" : "application/json" },
61+ json = {"sql" : "GRANT ROLE test_jdbc TO USER databend" },
4562 ).raise_for_status ()
46-
4763
4864def download_testng ():
4965 urls = [
0 commit comments