Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: PengFei Li <[email protected]>
  • Loading branch information
banmoy committed Jan 27, 2025
1 parent 4c0d1e5 commit ca6182e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
28 changes: 27 additions & 1 deletion test/sql/test_profile/R/test_load_channel_profile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,33 @@ INSERT INTO `t0` (v1, v2, v3) values
(2, 4, 12);
-- result:
-- !result
shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh
SET enable_profile=true;
-- result:
-- !result
SET enable_async_profile=false;
-- result:
-- !result
INSERT INTO t0 WITH LABEL label_${uuid0} SELECT * FROM t0;
-- result:
-- !result
shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" label="label_${uuid0}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh
-- result:
0
Analyze profile succeeded
Analyze profile succeeded
-- !result
alter table t0 set('enable_load_profile'='true');
-- result:
-- !result
shell: curl --location-trusted -u root: -H "Expect:100-continue" -H "label: "label_${uuid1}"" -H "column_separator: ," -d '1,2,3' -X PUT ${url}/api/${db[0]}/t0/_stream_load
-- result:
0
{
"Status": "Success",
"Message": "OK"
}
-- !result
shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" label="label_${uuid1}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh
-- result:
0
Analyze profile succeeded
Expand Down
9 changes: 8 additions & 1 deletion test/sql/test_profile/T/test_load_channel_profile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ INSERT INTO `t0` (v1, v2, v3) values
(2, 4, 11),
(2, 4, 12);

shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh
SET enable_profile=true;
SET enable_async_profile=false;
INSERT INTO t0 WITH LABEL label_${uuid0} SELECT * FROM t0;
shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" label="label_${uuid0}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh

alter table t0 set('enable_load_profile'='true');
shell: curl --location-trusted -u root: -H "Expect:100-continue" -H "label: "label_${uuid1}"" -H "column_separator: ," -d '1,2,3' -X PUT ${url}/api/${db[0]}/t0/_stream_load
shell: env mysql_cmd="${mysql_cmd} -D${db[0]}" label="label_${uuid1}" bash ${root_path}/sql/test_profile/T/test_load_channel_profile_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ function check_keywords() {
}

sql=$(cat << EOF
SET enable_profile=true;
SET enable_async_profile=false;
INSERT INTO t0 SELECT * FROM t0;
SELECT get_query_profile(last_query_id());
SELECT get_query_profile(PROFILE_ID) AS result FROM information_schema.loads WHERE LABEL = '${label}';
EOF
)

Expand Down

0 comments on commit ca6182e

Please sign in to comment.