mirror of
https://github.com/MariaDB/server.git
synced 2026-04-26 10:15:29 +02:00
5.3 merge
This commit is contained in:
commit
44cf9ee5f7
52 changed files with 850 additions and 135 deletions
|
|
@ -86,6 +86,40 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static ulonglong view_algo_to_frm(ulonglong val)
|
||||
{
|
||||
switch(val)
|
||||
{
|
||||
case VIEW_ALGORITHM_UNDEFINED:
|
||||
return VIEW_ALGORITHM_UNDEFINED_FRM;
|
||||
case VIEW_ALGORITHM_MERGE:
|
||||
return VIEW_ALGORITHM_MERGE_FRM;
|
||||
case VIEW_ALGORITHM_TMPTABLE:
|
||||
return VIEW_ALGORITHM_TMPTABLE_FRM;
|
||||
}
|
||||
DBUG_ASSERT(0); /* Should never happen */
|
||||
return VIEW_ALGORITHM_UNDEFINED;
|
||||
}
|
||||
|
||||
static ulonglong view_algo_from_frm(ulonglong val)
|
||||
{
|
||||
switch(val)
|
||||
{
|
||||
case VIEW_ALGORITHM_UNDEFINED_FRM:
|
||||
return VIEW_ALGORITHM_UNDEFINED;
|
||||
case VIEW_ALGORITHM_MERGE_FRM:
|
||||
return VIEW_ALGORITHM_MERGE;
|
||||
case VIEW_ALGORITHM_TMPTABLE_FRM:
|
||||
return VIEW_ALGORITHM_TMPTABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
Early versions of MariaDB 5.2/5.3 had identical in-memory and frm values
|
||||
Return input value.
|
||||
*/
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Write parameter value to IO_CACHE.
|
||||
|
|
@ -124,8 +158,14 @@ write_parameter(IO_CACHE *file, uchar* base, File_option *parameter)
|
|||
break;
|
||||
}
|
||||
case FILE_OPTIONS_ULONGLONG:
|
||||
case FILE_OPTIONS_VIEW_ALGO:
|
||||
{
|
||||
num.set(*((ulonglong *)(base + parameter->offset)), &my_charset_bin);
|
||||
ulonglong val= *(ulonglong *)(base + parameter->offset);
|
||||
|
||||
if (parameter->type == FILE_OPTIONS_VIEW_ALGO)
|
||||
val= view_algo_to_frm(val);
|
||||
|
||||
num.set(val, &my_charset_bin);
|
||||
if (my_b_append(file, (const uchar *)num.ptr(), num.length()))
|
||||
DBUG_RETURN(TRUE);
|
||||
break;
|
||||
|
|
@ -769,6 +809,7 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
|
|||
break;
|
||||
}
|
||||
case FILE_OPTIONS_ULONGLONG:
|
||||
case FILE_OPTIONS_VIEW_ALGO:
|
||||
if (!(eol= strchr(ptr, '\n')))
|
||||
{
|
||||
my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0),
|
||||
|
|
@ -777,8 +818,12 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
|
|||
}
|
||||
{
|
||||
int not_used;
|
||||
*((ulonglong*)(base + parameter->offset))=
|
||||
my_strtoll10(ptr, 0, ¬_used);
|
||||
ulonglong val= (ulonglong)my_strtoll10(ptr, 0, ¬_used);
|
||||
|
||||
if (parameter->type == FILE_OPTIONS_VIEW_ALGO)
|
||||
val= view_algo_from_frm(val);
|
||||
|
||||
*((ulonglong*)(base + parameter->offset))= val;
|
||||
}
|
||||
ptr= eol+1;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue