mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
Remove FILE_OPTIONS_STRING after version bump
FILE_OPTIONS_STRING was disabled for 10.11.20 by MDEV-40484. Use FILE_OPTIONS_ESTRING for the remaining fields (md5, charset names never contain escaped characters).
This commit is contained in:
@@ -145,13 +145,6 @@ write_parameter(IO_CACHE *file, const uchar* base, File_option *parameter)
|
||||
DBUG_ENTER("write_parameter");
|
||||
|
||||
switch (parameter->type) {
|
||||
case FILE_OPTIONS_STRING:
|
||||
{
|
||||
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
|
||||
if (my_b_write(file, (const uchar *)val_s->str, val_s->length))
|
||||
DBUG_RETURN(TRUE);
|
||||
break;
|
||||
}
|
||||
case FILE_OPTIONS_ESTRING:
|
||||
{
|
||||
if (write_escaped_string(file, (LEX_STRING *)(base + parameter->offset)))
|
||||
@@ -537,40 +530,6 @@ frm_error:
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
parse LEX_STRING.
|
||||
|
||||
@param ptr pointer on string beginning
|
||||
@param end pointer on symbol after parsed string end (still owned
|
||||
by buffer and can be accessed
|
||||
@param mem_root MEM_ROOT for parameter allocation
|
||||
@param str pointer on string, where results should be stored
|
||||
|
||||
@retval
|
||||
0 error
|
||||
@retval
|
||||
\# pointer on symbol after string
|
||||
*/
|
||||
|
||||
|
||||
static const char *
|
||||
parse_string(const char *ptr, const char *end, MEM_ROOT *mem_root,
|
||||
LEX_STRING *str)
|
||||
{
|
||||
// get string length
|
||||
const char *eol= strchr(ptr, '\n');
|
||||
|
||||
if (eol >= end)
|
||||
return 0;
|
||||
|
||||
str->length= eol - ptr;
|
||||
|
||||
if (!(str->str= strmake_root(mem_root, ptr, str->length)))
|
||||
return 0;
|
||||
return eol+1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
read escaped string from ptr to eol in already allocated str.
|
||||
|
||||
@@ -836,18 +795,6 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
|
||||
// get value
|
||||
ptr+= (len+1);
|
||||
switch (parameter->type) {
|
||||
case FILE_OPTIONS_STRING:
|
||||
{
|
||||
if (!(ptr= parse_string(ptr, end, mem_root,
|
||||
(LEX_STRING *)(base +
|
||||
parameter->offset))))
|
||||
{
|
||||
my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0),
|
||||
parameter->name.str, line);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FILE_OPTIONS_ESTRING:
|
||||
{
|
||||
if (!(ptr= parse_escaped_string(ptr, end, mem_root,
|
||||
|
||||
@@ -27,9 +27,6 @@ typedef struct st_mem_root MEM_ROOT;
|
||||
#define PARSE_FILE_TIMESTAMPLENGTH 19
|
||||
|
||||
enum file_opt_type {
|
||||
#if MYSQL_VERSION_ID < 101120
|
||||
FILE_OPTIONS_STRING, /**< String (LEX_STRING) */
|
||||
#endif
|
||||
FILE_OPTIONS_ESTRING, /**< Escaped string (LEX_STRING) */
|
||||
FILE_OPTIONS_ULONGLONG, /**< ulonglong parameter (ulonglong) */
|
||||
FILE_OPTIONS_VIEW_ALGO, /**< Similar to longlong, but needs conversion */
|
||||
|
||||
@@ -220,7 +220,7 @@ static File_option triggers_file_parameters[]=
|
||||
my_offsetof(class Table_triggers_list, hr_create_times),
|
||||
FILE_OPTIONS_ULLLIST
|
||||
},
|
||||
{ { 0, 0 }, 0, FILE_OPTIONS_STRING }
|
||||
{ { 0, 0 }, 0, FILE_OPTIONS_ESTRING }
|
||||
};
|
||||
|
||||
File_option sql_modes_parameters=
|
||||
@@ -263,7 +263,7 @@ static File_option trigname_file_parameters[]=
|
||||
offsetof(struct st_trigname, trigger_table),
|
||||
FILE_OPTIONS_ESTRING
|
||||
},
|
||||
{ { 0, 0 }, 0, FILE_OPTIONS_STRING }
|
||||
{ { 0, 0 }, 0, FILE_OPTIONS_ESTRING }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ static File_option view_parameters[]=
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{ STRING_WITH_LEN("md5")},
|
||||
my_offsetof(TABLE_LIST, md5),
|
||||
FILE_OPTIONS_STRING},
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{ STRING_WITH_LEN("updatable")},
|
||||
my_offsetof(TABLE_LIST, updatable_view),
|
||||
FILE_OPTIONS_ULONGLONG},
|
||||
@@ -852,10 +852,10 @@ static File_option view_parameters[]=
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{(char*) STRING_WITH_LEN("client_cs_name")},
|
||||
my_offsetof(TABLE_LIST, view_client_cs_name),
|
||||
FILE_OPTIONS_STRING},
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{(char*) STRING_WITH_LEN("connection_cl_name")},
|
||||
my_offsetof(TABLE_LIST, view_connection_cl_name),
|
||||
FILE_OPTIONS_STRING},
|
||||
FILE_OPTIONS_ESTRING},
|
||||
{{(char*) STRING_WITH_LEN("view_body_utf8")},
|
||||
my_offsetof(TABLE_LIST, view_body_utf8),
|
||||
FILE_OPTIONS_ESTRING},
|
||||
@@ -863,7 +863,7 @@ static File_option view_parameters[]=
|
||||
my_offsetof(TABLE_LIST, mariadb_version),
|
||||
FILE_OPTIONS_ULONGLONG},
|
||||
{{NullS, 0}, 0,
|
||||
FILE_OPTIONS_STRING}
|
||||
FILE_OPTIONS_ESTRING}
|
||||
};
|
||||
|
||||
|
||||
@@ -871,7 +871,7 @@ static File_option view_timestamp_parameters[]=
|
||||
{
|
||||
|
||||
{{ C_STRING_WITH_LEN("timestamp")}, 0, FILE_OPTIONS_TIMESTAMP},
|
||||
{{NullS, 0}, 0, FILE_OPTIONS_STRING}
|
||||
{{NullS, 0}, 0, FILE_OPTIONS_ESTRING}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user