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"
	<tarantool-patches@freelists.org>
Subject: [tarantool-patches] Re: [tarantool] 02/03: sql: remove SQL fields from Table and Column
Date: Wed, 23 May 2018 00:29:40 +0300	[thread overview]
Message-ID: <602a6eac-ffd0-c4b1-74a3-bcbab3d7bbf3@tarantool.org> (raw)
In-Reply-To: <1527022913.906931598.31425120730523877@mxpdd15.i.mail.ru>

Hello. Thanks for the patch! See 1 comment below.

On 23/05/2018 00:12, Kirill Shcherbatov wrote:
> This is an automated email from the git hooks/post-receive script.
> 
> kshcherbatov pushed a commit to branch gh-3272-no-sql-checks
> in repository tarantool.
> 
> commit e5bc5697d6418f3ce2e69bb05cebb1e68e0e24a6
> Author: Kirill Shcherbatov <kshcherbatov@tarantool.org>
> AuthorDate: Mon May 21 16:02:14 2018 +0300
> 
>      sql: remove SQL fields from Table and Column
>      
>      1. Removed zName, is_nullable, type from SQL Column.
>      2. Removed zColumns, zName from SQL Table.
>      3. Refactored Parser to use def_expression directly.
>      4. Introduced sql_table_def_rebuild intended for collect
>      fragmented with sql_field_retrieve space_def into memory
>      located in one allocation.
>      
>      Part of #3272, #3218.
> ---
>   src/box/field_def.h     |   6 +
>   src/box/space_def.c     |  36 ++---
>   src/box/space_def.h     |  20 +++
>   src/box/sql.c           | 120 ++++++++++++----
>   src/box/sql.h           |  32 +++++
>   src/box/sql/alter.c     |  54 +++++---
>   src/box/sql/analyze.c   |  16 ++-
>   src/box/sql/build.c     | 360 ++++++++++++++++++++++++++----------------------
>   src/box/sql/delete.c    |   6 +-
>   src/box/sql/expr.c      |  17 ++-
>   src/box/sql/fkey.c      |  37 ++---
>   src/box/sql/hash.c      |  10 +-
>   src/box/sql/hash.h      |   3 +-
>   src/box/sql/insert.c    |  77 ++++++-----
>   src/box/sql/pragma.c    |  66 +++++----
>   src/box/sql/prepare.c   |  43 +++---
>   src/box/sql/resolve.c   |  26 ++--
>   src/box/sql/select.c    | 200 ++++++++++++++++-----------
>   src/box/sql/sqliteInt.h |  56 +++++---
>   src/box/sql/tokenize.c  |   5 +-
>   src/box/sql/treeview.c  |   2 +-
>   src/box/sql/trigger.c   |   9 +-
>   src/box/sql/update.c    |  36 ++---
>   src/box/sql/util.c      |   9 --
>   src/box/sql/vdbe.c      |   2 +-
>   src/box/sql/vdbeaux.c   |  34 -----
>   src/box/sql/where.c     |  24 ++--
>   src/box/sql/wherecode.c |  11 +-
>   src/box/sql/whereexpr.c |   6 +-
>   29 files changed, 769 insertions(+), 554 deletions(-)
> 
> diff --git a/src/box/sql.c b/src/box/sql.c
> index c0bddd2..effceb2 100644
> --- a/src/box/sql.c
> +++ b/src/box/sql.c
> @@ -1691,3 +1701,63 @@ space_column_default_expr(uint32_t space_id, uint32_t fieldno)
>   
>   	return space->def->fields[fieldno].default_value_expr;
>   }
> +
> +struct space_def *
> +sql_ephemeral_space_def_new(Parse *parser, const char *name)
> +{
> +	struct space_def *def = NULL;
> +	struct region *region = &fiber()->gc;
> +	size_t name_len = name != NULL ? strlen(name) : 0;
> +	uint32_t dummy;
> +	size_t size = space_def_sizeof(name_len, NULL, 0, &dummy, &dummy, &dummy);
> +	def = (struct space_def *)region_alloc(region, size);
> +	if (def == NULL) {
> +		diag_set(OutOfMemory, sizeof(struct tuple_dictionary),

1. Wrong size.

> +			 "region_alloc", "sql_ephemeral_space_def_new");
> +		parser->rc = SQL_TARANTOOL_ERROR;
> +		parser->nErr++;
> +		return NULL;
> +	}
> +
> +	memset(def, 0, size);
> +	memcpy(def->name, name, name_len);
> +	def->name[name_len] = '\0';
> +	def->opts.temporary = true;
> +	return def;
> +}

           reply	other threads:[~2018-05-22 21:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1527022913.906931598.31425120730523877@mxpdd15.i.mail.ru>]

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=602a6eac-ffd0-c4b1-74a3-bcbab3d7bbf3@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [tarantool] 02/03: sql: remove SQL fields from Table and Column' \
    /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