mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Merge.
This commit is contained in:
commit
e6390e23c2
8 changed files with 60 additions and 12 deletions
16
mysql-test/include/have_simple_parser.inc
Normal file
16
mysql-test/include/have_simple_parser.inc
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#
|
||||||
|
# Check if server has support for loading udf's
|
||||||
|
# i.e it will support dlopen
|
||||||
|
#
|
||||||
|
--require r/have_dynamic_loading.require
|
||||||
|
disable_query_log;
|
||||||
|
show variables like 'have_dynamic_loading';
|
||||||
|
enable_query_log;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check if the variable SIMPLE_PARSER is set
|
||||||
|
#
|
||||||
|
--require r/have_simple_parser.require
|
||||||
|
disable_query_log;
|
||||||
|
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
|
||||||
|
enable_query_log;
|
|
@ -163,6 +163,7 @@ our $exe_my_print_defaults;
|
||||||
our $exe_perror;
|
our $exe_perror;
|
||||||
our $lib_udf_example;
|
our $lib_udf_example;
|
||||||
our $lib_example_plugin;
|
our $lib_example_plugin;
|
||||||
|
our $lib_simple_parser;
|
||||||
our $exe_libtool;
|
our $exe_libtool;
|
||||||
|
|
||||||
our $opt_bench= 0;
|
our $opt_bench= 0;
|
||||||
|
@ -1717,6 +1718,10 @@ sub executable_setup () {
|
||||||
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
|
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
|
||||||
"$glob_basedir/storage/example/.libs/ha_example.so",);
|
"$glob_basedir/storage/example/.libs/ha_example.so",);
|
||||||
|
|
||||||
|
# Look for the simple_parser library
|
||||||
|
$lib_simple_parser=
|
||||||
|
mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
|
||||||
|
"$glob_basedir/plugin/fulltext/.libs/mypluglib.so",);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Look for mysqltest executable
|
# Look for mysqltest executable
|
||||||
|
@ -2199,6 +2204,14 @@ sub environment_setup () {
|
||||||
$ENV{'EXAMPLE_PLUGIN_OPT'}=
|
$ENV{'EXAMPLE_PLUGIN_OPT'}=
|
||||||
($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
|
($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
|
||||||
|
|
||||||
|
# ----------------------------------------------------
|
||||||
|
# Add the path where mysqld will find mypluglib.so
|
||||||
|
# ----------------------------------------------------
|
||||||
|
$ENV{'SIMPLE_PARSER'}=
|
||||||
|
($lib_simple_parser ? basename($lib_simple_parser) : "");
|
||||||
|
$ENV{'SIMPLE_PARSER_OPT'}=
|
||||||
|
($lib_simple_parser ? "--plugin_dir=" . dirname($lib_simple_parser) : "");
|
||||||
|
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# Setup env so childs can execute myisampack and myisamchk
|
# Setup env so childs can execute myisampack and myisamchk
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
|
|
5
mysql-test/r/fulltext_plugin.result
Normal file
5
mysql-test/r/fulltext_plugin.result
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
|
||||||
|
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||||
|
DROP TABLE t1;
|
||||||
|
UNINSTALL PLUGIN simple_parser;
|
2
mysql-test/r/have_simple_parser.require
Normal file
2
mysql-test/r/have_simple_parser.require
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
have_simple_parser
|
||||||
|
1
|
1
mysql-test/t/fulltext_plugin-master.opt
Normal file
1
mysql-test/t/fulltext_plugin-master.opt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
$SIMPLE_PARSER_OPT
|
10
mysql-test/t/fulltext_plugin.test
Normal file
10
mysql-test/t/fulltext_plugin.test
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--source include/have_simple_parser.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||||
|
#
|
||||||
|
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
|
||||||
|
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||||
|
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||||
|
DROP TABLE t1;
|
||||||
|
UNINSTALL PLUGIN simple_parser;
|
|
@ -5870,7 +5870,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
||||||
if (key_info->flags & HA_USES_BLOCK_SIZE)
|
if (key_info->flags & HA_USES_BLOCK_SIZE)
|
||||||
key_create_info.block_size= key_info->block_size;
|
key_create_info.block_size= key_info->block_size;
|
||||||
if (key_info->flags & HA_USES_PARSER)
|
if (key_info->flags & HA_USES_PARSER)
|
||||||
key_create_info.parser_name= *key_info->parser_name;
|
key_create_info.parser_name= *plugin_name(key_info->parser);
|
||||||
|
|
||||||
if (key_info->flags & HA_SPATIAL)
|
if (key_info->flags & HA_SPATIAL)
|
||||||
key_type= Key::SPATIAL;
|
key_type= Key::SPATIAL;
|
||||||
|
|
23
sql/table.cc
23
sql/table.cc
|
@ -400,6 +400,8 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
|
||||||
void free_table_share(TABLE_SHARE *share)
|
void free_table_share(TABLE_SHARE *share)
|
||||||
{
|
{
|
||||||
MEM_ROOT mem_root;
|
MEM_ROOT mem_root;
|
||||||
|
uint idx;
|
||||||
|
KEY *key_info;
|
||||||
DBUG_ENTER("free_table_share");
|
DBUG_ENTER("free_table_share");
|
||||||
DBUG_PRINT("enter", ("table: %s.%s", share->db.str, share->table_name.str));
|
DBUG_PRINT("enter", ("table: %s.%s", share->db.str, share->table_name.str));
|
||||||
DBUG_ASSERT(share->ref_count == 0);
|
DBUG_ASSERT(share->ref_count == 0);
|
||||||
|
@ -426,6 +428,16 @@ void free_table_share(TABLE_SHARE *share)
|
||||||
plugin_unlock(NULL, share->db_plugin);
|
plugin_unlock(NULL, share->db_plugin);
|
||||||
share->db_plugin= NULL;
|
share->db_plugin= NULL;
|
||||||
|
|
||||||
|
/* Release fulltext parsers */
|
||||||
|
key_info= share->key_info;
|
||||||
|
for (idx= share->keys; idx; idx--, key_info++)
|
||||||
|
{
|
||||||
|
if (key_info->flags & HA_USES_PARSER)
|
||||||
|
{
|
||||||
|
plugin_unlock(NULL, key_info->parser);
|
||||||
|
key_info->flags= 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* We must copy mem_root from share because share is allocated through it */
|
/* We must copy mem_root from share because share is allocated through it */
|
||||||
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
|
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
|
||||||
free_root(&mem_root, MYF(0)); // Free's share
|
free_root(&mem_root, MYF(0)); // Free's share
|
||||||
|
@ -1943,22 +1955,11 @@ partititon_err:
|
||||||
int closefrm(register TABLE *table, bool free_share)
|
int closefrm(register TABLE *table, bool free_share)
|
||||||
{
|
{
|
||||||
int error=0;
|
int error=0;
|
||||||
uint idx;
|
|
||||||
KEY *key_info;
|
|
||||||
DBUG_ENTER("closefrm");
|
DBUG_ENTER("closefrm");
|
||||||
DBUG_PRINT("enter", ("table: 0x%lx", (long) table));
|
DBUG_PRINT("enter", ("table: 0x%lx", (long) table));
|
||||||
|
|
||||||
if (table->db_stat)
|
if (table->db_stat)
|
||||||
error=table->file->close();
|
error=table->file->close();
|
||||||
key_info= table->key_info;
|
|
||||||
for (idx= table->s->keys; idx; idx--, key_info++)
|
|
||||||
{
|
|
||||||
if (key_info->flags & HA_USES_PARSER)
|
|
||||||
{
|
|
||||||
plugin_unlock(NULL, key_info->parser);
|
|
||||||
key_info->flags= 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
|
my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
table->alias= 0;
|
table->alias= 0;
|
||||||
if (table->field)
|
if (table->field)
|
||||||
|
|
Loading…
Add table
Reference in a new issue