Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2002 05/09/28 14:54:00 svoj@stripped +30 -0
Merge mysql.com:/home/svoj/devel/BitKeeper/mysql-5.0
into mysql.com:/home/svoj/devel/mysql/CNET/merge/mysql-5.0
sql/unireg.cc
1.70 05/09/28 14:53:56 svoj@stripped +1 -19
Manual merge - use remote
sql/table.cc
1.193 05/09/28 14:53:56 svoj@stripped +0 -56
Manual merge - use remote
sql/sql_yacc.yy
1.432 05/09/28 14:53:56 svoj@stripped +1 -2
Manual merge
sql/share/errmsg.txt
1.48 05/09/28 14:53:56 svoj@stripped +2 -4
Manual merge - use remote
sql/structs.h
1.50 05/09/28 14:50:31 svoj@stripped +0 -0
Auto merged
sql/sql_udf.cc
1.54 05/09/28 14:50:31 svoj@stripped +0 -0
Auto merged
sql/sql_table.cc
1.274 05/09/28 14:50:31 svoj@stripped +0 -0
Auto merged
sql/sql_show.cc
1.286 05/09/28 14:50:30 svoj@stripped +0 -0
Auto merged
sql/sql_parse.cc
1.496 05/09/28 14:50:30 svoj@stripped +0 -0
Auto merged
sql/sql_lex.h
1.200 05/09/28 14:50:30 svoj@stripped +0 -0
Auto merged
sql/sql_class.h
1.269 05/09/28 14:50:30 svoj@stripped +0 -0
Auto merged
sql/set_var.cc
1.143 05/09/28 14:50:29 svoj@stripped +0 -0
Auto merged
sql/mysqld.cc
1.507 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
sql/mysql_priv.h
1.355 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
sql/lex.h
1.142 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
sql/handler.h
1.155 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
sql/ha_myisam.cc
1.160 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
sql/Makefile.am
1.111 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
scripts/mysql_fix_privilege_tables.sql
1.31 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
scripts/mysql_create_system_tables.sh
1.27 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
mysql-test/t/system_mysql_db_fix.test
1.18 05/09/28 14:50:28 svoj@stripped +0 -0
Auto merged
mysql-test/r/system_mysql_db.result
1.28 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
mysql-test/r/information_schema.result
1.84 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
mysql-test/r/connect.result
1.16 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
myisam/ft_boolean_search.c
1.93 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
libmysqld/Makefile.am
1.63 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
include/myisam.h
1.70 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
include/my_global.h
1.109 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
configure.in
1.350 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
Makefile.am
1.78 05/09/28 14:50:27 svoj@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: svoj
# Host: svoj-laptop.mysql.com
# Root: /home/svoj/devel/mysql/CNET/merge/mysql-5.0/RESYNC
--- 1.77/Makefile.am 2005-09-02 15:18:34 +05:00
+++ 1.78/Makefile.am 2005-09-28 14:50:27 +05:00
@@ -25,14 +25,16 @@
@thread_dirs@ pstack \
@sql_union_dirs@ scripts @man_dirs@ tests \
netware @libmysqld_dirs@ \
- @bench_dirs@ support-files @tools_dirs@
+ @bench_dirs@ support-files @tools_dirs@ \
+ plugin
DIST_SUBDIRS = . include @docs_dirs@ zlib \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@sql_union_dirs@ scripts @man_dirs@ tests SSL\
BUILD netware os2 @libmysqld_dirs@ \
- @bench_dirs@ support-files @tools_dirs@
+ @bench_dirs@ support-files @tools_dirs@ \
+ plugin
# Relink after clean
linked_sources = linked_client_sources linked_server_sources \
--- 1.349/configure.in 2005-09-21 23:17:50 +05:00
+++ 1.350/configure.in 2005-09-28 14:50:27 +05:00
@@ -2763,7 +2763,9 @@
cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
zlib/Makefile dnl
- cmd-line-utils/readline/Makefile)
+ cmd-line-utils/readline/Makefile dnl
+ plugin/Makefile dnl
+ plugin/fulltext/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp >
stamp-h)
AC_OUTPUT
--- 1.69/include/myisam.h 2005-09-01 22:22:47 +05:00
+++ 1.70/include/myisam.h 2005-09-28 14:50:27 +05:00
@@ -383,6 +383,20 @@
} SORT_KEY_BLOCKS;
+/*
+ MyISAM supports several statistics collection methods. Currently statistics
+ collection method is not stored in MyISAM file and has to be specified for
+ each table analyze/repair operation in MI_CHECK::stats_method.
+*/
+
+typedef enum
+{
+ /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
+ MI_STATS_METHOD_NULLS_NOT_EQUAL,
+ /* Treat NULLs as equal when collecting statistics (like 4.0 did) */
+ MI_STATS_METHOD_NULLS_EQUAL
+} enum_mi_stats_method;
+
typedef struct st_mi_check_param
{
ulonglong auto_increment_value;
@@ -413,6 +427,7 @@
void *thd;
const char *db_name, *table_name;
const char *op_name;
+ enum_mi_stats_method stats_method;
} MI_CHECK;
typedef struct st_sort_ft_buf
--- 1.110/sql/Makefile.am 2005-09-07 02:40:47 +05:00
+++ 1.111/sql/Makefile.am 2005-09-28 14:50:28 +05:00
@@ -62,6 +62,7 @@
tztime.h my_decimal.h\
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
parse_file.h sql_view.h sql_trigger.h \
+ sql_array.h sql_cursor.h \
examples/ha_example.h examples/ha_archive.h \
examples/ha_tina.h ha_blackhole.h \
ha_federated.h
@@ -94,7 +95,7 @@
client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc \
sql_olap.cc sql_view.cc \
- gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \
+ gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
tztime.cc my_time.c my_decimal.cc\
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
sp_cache.cc parse_file.cc sql_trigger.cc \
--- 1.159/sql/ha_myisam.cc 2005-09-02 04:52:23 +05:00
+++ 1.160/sql/ha_myisam.cc 2005-09-28 14:50:28 +05:00
@@ -39,6 +39,12 @@
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
myisam_recover_names, NULL};
+const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
+ NullS};
+TYPELIB myisam_stats_method_typelib= {
+ array_elements(myisam_stats_method_names) - 1, "",
+ myisam_stats_method_names, NULL};
+
/*****************************************************************************
** MyISAM tables
@@ -46,7 +52,7 @@
/* MyISAM handlerton */
-static handlerton myisam_hton= {
+handlerton myisam_hton= {
"MyISAM",
0, /* slot */
0, /* savepoint size. */
@@ -333,6 +339,7 @@
param.db_name= table->s->db;
param.table_name= table->alias;
param.testflag = check_opt->flags | T_CHECK | T_SILENT;
+ param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
if (!(table->db_stat & HA_READ_ONLY))
param.testflag|= T_STATISTICS;
@@ -422,6 +429,7 @@
param.testflag= (T_FAST | T_CHECK | T_SILENT | T_STATISTICS |
T_DONT_CHECK_CHECKSUM);
param.using_global_keycache = 1;
+ param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
if (!(share->state.changed & STATE_NOT_ANALYZED))
return HA_ADMIN_ALREADY_DONE;
@@ -976,6 +984,7 @@
T_CREATE_MISSING_KEYS);
param.myf_rw&= ~MY_WAIT_IF_FULL;
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
+ param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
param.tmpdir=&mysql_tmpdir_list;
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
{
--- 1.154/sql/handler.h 2005-09-23 04:58:04 +05:00
+++ 1.155/sql/handler.h 2005-09-28 14:50:28 +05:00
@@ -406,6 +406,7 @@
uint options; /* OR of HA_CREATE_ options */
uint raid_type,raid_chunks;
uint merge_insert_method;
+ uint extra_size; /* length of extra data segment */
bool table_existed; /* 1 in create if table existed */
bool frm_only; /* 1 if no ha_create_table() */
bool varchar; /* 1 if table has a VARCHAR */
--- 1.141/sql/lex.h 2005-08-25 18:39:00 +05:00
+++ 1.142/sql/lex.h 2005-09-28 14:50:28 +05:00
@@ -245,6 +245,7 @@
{ "INSENSITIVE", SYM(INSENSITIVE_SYM)},
{ "INSERT", SYM(INSERT)},
{ "INSERT_METHOD", SYM(INSERT_METHOD)},
+ { "INSTALL", SYM(INSTALL_SYM)},
{ "INT", SYM(INT_SYM)},
{ "INT1", SYM(TINYINT)},
{ "INT2", SYM(SMALLINT)},
@@ -364,9 +365,11 @@
{ "OUTER", SYM(OUTER)},
{ "OUTFILE", SYM(OUTFILE)},
{ "PACK_KEYS", SYM(PACK_KEYS_SYM)},
+ { "PARSER", SYM(PARSER_SYM)},
{ "PARTIAL", SYM(PARTIAL)},
{ "PASSWORD", SYM(PASSWORD)},
{ "PHASE", SYM(PHASE_SYM)},
+ { "PLUGIN", SYM(PLUGIN_SYM)},
{ "POINT", SYM(POINT_SYM)},
{ "POLYGON", SYM(POLYGON)},
{ "PRECISION", SYM(PRECISION)},
@@ -442,7 +445,7 @@
{ "SNAPSHOT", SYM(SNAPSHOT_SYM)},
{ "SMALLINT", SYM(SMALLINT)},
{ "SOME", SYM(ANY_SYM)},
- { "SONAME", SYM(UDF_SONAME_SYM)},
+ { "SONAME", SYM(SONAME_SYM)},
{ "SOUNDS", SYM(SOUNDS_SYM)},
{ "SPATIAL", SYM(SPATIAL_SYM)},
{ "SPECIFIC", SYM(SPECIFIC_SYM)},
@@ -510,6 +513,7 @@
{ "UNIQUE", SYM(UNIQUE_SYM)},
{ "UNKNOWN", SYM(UNKNOWN_SYM)},
{ "UNLOCK", SYM(UNLOCK_SYM)},
+ { "UNINSTALL", SYM(UNINSTALL_SYM)},
{ "UNSIGNED", SYM(UNSIGNED)},
{ "UNTIL", SYM(UNTIL_SYM)},
{ "UPDATE", SYM(UPDATE_SYM)},
--- 1.354/sql/mysql_priv.h 2005-09-21 20:42:25 +05:00
+++ 1.355/sql/mysql_priv.h 2005-09-28 14:50:28 +05:00
@@ -482,6 +482,7 @@
#include "sql_error.h"
#include "field.h" /* Field definitions */
#include "protocol.h"
+#include "sql_plugin.h"
#include "sql_udf.h"
class user_var_entry;
class Security_context;
--- 1.506/sql/mysqld.cc 2005-09-24 03:35:27 +05:00
+++ 1.507/sql/mysqld.cc 2005-09-28 14:50:28 +05:00
@@ -1052,10 +1052,13 @@
lex_free(); /* Free some memory */
set_var_free();
free_charsets();
-#ifdef HAVE_DLOPEN
if (!opt_noacl)
+ {
+#ifdef HAVE_DLOPEN
udf_free();
#endif
+ plugin_free();
+ }
(void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
if (tc_log)
tc_log->close();
@@ -3278,10 +3281,13 @@
if (!opt_noacl)
(void) grant_init();
-#ifdef HAVE_DLOPEN
if (!opt_noacl)
+ {
+ plugin_init();
+#ifdef HAVE_DLOPEN
udf_init();
#endif
+ }
if (opt_bootstrap) /* If running with bootstrap, do not start replication. */
opt_skip_slave_start= 1;
/*
@@ -4434,7 +4440,8 @@
OPT_TIMED_MUTEXES,
OPT_OLD_STYLE_USER_LIMITS,
OPT_LOG_SLOW_ADMIN_STATEMENTS,
- OPT_TABLE_LOCK_WAIT_TIMEOUT
+ OPT_TABLE_LOCK_WAIT_TIMEOUT,
+ OPT_PLUGIN_DIR
};
@@ -5556,6 +5563,10 @@
(gptr*) &global_system_variables.optimizer_search_depth,
(gptr*) &max_system_variables.optimizer_search_depth,
0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
+ {"plugin-dir", OPT_PLUGIN_DIR,
+ "Directory for plugins.",
+ (gptr*) &opt_plugin_dir, (gptr*) &opt_plugin_dir, 0, GET_STR, REQUIRED_ARG,
+ 0, 0, 0, 0, 0, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
(gptr*) &global_system_variables.preload_buff_size,
@@ -6129,6 +6140,7 @@
sizeof(mysql_real_data_home)-1);
mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
mysql_data_home_buff[1]=0;
+ opt_plugin_dir= get_relative_path(LIBDIR);
/* Replication parameters */
master_user= (char*) "test";
--- 1.268/sql/sql_class.h 2005-09-23 01:46:50 +05:00
+++ 1.269/sql/sql_class.h 2005-09-28 14:50:30 +05:00
@@ -409,11 +409,13 @@
List<key_part_spec> columns;
const char *name;
bool generated;
+ struct st_plugin_int *parser;
Key(enum Keytype type_par, const char *name_arg, enum ha_key_alg alg_par,
- bool generated_arg, List<key_part_spec> &cols)
+ bool generated_arg, List<key_part_spec> &cols,
+ struct st_plugin_int *parser_arg= (struct st_plugin_int*)0)
:type(type_par), algorithm(alg_par), columns(cols), name(name_arg),
- generated(generated_arg)
+ generated(generated_arg), parser(parser_arg)
{}
~Key() {}
/* Equality comparison of keys (ignoring name) */
--- 1.199/sql/sql_lex.h 2005-09-23 01:46:50 +05:00
+++ 1.200/sql/sql_lex.h 2005-09-28 14:50:30 +05:00
@@ -90,6 +90,7 @@
SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
+ SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
/* This should be the last !!! */
SQLCOM_END
--- 1.495/sql/sql_parse.cc 2005-09-26 13:12:20 +05:00
+++ 1.496/sql/sql_parse.cc 2005-09-28 14:50:30 +05:00
@@ -4722,6 +4722,15 @@
case SQLCOM_XA_RECOVER:
res= mysql_xa_recover(thd);
break;
+ case SQLCOM_INSTALL_PLUGIN:
+ if (! (res= mysql_install_plugin(thd, &thd->lex->comment,
+ &thd->lex->ident)))
+ send_ok(thd);
+ break;
+ case SQLCOM_UNINSTALL_PLUGIN:
+ if (! (res= mysql_uninstall_plugin(thd, &thd->lex->comment)))
+ send_ok(thd);
+ break;
default:
DBUG_ASSERT(0); /* Impossible */
send_ok(thd);
--- 1.285/sql/sql_show.cc 2005-09-23 00:03:48 +05:00
+++ 1.286/sql/sql_show.cc 2005-09-28 14:50:30 +05:00
@@ -946,6 +946,12 @@
}
}
packet->append(')');
+ if (key_info->parser)
+ {
+ packet->append(" WITH PARSER ", 13);
+ append_identifier(thd, packet, key_info->parser->name.str,
+ key_info->parser->name.length);
+ }
}
/*
--- 1.273/sql/sql_table.cc 2005-09-15 04:57:52 +05:00
+++ 1.274/sql/sql_table.cc 2005-09-28 14:50:31 +05:00
@@ -1022,6 +1022,8 @@
break;
case Key::FULLTEXT:
key_info->flags= HA_FULLTEXT;
+ if ((key_info->parser= key->parser))
+ key_info->flags|= HA_USES_PARSER;
break;
case Key::SPATIAL:
#ifdef HAVE_SPATIAL
--- 1.53/sql/sql_udf.cc 2005-08-20 20:40:38 +05:00
+++ 1.54/sql/sql_udf.cc 2005-09-28 14:50:31 +05:00
@@ -446,10 +446,10 @@
restore_record(table, s->default_values); // Default values for fields
table->field[0]->store(u_d->name.str, u_d->name.length,
system_charset_info);
- table->field[1]->store((longlong) u_d->returns);
+ table->field[1]->store((longlong) u_d->returns, TRUE);
table->field[2]->store(u_d->dl,(uint) strlen(u_d->dl),
system_charset_info);
if (table->s->fields >= 4) // If not old func format
- table->field[3]->store((longlong) u_d->type);
+ table->field[3]->store((longlong) u_d->type, TRUE);
error = table->file->write_row(table->record[0]);
close_thread_tables(thd);
--- 1.431/sql/sql_yacc.yy 2005-09-23 12:18:52 +05:00
+++ 1.432/sql/sql_yacc.yy 2005-09-28 14:53:56 +05:00
@@ -107,6 +107,7 @@
struct { int vars, conds, hndlrs, curs; } spblock;
sp_name *spname;
struct st_lex *lex;
+ struct st_plugin_int *plugin;
}
%{
@@ -334,6 +335,7 @@
%token INSENSITIVE_SYM
%token INSERT
%token INSERT_METHOD
+%token INSTALL_SYM
%token INTERVAL_SYM
%token INTO
%token INT_SYM
@@ -464,10 +466,12 @@
%token OUTFILE
%token OUT_SYM
%token PACK_KEYS_SYM
+%token PARSER_SYM
%token PARTIAL
%token PASSWORD
%token PARAM_MARKER
%token PHASE_SYM
+%token PLUGIN_SYM
%token POINTFROMTEXT
%token POINT_SYM
%token POLYFROMTEXT
@@ -550,6 +554,7 @@
%token SLAVE
%token SMALLINT
%token SNAPSHOT_SYM
+%token SONAME_SYM
%token SOUNDS_SYM
%token SPATIAL_SYM
%token SPECIFIC_SYM
@@ -608,13 +613,13 @@
%token TYPES_SYM
%token TYPE_SYM
%token UDF_RETURNS_SYM
-%token UDF_SONAME_SYM
%token ULONGLONG_NUM
%token UNCOMMITTED_SYM
%token UNDEFINED_SYM
%token UNDERSCORE_CHARSET
%token UNDO_SYM
%token UNICODE_SYM
+%token UNINSTALL_SYM
%token UNION_SYM
%token UNIQUE_SYM
%token UNIQUE_USERS
@@ -794,6 +799,8 @@
%type <boolfunc2creator> comp_op
+%type <plugin> opt_fulltext_parser
+
%type <NONE>
query verb_clause create change select do drop insert replace insert2
insert_values update delete truncate rename
@@ -830,7 +837,7 @@
statement sp_suid opt_view_list view_list or_replace algorithm
sp_c_chistics sp_a_chistics sp_chistic sp_c_chistic xa
load_data opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
- view_user view_suid
+ install uninstall view_user view_suid
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -891,6 +898,7 @@
| handler
| help
| insert
+ | install
| kill
| load
| lock
@@ -914,6 +922,7 @@
| slave
| start
| truncate
+ | uninstall
| unlock
| update
| use
@@ -1171,11 +1180,15 @@
lex->col_list.empty();
lex->change=NullS;
}
- '(' key_list ')'
+ '(' key_list ')' opt_fulltext_parser
{
LEX *lex=Lex;
-
- lex->key_list.push_back(new Key($2,$4.str, $5, 0, lex->col_list));
+ if ($2 != Key::FULLTEXT && $12)
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
+ YYABORT;
+ }
+ lex->key_list.push_back(new Key($2,$4.str,$5,0,lex->col_list,$12));
lex->col_list.empty();
}
| CREATE DATABASE opt_if_not_exists ident
@@ -1365,7 +1378,7 @@
;
create_function_tail:
- RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys
+ RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_CREATE_FUNCTION;
@@ -2789,10 +2802,15 @@
;
key_def:
- key_type opt_ident key_alg '(' key_list ')'
+ key_type opt_ident key_alg '(' key_list ')' opt_fulltext_parser
{
LEX *lex=Lex;
- lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list));
+ if ($1 != Key::FULLTEXT && $7)
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
+ YYABORT;
+ }
+ lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list, $7));
lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')'
@@ -2827,6 +2845,21 @@
}
;
+opt_fulltext_parser:
+ /* empty */ { $$= (struct st_plugin_int*)0; }
+ | WITH PARSER_SYM IDENT_sys
+ {
+ struct st_plugin_int *plugin;
+ if ((plugin= plugin_lock(&$3, MYSQL_FTPARSER_PLUGIN)))
+ $$= plugin;
+ else
+ {
+ my_error(ER_FUNCTION_NOT_DEFINED, MYF(0), $3.str);
+ YYABORT;
+ }
+ }
+ ;
+
opt_check_constraint:
/* empty */
| check_constraint
@@ -7526,9 +7559,12 @@
| FLUSH_SYM {}
| HANDLER_SYM {}
| HELP_SYM {}
+ | INSTALL_SYM {}
| LANGUAGE_SYM {}
| NO_SYM {}
| OPEN_SYM {}
+ | PARSER_SYM {}
+ | PLUGIN_SYM {}
| PREPARE_SYM {}
| REPAIR {}
| RESET_SYM {}
@@ -7538,10 +7574,12 @@
| SECURITY_SYM {}
| SIGNED_SYM {}
| SLAVE {}
+ | SONAME_SYM {}
| START_SYM {}
| STOP_SYM {}
| TRUNCATE_SYM {}
| UNICODE_SYM {}
+ | UNINSTALL_SYM {}
| XA_SYM {}
;
@@ -9072,4 +9110,19 @@
| FOR_SYM MIGRATE_SYM { Lex->xa_opt=XA_FOR_MIGRATE; }
;
+install:
+ INSTALL_SYM PLUGIN_SYM IDENT_sys SONAME_SYM TEXT_STRING_sys
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_INSTALL_PLUGIN;
+ lex->comment= $3;
+ lex->ident= $5;
+ };
+uninstall:
+ UNINSTALL_SYM PLUGIN_SYM IDENT_sys
+ {
+ LEX *lex= Lex;
+ lex->sql_command= SQLCOM_UNINSTALL_PLUGIN;
+ lex->comment= $3;
+ };
--- 1.49/sql/structs.h 2005-08-27 16:08:45 +05:00
+++ 1.50/sql/structs.h 2005-09-28 14:50:31 +05:00
@@ -187,7 +187,7 @@
SHOW_SSL_GET_CIPHER_LIST,
#endif /* HAVE_OPENSSL */
SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
- SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG,
+ SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS
};
--- 1.83/mysql-test/r/information_schema.result 2005-09-23 01:46:48 +05:00
+++ 1.84/mysql-test/r/information_schema.result 2005-09-28 14:50:27 +05:00
@@ -60,6 +60,7 @@
help_relation
help_topic
host
+plugin
proc
procs_priv
tables_priv
@@ -709,7 +710,7 @@
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*)
-101
+102
drop view a2, a1;
drop table t_crashme;
select table_schema,table_name, column_name from
@@ -779,7 +780,7 @@
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 16
-mysql 17
+mysql 18
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
begin
--- 1.108/include/my_global.h 2005-09-15 22:00:20 +05:00
+++ 1.109/include/my_global.h 2005-09-28 14:50:27 +05:00
@@ -1273,4 +1273,23 @@
#define NO_EMBEDDED_ACCESS_CHECKS
#endif
+#ifdef HAVE_DLOPEN
+#if defined(__WIN__)
+#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name)
+#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
+#define dlclose(lib) FreeLibrary((HMODULE)lib)
+#elif !defined(OS2)
+#include <dlfcn.h>
+#endif
+#endif
+
+/* FreeBSD 2.2.2 does not define RTLD_NOW) */
+#ifndef RTLD_NOW
+#define RTLD_NOW 1
+#endif
+
+#ifndef HAVE_DLERROR
+#define dlerror() ""
+#endif
+
#endif /* my_global_h */
--- 1.142/sql/set_var.cc 2005-09-21 20:42:26 +05:00
+++ 1.143/sql/set_var.cc 2005-09-28 14:50:29 +05:00
@@ -929,6 +929,7 @@
{sys_optimizer_search_depth.name,(char*) &sys_optimizer_search_depth,
SHOW_SYS},
{"pid_file", (char*) pidfile_name, SHOW_CHAR},
+ {"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR},
{"port", (char*) &mysqld_port, SHOW_INT},
{sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS},
{"protocol_version", (char*) &protocol_version, SHOW_INT},
--- 1.30/scripts/mysql_fix_privilege_tables.sql 2005-08-24 04:37:17 +05:00
+++ 1.31/scripts/mysql_fix_privilege_tables.sql 2005-09-28 14:50:28 +05:00
@@ -19,6 +19,12 @@
PRIMARY KEY (name)
) CHARACTER SET utf8 COLLATE utf8_bin;
+CREATE TABLE IF NOT EXISTS plugin (
+ name char(64) binary DEFAULT '' NOT NULL,
+ dl char(128) DEFAULT '' NOT NULL,
+ PRIMARY KEY (name)
+) CHARACTER SET utf8 COLLATE utf8_bin;
+
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
-- Detect whether or not we had the Grant_priv column
--- 1.62/libmysqld/Makefile.am 2005-09-02 01:45:36 +05:00
+++ 1.63/libmysqld/Makefile.am 2005-09-28 14:50:27 +05:00
@@ -62,7 +62,7 @@
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
- spatial.cc gstream.cc sql_help.cc tztime.cc protocol_cursor.cc \
+ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
ha_blackhole.cc
--- 1.92/myisam/ft_boolean_search.c 2005-08-11 16:02:39 +05:00
+++ 1.93/myisam/ft_boolean_search.c 2005-09-28 14:50:27 +05:00
@@ -69,6 +69,7 @@
float weight;
float cur_weight;
LIST *phrase; /* phrase words */
+ LIST *document; /* for phrase search */
uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */
uint ythresh; /* number of "yes" words in expr */
@@ -131,79 +132,156 @@
return i;
}
-static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
- FTB_EXPR *up, uint depth, byte *up_quot)
+
+typedef struct st_my_ftb_param
{
- byte res;
- FTB_PARAM param;
- FT_WORD w;
- FTB_WORD *ftbw;
- FTB_EXPR *ftbe;
- FT_WORD *phrase_word;
- LIST *phrase_list;
- uint extra=HA_FT_WLEN+ftb->info->s->rec_reflength; /* just a shortcut */
+ FTB *ftb;
+ FTB_EXPR *ftbe;
+ byte *up_quot;
+ uint depth;
+} MY_FTB_PARAM;
+
+
+static int ftb_query_add_word(void *param, byte *word, uint word_len,
+ MYSQL_FTPARSER_BOOLEAN_INFO *info)
+{
+ MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param;
+ FTB_WORD *ftbw;
+ FTB_EXPR *ftbe;
+ FT_WORD *phrase_word;
+ LIST *tmp_element;
+ int r= info->weight_adjust;
+ float weight= (float)
+ (info->wasign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)];
+
+ switch (info->type) {
+ case FT_CHUNK_TYPE_WORD:
+ ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root,
+ sizeof(FTB_WORD) +
+ (info->trunc ? MI_MAX_KEY_BUFF :
+ word_len * ftb_param->ftb->charset->mbmaxlen
+
+ HA_FT_WLEN +
+ ftb_param->ftb->info->s->rec_reflength));
+ ftbw->len= word_len + 1;
+ ftbw->flags= 0;
+ ftbw->off= 0;
+ if (info->yesno > 0) ftbw->flags|= FTB_FLAG_YES;
+ if (info->yesno < 0) ftbw->flags|= FTB_FLAG_NO;
+ if (info->trunc) ftbw->flags|= FTB_FLAG_TRUNC;
+ ftbw->weight= weight;
+ ftbw->up= ftb_param->ftbe;
+ ftbw->docid[0]= ftbw->docid[1]= HA_OFFSET_ERROR;
+ ftbw->ndepth= (info->yesno < 0) + ftb_param->depth;
+ ftbw->key_root= HA_OFFSET_ERROR;
+ memcpy(ftbw->word + 1, word, word_len);
+ ftbw->word[0]= word_len;
+ if (info->yesno > 0) ftbw->up->ythresh++;
+ queue_insert(&ftb_param->ftb->queue, (byte *)ftbw);
+ ftb_param->ftb->with_scan|= (info->trunc & FTB_FLAG_TRUNC);
+ /* fall through */
+ case FT_CHUNK_TYPE_STOPWORD:
+ if (! ftb_param->up_quot) break;
+ phrase_word= (FT_WORD *)alloc_root(&ftb_param->ftb->mem_root,
sizeof(FT_WORD));
+ tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST));
+ phrase_word->pos= word;
+ phrase_word->len= word_len;
+ tmp_element->data= (void *)phrase_word;
+ ftb_param->ftbe->phrase= list_add(ftb_param->ftbe->phrase,
tmp_element);
+ /* Allocate document list at this point.
+ It allows to avoid huge amount of allocs/frees for each row.*/
+ tmp_element= (LIST *)alloc_root(&ftb_param->ftb->mem_root, sizeof(LIST));
+ tmp_element->data= alloc_root(&ftb_param->ftb->mem_root,
sizeof(FT_WORD));
+ ftb_param->ftbe->document=
+ list_add(ftb_param->ftbe->document, tmp_element);
+ break;
+ case FT_CHUNK_TYPE_LBR:
+ ftbe=(FTB_EXPR *)alloc_root(&ftb_param->ftb->mem_root, sizeof(FTB_EXPR));
+ ftbe->flags= 0;
+ if (info->yesno > 0) ftbe->flags|= FTB_FLAG_YES;
+ if (info->yesno < 0) ftbe->flags|= FTB_FLAG_NO;
+ ftbe->weight= weight;
+ ftbe->up= ftb_param->ftbe;
+ ftbe->ythresh= ftbe->yweaks= 0;
+ ftbe->docid[0]= ftbe->docid[1]= HA_OFFSET_ERROR;
+ ftbe->phrase= NULL;
+ ftbe->document= 0;
+ if (info->quot) ftb_param->ftb->with_scan|= 2;
+ if (info->yesno > 0) ftbe->up->ythresh++;
+ ftb_param->ftbe= ftbe;
+ ftb_param->depth++;
+ ftb_param->up_quot= info->quot;
+ break;
+ case FT_CHUNK_TYPE_RBR:
+ if (ftb_param->ftbe->document)
+ {
+ /* Circuit document list */
+ for (tmp_element= ftb_param->ftbe->document;
+ tmp_element->next; tmp_element= tmp_element->next) /* no-op */;
+ tmp_element->next= ftb_param->ftbe->document;
+ ftb_param->ftbe->document->prev= tmp_element;
+ }
+ info->quot= 0;
+ if (ftb_param->ftbe->up)
+ {
+ DBUG_ASSERT(ftb_param->depth);
+ ftb_param->ftbe= ftb_param->ftbe->up;
+ ftb_param->depth--;
+ ftb_param->up_quot= 0;
+ }
+ break;
+ case FT_CHUNK_TYPE_EOF:
+ default:
+ break;
+ }
+ return(0);
+}
+
+
+static int ftb_parse_query_internal(void *param, byte *query, uint len)
+{
+ MY_FTB_PARAM *ftb_param= (MY_FTB_PARAM *)param;
+ MYSQL_FTPARSER_BOOLEAN_INFO info;
+ CHARSET_INFO *cs= ftb_param->ftb->charset;
+ byte **start= &query;
+ byte *end= query + len;
+ FT_WORD w;
+
+ info.prev= ' ';
+ info.quot= 0;
+ while (ft_get_word(cs, start, end, &w, &info))
+ ftb_query_add_word(param, w.pos, w.len, &info);
+ return(0);
+}
+
+
+static void _ftb_parse_query(FTB *ftb, byte *query, uint len,
+ struct st_mysql_ftparser *parser)
+{
+ MYSQL_FTPARSER_PARAM param;
+ MY_FTB_PARAM ftb_param;
if (ftb->state != UNINITIALIZED)
return;
- param.prev=' ';
- param.quot= up_quot;
- while ((res=ft_get_word(ftb->charset,start,end,&w,¶m)))
- {
- int r=param.plusminus;
- float weight= (float) (param.pmsign ? nwghts : wghts)[(r>5)?5:((r<-5)?-5:r)];
- switch (res) {
- case 1: /* word found */
- ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
- sizeof(FTB_WORD) +
- (param.trunc ? MI_MAX_KEY_BUFF :
- w.len*ftb->charset->mbmaxlen+extra));
- ftbw->len=w.len+1;
- ftbw->flags=0;
- ftbw->off=0;
- if (param.yesno>0) ftbw->flags|=FTB_FLAG_YES;
- if (param.yesno<0) ftbw->flags|=FTB_FLAG_NO;
- if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC;
- ftbw->weight=weight;
- ftbw->up=up;
- ftbw->docid[0]=ftbw->docid[1]=HA_OFFSET_ERROR;
- ftbw->ndepth= (param.yesno<0) + depth;
- ftbw->key_root=HA_OFFSET_ERROR;
- memcpy(ftbw->word+1, w.pos, w.len);
- ftbw->word[0]=w.len;
- if (param.yesno > 0) up->ythresh++;
- queue_insert(& ftb->queue, (byte *)ftbw);
- ftb->with_scan|=(param.trunc & FTB_FLAG_TRUNC);
- case 4: /* not indexed word (stopword or too short/long) */
- if (! up_quot) break;
- phrase_word= (FT_WORD *)alloc_root(&ftb->mem_root, sizeof(FT_WORD));
- phrase_list= (LIST *)alloc_root(&ftb->mem_root, sizeof(LIST));
- phrase_word->pos= w.pos;
- phrase_word->len= w.len;
- phrase_list->data= (void *)phrase_word;
- up->phrase= list_add(up->phrase, phrase_list);
- break;
- case 2: /* left bracket */
- ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR));
- ftbe->flags=0;
- if (param.yesno>0) ftbe->flags|=FTB_FLAG_YES;
- if (param.yesno<0) ftbe->flags|=FTB_FLAG_NO;
- ftbe->weight=weight;
- ftbe->up=up;
- ftbe->ythresh=ftbe->yweaks=0;
- ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR;
- ftbe->phrase= NULL;
- if (param.quot) ftb->with_scan|=2;
- if (param.yesno > 0) up->ythresh++;
- _ftb_parse_query(ftb, start, end, ftbe, depth+1, param.quot);
- param.quot=0;
- break;
- case 3: /* right bracket */
- if (up_quot) up->phrase= list_reverse(up->phrase);
- return;
- }
+ ftb_param.ftb= ftb;
+ ftb_param.depth= 0;
+ ftb_param.ftbe= ftb->root;
+ ftb_param.up_quot= 0;
+
+ if (parser)
+ {
+ param.mysql_parse= ftb_parse_query_internal;
+ param.mysql_add_word= ftb_query_add_word;
+ param.ftparser_state= 0;
+ param.mysql_ftparam= (void *)&ftb_param;
+ param.cs= ftb->charset;
+ param.doc= query;
+ param.length= len;
+ param.flags= MYSQL_FTPARSER_BOOLEAN_MODE;
+ parser->parse(¶m);
}
- return;
+ else
+ ftb_parse_query_internal((void *)&ftb_param, query, len);
}
static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
@@ -426,8 +504,10 @@
ftbe->ythresh=ftbe->yweaks=0;
ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR;
ftbe->phrase= NULL;
+ ftbe->document= 0;
ftb->root=ftbe;
- _ftb_parse_query(ftb, &query, query+query_len, ftbe, 0, NULL);
+ _ftb_parse_query(ftb, query, query_len,
+ keynr == NO_SUCH_KEY ? 0 : info->s->keyinfo[keynr].parser);
ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD *)*ftb->queue.elements);
memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements);
@@ -443,6 +523,62 @@
}
+typedef struct st_my_ftb_phrase_param
+{
+ LIST *phrase;
+ LIST *document;
+ CHARSET_INFO *cs;
+ uint phrase_length;
+ uint document_length;
+ uint match;
+} MY_FTB_PHRASE_PARAM;
+
+
+static int ftb_phrase_add_word(void *param, byte *word, uint word_len,
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+{
+ MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param;
+ FT_WORD *w= (FT_WORD *)phrase_param->document->data;
+ LIST *phrase, *document;
+ w->pos= word;
+ w->len= word_len;
+ phrase_param->document= phrase_param->document->prev;
+ if (phrase_param->phrase_length > phrase_param->document_length)
+ {
+ phrase_param->document_length++;
+ return 0;
+ }
+ /* TODO: rewrite phrase search to avoid
+ comparing the same word twice. */
+ for (phrase= phrase_param->phrase, document= phrase_param->document->next;
+ phrase; phrase= phrase->next, document= document->next)
+ {
+ FT_WORD *phrase_word= (FT_WORD *)phrase->data;
+ FT_WORD *document_word= (FT_WORD *)document->data;
+ if (my_strnncoll(phrase_param->cs, phrase_word->pos, phrase_word->len,
+ document_word->pos, document_word->len))
+ return 0;
+ }
+ phrase_param->match++;
+ return 0;
+}
+
+
+static int ftb_check_phrase_internal(void *param, byte *document, uint len)
+{
+ FT_WORD word;
+ MY_FTB_PHRASE_PARAM *phrase_param= (MY_FTB_PHRASE_PARAM *)param;
+ const byte *docend= document + len;
+ while (ft_simple_get_word(phrase_param->cs, &document, docend, &word,
FALSE))
+ {
+ ftb_phrase_add_word(param, word.pos, word.len, 0);
+ if (phrase_param->match)
+ return 1;
+ }
+ return 0;
+}
+
+
/*
Checks if given buffer matches phrase list.
@@ -457,31 +593,34 @@
1 is returned if phrase found, 0 else.
*/
-static int _ftb_check_phrase(const byte *s0, const byte *e0,
- LIST *phrase, CHARSET_INFO *cs)
-{
- FT_WORD h_word;
- const byte *h_start= s0;
- DBUG_ENTER("_ftb_strstr");
- DBUG_ASSERT(phrase);
-
- while (ft_simple_get_word(cs, (byte **)&h_start, e0, &h_word, FALSE))
- {
- FT_WORD *n_word;
- LIST *phrase_element= phrase;
- const byte *h_start1= h_start;
- for (;;)
- {
- n_word= (FT_WORD *)phrase_element->data;
- if (my_strnncoll(cs, h_word.pos, h_word.len, n_word->pos, n_word->len))
- break;
- if (! (phrase_element= phrase_element->next))
- DBUG_RETURN(1);
- if (! ft_simple_get_word(cs, (byte **)&h_start1, e0, &h_word, FALSE))
- DBUG_RETURN(0);
- }
+static int _ftb_check_phrase(const byte *document, uint len,
+ FTB_EXPR *ftbe, CHARSET_INFO *cs,
+ struct st_mysql_ftparser *parser)
+{
+ MY_FTB_PHRASE_PARAM ftb_param;
+ MYSQL_FTPARSER_PARAM param;
+ DBUG_ENTER("_ftb_check_phrase");
+ ftb_param.phrase= ftbe->phrase;
+ ftb_param.document= ftbe->document;
+ ftb_param.cs= cs;
+ ftb_param.phrase_length= list_length(ftbe->phrase);
+ ftb_param.document_length= 1;
+ ftb_param.match= 0;
+ if (parser)
+ {
+ param.mysql_parse= ftb_check_phrase_internal;
+ param.mysql_add_word= ftb_phrase_add_word;
+ param.ftparser_state= 0;
+ param.mysql_ftparam= (void *)&ftb_param;
+ param.cs= cs;
+ param.doc= (byte *)document;
+ param.length= len;
+ param.flags= MYSQL_FTPARSER_DOCUMENT_MODE;
+ parser->parse(¶m);
}
- DBUG_RETURN(0);
+ else
+ ftb_check_phrase_internal((void *)&ftb_param, (byte *)document, len);
+ DBUG_RETURN(ftb_param.match ? 1 : 0);
}
@@ -492,6 +631,8 @@
float weight=ftbw->weight;
int yn=ftbw->flags, ythresh, mode=(ftsi_orig != 0);
my_off_t curdoc=ftbw->docid[mode];
+ struct st_mysql_ftparser *parser= ftb->keynr == NO_SUCH_KEY ? 0 :
+ ftb->info->s->keyinfo[ftb->keynr].parser;
for (ftbe=ftbw->up; ftbe; ftbe=ftbe->up)
{
@@ -521,8 +662,8 @@
{
if (!ftsi.pos)
continue;
- not_found = ! _ftb_check_phrase(ftsi.pos, ftsi.pos+ftsi.len,
- ftbe->phrase, ftb->charset);
+ not_found = ! _ftb_check_phrase(ftsi.pos, ftsi.len,
+ ftbe, ftb->charset, parser);
}
if (not_found) break;
} /* ftbe->quot */
@@ -629,14 +770,66 @@
}
-float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
+typedef struct st_my_ftb_find_param
{
- FT_WORD word;
+ FT_INFO *ftb;
+ FT_SEG_ITERATOR *ftsi;
+} MY_FTB_FIND_PARAM;
+
+
+static int ftb_find_relevance_add_word(void *param, byte *word, uint len,
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+{
+ MY_FTB_FIND_PARAM *ftb_param= (MY_FTB_FIND_PARAM *)param;
+ FT_INFO *ftb= ftb_param->ftb;
FTB_WORD *ftbw;
+ int a, b, c;
+ for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2)
+ {
+ ftbw= ftb->list[c];
+ if (mi_compare_text(ftb->charset, (uchar*)word, len,
+ (uchar*)ftbw->word+1, ftbw->len-1,
+ (my_bool)(ftbw->flags&FTB_FLAG_TRUNC), 0) > 0)
+ b= c;
+ else
+ a= c;
+ }
+ for (; c >= 0; c--)
+ {
+ ftbw= ftb->list[c];
+ if (mi_compare_text(ftb->charset, (uchar*)word, len,
+ (uchar*)ftbw->word + 1,ftbw->len - 1,
+ (my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0))
+ break;
+ if (ftbw->docid[1] == ftb->info->lastpos)
+ continue;
+ ftbw->docid[1]= ftb->info->lastpos;
+ _ftb_climb_the_tree(ftb, ftbw, ftb_param->ftsi);
+ }
+ return(0);
+}
+
+
+static int ftb_find_relevance_parse(void *param, byte *doc, uint len)
+{
+ FT_INFO *ftb= ((MY_FTB_FIND_PARAM *)param)->ftb;
+ byte *end= doc + len;
+ FT_WORD w;
+ while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE))
+ ftb_find_relevance_add_word(param, w.pos, w.len, 0);
+ return(0);
+}
+
+
+float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
+{
FTB_EXPR *ftbe;
FT_SEG_ITERATOR ftsi, ftsi2;
- const byte *end;
my_off_t docid=ftb->info->lastpos;
+ MY_FTB_FIND_PARAM ftb_param;
+ MYSQL_FTPARSER_PARAM param;
+ struct st_mysql_ftparser *parser= ftb->keynr == NO_SUCH_KEY ? 0 :
+ ftb->info->s->keyinfo[ftb->keynr].parser;
if (docid == HA_OFFSET_ERROR)
return -2.0;
@@ -664,41 +857,31 @@
_mi_ft_segiterator_init(ftb->info, ftb->keynr, record, &ftsi);
memcpy(&ftsi2, &ftsi, sizeof(ftsi));
+ ftb_param.ftb= ftb;
+ ftb_param.ftsi= &ftsi2;
+ if (parser)
+ {
+ param.mysql_parse= ftb_find_relevance_parse;
+ param.mysql_add_word= ftb_find_relevance_add_word;
+ param.ftparser_state= 0;
+ param.mysql_ftparam= (void *)&ftb_param;
+ param.cs= ftb->charset;
+ param.flags= MYSQL_FTPARSER_DOCUMENT_MODE;
+ }
while (_mi_ft_segiterator(&ftsi))
{
if (!ftsi.pos)
continue;
- end=ftsi.pos+ftsi.len;
- while (ft_simple_get_word(ftb->charset, (byte **) &ftsi.pos,
- (byte *) end, &word, TRUE))
+ if (parser)
{
- int a, b, c;
- for (a=0, b=ftb->queue.elements, c=(a+b)/2; b-a>1; c=(a+b)/2)
- {
- ftbw=ftb->list[c];
- if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len,
- (uchar*) ftbw->word+1, ftbw->len-1,
- (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0) >0)
- b=c;
- else
- a=c;
- }
- for (; c>=0; c--)
- {
- ftbw=ftb->list[c];
- if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len,
- (uchar*) ftbw->word+1,ftbw->len-1,
- (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0))
- break;
- if (ftbw->docid[1] == docid)
- continue;
- ftbw->docid[1]=docid;
- _ftb_climb_the_tree(ftb, ftbw, &ftsi2);
- }
+ param.doc= (byte *)ftsi.pos;
+ param.length= ftsi.len;
+ parser->parse(¶m);
}
+ else
+ ftb_find_relevance_parse((void *)&ftb_param, (byte *)ftsi.pos, ftsi.len);
}
-
ftbe=ftb->root;
if (ftbe->docid[1]==docid && ftbe->cur_weight>0 &&
ftbe->yesses>=ftbe->ythresh && !ftbe->nos)
--- 1.15/mysql-test/r/connect.result 2005-08-20 20:40:37 +05:00
+++ 1.16/mysql-test/r/connect.result 2005-09-28 14:50:27 +05:00
@@ -1,3 +1,4 @@
+drop table if exists t1,t2;
show tables;
Tables_in_mysql
columns_priv
@@ -74,3 +75,8 @@
Tables_in_test
delete from mysql.user where user=_binary"test";
flush privileges;
+create table t1 (id integer not null auto_increment primary key);
+create temporary table t2(id integer not null auto_increment primary key);
+set @id := 1;
+delete from t1 where id like @id;
+drop table t1;
--- 1.27/mysql-test/r/system_mysql_db.result 2005-07-27 06:08:44 +05:00
+++ 1.28/mysql-test/r/system_mysql_db.result 2005-09-28 14:50:27 +05:00
@@ -9,6 +9,7 @@
help_relation
help_topic
host
+plugin
proc
procs_priv
tables_priv
--- 1.17/mysql-test/t/system_mysql_db_fix.test 2005-09-16 00:17:37 +05:00
+++ 1.18/mysql-test/t/system_mysql_db_fix.test 2005-09-28 14:50:28 +05:00
@@ -85,7 +85,7 @@
-- disable_query_log
-DROP TABLE db, host, user, func, tables_priv, columns_priv, procs_priv, help_category,
help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second,
time_zone_name, time_zone_transition, time_zone_transition_type;
+DROP TABLE db, host, user, func, plugin, tables_priv, columns_priv, procs_priv,
help_category, help_keyword, help_relation, help_topic, proc, time_zone,
time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type;
-- enable_query_log
--- 1.26/scripts/mysql_create_system_tables.sh 2005-07-27 06:08:44 +05:00
+++ 1.27/scripts/mysql_create_system_tables.sh 2005-09-28 14:50:28 +05:00
@@ -39,8 +39,8 @@
c_hr=""
c_hk=""
i_ht=""
-c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls=""
-i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls=""
+c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" c_pl=""
+i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" i_pl=""
c_p="" c_pp=""
# Check for old tables
@@ -202,6 +202,21 @@
c_f="$c_f comment='User defined functions';"
fi
+if test ! -f $mdata/plugin.frm
+then
+ if test "$1" = "verbose" ; then
+ echo "Preparing plugin table" 1>&2;
+ fi
+
+ c_pl="$c_pl CREATE TABLE plugin ("
+ c_pl="$c_pl name char(64) binary DEFAULT '' NOT NULL,"
+ c_pl="$c_pl dl char(128) DEFAULT '' NOT NULL,"
+ c_pl="$c_pl PRIMARY KEY (name)"
+ c_pl="$c_pl ) engine=MyISAM"
+ c_pl="$c_pl CHARACTER SET utf8 COLLATE utf8_bin"
+ c_pl="$c_pl comment='MySQL plugins';"
+fi
+
if test ! -f $mdata/tables_priv.frm
then
if test "$1" = "verbose" ; then
@@ -740,6 +755,9 @@
$c_f
$i_f
+
+$c_pl
+$i_pl
$c_t
$c_c
| Thread |
|---|
| • bk commit into 5.0 tree (svoj:1.2002) | svoj | 28 Sep |