mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#2936
"Server Variables for Plugins" Implement support for plugins to declare server variables. Demonstrate functionality by removing InnoDB specific code from sql/* New feature for HASH - HASH_UNIQUE flag New feature for DYNAMIC_ARRAY - initializer accepts preallocated ptr. Completed support for plugin reference counting.
This commit is contained in:
@ -172,6 +172,7 @@ void lex_start(THD *thd, const uchar *buf, uint length)
|
||||
lex->spcont= NULL;
|
||||
lex->proc_list.first= 0;
|
||||
lex->escape_used= FALSE;
|
||||
lex->query_tables= 0;
|
||||
lex->reset_query_tables_list(FALSE);
|
||||
lex->expr_allows_subselect= TRUE;
|
||||
|
||||
@ -211,6 +212,12 @@ void lex_end(LEX *lex)
|
||||
lex->yacc_yyss= 0;
|
||||
lex->yacc_yyvs= 0;
|
||||
}
|
||||
|
||||
/* release used plugins */
|
||||
plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
|
||||
lex->plugins.elements);
|
||||
reset_dynamic(&lex->plugins);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -1673,6 +1680,17 @@ void st_select_lex::print_limit(THD *thd, String *str)
|
||||
|
||||
void Query_tables_list::reset_query_tables_list(bool init)
|
||||
{
|
||||
if (!init && query_tables)
|
||||
{
|
||||
TABLE_LIST *table= query_tables;
|
||||
for (;;)
|
||||
{
|
||||
delete table->view;
|
||||
if (query_tables_last == &table->next_global ||
|
||||
!(table= table->next_global))
|
||||
break;
|
||||
}
|
||||
}
|
||||
query_tables= 0;
|
||||
query_tables_last= &query_tables;
|
||||
query_tables_own_last= 0;
|
||||
@ -1727,6 +1745,10 @@ st_lex::st_lex()
|
||||
:result(0), yacc_yyss(0), yacc_yyvs(0),
|
||||
sql_command(SQLCOM_END)
|
||||
{
|
||||
my_init_dynamic_array2(&plugins, sizeof(plugin_ref),
|
||||
plugins_static_buffer,
|
||||
INITIAL_LEX_PLUGIN_LIST_SIZE,
|
||||
INITIAL_LEX_PLUGIN_LIST_SIZE);
|
||||
reset_query_tables_list(TRUE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user