diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2023-04-24 17:57:45 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-04-25 13:47:46 +0300 |
commit | a72b2c3ffb15541520de96c29ea482f80a57f46f (patch) | |
tree | b775b902c792d873d14e6c188026c14d2676548f /mysql-test/main | |
parent | 29fb041007285c34d9c22dbc6359a2e9b9ea32f3 (diff) | |
download | mariadb-git-a72b2c3ffb15541520de96c29ea482f80a57f46f.tar.gz |
MDEV-31121: ANALYZE statement produces 0 for all timings in embedded server
Timers require my_timer_init() call.
It was made only in mysqld_main(). Call it also from init_embedded_server().
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/analyze_format_json_emb.result | 11 | ||||
-rw-r--r-- | mysql-test/main/analyze_format_json_emb.test | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/main/analyze_format_json_emb.result b/mysql-test/main/analyze_format_json_emb.result new file mode 100644 index 00000000000..d61e205f031 --- /dev/null +++ b/mysql-test/main/analyze_format_json_emb.result @@ -0,0 +1,11 @@ +# +# MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve +# +create table t1 (a int); +insert into t1 values (0),(0); +set @js='$out'; +set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +cast(json_extract(@out,'$[0]') as DOUBLE) > 0 +1 +drop table t1; diff --git a/mysql-test/main/analyze_format_json_emb.test b/mysql-test/main/analyze_format_json_emb.test new file mode 100644 index 00000000000..dcf6f24dd8e --- /dev/null +++ b/mysql-test/main/analyze_format_json_emb.test @@ -0,0 +1,18 @@ +--source include/is_embedded.inc +--source include/big_test.inc + +--echo # +--echo # MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve +--echo # +create table t1 (a int); +insert into t1 values (0),(0); +let $out=` +analyze format=json select sleep(1+a) from t1 +`; + +evalp set @js='$out'; +set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; + +drop table t1; + |