Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] net.box: fix 'unique' index flag in net.box schema
Date: Mon, 1 Apr 2019 11:42:03 +0300	[thread overview]
Message-ID: <9ae2ce53-0956-effd-e0a1-6fcd93559167@tarantool.org> (raw)
In-Reply-To: <a47e7685ffd74e3e9049ed62e38fa60370b8e5f9.1554095230.git.alexander.turenko@tarantool.org>


> diff --git a/test/box-tap/gh-4091-net.box-indexes-are-always-non-unique.test.lua b/test/box-tap/gh-4091-net.box-indexes-are-always-non-unique.test.lua
> new file mode 100755
> index 000000000..04c576915
> --- /dev/null
> +++ b/test/box-tap/gh-4091-net.box-indexes-are-always-non-unique.test.lua

Please, just add a one line to box/net.box.lua. It does not help at all
to have a new file per each issue. This way looks bulky and hard to search
for something.

> @@ -0,0 +1,30 @@
> +#!/usr/bin/env tarantool
> +
> +local tap = require('tap')
> +local net_box = require('net.box')
> +local urilib = require('uri')
> +
> +box.cfg({
> +    listen = os.getenv('LISTEN') or 'localhost:3301',
> +})
> +
> +box.schema.user.grant('guest', 'read,write,execute', 'universe')
> +
> +box.schema.create_space('s')
> +box.space.s:create_index('pk')
> +box.space.s:create_index('sk', {unique = false})
> +
> +local test = tap.test('gh-4091-net.box-indexes-are-always-non-unique')
> +test:plan(2)
> +
> +local uri = urilib.parse(box.cfg.listen)
> +local uri = ('%s:%s'):format(uri.host or 'localhost', uri.service)
> +local conn = net_box.connect(uri)
> +
> +test:is(conn.space.s.index.pk.unique, true, 'unique index')
> +test:is(conn.space.s.index.sk.unique, false, 'non-unique index')
> +
> +box.space.s:drop()
> +box.schema.user.revoke('guest', 'read,write,execute', 'universe')
> +
> +os.exit(test:check() == true and 0 or 1)
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-04-01  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01  5:08 [tarantool-patches] " Alexander Turenko
2019-04-01  8:42 ` Vladislav Shpilevoy [this message]
2019-04-01 10:08   ` [tarantool-patches] " Alexander Turenko
2019-04-01 15:32     ` Vladislav Shpilevoy
2019-04-01 16:15       ` Alexander Turenko
2019-04-01 17:51         ` Vladislav Shpilevoy
2019-04-12 16:22 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ae2ce53-0956-effd-e0a1-6fcd93559167@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] net.box: fix '\''unique'\'' index flag in net.box schema' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox