[MDEV-31121] ANALYZE statement produces 0 for all timings in embedded server Created: 2023-04-24 Updated: 2023-04-25 Resolved: 2023-04-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Embedded Server, Optimizer |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 11.1.1, 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This was discovered by BB:
analyze_format_json_timings.test has been added recently. Before that, all tests just masked the values of r.*time_ms in ANALYZE outputs . If I make the test to print the verbatim ANALYZE output, I can see this:
Note that counter values seem to be ok (r_loops, r_rows). But timings are not. |
| Comments |
| Comment by Daniel Black [ 2023-04-24 ] | |||||||||||||||||||
|
the timer (my_timer_init) isn't initialized in embedded. Reminder - https://github.com/MariaDB/server/pull/2448 | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-04-24 ] | |||||||||||||||||||
|
This is because timing layer is not initialized correctly:
The call to
is present only in mysqld_main() only, which I guess is not run in embedded server. | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-04-24 ] | |||||||||||||||||||
|
danblack ok handled that PR. But it won't solve this bug, would it... | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-04-24 ] | |||||||||||||||||||
|
bb-10.4-mdev31121 | |||||||||||||||||||
| Comment by Rex Johnston [ 2023-04-24 ] | |||||||||||||||||||
|
confirmed. without my_timer_init() in the library initialization, ms timers return zero, with the patch, they return proper timings. e.g.
|