[Tarantool-patches] [PATCH] box: sql prepare and execute statistics should be reflected in box.stat()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Mar 4 01:39:54 MSK 2020


Thanks for the patch!

See 2 comments below.

> Calling prepare and execute did not update corresponding request statistics
> in the box.stat table. This happened because methods that collect stats were
> never called where they should have been.

1. I don't think we can make this commit have the same commit message
as the original commit (even with an amendment below). And it should not
be 'Closes'. This is rather 'Follow-up'.

> There was a bug in previous commit resulting in collecting statistics on
> box.execute twice in some cases.
>  
> Closes #4756
> ---
> Issue:
> https://github.com/tarantool/tarantool/issues/4756
> Branch:
> https://github.com/tarantool/tarantool/tree/eljashm/gh-4756-hotfix-box-stat-execute-prepare 
> > diff --git a/test/sql/iproto.result b/test/sql/iproto.result
> index a391307d1..0e046577d 100644
> --- a/test/sql/iproto.result
> +++ b/test/sql/iproto.result
> @@ -800,22 +800,22 @@ e = box.stat().EXECUTE.total
>  s = box.prepare([[ SELECT ?; ]])
>  ---
>  ...
> -s:execute({42})
> +res, err = box.unprepare(s)
>  ---
> -- metadata:
> -  - name: '?'
> -    type: integer
> -  rows:
> -  - [42]
>  ...
> -res, err = box.unprepare(s)
> +box.execute('create table test (id integer primary key, a integer)')
>  ---
> +- row_count: 1
> +...
> +box.execute('DROP TABLE test')

2. Is it important to call DDL? Would 'box.execute('SELECT 1;')' be
enough?


More information about the Tarantool-patches mailing list