From 806f9e24ff1e9409d6b833c4ec1c07d3e45272c3 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Sun, 20 Nov 2005 20:47:07 +0200 Subject: Inefficient usage of String::append() fixed. Bad examples of usage of a string with its length fixed. The incorrect length in the trigger file configuration descriptor fixed (BUG#14090). A hook for unknown keys added to the parser to support old .TRG files. --- sql/parse_file.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'sql/parse_file.h') diff --git a/sql/parse_file.h b/sql/parse_file.h index b4199e4fbf1..afa88da2ead 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -40,6 +40,35 @@ struct File_option file_opt_type type; /* Option type */ }; + +/* + This hook used to catch no longer supported keys and process them for + backward compatibility. +*/ + +class Unknown_key_hook +{ +public: + virtual bool process_unknown_string(char *&unknown_key, gptr base, + MEM_ROOT *mem_root, char *end)= 0; +}; + + +/* Dummy hook for parsers which do not need hook for unknown keys */ + +class File_parser_dummy_hook: public Unknown_key_hook +{ +public: + virtual bool process_unknown_string(char *&unknown_key, gptr base, + MEM_ROOT *mem_root, char *end); +}; + +extern File_parser_dummy_hook file_parser_dummy_hook; + +bool get_file_options_ulllist(char *&ptr, char *end, char *line, + gptr base, File_option *parameter, + MEM_ROOT *mem_root); + class File_parser; File_parser *sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, bool bad_format_errors); @@ -64,7 +93,8 @@ public: my_bool ok() { return content_ok; } LEX_STRING *type() { return &file_type; } my_bool parse(gptr base, MEM_ROOT *mem_root, - struct File_option *parameters, uint required); + struct File_option *parameters, uint required, + Unknown_key_hook *hook); friend File_parser *sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, -- cgit v1.2.1