MDEV-12273 Remove dict_table_t::does_not_fit_in_memory

In the InnoDB internal SQL parser, there is the keyword
DOES_NOT_FIT_IN_MEMORY that is never specified in any CREATE TABLE
statement that is passed to the InnoDB SQL parser
(que_eval_sql() or pars_sql() or yyparse()). If this keyword were
ever present, it would set the flag dict_table_t::does_not_fit_in_memory
which is only present in debug builds.

Let us remove all traces of this.

Also, fix storage/innobase/pars/make_flex.sh so that no the generated
file storage/innobase/pars/lexyy.cc works as is.

FIXME: Always generate the InnoDB Bison files at build time, similar
to how sql/sql_yacc.yy is handled. (This would still leave the
generated scanner files, unless we want to add a build-time dependency
for Flex.)
This commit is contained in:
Marko Mäkelä 2017-03-15 15:56:17 +02:00
commit 105f46ffb8
10 changed files with 2514 additions and 2808 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
#!/bin/bash
#
# Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
# Copyright (c) 2017, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE
# a warning on Win64. Add the cast. Also define some symbols as static.
sed -e '
s/'"$TMPFILE"'/'"$OUTFILE"'/;
s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);//
s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/;
s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/;
s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/;
@ -38,10 +40,12 @@ s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/;
s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/;
s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/;
s/extern int yy\(leng\|_flex_debug\|lineno\);//;
s/\(int yy\(leng\|lineno\|_flex_debug\)\)/static \1/;
s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/;
s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/;
s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/;
s/^extern \(\(FILE\|char\) *\* *yy\).*//;
s/^\(FILE\|char\) *\* *yy/static &/;
' < $TMPFILE >> $OUTFILE
rm $TMPFILE

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -102,7 +103,6 @@ yylex(void);
%token PARS_INDEX_TOKEN
%token PARS_UNIQUE_TOKEN
%token PARS_CLUSTERED_TOKEN
%token PARS_DOES_NOT_FIT_IN_MEM_TOKEN
%token PARS_ON_TOKEN
%token PARS_ASSIGN_TOKEN
%token PARS_DECLARE_TOKEN
@ -154,6 +154,8 @@ yylex(void);
%left NEG /* negation--unary minus */
%left '%'
%expect 41
/* Grammar follows */
%%
@ -573,13 +575,6 @@ opt_not_null:
/* pass any non-NULL pointer */ }
;
not_fit_in_memory:
/* Nothing */ { $$ = NULL; }
| PARS_DOES_NOT_FIT_IN_MEM_TOKEN
{ $$ = &pars_int_token;
/* pass any non-NULL pointer */ }
;
compact:
/* Nothing */ { $$ = NULL; }
| PARS_COMPACT_TOKEN { $$ = &pars_int_token;
@ -595,12 +590,12 @@ block_size:
create_table:
PARS_CREATE_TOKEN PARS_TABLE_TOKEN
table_name '(' column_def_list ')'
not_fit_in_memory compact block_size
compact block_size
{ $$ = pars_create_table(
static_cast<sym_node_t*>($3),
static_cast<sym_node_t*>($5),
static_cast<sym_node_t*>($8),
static_cast<sym_node_t*>($9), $7); }
static_cast<sym_node_t*>($7),
static_cast<sym_node_t*>($8)); }
;
column_list:

View file

@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -66,7 +67,7 @@ Created 12/14/1997 Heikki Tuuri
/* Note: We cast &result to int* from yysize_t* */
#define YY_INPUT(buf, result, max_size) \
pars_get_lex_chars(buf, (int*) &result, max_size)
(result = pars_get_lex_chars(buf, max_size))
/* String buffer for removing quotes */
static ulint stringbuf_len_alloc = 0; /* Allocated length */
@ -425,10 +426,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_CLUSTERED_TOKEN);
}
"DOES_NOT_FIT_IN_MEMORY" {
return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN);
}
"ON" {
return(PARS_ON_TOKEN);
}

View file

@ -1857,18 +1857,7 @@ pars_create_table(
table */
sym_node_t* column_defs, /*!< in: list of column names */
sym_node_t* compact, /* in: non-NULL if COMPACT table. */
sym_node_t* block_size, /* in: block size (can be NULL) */
void* not_fit_in_memory MY_ATTRIBUTE((unused)))
/*!< in: a non-NULL pointer means that
this is a table which in simulations
should be simulated as not fitting
in memory; thread is put to sleep
to simulate disk accesses; NOTE that
this flag is not stored to the data
dictionary on disk, and the database
will forget about non-NULL value if
it has to reload the table definition
from disk */
sym_node_t* block_size) /* in: block size (can be NULL) */
{
dict_table_t* table;
sym_node_t* column;
@ -1932,11 +1921,6 @@ pars_create_table(
table = dict_mem_table_create(
table_sym->name, 0, n_cols, 0, flags, flags2);
#ifdef UNIV_DEBUG
if (not_fit_in_memory != NULL) {
table->does_not_fit_in_memory = TRUE;
}
#endif /* UNIV_DEBUG */
column = column_defs;
while (column) {