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
242044b8
Commit
242044b8
authored
Aug 08, 2013
by
Zardosht Kasheff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs Tokutek/ft-index/#26 have ha_tokudb use new XXX_multiple API
parent
e42c4c1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
35 deletions
+28
-35
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+26
-33
storage/tokudb/ha_tokudb.h
storage/tokudb/ha_tokudb.h
+2
-2
No files found.
storage/tokudb/ha_tokudb.cc
View file @
242044b8
...
...
@@ -1263,11 +1263,12 @@ cleanup:
static
int
generate_row_for_del
(
DB
*
dest_db
,
DB
*
src_db
,
DBT
*
dest_key
,
DBT
_ARRAY
*
dest_key_arrays
,
const
DBT
*
src_key
,
const
DBT
*
src_val
)
{
DBT
*
dest_key
=
&
dest_key_arrays
->
dbts
[
0
];
return
tokudb_generate_row
(
dest_db
,
src_db
,
...
...
@@ -1282,12 +1283,14 @@ static int generate_row_for_del(
static
int
generate_row_for_put
(
DB
*
dest_db
,
DB
*
src_db
,
DBT
*
dest_key
,
DBT
*
dest_val
,
DBT
_ARRAY
*
dest_key_arrays
,
DBT
_ARRAY
*
dest_val_arrays
,
const
DBT
*
src_key
,
const
DBT
*
src_val
)
{
DBT
*
dest_key
=
&
dest_key_arrays
->
dbts
[
0
];
DBT
*
dest_val
=
(
dest_val_arrays
==
NULL
)
?
NULL
:
&
dest_val_arrays
->
dbts
[
0
];
return
tokudb_generate_row
(
dest_db
,
src_db
,
...
...
@@ -1327,8 +1330,14 @@ ha_tokudb::ha_tokudb(handlerton * hton, TABLE_SHARE * table_arg):handler(hton, t
num_blob_bytes
=
0
;
delay_updating_ai_metadata
=
false
;
ai_metadata_update_required
=
false
;
memset
(
mult_key_dbt
,
0
,
sizeof
(
mult_key_dbt
));
memset
(
mult_rec_dbt
,
0
,
sizeof
(
mult_rec_dbt
));
memset
(
mult_key_dbt_array
,
0
,
sizeof
(
mult_key_dbt_array
));
memset
(
mult_rec_dbt_array
,
0
,
sizeof
(
mult_rec_dbt_array
));
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_key_dbt_array
)
/
sizeof
(
mult_key_dbt_array
[
0
]);
i
++
)
{
toku_dbt_array_init
(
&
mult_key_dbt_array
[
i
],
1
);
}
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_rec_dbt_array
)
/
sizeof
(
mult_rec_dbt_array
[
0
]);
i
++
)
{
toku_dbt_array_init
(
&
mult_rec_dbt_array
[
i
],
1
);
}
loader
=
NULL
;
abort_loader
=
false
;
memset
(
&
lc
,
0
,
sizeof
(
lc
));
...
...
@@ -1857,7 +1866,6 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
int
error
=
0
;
int
ret_val
=
0
;
uint
curr_num_DBs
=
0
;
transaction
=
NULL
;
cursor
=
NULL
;
...
...
@@ -1875,7 +1883,6 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
else
{
key_used_on_scan
=
primary_key
;
}
curr_num_DBs
=
table_share
->
keys
+
test
(
hidden_primary_key
);
/* Need some extra memory in case of packed keys */
// the "+ 1" is for the first byte that states +/- infinity
...
...
@@ -1918,14 +1925,6 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
goto
exit
;
}
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_key_dbt
)
/
sizeof
(
mult_key_dbt
[
0
]);
i
++
)
{
mult_key_dbt
[
i
].
flags
=
DB_DBT_REALLOC
;
}
for
(
uint32_t
i
=
0
;
i
<
curr_num_DBs
;
i
++
)
{
mult_rec_dbt
[
i
].
flags
=
DB_DBT_REALLOC
;
}
/* Init shared structure */
pthread_mutex_lock
(
&
tokudb_mutex
);
share
=
get_share
(
name
,
table_share
);
...
...
@@ -2256,17 +2255,11 @@ int ha_tokudb::__close() {
my_free
(
blob_buff
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
(
alloc_ptr
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
(
range_query_buff
,
MYF
(
MY_ALLOW_ZERO_PTR
));
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_rec_dbt
)
/
sizeof
(
mult_rec_dbt
[
0
]);
i
++
)
{
if
(
mult_rec_dbt
[
i
].
flags
==
DB_DBT_REALLOC
&&
mult_rec_dbt
[
i
].
data
!=
NULL
)
{
free
(
mult_rec_dbt
[
i
].
data
);
}
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_key_dbt_array
)
/
sizeof
(
mult_key_dbt_array
[
0
]);
i
++
)
{
toku_dbt_array_destroy
(
&
mult_key_dbt_array
[
i
]);
}
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_key_dbt
)
/
sizeof
(
mult_key_dbt
[
0
]);
i
++
)
{
if
(
mult_key_dbt
[
i
].
flags
==
DB_DBT_REALLOC
&&
mult_key_dbt
[
i
].
data
!=
NULL
)
{
free
(
mult_key_dbt
[
i
].
data
);
}
for
(
uint32_t
i
=
0
;
i
<
sizeof
(
mult_rec_dbt_array
)
/
sizeof
(
mult_rec_dbt_array
[
0
]);
i
++
)
{
toku_dbt_array_destroy
(
&
mult_rec_dbt_array
[
i
]);
}
rec_buff
=
NULL
;
rec_update_buff
=
NULL
;
...
...
@@ -3937,13 +3930,13 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN
// env->put_multiple(), except that
// we will just do a put() right away.
error
=
tokudb_generate_row
(
db
,
src_db
,
&
mult_key_dbt
[
i
],
&
mult_rec_dbt
[
i
],
&
mult_key_dbt
_array
[
i
].
dbts
[
0
],
&
mult_rec_dbt_array
[
i
].
dbts
[
0
],
pk_key
,
pk_val
);
if
(
error
!=
0
)
{
goto
out
;
}
error
=
db
->
put
(
db
,
txn
,
&
mult_key_dbt
[
i
],
&
mult_rec_dbt
[
i
],
flags
);
error
=
db
->
put
(
db
,
txn
,
&
mult_key_dbt
_array
[
i
].
dbts
[
0
],
&
mult_rec_dbt
_array
[
i
].
dbts
[
0
],
flags
);
}
if
(
error
!=
0
)
{
goto
out
;
...
...
@@ -3959,8 +3952,8 @@ int ha_tokudb::insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN
pk_val
,
curr_num_DBs
,
share
->
key_file
,
mult_key_dbt
,
mult_rec_dbt
,
mult_key_dbt
_array
,
mult_rec_dbt
_array
,
mult_put_flags
);
}
...
...
@@ -4314,9 +4307,9 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
share
->
key_file
,
mult_put_flags
,
2
*
curr_num_DBs
,
mult_key_dbt
,
mult_key_dbt
_array
,
curr_num_DBs
,
mult_rec_dbt
mult_rec_dbt
_array
);
if
(
error
==
DB_KEYEXIST
)
{
...
...
@@ -4391,7 +4384,7 @@ int ha_tokudb::delete_row(const uchar * record) {
&
row
,
curr_num_DBs
,
share
->
key_file
,
mult_key_dbt
,
mult_key_dbt
_array
,
mult_del_flags
);
...
...
storage/tokudb/ha_tokudb.h
View file @
242044b8
...
...
@@ -281,8 +281,8 @@ private:
//
// individual DBTs for each index
//
DBT
mult_key_dbt
[
2
*
(
MAX_KEY
+
1
)];
DBT
mult_rec_dbt
[
MAX_KEY
+
1
];
DBT
_ARRAY
mult_key_dbt_array
[
2
*
(
MAX_KEY
+
1
)];
DBT
_ARRAY
mult_rec_dbt_array
[
MAX_KEY
+
1
];
uint32_t
mult_put_flags
[
MAX_KEY
+
1
];
uint32_t
mult_del_flags
[
MAX_KEY
+
1
];
uint32_t
mult_dbt_flags
[
MAX_KEY
+
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