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
e5989d52
Commit
e5989d52
authored
May 14, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: simplify innobase_compression_algorithm_validate()
parent
8815fb3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
50 deletions
+6
-50
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+3
-25
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+3
-25
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
e5989d52
...
@@ -20033,33 +20033,11 @@ innodb_compression_algorithm_validate(
...
@@ -20033,33 +20033,11 @@ innodb_compression_algorithm_validate(
long
compression_algorithm
;
long
compression_algorithm
;
DBUG_ENTER
(
"innobase_compression_algorithm_validate"
);
DBUG_ENTER
(
"innobase_compression_algorithm_validate"
);
if
(
value
->
value_type
(
value
)
==
MYSQL_VALUE_TYPE_STRING
)
{
if
(
check_sysvar_enum
(
thd
,
var
,
save
,
value
))
{
char
buff
[
STRING_BUFFER_USUAL_SIZE
];
const
char
*
str
;
int
length
=
sizeof
(
buff
);
if
(
!
(
str
=
value
->
val_str
(
value
,
buff
,
&
length
)))
{
DBUG_RETURN
(
1
);
}
if
((
compression_algorithm
=
(
long
)
find_type
(
str
,
&
page_compression_algorithms_typelib
,
0
)
-
1
)
<
0
)
{
DBUG_RETURN
(
1
);
}
}
else
{
long
long
tmp
;
if
(
value
->
val_int
(
value
,
&
tmp
))
{
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
tmp
<
0
||
tmp
>=
page_compression_algorithms_typelib
.
count
)
{
compression_algorithm
=
*
reinterpret_cast
<
ulong
*>
(
save
);
DBUG_RETURN
(
1
);
}
compression_algorithm
=
(
long
)
tmp
;
}
*
reinterpret_cast
<
ulong
*>
(
save
)
=
compression_algorithm
;
#ifndef HAVE_LZ4
#ifndef HAVE_LZ4
if
(
compression_algorithm
==
PAGE_LZ4_ALGORITHM
)
{
if
(
compression_algorithm
==
PAGE_LZ4_ALGORITHM
)
{
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
e5989d52
...
@@ -21261,33 +21261,11 @@ innodb_compression_algorithm_validate(
...
@@ -21261,33 +21261,11 @@ innodb_compression_algorithm_validate(
long
compression_algorithm
;
long
compression_algorithm
;
DBUG_ENTER
(
"innobase_compression_algorithm_validate"
);
DBUG_ENTER
(
"innobase_compression_algorithm_validate"
);
if
(
value
->
value_type
(
value
)
==
MYSQL_VALUE_TYPE_STRING
)
{
if
(
check_sysvar_enum
(
thd
,
var
,
save
,
value
))
{
char
buff
[
STRING_BUFFER_USUAL_SIZE
];
const
char
*
str
;
int
length
=
sizeof
(
buff
);
if
(
!
(
str
=
value
->
val_str
(
value
,
buff
,
&
length
)))
{
DBUG_RETURN
(
1
);
}
if
((
compression_algorithm
=
(
long
)
find_type
(
str
,
&
page_compression_algorithms_typelib
,
0
)
-
1
)
<
0
)
{
DBUG_RETURN
(
1
);
}
}
else
{
long
long
tmp
;
if
(
value
->
val_int
(
value
,
&
tmp
))
{
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
tmp
<
0
||
tmp
>=
page_compression_algorithms_typelib
.
count
)
{
compression_algorithm
=
*
reinterpret_cast
<
ulong
*>
(
save
);
DBUG_RETURN
(
1
);
}
compression_algorithm
=
(
long
)
tmp
;
}
*
reinterpret_cast
<
ulong
*>
(
save
)
=
compression_algorithm
;
#ifndef HAVE_LZ4
#ifndef HAVE_LZ4
if
(
compression_algorithm
==
PAGE_LZ4_ALGORITHM
)
{
if
(
compression_algorithm
==
PAGE_LZ4_ALGORITHM
)
{
...
...
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