Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
	tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: improve vdbe_field_ref fetcher
Date: Mon, 19 Aug 2019 22:00:07 +0200	[thread overview]
Message-ID: <8096b7f4-cb40-a198-2401-8f4053e655e1@tarantool.org> (raw)
In-Reply-To: <1924807e-20f8-31a4-0000-716346659f30@tarantool.org>

Hi! Thanks for the fixes. Mine are on the branch in
a separate commit and below. Squash them please, if they
are ok.

============================================================

diff --git a/src/box/column_mask.h b/src/box/column_mask.h
index 5fb0e1fe0..9470fe19c 100644
--- a/src/box/column_mask.h
+++ b/src/box/column_mask.h
@@ -125,16 +125,15 @@ column_mask_fieldno_is_set(uint64_t column_mask, uint32_t fieldno)
 
 /**
  * Set a bit with given index @a bitno in a given @a bitmask.
- * Do nothing when @a bitno is greater than size if bitmask.
+ * Do nothing when @a bitno is greater than size of bitmask.
  * @param bitmask Bitmask to test.
- * @param bitno bit number to test (must be 0-based).
+ * @param bitno Bit number to test (must be 0-based).
  */
 static inline void
 bitmask64_set_bit(uint64_t *bitmask, uint32_t bitno)
 {
-	if (bitno >= 64)
-		return;
-	*bitmask |= ((uint64_t)1 << bitno);
+	if (bitno < 64)
+		*bitmask |= ((uint64_t)1 << bitno);
 }
 
 /**
@@ -148,9 +147,7 @@ bitmask64_set_bit(uint64_t *bitmask, uint32_t bitno)
 static inline bool
 bitmask64_is_bit_set(uint64_t bitmask, uint32_t bitno)
 {
-	if (bitno >= 64)
-		return false;
-	return (bitmask & ((uint64_t)1 << bitno)) != 0;
+	return bitno < 64 && (bitmask & ((uint64_t)1 << bitno)) != 0;
 }
 
 #endif
diff --git a/test/sql/misc.result b/test/sql/misc.result
index 545be15f6..a157ddbc1 100644
--- a/test/sql/misc.result
+++ b/test/sql/misc.result
@@ -181,35 +181,10 @@ box.execute('SELECT field70, field64 FROM test')
   rows:
   - [70, 64]
 ...
-box.space.TEST:drop()
----
-...
 -- In the case below described optimization works fine.
-format = {}
----
-...
-t = {}
----
-...
-for i = 1, 70 do                                                \
-        format[i] = {name = 'FIELD'..i, type = 'unsigned'}      \
-        t[i] = i                                                \
-end
+pk:alter({parts = {66}})
 ---
 ...
-s = box.schema.create_space('TEST', {format = format})
----
-...
-pk = s:create_index('pk', {parts = {66}})
----
-...
-s:insert(t)
----
-- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
-  23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
-  43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
-  63, 64, 65, 66, 67, 68, 69, 70]
-...
 box.execute('SELECT field66, field68, field70 FROM test')
 ---
 - metadata:
diff --git a/test/sql/misc.test.lua b/test/sql/misc.test.lua
index 8067be213..541660c61 100644
--- a/test/sql/misc.test.lua
+++ b/test/sql/misc.test.lua
@@ -59,17 +59,8 @@ s = box.schema.create_space('TEST', {format = format})
 pk = s:create_index('pk', {parts = {70}})
 s:insert(t)
 box.execute('SELECT field70, field64 FROM test')
-box.space.TEST:drop()
 
 -- In the case below described optimization works fine.
-format = {}
-t = {}
-for i = 1, 70 do                                                \
-        format[i] = {name = 'FIELD'..i, type = 'unsigned'}      \
-        t[i] = i                                                \
-end
-s = box.schema.create_space('TEST', {format = format})
-pk = s:create_index('pk', {parts = {66}})
-s:insert(t)
+pk:alter({parts = {66}})
 box.execute('SELECT field66, field68, field70 FROM test')
 box.space.TEST:drop()

  reply	other threads:[~2019-08-19 19:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  7:43 [tarantool-patches] " Kirill Shcherbatov
2019-07-22  8:45 ` [tarantool-patches] " Kirill Shcherbatov
2019-08-08 21:13 ` Vladislav Shpilevoy
2019-08-12 15:14   ` Kirill Shcherbatov
2019-08-13 21:23     ` Vladislav Shpilevoy
2019-08-14 10:24       ` Kirill Shcherbatov
2019-08-14 20:18         ` Vladislav Shpilevoy
2019-08-15  8:39           ` Kirill Shcherbatov
2019-08-15 21:16             ` Vladislav Shpilevoy
2019-08-16  7:49               ` Kirill Shcherbatov
2019-08-19 20:00                 ` Vladislav Shpilevoy [this message]
2019-08-19 20:27                   ` Kirill Shcherbatov
2019-08-19 20:50                     ` Vladislav Shpilevoy
2019-08-20  9:07                     ` n.pettik
2019-08-20 18:46                       ` Vladislav Shpilevoy
2019-08-22 12:08 ` 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=8096b7f4-cb40-a198-2401-8f4053e655e1@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: improve vdbe_field_ref fetcher' \
    /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