forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Add instrumentation to log thrift request from bypass rpc workflow to performance schema (specifically the "esms_by_all" table). The changes made include: - adding a sysvar to control pfs logging (this is enabled by default) - adding statement/digest instrumentation to Bypass RPC path - computing the query's digest if the sysvar is enabled (needed to log to performance schema) Differential Revision: D46087826 ------------------------------------------------------------------------------------- Do not define static variables in a header file (facebook#1409) Summary: Since they are used only once, move them to their respective use locations. This fixes a GCC compilation error: In file included from /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/rdb_nosql_digest.cc:1: /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:28:20: error: ‘myrocks::desc_tok’ defined but not used [-Werror=unused-variable] 28 | static LEX_CSTRING desc_tok{STRING_WITH_LEN("DESC")}; | ^~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:27:20: error: ‘myrocks::asc_tok’ defined but not used [-Werror=unused-variable] 27 | static LEX_CSTRING asc_tok{STRING_WITH_LEN("ASC")}; | ^~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:26:20: error: ‘myrocks::limit_tok’ defined but not used [-Werror=unused-variable] 26 | static LEX_CSTRING limit_tok{STRING_WITH_LEN("LIMIT")}; | ^~~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:25:20: error: ‘myrocks::by_tok’ defined but not used [-Werror=unused-variable] 25 | static LEX_CSTRING by_tok{STRING_WITH_LEN("BY")}; | ^~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:24:20: error: ‘myrocks::order_tok’ defined but not used [-Werror=unused-variable] 24 | static LEX_CSTRING order_tok{STRING_WITH_LEN("ORDER")}; | ^~~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:23:20: error: ‘myrocks::index_tok’ defined but not used [-Werror=unused-variable] 23 | static LEX_CSTRING index_tok{STRING_WITH_LEN("INDEX")}; | ^~~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:22:20: error: ‘myrocks::force_tok’ defined but not used [-Werror=unused-variable] 22 | static LEX_CSTRING force_tok{STRING_WITH_LEN("FORCE")}; | ^~~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:21:20: error: ‘myrocks::where_tok’ defined but not used [-Werror=unused-variable] 21 | static LEX_CSTRING where_tok{STRING_WITH_LEN("WHERE")}; | ^~~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:20:20: error: ‘myrocks::from_tok’ defined but not used [-Werror=unused-variable] 20 | static LEX_CSTRING from_tok{STRING_WITH_LEN("FROM")}; | ^~~~~~~~ /home/laurynas/vilniusdb/fb-mysql/storage/rocksdb/./rdb_nosql_digest.h:19:20: error: ‘myrocks::select_tok’ defined but not used [-Werror=unused-variable] 19 | static LEX_CSTRING select_tok{STRING_WITH_LEN("SELECT")}; | ^~~~~~~~~~ Pull Request resolved: facebook#1409 Differential Revision: D52259043 fbshipit-source-id: 42a062a ------------------------------------------------------------------------------------ [thrift] Fix bypass_pfs_logging test Summary: Fixed failing tests and other bugs that showed up while attempting to reproduce the issue - update digest from test results; this is likely from recording test results on an older iteration - set `thrift_server_bypass` to ON in thrift_server test initialization (this is needed after D52489280 sets this to `OFF` by default) - clean up state of `bypass_pfs_logging` sys var after tests Differential Revision: D52523295 fbshipit-source-id: eb5a1f8
- Loading branch information
1 parent
2a060e0
commit 0cf779c
Showing
15 changed files
with
654 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
mysql-test/suite/sys_vars/r/bypass_rpc_pfs_logging_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
SET @start_value = @@global.bypass_rpc_pfs_logging; | ||
SELECT @start_value; | ||
@start_value | ||
0 | ||
SET @@global.bypass_rpc_pfs_logging = DEFAULT; | ||
SELECT @@global.bypass_rpc_pfs_logging = TRUE; | ||
@@global.bypass_rpc_pfs_logging = TRUE | ||
0 | ||
SET @@global.bypass_rpc_pfs_logging = ON; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
1 | ||
SET @@global.bypass_rpc_pfs_logging = OFF; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
0 | ||
SET @@global.bypass_rpc_pfs_logging = 2; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of '2' | ||
SET @@global.bypass_rpc_pfs_logging = -1; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of '-1' | ||
SET @@global.bypass_rpc_pfs_logging = TRUEF; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'TRUEF' | ||
SET @@global.bypass_rpc_pfs_logging = TRUE_F; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'TRUE_F' | ||
SET @@global.bypass_rpc_pfs_logging = FALSE0; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'FALSE0' | ||
SET @@global.bypass_rpc_pfs_logging = OON; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'OON' | ||
SET @@global.bypass_rpc_pfs_logging = ONN; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'ONN' | ||
SET @@global.bypass_rpc_pfs_logging = OOFF; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of 'OOFF' | ||
SET @@global.bypass_rpc_pfs_logging = 0FF; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of '0FF' | ||
SET @@global.bypass_rpc_pfs_logging = ' '; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of ' ' | ||
SET @@global.bypass_rpc_pfs_logging = " "; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of ' ' | ||
SET @@global.bypass_rpc_pfs_logging = ''; | ||
ERROR 42000: Variable 'bypass_rpc_pfs_logging' can't be set to the value of '' | ||
SET @@session.bypass_rpc_pfs_logging = OFF; | ||
ERROR HY000: Variable 'bypass_rpc_pfs_logging' is a GLOBAL variable and should be set with SET GLOBAL | ||
SELECT @@session.bypass_rpc_pfs_logging; | ||
ERROR HY000: Variable 'bypass_rpc_pfs_logging' is a GLOBAL variable | ||
SELECT IF(@@global.bypass_rpc_pfs_logging, "ON", "OFF") = VARIABLE_VALUE | ||
FROM performance_schema.global_variables | ||
WHERE VARIABLE_NAME='bypass_rpc_pfs_logging'; | ||
IF(@@global.bypass_rpc_pfs_logging, "ON", "OFF") = VARIABLE_VALUE | ||
1 | ||
SET @@global.bypass_rpc_pfs_logging = 0; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
0 | ||
SET @@global.bypass_rpc_pfs_logging = 1; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
1 | ||
SET @@global.bypass_rpc_pfs_logging = TRUE; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
1 | ||
SET @@global.bypass_rpc_pfs_logging = FALSE; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
0 | ||
SET @@global.bypass_rpc_pfs_logging = ON; | ||
SELECT @@bypass_rpc_pfs_logging = @@global.bypass_rpc_pfs_logging; | ||
@@bypass_rpc_pfs_logging = @@global.bypass_rpc_pfs_logging | ||
1 | ||
SET bypass_rpc_pfs_logging = ON; | ||
ERROR HY000: Variable 'bypass_rpc_pfs_logging' is a GLOBAL variable and should be set with SET GLOBAL | ||
SET local.bypass_rpc_pfs_logging = OFF; | ||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'local.bypass_rpc_pfs_logging = OFF' at line 1 | ||
SELECT local.bypass_rpc_pfs_logging; | ||
ERROR 42S02: Unknown table 'local' in field list | ||
SET global.bypass_rpc_pfs_logging = ON; | ||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'global.bypass_rpc_pfs_logging = ON' at line 1 | ||
SELECT global.bypass_rpc_pfs_logging; | ||
ERROR 42S02: Unknown table 'global' in field list | ||
SELECT bypass_rpc_pfs_logging = @@session.bypass_rpc_pfs_logging; | ||
ERROR HY000: Variable 'bypass_rpc_pfs_logging' is a GLOBAL variable | ||
SET @@global.bypass_rpc_pfs_logging = @start_value; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
@@global.bypass_rpc_pfs_logging | ||
0 |
78 changes: 78 additions & 0 deletions
78
mysql-test/suite/sys_vars/t/bypass_rpc_pfs_logging_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
SET @start_value = @@global.bypass_rpc_pfs_logging; | ||
SELECT @start_value; | ||
|
||
|
||
SET @@global.bypass_rpc_pfs_logging = DEFAULT; | ||
SELECT @@global.bypass_rpc_pfs_logging = TRUE; | ||
|
||
|
||
SET @@global.bypass_rpc_pfs_logging = ON; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
SET @@global.bypass_rpc_pfs_logging = OFF; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
|
||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = 2; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = -1; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = TRUEF; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = TRUE_F; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = FALSE0; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = OON; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = ONN; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = OOFF; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = 0FF; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = ' '; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = " "; | ||
--Error ER_WRONG_VALUE_FOR_VAR | ||
SET @@global.bypass_rpc_pfs_logging = ''; | ||
|
||
|
||
--Error ER_GLOBAL_VARIABLE | ||
SET @@session.bypass_rpc_pfs_logging = OFF; | ||
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
SELECT @@session.bypass_rpc_pfs_logging; | ||
|
||
|
||
SELECT IF(@@global.bypass_rpc_pfs_logging, "ON", "OFF") = VARIABLE_VALUE | ||
FROM performance_schema.global_variables | ||
WHERE VARIABLE_NAME='bypass_rpc_pfs_logging'; | ||
|
||
|
||
SET @@global.bypass_rpc_pfs_logging = 0; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
SET @@global.bypass_rpc_pfs_logging = 1; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
|
||
SET @@global.bypass_rpc_pfs_logging = TRUE; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
SET @@global.bypass_rpc_pfs_logging = FALSE; | ||
SELECT @@global.bypass_rpc_pfs_logging; | ||
|
||
SET @@global.bypass_rpc_pfs_logging = ON; | ||
SELECT @@bypass_rpc_pfs_logging = @@global.bypass_rpc_pfs_logging; | ||
|
||
--Error ER_GLOBAL_VARIABLE | ||
SET bypass_rpc_pfs_logging = ON; | ||
--Error ER_PARSE_ERROR | ||
SET local.bypass_rpc_pfs_logging = OFF; | ||
--Error ER_UNKNOWN_TABLE | ||
SELECT local.bypass_rpc_pfs_logging; | ||
--Error ER_PARSE_ERROR | ||
SET global.bypass_rpc_pfs_logging = ON; | ||
--Error ER_UNKNOWN_TABLE | ||
SELECT global.bypass_rpc_pfs_logging; | ||
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
SELECT bypass_rpc_pfs_logging = @@session.bypass_rpc_pfs_logging; | ||
|
||
SET @@global.bypass_rpc_pfs_logging = @start_value; | ||
SELECT @@global.bypass_rpc_pfs_logging; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
mysql-test/suite/thrift_server/r/bypass_pfs_logging.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
CREATE TABLE t1(c1 BIGINT NOT NULL, c2 VARCHAR(64), c3 int NOT NULL, PRIMARY KEY (c1)); | ||
insert into t1 values (1, 'v1', 2), (2, 'v2', 3), (3, null, 4); | ||
SELECT @@bypass_rpc_pfs_logging INTO @save_bypass_rpc_pfs_logging; | ||
TRUNCATE TABLE performance_schema.events_statements_summary_by_all; | ||
|
||
TEST CASE performance_schema_esms_by_all=off. bypass_rpc_pfs_logging=off. No data in events_statements_summary_by_all | ||
|
||
set global performance_schema_esms_by_all = off; | ||
set global bypass_rpc_pfs_logging = off; | ||
select @@performance_schema_esms_by_all; | ||
@@performance_schema_esms_by_all | ||
0 | ||
select @@bypass_rpc_pfs_logging; | ||
@@bypass_rpc_pfs_logging | ||
0 | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":2}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":4,"name":"c2"}] | ||
1 row [{"signedIntVal":2}, {"stringVal":"v2"}] | ||
2 row [{"signedIntVal":3}, {"isNull":true}] | ||
3 hlcTsLowerBound 0 | ||
select schema_name, digest, user, client_id, plan_id, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_all where query_sample_text like '%bypass rpc%'; | ||
schema_name digest user client_id plan_id count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
select schema_name, digest, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_digest where query_sample_text like '%bypass rpc%'; | ||
schema_name digest count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
test 7ccb84550cd3166e3616468625636da4 1 0 0 0 | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
|
||
TEST CASE performance_schema_esms_by_all=off. bypass_rpc_pfs_logging=on. No data in events_statements_summary_by_all since | ||
primary switch 'performance_schema.esms_by_all' is turned off. | ||
echo | ||
set global performance_schema_esms_by_all = off; | ||
set global bypass_rpc_pfs_logging = on; | ||
select @@performance_schema_esms_by_all; | ||
@@performance_schema_esms_by_all | ||
0 | ||
select @@bypass_rpc_pfs_logging; | ||
@@bypass_rpc_pfs_logging | ||
1 | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":2}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":4,"name":"c2"}] | ||
1 row [{"signedIntVal":2}, {"stringVal":"v2"}] | ||
2 row [{"signedIntVal":3}, {"isNull":true}] | ||
3 hlcTsLowerBound 0 | ||
select schema_name, digest, client_id, plan_id, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_all where query_sample_text like '%bypass rpc%'; | ||
schema_name digest client_id plan_id count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
select schema_name, digest, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_digest where query_sample_text like '%bypass rpc%'; | ||
schema_name digest count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
test e8f3d908aa6ac78634d186bb58579527 1 0 0 0 | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
|
||
TEST CASE performance_schema_esms_by_all=on. bypass_rpc_pfs_logging=off. Data will be stored in sql_statistics, but not bypass_rpc queries | ||
|
||
set global performance_schema_esms_by_all = on; | ||
set global bypass_rpc_pfs_logging = off; | ||
select @@performance_schema_esms_by_all; | ||
@@performance_schema_esms_by_all | ||
1 | ||
select @@bypass_rpc_pfs_logging; | ||
@@bypass_rpc_pfs_logging | ||
0 | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":2}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":4,"name":"c2"}] | ||
1 row [{"signedIntVal":2}, {"stringVal":"v2"}] | ||
2 row [{"signedIntVal":3}, {"isNull":true}] | ||
3 hlcTsLowerBound 0 | ||
select schema_name, digest, client_id, plan_id, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_all where query_sample_text like '%bypass rpc%'; | ||
schema_name digest client_id plan_id count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
select schema_name, digest, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_digest where query_sample_text like '%bypass rpc%'; | ||
schema_name digest count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
|
||
TEST CASE performance_schema_esms_by_all=on. bypass_rpc_pfs_logging=on. Data will be stored in sql_statistics | ||
|
||
set global performance_schema_esms_by_all = on; | ||
set global bypass_rpc_pfs_logging = on; | ||
select @@performance_schema_esms_by_all; | ||
@@performance_schema_esms_by_all | ||
1 | ||
select @@bypass_rpc_pfs_logging; | ||
@@bypass_rpc_pfs_logging | ||
1 | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":2}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":4,"name":"c2"}] | ||
1 row [{"signedIntVal":2}, {"stringVal":"v2"}] | ||
2 row [{"signedIntVal":3}, {"isNull":true}] | ||
3 hlcTsLowerBound 0 | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":3}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":5,"name":"c2"}] | ||
1 row [{"signedIntVal":3}, {"isNull":true}] | ||
2 hlcTsLowerBound 0 | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
SET GLOBAL THRIFT_SERVER_TESTER_INPUT='bypass: {"db_name":"test","table_name":"t1","columns":["c1", "c2"],"where":[{"column":"c3","op":2,"value":{"signedIntVal":2}},{"column":"c3","op":1,"value":{"signedIntVal":4}}]}'; | ||
SELECT SEQ_NUMBER, TYPE, VALUE FROM THRIFT_SERVER_PLUGIN_OUTPUT ORDER BY SEQ_NUMBER; | ||
SEQ_NUMBER TYPE VALUE | ||
0 header [{"type":2,"name":"c1"}, {"type":4,"name":"c2"}] | ||
1 row [{"signedIntVal":2}, {"stringVal":"v2"}] | ||
2 hlcTsLowerBound 0 | ||
TRUNCATE TABLE THRIFT_SERVER_PLUGIN_OUTPUT; | ||
select schema_name, digest, client_id, plan_id, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_all where query_sample_text like '%bypass rpc%'; | ||
schema_name digest client_id plan_id count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
test 5c3a390111f66b62dee3b0fca221c091 00000000000000000000000000000000 00000000000000000000000000000000 2 0 0 0 | ||
test aac67466d0e9c28fa3daff45bf1c4d20 00000000000000000000000000000000 00000000000000000000000000000000 1 0 0 0 | ||
select schema_name, digest, count_star, sum_rows_deleted, sum_rows_inserted, sum_rows_updated from performance_schema.events_statements_summary_by_digest where query_sample_text like '%bypass rpc%'; | ||
schema_name digest count_star sum_rows_deleted sum_rows_inserted sum_rows_updated | ||
Cleanup | ||
set global performance_schema_esms_by_all = DEFAULT; | ||
SET GLOBAL bypass_rpc_pfs_logging = @save_bypass_rpc_pfs_logging; | ||
drop table t1; |
Oops, something went wrong.