mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 11:45:32 +02:00
Auto-merge from mysql-next-mr.
This commit is contained in:
commit
e29ea6c2f8
530 changed files with 20562 additions and 7140 deletions
|
|
@ -33,7 +33,14 @@ static int lex_one_token(void *arg, void *yythd);
|
|||
|
||||
sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
|
||||
|
||||
/**
|
||||
LEX_STRING constant for null-string to be used in parser and other places.
|
||||
*/
|
||||
const LEX_STRING null_lex_str= {NULL, 0};
|
||||
const LEX_STRING empty_lex_str= { (char*) "", 0 };
|
||||
|
||||
/* Longest standard keyword name */
|
||||
|
||||
#define TOCK_NAME_LENGTH 24
|
||||
|
||||
/*
|
||||
|
|
@ -138,6 +145,7 @@ Lex_input_stream::Lex_input_stream(THD *thd,
|
|||
found_semicolon(NULL),
|
||||
ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)),
|
||||
stmt_prepare_mode(FALSE),
|
||||
multi_statements(TRUE),
|
||||
in_comment(NO_COMMENT),
|
||||
m_underscore_cs(NULL)
|
||||
{
|
||||
|
|
@ -1555,7 +1563,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
|
|||
keys_onoff(rhs.keys_onoff),
|
||||
tablespace_op(rhs.tablespace_op),
|
||||
partition_names(rhs.partition_names, mem_root),
|
||||
no_parts(rhs.no_parts),
|
||||
num_parts(rhs.num_parts),
|
||||
change_level(rhs.change_level),
|
||||
datetime_field(rhs.datetime_field),
|
||||
error_if_not_empty(rhs.error_if_not_empty)
|
||||
|
|
@ -2149,7 +2157,7 @@ void st_select_lex::print_limit(THD *thd,
|
|||
to implement the clean up.
|
||||
*/
|
||||
|
||||
void st_lex::cleanup_lex_after_parse_error(THD *thd)
|
||||
void LEX::cleanup_lex_after_parse_error(THD *thd)
|
||||
{
|
||||
/*
|
||||
Delete sphead for the side effect of restoring of the original
|
||||
|
|
@ -2208,7 +2216,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
|
|||
We delay real initialization of hash (and therefore related
|
||||
memory allocation) until first insertion into this hash.
|
||||
*/
|
||||
hash_clear(&sroutines);
|
||||
my_hash_clear(&sroutines);
|
||||
}
|
||||
else if (sroutines.records)
|
||||
{
|
||||
|
|
@ -2231,7 +2239,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
|
|||
|
||||
void Query_tables_list::destroy_query_tables_list()
|
||||
{
|
||||
hash_free(&sroutines);
|
||||
my_hash_free(&sroutines);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2239,7 +2247,7 @@ void Query_tables_list::destroy_query_tables_list()
|
|||
Initialize LEX object.
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::st_lex()
|
||||
LEX::LEX()
|
||||
|
||||
NOTE
|
||||
LEX object initialized with this constructor can be used as part of
|
||||
|
|
@ -2249,7 +2257,7 @@ void Query_tables_list::destroy_query_tables_list()
|
|||
for this.
|
||||
*/
|
||||
|
||||
st_lex::st_lex()
|
||||
LEX::LEX()
|
||||
:result(0),
|
||||
sql_command(SQLCOM_END), option_type(OPT_DEFAULT), is_lex_started(0)
|
||||
{
|
||||
|
|
@ -2266,7 +2274,7 @@ st_lex::st_lex()
|
|||
Check whether the merging algorithm can be used on this VIEW
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::can_be_merged()
|
||||
LEX::can_be_merged()
|
||||
|
||||
DESCRIPTION
|
||||
We can apply merge algorithm if it is single SELECT view with
|
||||
|
|
@ -2280,7 +2288,7 @@ st_lex::st_lex()
|
|||
TRUE - merge algorithm can be used
|
||||
*/
|
||||
|
||||
bool st_lex::can_be_merged()
|
||||
bool LEX::can_be_merged()
|
||||
{
|
||||
// TODO: do not forget implement case when select_lex.table_list.elements==0
|
||||
|
||||
|
|
@ -2317,19 +2325,19 @@ bool st_lex::can_be_merged()
|
|||
check if command can use VIEW with MERGE algorithm (for top VIEWs)
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::can_use_merged()
|
||||
LEX::can_use_merged()
|
||||
|
||||
DESCRIPTION
|
||||
Only listed here commands can use merge algorithm in top level
|
||||
SELECT_LEX (for subqueries will be used merge algorithm if
|
||||
st_lex::can_not_use_merged() is not TRUE).
|
||||
LEX::can_not_use_merged() is not TRUE).
|
||||
|
||||
RETURN
|
||||
FALSE - command can't use merged VIEWs
|
||||
TRUE - VIEWs with MERGE algorithms can be used
|
||||
*/
|
||||
|
||||
bool st_lex::can_use_merged()
|
||||
bool LEX::can_use_merged()
|
||||
{
|
||||
switch (sql_command)
|
||||
{
|
||||
|
|
@ -2354,18 +2362,18 @@ bool st_lex::can_use_merged()
|
|||
Check if command can't use merged views in any part of command
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::can_not_use_merged()
|
||||
LEX::can_not_use_merged()
|
||||
|
||||
DESCRIPTION
|
||||
Temporary table algorithm will be used on all SELECT levels for queries
|
||||
listed here (see also st_lex::can_use_merged()).
|
||||
listed here (see also LEX::can_use_merged()).
|
||||
|
||||
RETURN
|
||||
FALSE - command can't use merged VIEWs
|
||||
TRUE - VIEWs with MERGE algorithms can be used
|
||||
*/
|
||||
|
||||
bool st_lex::can_not_use_merged()
|
||||
bool LEX::can_not_use_merged()
|
||||
{
|
||||
switch (sql_command)
|
||||
{
|
||||
|
|
@ -2394,7 +2402,7 @@ bool st_lex::can_not_use_merged()
|
|||
FALSE no, we need data
|
||||
*/
|
||||
|
||||
bool st_lex::only_view_structure()
|
||||
bool LEX::only_view_structure()
|
||||
{
|
||||
switch (sql_command) {
|
||||
case SQLCOM_SHOW_CREATE:
|
||||
|
|
@ -2423,7 +2431,7 @@ bool st_lex::only_view_structure()
|
|||
*/
|
||||
|
||||
|
||||
bool st_lex::need_correct_ident()
|
||||
bool LEX::need_correct_ident()
|
||||
{
|
||||
switch(sql_command)
|
||||
{
|
||||
|
|
@ -2453,7 +2461,7 @@ bool st_lex::need_correct_ident()
|
|||
VIEW_CHECK_CASCADED CHECK OPTION CASCADED
|
||||
*/
|
||||
|
||||
uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
|
||||
uint8 LEX::get_effective_with_check(TABLE_LIST *view)
|
||||
{
|
||||
if (view->select_lex->master_unit() == &unit &&
|
||||
which_check_option_applicable())
|
||||
|
|
@ -2482,7 +2490,7 @@ uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
|
|||
*/
|
||||
|
||||
bool
|
||||
st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
|
||||
LEX::copy_db_to(char **p_db, size_t *p_db_length) const
|
||||
{
|
||||
if (sphead)
|
||||
{
|
||||
|
|
@ -2559,7 +2567,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl)
|
|||
clause.
|
||||
*/
|
||||
|
||||
void st_lex::set_trg_event_type_for_tables()
|
||||
void LEX::set_trg_event_type_for_tables()
|
||||
{
|
||||
uint8 new_trg_event_map= 0;
|
||||
|
||||
|
|
@ -2702,7 +2710,7 @@ void st_lex::set_trg_event_type_for_tables()
|
|||
In this case link_to_local is set.
|
||||
|
||||
*/
|
||||
TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
|
||||
TABLE_LIST *LEX::unlink_first_table(bool *link_to_local)
|
||||
{
|
||||
TABLE_LIST *first;
|
||||
if ((first= query_tables))
|
||||
|
|
@ -2742,7 +2750,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
|
|||
table list
|
||||
|
||||
SYNOPSYS
|
||||
st_lex::first_lists_tables_same()
|
||||
LEX::first_lists_tables_same()
|
||||
|
||||
NOTES
|
||||
In many cases (for example, usual INSERT/DELETE/...) the first table of
|
||||
|
|
@ -2753,7 +2761,7 @@ TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
|
|||
the global list first.
|
||||
*/
|
||||
|
||||
void st_lex::first_lists_tables_same()
|
||||
void LEX::first_lists_tables_same()
|
||||
{
|
||||
TABLE_LIST *first_table= (TABLE_LIST*) select_lex.table_list.first;
|
||||
if (query_tables != first_table && first_table != 0)
|
||||
|
|
@ -2789,7 +2797,7 @@ void st_lex::first_lists_tables_same()
|
|||
global list
|
||||
*/
|
||||
|
||||
void st_lex::link_first_table_back(TABLE_LIST *first,
|
||||
void LEX::link_first_table_back(TABLE_LIST *first,
|
||||
bool link_to_local)
|
||||
{
|
||||
if (first)
|
||||
|
|
@ -2816,7 +2824,7 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
|
|||
cleanup lex for case when we open table by table for processing
|
||||
|
||||
SYNOPSIS
|
||||
st_lex::cleanup_after_one_table_open()
|
||||
LEX::cleanup_after_one_table_open()
|
||||
|
||||
NOTE
|
||||
This method is mostly responsible for cleaning up of selects lists and
|
||||
|
|
@ -2824,7 +2832,7 @@ void st_lex::link_first_table_back(TABLE_LIST *first,
|
|||
to call Query_tables_list::reset_query_tables_list(FALSE).
|
||||
*/
|
||||
|
||||
void st_lex::cleanup_after_one_table_open()
|
||||
void LEX::cleanup_after_one_table_open()
|
||||
{
|
||||
/*
|
||||
thd->lex->derived_tables & additional units may be set if we open
|
||||
|
|
@ -2859,7 +2867,7 @@ void st_lex::cleanup_after_one_table_open()
|
|||
backup Pointer to Query_tables_list instance to be used for backup
|
||||
*/
|
||||
|
||||
void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup)
|
||||
void LEX::reset_n_backup_query_tables_list(Query_tables_list *backup)
|
||||
{
|
||||
backup->set_query_tables_list(this);
|
||||
/*
|
||||
|
|
@ -2878,7 +2886,7 @@ void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup)
|
|||
backup Pointer to Query_tables_list instance used for backup
|
||||
*/
|
||||
|
||||
void st_lex::restore_backup_query_tables_list(Query_tables_list *backup)
|
||||
void LEX::restore_backup_query_tables_list(Query_tables_list *backup)
|
||||
{
|
||||
this->destroy_query_tables_list();
|
||||
this->set_query_tables_list(backup);
|
||||
|
|
@ -2889,14 +2897,14 @@ void st_lex::restore_backup_query_tables_list(Query_tables_list *backup)
|
|||
Checks for usage of routines and/or tables in a parsed statement
|
||||
|
||||
SYNOPSIS
|
||||
st_lex:table_or_sp_used()
|
||||
LEX:table_or_sp_used()
|
||||
|
||||
RETURN
|
||||
FALSE No routines and tables used
|
||||
TRUE Either or both routines and tables are used.
|
||||
*/
|
||||
|
||||
bool st_lex::table_or_sp_used()
|
||||
bool LEX::table_or_sp_used()
|
||||
{
|
||||
DBUG_ENTER("table_or_sp_used");
|
||||
|
||||
|
|
@ -3057,7 +3065,7 @@ bool st_select_lex::add_index_hint (THD *thd, char *str, uint length)
|
|||
@retval FALSE No, not a management partition command
|
||||
*/
|
||||
|
||||
bool st_lex::is_partition_management() const
|
||||
bool LEX::is_partition_management() const
|
||||
{
|
||||
return (sql_command == SQLCOM_ALTER_TABLE &&
|
||||
(alter_info.flags == ALTER_ADD_PARTITION ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue