1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Now ftparser does not need to bother about memory management -

it can tell MySQL to make a copy of everything (bug#17123)


include/mysql/plugin.h:
  Now ftparser does not need to bother about memory management -
  it can tell MySQL to make a copy of everything (bug#17123)
  MYSQL_FTFLAGS_NEED_COPY flag
storage/myisam/ft_boolean_search.c:
  param->flags
storage/myisam/ft_nlq_search.c:
  param->flags. ft_parse takes a mem_root as an argument
storage/myisam/ft_parser.c:
  ftparser takes a memroot as an argument. words are copied there, if necessary.
  memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/ft_update.c:
  ftparser takes a memroot as an argument. words are copied there, if necessary.
  memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/ftdefs.h:
  ftparser takes a memroot as an argument. words are copied there, if necessary.
  memroot is reset for every parsing and free'd at the end of the statement.
storage/myisam/mi_check.c:
  ftparser takes a memroot as an argument. words are copied there, if necessary
storage/myisam/myisamdef.h:
  memroot for ftparser in MI_INFO and MI_SORT_PARAM
storage/myisam/sort.c:
  free ftparser memroot
This commit is contained in:
unknown
2006-05-30 18:15:18 +02:00
parent f1bb09e777
commit 15a13203f1
9 changed files with 87 additions and 60 deletions

View File

@ -201,6 +201,17 @@ typedef struct st_mysql_ftparser_boolean_info
char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO;
/*
The following flag means that buffer with a string (document, word)
may be overwritten by the caller before the end of the parsing (that is
before st_mysql_ftparser::deinit() call). If one needs the string
to survive between two successive calls of the parsing function, she
needs to save a copy of it. The flag may be set by MySQL before calling
st_mysql_ftparser::parse(), or it may be set by a plugin before calling
st_mysql_ftparser_param::mysql_parse() or
st_mysql_ftparser_param::mysql_add_word().
*/
#define MYSQL_FTFLAGS_NEED_COPY 1
/*
An argument of the full-text parser plugin. This structure is
@ -234,8 +245,10 @@ typedef struct st_mysql_ftparser_boolean_info
length: Length of the document or query string, in bytes.
flags: See MYSQL_FTFLAGS_* constants above.
mode: The parsing mode. With boolean operators, with stopwords, or
nothing. See MYSQL_FTPARSER_* constants above.
nothing. See enum_ftparser_mode above.
*/
typedef struct st_mysql_ftparser_param
@ -250,6 +263,7 @@ typedef struct st_mysql_ftparser_param
struct charset_info_st *cs;
char *doc;
int length;
int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;