mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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().
This commit is contained in:
@ -565,6 +565,8 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
|||||||
if (ho_error != 0)
|
if (ho_error != 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
my_timer_init(&sys_timer_info);
|
||||||
|
|
||||||
if (init_common_variables())
|
if (init_common_variables())
|
||||||
{
|
{
|
||||||
mysql_server_end();
|
mysql_server_end();
|
||||||
|
11
mysql-test/main/analyze_format_json_emb.result
Normal file
11
mysql-test/main/analyze_format_json_emb.result
Normal file
@ -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;
|
18
mysql-test/main/analyze_format_json_emb.test
Normal file
18
mysql-test/main/analyze_format_json_emb.test
Normal file
@ -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;
|
||||||
|
|
Reference in New Issue
Block a user