Debian Codegraph @

mysql-test/suite/x/include/create_mysql_accounts_for_xplugin_tests.inc

raw
1 #
2 ## Create several MySQL Server account that use different authentication
3 ## plugins.
4 #
5 # [--let $user_native=user_name]
6 # [--let $user_sha256=user_name]
7 # [--let $user_cache2=user_name]
8 #
9 # [--let $host_native=host_name_or_ip]
10 # [--let $host_sha256=host_name_or_ip]
11 # [--let $host_cache2=host_name_or_ip]
12 #
13 # [--let $pass_native=password]
14 # [--let $pass_sha256=password]
15 # [--let $pass_cache2=password]
16 # [--let $all_users_have_the_same_name=overwrite_name_for_all_accounts]
17 #
18 # --source ../include/create_mysql_accounts_for_xplugin_tests.h
19 #
20
21 #
22 ## Defaults for user names
23 #
24
25 if ($user_native == "")
26 {
27 --let $user_native=xuser_native
28 }
29
30 if ($user_sha256 == "")
31 {
32 --let $user_sha256=xuser_sha256
33 }
34
35 if ($user_cache2 == "")
36 {
37 --let $user_cache2=xuser_cache2
38 }
39
40
41 #
42 ## Defaults for user hosts
43 #
44
45 if ($host_native == "")
46 {
47 --let $host_native='localhost'
48 }
49
50 if ($host_sha256 == "")
51 {
52 --let $host_sha256='localhost'
53 }
54
55 if ($host_cache2 == "")
56 {
57 --let $host_cache2='localhost'
58 }
59
60
61 #
62 ## Defaults for user passwords
63 #
64
65 if ($pass_native == "")
66 {
67 --let $pass_native='native'
68 }
69
70 if ($pass_sha256 == "")
71 {
72 --let $pass_sha256='sha256'
73 }
74
75 if ($pass_cache2 == "")
76 {
77 --let $pass_cache2='cache2'
78 }
79
80 if ($all_users_have_the_same_name != "")
81 {
82 --let $user_native=$all_users_have_the_same_name
83 --let $user_sha256=$all_users_have_the_same_name
84 --let $user_cache2=$all_users_have_the_same_name
85 }
86
87 eval CREATE USER $user_native@$host_native
88 IDENTIFIED WITH 'mysql_native_password' BY $pass_native;
89
90 eval CREATE USER $user_sha256@$host_sha256
91 IDENTIFIED WITH 'sha256_password' BY $pass_sha256;
92
93 eval CREATE USER $user_cache2@$host_cache2
94 IDENTIFIED WITH 'caching_sha2_password' BY $pass_cache2;
95