[tarantool-patches] Re: [PATCH v5 3/6] sql: Show currently set sql_default_engine

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Jan 30 16:57:00 MSK 2019



On 29/01/2019 17:29, imeevma at tarantool.org wrote:
> After this patch, "PRAGMA sql_default_engine" called without
> arguments will return currently set sql_default_engine.
> ---
>   src/box/sql/pragma.c                 | 18 +++++++++++++-----
>   test/sql-tap/gh-2367-pragma.test.lua | 35 +++++++++++++++++++++++++++--------
>   2 files changed, 40 insertions(+), 13 deletions(-)
> 
> diff --git a/test/sql-tap/gh-2367-pragma.test.lua b/test/sql-tap/gh-2367-pragma.test.lua
> index c0792c9..90ecd56 100755
> --- a/test/sql-tap/gh-2367-pragma.test.lua
> +++ b/test/sql-tap/gh-2367-pragma.test.lua
> +--
> +-- gh-3832: Some statements do not return column type
> +--
> +-- Check that "PRAGMA sql_default_engine" called without arguments
> +-- returns currently set sql_default_engine.
>   test:do_catchsql_test(
> -	"pragma-2.5",
> +	"pragma-3.1",
>   	[[
> -		pragma sql_default_engine 1;
> +		pragma sql_default_engine='vinyl';
> +		pragma sql_default_engine;
>   	]], {
> -	1, 'near \"1\": syntax error'
> +	-- <pragma-3.1>
> +	0, {'vinyl'}
> +	-- <pragma-3.1>

If a test does not fail, you should not use
test:do_catchsql_test. We have do_test for this.

Also, this file is named gh-2367-***, but you added
here a test for gh-3832. This is why it made no
sense to create a new file on each issue. Please,
rename it to pragma.test.lua.

> +})
> +
> +test:do_catchsql_test(
> +	"pragma-3.2",
> +	[[
> +		pragma sql_default_engine='memtx';
> +		pragma sql_default_engine;
> +	]], {
> +	-- <pragma-3.2>
> +	0, {'memtx'}
> +	-- <pragma-3.2>
>   })
>   
>   test:finish_test()
> -- 
> 2.7.4
> 
> 




More information about the Tarantool-patches mailing list