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
fb6d749f
Commit
fb6d749f
authored
Nov 10, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start port of tokudb to mariadb 10
parent
b8d7ee97
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
storage/tokudb/ha_tokudb_alter_56.cc
storage/tokudb/ha_tokudb_alter_56.cc
+9
-7
storage/tokudb/hatoku_cmp.cc
storage/tokudb/hatoku_cmp.cc
+6
-3
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+10
-0
No files found.
storage/tokudb/ha_tokudb_alter_56.cc
View file @
fb6d749f
...
...
@@ -91,13 +91,15 @@ PATENT RIGHTS GRANT:
#if TOKU_INCLUDE_ALTER_56
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
#define TOKU_ALTER_RENAME ALTER_RENAME_56
#elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
#define TOKU_ALTER_RENAME ALTER_RENAME
#elif 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#define DYNAMIC_ARRAY_ELEMENTS_TYPE size_t
#elif (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799)
#define TOKU_ALTER_RENAME ALTER_RENAME
#define DYNAMIC_ARRAY_ELEMENTS_TYPE int
#elif 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599
#define TOKU_ALTER_RENAME ALTER_RENAME_56
#define DYNAMIC_ARRAY_ELEMENTS_TYPE int
#else
#error
#endif
...
...
@@ -838,7 +840,7 @@ static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter
return
false
;
if
(
ctx
->
changed_fields
.
elements
()
>
1
)
return
false
;
// only support one field change
for
(
int
ai
=
0
;
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
for
(
DYNAMIC_ARRAY_ELEMENTS_TYPE
ai
=
0
;
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
uint
i
=
ctx
->
changed_fields
.
at
(
ai
);
Field
*
old_field
=
table
->
field
[
i
];
Field
*
new_field
=
altered_table
->
field
[
i
];
...
...
@@ -860,7 +862,7 @@ static bool is_sorted(Dynamic_array<uint> &a) {
bool
r
=
true
;
if
(
a
.
elements
()
>
0
)
{
uint
lastelement
=
a
.
at
(
0
);
for
(
int
i
=
1
;
i
<
a
.
elements
();
i
++
)
for
(
DYNAMIC_ARRAY_ELEMENTS_TYPE
i
=
1
;
i
<
a
.
elements
();
i
++
)
if
(
lastelement
>
a
.
at
(
i
))
r
=
false
;
}
...
...
@@ -871,7 +873,7 @@ int ha_tokudb::alter_table_expand_columns(TABLE *altered_table, Alter_inplace_in
int
error
=
0
;
tokudb_alter_ctx
*
ctx
=
static_cast
<
tokudb_alter_ctx
*>
(
ha_alter_info
->
handler_ctx
);
assert
(
is_sorted
(
ctx
->
changed_fields
));
// since we build the changed_fields array in field order, it must be sorted
for
(
int
ai
=
0
;
error
==
0
&&
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
for
(
DYNAMIC_ARRAY_ELEMENTS_TYPE
ai
=
0
;
error
==
0
&&
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
uint
expand_field_num
=
ctx
->
changed_fields
.
at
(
ai
);
error
=
alter_table_expand_one_column
(
altered_table
,
ha_alter_info
,
expand_field_num
);
}
...
...
@@ -1129,7 +1131,7 @@ static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_i
return
false
;
if
(
ctx
->
changed_fields
.
elements
()
>
1
)
return
false
;
// only support one field change
for
(
int
ai
=
0
;
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
for
(
DYNAMIC_ARRAY_ELEMENTS_TYPE
ai
=
0
;
ai
<
ctx
->
changed_fields
.
elements
();
ai
++
)
{
uint
i
=
ctx
->
changed_fields
.
at
(
ai
);
Field
*
old_field
=
table
->
field
[
i
];
Field
*
new_field
=
altered_table
->
field
[
i
];
...
...
storage/tokudb/hatoku_cmp.cc
View file @
fb6d749f
...
...
@@ -118,7 +118,8 @@ bool field_valid_for_tokudb_table(Field* field) {
case
MYSQL_TYPE_DOUBLE
:
case
MYSQL_TYPE_FLOAT
:
#if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799)
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \
(100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099)
case
MYSQL_TYPE_DATETIME2
:
case
MYSQL_TYPE_TIMESTAMP2
:
case
MYSQL_TYPE_TIME2
:
...
...
@@ -266,7 +267,8 @@ TOKU_TYPE mysql_to_toku_type (Field* field) {
ret_val
=
toku_type_float
;
goto
exit
;
#if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799)
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \
(100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099)
case
MYSQL_TYPE_DATETIME2
:
case
MYSQL_TYPE_TIMESTAMP2
:
case
MYSQL_TYPE_TIME2
:
...
...
@@ -3227,7 +3229,8 @@ bool fields_are_same_type(
case
MYSQL_TYPE_TIME
:
case
MYSQL_TYPE_TIMESTAMP
:
#if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799)
(50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \
(100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099)
case
MYSQL_TYPE_DATETIME2
:
case
MYSQL_TYPE_TIMESTAMP2
:
case
MYSQL_TYPE_TIME2
:
...
...
storage/tokudb/hatoku_defines.h
View file @
fb6d749f
...
...
@@ -121,6 +121,16 @@ PATENT RIGHTS GRANT:
#if defined(TOKUDB_PATCHES) && TOKUDB_PATCHES == 0
#elif 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
#define TOKU_USE_DB_TYPE_TOKUDB 1
#define TOKU_INCLUDE_ALTER_56 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 0
#define TOKU_INCLUDE_XA 1
#define TOKU_INCLUDE_WRITE_FRM_DATA 0
#if defined(MARIADB_BASE_VERSION)
#define TOKU_INCLUDE_EXTENDED_KEYS 1
#endif
#elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
#define TOKU_USE_DB_TYPE_UNKNOWN 1
#define TOKU_INCLUDE_ALTER_56 1
...
...
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