Commit 105f46ff authored by Marko Mäkelä's avatar Marko Mäkelä

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.)
parent aad15eae
...@@ -568,12 +568,6 @@ btr_search_update_block_hash_info( ...@@ -568,12 +568,6 @@ btr_search_update_block_hash_info(
block->left_side = info->left_side; block->left_side = info->left_side;
} }
#ifdef UNIV_DEBUG
if (cursor->index->table->does_not_fit_in_memory) {
block->n_hash_helps = 0;
}
#endif /* UNIV_DEBUG */
if ((block->n_hash_helps > page_get_n_recs(block->frame) if ((block->n_hash_helps > page_get_n_recs(block->frame)
/ BTR_SEARCH_PAGE_BUILD_LIMIT) / BTR_SEARCH_PAGE_BUILD_LIMIT)
&& (info->n_hash_potential >= BTR_SEARCH_BUILD_LIMIT)) { && (info->n_hash_potential >= BTR_SEARCH_BUILD_LIMIT)) {
......
...@@ -1532,15 +1532,6 @@ struct dict_table_t { ...@@ -1532,15 +1532,6 @@ struct dict_table_t {
/*!< set of foreign key constraints which refer to this table */ /*!< set of foreign key constraints which refer to this table */
dict_foreign_set referenced_set; dict_foreign_set referenced_set;
#ifdef UNIV_DEBUG
/** This field is used to specify in simulations tables which are so
big that disk should be accessed. Disk access is simulated by putting
the thread to sleep for a while. NOTE that this flag is not stored to
the data dictionary on disk, and the database will forget about value
TRUE if it has to reload the table definition from disk. */
ibool does_not_fit_in_memory;
#endif /* UNIV_DEBUG */
/** TRUE if the maximum length of a single row exceeds BIG_ROW_SIZE. /** TRUE if the maximum length of a single row exceeds BIG_ROW_SIZE.
Initialized in dict_table_add_to_cache(). */ Initialized in dict_table_add_to_cache(). */
unsigned big_rows:1; unsigned big_rows:1;
......
This diff is collapsed.
...@@ -373,18 +373,7 @@ pars_create_table( ...@@ -373,18 +373,7 @@ pars_create_table(
table */ table */
sym_node_t* column_defs, /*!< in: list of column names */ sym_node_t* column_defs, /*!< in: list of column names */
sym_node_t* compact, /* in: non-NULL if COMPACT table. */ sym_node_t* compact, /* in: non-NULL if COMPACT table. */
sym_node_t* block_size, /* in: block size (can be NULL) */ sym_node_t* block_size); /* in: block size (can be NULL) */
void* not_fit_in_memory);
/*!< 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 */
/*********************************************************************//** /*********************************************************************//**
Parses an index creation operation. Parses an index creation operation.
@return index create subgraph */ @return index create subgraph */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/bash #!/bin/bash
# #
# Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. # 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 # 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 # the terms of the GNU General Public License as published by the Free Software
...@@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE ...@@ -31,6 +32,7 @@ echo '#include "univ.i"' > $OUTFILE
# a warning on Win64. Add the cast. Also define some symbols as static. # a warning on Win64. Add the cast. Also define some symbols as static.
sed -e ' sed -e '
s/'"$TMPFILE"'/'"$OUTFILE"'/; 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/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/;
s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/;
s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) 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/; ...@@ -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/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/;
s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/; s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/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/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/;
s/^\(\(FILE\|char\) *\* *yyget\)/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 ' < $TMPFILE >> $OUTFILE
rm $TMPFILE rm $TMPFILE
This source diff could not be displayed because it is too large. You can view the blob instead.
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -102,7 +103,6 @@ yylex(void); ...@@ -102,7 +103,6 @@ yylex(void);
%token PARS_INDEX_TOKEN %token PARS_INDEX_TOKEN
%token PARS_UNIQUE_TOKEN %token PARS_UNIQUE_TOKEN
%token PARS_CLUSTERED_TOKEN %token PARS_CLUSTERED_TOKEN
%token PARS_DOES_NOT_FIT_IN_MEM_TOKEN
%token PARS_ON_TOKEN %token PARS_ON_TOKEN
%token PARS_ASSIGN_TOKEN %token PARS_ASSIGN_TOKEN
%token PARS_DECLARE_TOKEN %token PARS_DECLARE_TOKEN
...@@ -154,6 +154,8 @@ yylex(void); ...@@ -154,6 +154,8 @@ yylex(void);
%left NEG /* negation--unary minus */ %left NEG /* negation--unary minus */
%left '%' %left '%'
%expect 41
/* Grammar follows */ /* Grammar follows */
%% %%
...@@ -573,13 +575,6 @@ opt_not_null: ...@@ -573,13 +575,6 @@ opt_not_null:
/* pass any non-NULL pointer */ } /* 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: compact:
/* Nothing */ { $$ = NULL; } /* Nothing */ { $$ = NULL; }
| PARS_COMPACT_TOKEN { $$ = &pars_int_token; | PARS_COMPACT_TOKEN { $$ = &pars_int_token;
...@@ -595,12 +590,12 @@ block_size: ...@@ -595,12 +590,12 @@ block_size:
create_table: create_table:
PARS_CREATE_TOKEN PARS_TABLE_TOKEN PARS_CREATE_TOKEN PARS_TABLE_TOKEN
table_name '(' column_def_list ')' table_name '(' column_def_list ')'
not_fit_in_memory compact block_size compact block_size
{ $$ = pars_create_table( { $$ = pars_create_table(
static_cast<sym_node_t*>($3), static_cast<sym_node_t*>($3),
static_cast<sym_node_t*>($5), static_cast<sym_node_t*>($5),
static_cast<sym_node_t*>($8), static_cast<sym_node_t*>($7),
static_cast<sym_node_t*>($9), $7); } static_cast<sym_node_t*>($8)); }
; ;
column_list: column_list:
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -66,7 +67,7 @@ Created 12/14/1997 Heikki Tuuri ...@@ -66,7 +67,7 @@ Created 12/14/1997 Heikki Tuuri
/* Note: We cast &result to int* from yysize_t* */ /* Note: We cast &result to int* from yysize_t* */
#define YY_INPUT(buf, result, max_size) \ #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 */ /* String buffer for removing quotes */
static ulint stringbuf_len_alloc = 0; /* Allocated length */ static ulint stringbuf_len_alloc = 0; /* Allocated length */
...@@ -425,10 +426,6 @@ In the state 'id', only two actions are possible (defined below). */ ...@@ -425,10 +426,6 @@ In the state 'id', only two actions are possible (defined below). */
return(PARS_CLUSTERED_TOKEN); return(PARS_CLUSTERED_TOKEN);
} }
"DOES_NOT_FIT_IN_MEMORY" {
return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN);
}
"ON" { "ON" {
return(PARS_ON_TOKEN); return(PARS_ON_TOKEN);
} }
......
...@@ -1857,18 +1857,7 @@ pars_create_table( ...@@ -1857,18 +1857,7 @@ pars_create_table(
table */ table */
sym_node_t* column_defs, /*!< in: list of column names */ sym_node_t* column_defs, /*!< in: list of column names */
sym_node_t* compact, /* in: non-NULL if COMPACT table. */ sym_node_t* compact, /* in: non-NULL if COMPACT table. */
sym_node_t* block_size, /* in: block size (can be NULL) */ 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 */
{ {
dict_table_t* table; dict_table_t* table;
sym_node_t* column; sym_node_t* column;
...@@ -1932,11 +1921,6 @@ pars_create_table( ...@@ -1932,11 +1921,6 @@ pars_create_table(
table = dict_mem_table_create( table = dict_mem_table_create(
table_sym->name, 0, n_cols, 0, flags, flags2); 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; column = column_defs;
while (column) { while (column) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment