From: Mergen Imeev via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH v1 1/3] sql: change mpstream_encode_vdbe_mem() signature Date: Wed, 17 Nov 2021 17:41:01 +0300 [thread overview] Message-ID: <1005f2a866e943ce95c940af4fb73e55d32a2bba.1637159909.git.imeevma@gmail.com> (raw) In-Reply-To: <cover.1637159909.git.imeevma@gmail.com> This patch changes the signature of mpstream_encode_vdbe_mem(), so it now follows the general rule that applies to most functions in mem.c. --- src/box/sql/mem.c | 6 +++--- src/box/sql/mem.h | 7 ++++--- src/box/sql/vdbe.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c index aaed522ef..356b2c7be 100644 --- a/src/box/sql/mem.c +++ b/src/box/sql/mem.c @@ -2971,7 +2971,7 @@ mem_from_mp(struct Mem *mem, const char *buf, uint32_t *len) } void -mpstream_encode_vdbe_mem(struct mpstream *stream, struct Mem *var) +mem_to_mpstream(const struct Mem *var, struct mpstream *stream) { assert(memIsValid(var)); switch (var->type) { @@ -3023,7 +3023,7 @@ sql_vdbe_mem_encode_tuple(struct Mem *fields, uint32_t field_count, set_encode_error, &is_error); mpstream_encode_array(&stream, field_count); for (struct Mem *field = fields; field < fields + field_count; field++) - mpstream_encode_vdbe_mem(&stream, field); + mem_to_mpstream(field, &stream); mpstream_flush(&stream); if (is_error) { diag_set(OutOfMemory, stream.pos - stream.buf, @@ -3120,7 +3120,7 @@ port_vdbemem_get_msgpack(struct port *base, uint32_t *size) set_encode_error, &is_error); mpstream_encode_array(&stream, port->mem_count); for (uint32_t i = 0; i < port->mem_count && !is_error; i++) - mpstream_encode_vdbe_mem(&stream, (struct Mem *)port->mem + i); + mem_to_mpstream((struct Mem *)port->mem + i, &stream); mpstream_flush(&stream); *size = region_used(region) - region_svp; if (is_error) diff --git a/src/box/sql/mem.h b/src/box/sql/mem.h index c983534d5..c1a18fd3a 100644 --- a/src/box/sql/mem.h +++ b/src/box/sql/mem.h @@ -836,12 +836,13 @@ int mem_from_mp(struct Mem *mem, const char *buf, uint32_t *len); /** - * Perform encoding memory variable to stream. + * Perform encoding of MEM to stream. + * + * @param var MEM to encode to stream. * @param stream Initialized mpstream encoder object. - * @param var Vdbe memory variable to encode with stream. */ void -mpstream_encode_vdbe_mem(struct mpstream *stream, struct Mem *var); +mem_to_mpstream(const struct Mem *var, struct mpstream *stream); /** * Perform encoding field_count Vdbe memory fields on region as diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index 0c4e38557..3892cc102 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -3497,7 +3497,7 @@ case OP_Update: { mpstream_encode_array(&stream, 3); mpstream_encode_strn(&stream, "=", 1); mpstream_encode_uint(&stream, field_idx); - mpstream_encode_vdbe_mem(&stream, new_tuple + field_idx); + mem_to_mpstream(new_tuple + field_idx, &stream); } mpstream_flush(&stream); if (is_error) { -- 2.25.1
next prev parent reply other threads:[~2021-11-17 14:41 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-17 14:40 [Tarantool-patches] [PATCH v1 0/3] Introduce syntax for ARRAY values Mergen Imeev via Tarantool-patches 2021-11-17 14:41 ` Mergen Imeev via Tarantool-patches [this message] 2021-11-17 14:41 ` [Tarantool-patches] [PATCH v1 2/3] sql: refactor sql_vdbe_mem_encode_tuple() Mergen Imeev via Tarantool-patches 2021-11-19 23:35 ` Vladislav Shpilevoy via Tarantool-patches 2021-11-24 7:24 ` Mergen Imeev via Tarantool-patches 2021-11-17 14:41 ` [Tarantool-patches] [PATCH v1 3/3] sql: introduce syntax for ARRAY values Mergen Imeev via Tarantool-patches 2021-11-19 23:36 ` Vladislav Shpilevoy via Tarantool-patches 2021-11-24 7:29 ` Mergen Imeev via Tarantool-patches 2021-11-29 23:06 ` [Tarantool-patches] [PATCH v1 0/3] Introduce " Vladislav Shpilevoy via Tarantool-patches 2021-11-30 8:43 Mergen Imeev via Tarantool-patches 2021-11-30 8:43 ` [Tarantool-patches] [PATCH v1 1/3] sql: change mpstream_encode_vdbe_mem() signature Mergen Imeev via Tarantool-patches
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=1005f2a866e943ce95c940af4fb73e55d32a2bba.1637159909.git.imeevma@gmail.com \ --to=tarantool-patches@dev.tarantool.org \ --cc=imeevma@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v1 1/3] sql: change mpstream_encode_vdbe_mem() signature' \ /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