Adjust help

This commit is contained in:
lazio579 2019-02-21 16:32:37 +08:00
parent f947ed41d8
commit 3b5a349d3c

View File

@ -1990,58 +1990,63 @@ static struct sql_help_entry_t {
const char* desc;
int type;
} sql_help_entries[] = {
{"select conn_details from backends", "display the idle conns", ALL_HELP},
{"select * from backends", "list the backends and their state", ALL_HELP},
{"show connectionlist [num]", "show num connections. e.g. show connectionlist; ", ALL_HELP},
{"select * from groups","list the backends and their groups", SHARD_HELP},
{"show allow_ip|deny_ip", "show allow_ip|deny_ip rules. e.g. show allow_ip; ", ALL_HELP},
{"add allow_ip|deny_ip 'user@address'", "add address to white or black list", ALL_HELP},
{"delete allow_ip|deny_ip 'user@address'", "delete address from white or black list", ALL_HELP},
{"set reduce_conns [true|false]", "reduce idle connections if set to true. e.g. set reduce_conns true; ", ALL_HELP},
{"set maintain [true|false]", "close all client connections if set to true. e.g. set maintain false; ", ALL_HELP},
{"set charset_check [true|false]", "check the client charset is equal to the default charset", ALL_HELP},
{"refresh conns", "refresh all server connections. e.g. refresh conns; ", ALL_HELP},
{"show maintain status", "e.g. show maintain status; ", ALL_HELP},
{"save settings", "save the current running configuration to files. e.g. save settings; ", ALL_HELP},
{"show status [like '%pattern%']", "show select/update/insert/delete statistics", ALL_HELP},
{"show variables [like '%pattern%']", "e.g. show variables like '%proxy%'; ", ALL_HELP},
{"select version", "cetus version. e.g. select version; ", ALL_HELP},
{"select * from user_pwd [where user='name']", "e.g. select * from user_pwd; ", ALL_HELP},
{"select * from app_user_pwd [where user='name']", "e.g. select * from app_user_pwd where user='lede'; ", ALL_HELP},
{"update user_pwd set password='xx' where user='name'", "e.g. update user_pwd set password='123' where user='lede'; ", ALL_HELP},
{"update app_user_pwd set password='xx' where user='name'", "e.g. update app_user_pwd set password='123' where user='lede'; ", ALL_HELP},
{"delete from user_pwd where user='name'", "delete from user_pwd where user='lede'; ", ALL_HELP},
{"delete from app_user_pwd where user='name'", "delete from user_pwd where user='lede'; ", ALL_HELP},
{"insert into backends values ('ip:port', '[ro|rw]', 'state')",
"add mysql instance to backends list", RW_HELP},
{"insert into backends values ('ip:port@group', '[ro|rw]', 'state')",
"add mysql instance to backends list", SHARD_HELP},
{"update backends set (type|state)=x where [backend_ndx=index|address='ip:port']",
"e.g. update backends set type = 'rw' where backend_ndx = 3; ", ALL_HELP},
{"delete from backends where [backend_ndx=index|address='ip:port']", "e.g. delete from backends where backend_ndx = 1; ", ALL_HELP},
{"remove backend where [backend_ndx=index|address='ip:port']", "e.g. remove backend where address='3.1.2.1:6666'; ", ALL_HELP},
{"remove backend backend_ndx", "e.g. remove backend 1; ", ALL_HELP},
{"add master 'ip:port'", "e.g. add master '3.1.2.1:6666'; ", RW_HELP},
{"add master 'ip:port@group'", "e.g. add master '3.1.2.1:6666@data3'; ", SHARD_HELP},
{"add slave 'ip:port'", "e.g. add slave '3.1.2.0:6666'; ", RW_HELP},
{"add slave 'ip:port@group'", "e.g. add slave '3.1.2.0:6666@data3'; ", SHARD_HELP},
{"stats get [item]", "show query statistics", ALL_HELP},
{"cetus", "Show overall status of Cetus", ALL_HELP},
{"config get [item]", "show config", ALL_HELP},
{"config set key=value", "e.g. config set log-level = message; ", ALL_HELP},
{"stats reset", "reset query statistics", ALL_HELP},
{"select * from help", "show this help", ALL_HELP},
{"select help", "show this help", ALL_HELP},
{"cetus", "Show overall status of Cetus", ALL_HELP},
{"create vdb id (groupA:xx, groupB:xx) using method", "Method example: hash(int,4) range(str)", SHARD_HELP},
#ifndef SIMPLE_PARSER
{"create sharded table schema.table vdb id shardkey key", "e.g. create sharded table test.tb1 vdb 1 shardkey id; ", SHARD_HELP},
{"select * from vdb", "Show all vdb", SHARD_HELP},
{"select sharded table", "Show all sharded table", SHARD_HELP},
{"create single table schema.table on group", "e.g. create single table test.tb1 on data1; ", SHARD_HELP},
{"create vdb id (groupA:xx, groupB:xx) using method", "Method example: hash(int,4) range(str)", SHARD_HELP},
#endif
{"delete allow_ip|deny_ip 'user@address'", "delete address from white or black list", ALL_HELP},
{"delete from user_pwd where user='name'", "delete from user_pwd where user='lede'; ", ALL_HELP},
{"delete from app_user_pwd where user='name'", "delete from user_pwd where user='lede'; ", ALL_HELP},
{"delete from backends where [backend_ndx=index|address='ip:port']", "e.g. delete from backends where backend_ndx = 1; ", ALL_HELP},
{"insert into backends values ('ip:port', '[ro|rw]', 'state')", "add mysql instance to backends list", RW_HELP},
{"insert into backends values ('ip:port@group', '[ro|rw]', 'state')", "add mysql instance to backends list", SHARD_HELP},
{"kill query tid", "kill session when the thread id is equal to tid. e.g. kill query 1; ", ALL_HELP},
{"refresh conns", "refresh all server connections. e.g. refresh conns; ", ALL_HELP},
{"remove backend where [backend_ndx=index|address='ip:port']", "e.g. remove backend where address='3.1.2.1:6666'; ", ALL_HELP},
{"remove backend backend_ndx", "e.g. remove backend 1; ", ALL_HELP},
{"save settings", "save the current running configuration to files. e.g. save settings; ", ALL_HELP},
{"select help", "show this help", ALL_HELP},
{"select conn_details from backends", "display the idle conns", ALL_HELP},
#ifndef SIMPLE_PARSER
{"select sharded table", "Show all sharded table", SHARD_HELP},
{"select single table", "Show single tables. e.g. select single table; ", SHARD_HELP},
#endif
{"select version", "cetus version. e.g. select version; ", ALL_HELP},
{"select * from help", "show this help", ALL_HELP},
{"select * from backends", "list the backends and their state", ALL_HELP},
#ifndef SIMPLE_PARSER
{"select * from groups","list the backends and their groups", SHARD_HELP},
#endif
{"select * from user_pwd [where user='name']", "e.g. select * from user_pwd; ", ALL_HELP},
{"select * from app_user_pwd [where user='name']", "e.g. select * from app_user_pwd where user='lede'; ", ALL_HELP},
#ifndef SIMPLE_PARSER
{"select * from vdb", "Show all vdb", SHARD_HELP},
#endif
{"set reduce_conns [true|false]", "reduce idle connections if set to true. e.g. set reduce_conns true; ", ALL_HELP},
{"set maintain [true|false]", "close all client connections if set to true. e.g. set maintain false; ", ALL_HELP},
{"set charset_check [true|false]", "check the client charset is equal to the default charset", ALL_HELP},
{"show allow_ip|deny_ip", "show allow_ip|deny_ip rules. e.g. show allow_ip; ", ALL_HELP},
{"show connectionlist [num]", "show num connections. e.g. show connectionlist; ", ALL_HELP},
{"show maintain status", "e.g. show maintain status; ", ALL_HELP},
{"show status [like '%pattern%']", "show select/update/insert/delete statistics", ALL_HELP},
{"show variables [like '%pattern%']", "e.g. show variables like '%proxy%'; ", ALL_HELP},
{"sql log status", "show sql log status", ALL_HELP},
{"sql log start", "start sql log thread", ALL_HELP},
{"sql log stop", "stop sql log thread", ALL_HELP},
{"kill query tid", "kill session when the thread id is equal to tid. e.g. kill query 1; ", ALL_HELP},
{"stats get [item]", "show query statistics", ALL_HELP},
{"stats reset", "reset query statistics", ALL_HELP},
{"update user_pwd set password='xx' where user='name'", "e.g. update user_pwd set password='123' where user='lede'; ", ALL_HELP},
{"update app_user_pwd set password='xx' where user='name'", "e.g. update app_user_pwd set password='123' where user='lede'; ", ALL_HELP},
{"update backends set (type|state)=x where [backend_ndx=index|address='ip:port']", "e.g. update backends set type = 'rw' where backend_ndx = 3; ", ALL_HELP},
{NULL, NULL, 0}
};