Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
76d65499
Commit
76d65499
authored
Apr 23, 2012
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
5701d531
97aa8e8c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
11 deletions
+60
-11
sql/parse_file.cc
sql/parse_file.cc
+48
-3
sql/parse_file.h
sql/parse_file.h
+1
-0
sql/sql_view.cc
sql/sql_view.cc
+1
-1
sql/table.h
sql/table.h
+10
-7
No files found.
sql/parse_file.cc
View file @
76d65499
...
...
@@ -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
;
...
...
@@ -766,6 +806,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
),
...
...
@@ -774,8 +815,12 @@ File_parser::parse(uchar* base, MEM_ROOT *mem_root,
}
{
int
not_used
;
*
((
ulonglong
*
)(
base
+
parameter
->
offset
))
=
my_strtoll10
(
ptr
,
0
,
&
not_used
);
ulonglong
val
=
(
ulonglong
)
my_strtoll10
(
ptr
,
0
,
&
not_used
);
if
(
parameter
->
type
==
FILE_OPTIONS_VIEW_ALGO
)
val
=
view_algo_from_frm
(
val
);
*
((
ulonglong
*
)(
base
+
parameter
->
offset
))
=
val
;
}
ptr
=
eol
+
1
;
break
;
...
...
sql/parse_file.h
View file @
76d65499
...
...
@@ -26,6 +26,7 @@ enum file_opt_type {
FILE_OPTIONS_STRING
,
/**< String (LEX_STRING) */
FILE_OPTIONS_ESTRING
,
/**< Escaped string (LEX_STRING) */
FILE_OPTIONS_ULONGLONG
,
/**< ulonglong parameter (ulonglong) */
FILE_OPTIONS_VIEW_ALGO
,
/**< Similar to longlong, but needs conversion */
FILE_OPTIONS_TIMESTAMP
,
/**< timestamp (LEX_STRING have to be
allocated with length 20 (19+1) */
FILE_OPTIONS_STRLIST
,
/**< list of escaped strings
...
...
sql/sql_view.cc
View file @
76d65499
...
...
@@ -736,7 +736,7 @@ static File_option view_parameters[]=
FILE_OPTIONS_ULONGLONG
},
{{
C_STRING_WITH_LEN
(
"algorithm"
)},
my_offsetof
(
TABLE_LIST
,
algorithm
),
FILE_OPTIONS_
ULONGLONG
},
FILE_OPTIONS_
VIEW_ALGO
},
{{
C_STRING_WITH_LEN
(
"definer_user"
)},
my_offsetof
(
TABLE_LIST
,
definer
.
user
),
FILE_OPTIONS_STRING
},
...
...
sql/table.h
View file @
76d65499
...
...
@@ -1150,12 +1150,6 @@ typedef struct st_schema_table
/*
Types of derived tables. The ending part is a bitmap of phases that are
applicable to a derived table of the type.
* /
#define VIEW_ALGORITHM_UNDEFINED 0
#define VIEW_ALGORITHM_MERGE 1 + DT_COMMON + DT_MERGE
#define DERIVED_ALGORITHM_MERGE 2 + DT_COMMON + DT_MERGE
#define VIEW_ALGORITHM_TMPTABLE 3 + DT_COMMON + DT_MATERIALIZE
#define DERIVED_ALGORITHM_MATERIALIZE 4 + DT_COMMON + DT_MATERIALIZE
*/
#define DTYPE_ALGORITHM_UNDEFINED 0
#define DTYPE_VIEW 1
...
...
@@ -1188,7 +1182,16 @@ typedef struct st_schema_table
#define VIEW_ALGORITHM_UNDEFINED 0
#define VIEW_ALGORITHM_MERGE (DTYPE_VIEW | DTYPE_MERGE)
#define VIEW_ALGORITHM_TMPTABLE (DTYPE_VIEW + DTYPE_MATERIALIZE )
#define VIEW_ALGORITHM_TMPTABLE (DTYPE_VIEW | DTYPE_MATERIALIZE)
/*
View algorithm values as stored in the FRM. Values differ from in-memory
representation for backward compatibility.
*/
#define VIEW_ALGORITHM_UNDEFINED_FRM 0
#define VIEW_ALGORITHM_MERGE_FRM 1
#define VIEW_ALGORITHM_TMPTABLE_FRM 2
#define JOIN_TYPE_LEFT 1
#define JOIN_TYPE_RIGHT 2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment