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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4aa99ff7
Commit
4aa99ff7
authored
Oct 16, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for new key_map code
parent
b3ca82ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+20
-16
sql/ha_berkeley.h
sql/ha_berkeley.h
+1
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
No files found.
sql/ha_berkeley.cc
View file @
4aa99ff7
...
...
@@ -884,12 +884,12 @@ int ha_berkeley::write_row(byte * record)
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
new_error
=
txn_abort
(
sub_trans
);
/* purecov: deadcode */
}
else
if
(
changed_keys
)
else
if
(
!
changed_keys
.
is_clear_all
()
)
{
new_error
=
0
;
for
(
uint
keynr
=
0
;
changed_keys
;
keynr
++
,
changed_keys
>>=
1
)
for
(
uint
keynr
=
0
;
keynr
<
changed_keys
.
length
();
keynr
++
)
{
if
(
changed_keys
&
1
)
if
(
changed_keys
.
is_set
(
keynr
)
)
{
if
((
new_error
=
remove_key
(
sub_trans
,
keynr
,
record
,
&
prim_key
)))
...
...
@@ -1033,18 +1033,22 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map changed_keys,
rolled back. The last key set in changed_keys is the one that
triggered the duplicate key error (it wasn't inserted), so for
that one just put back the old value. */
for
(
keynr
=
0
;
changed_keys
;
keynr
++
,
changed_keys
>>=
1
)
if
(
!
changed_keys
.
is_clear_all
()
)
{
if
(
changed_keys
&
1
)
key_map
map1
(
1
);
for
(
keynr
=
0
;
keynr
<
changed_keys
.
length
();
keynr
++
)
{
if
(
changed_keys
!=
1
&&
(
error
=
remove_key
(
trans
,
keynr
,
new_row
,
new_key
)))
break
;
/* purecov: inspected */
if
((
error
=
key_file
[
keynr
]
->
put
(
key_file
[
keynr
],
trans
,
create_key
(
&
tmp_key
,
keynr
,
key_buff2
,
old_row
),
old_key
,
key_type
[
keynr
])))
break
;
/* purecov: inspected */
if
(
changed_keys
.
is_set
(
keynr
))
{
if
(
changed_keys
.
is_subset
(
map1
)
&&
(
error
=
remove_key
(
trans
,
keynr
,
new_row
,
new_key
)))
break
;
/* purecov: inspected */
if
((
error
=
key_file
[
keynr
]
->
put
(
key_file
[
keynr
],
trans
,
create_key
(
&
tmp_key
,
keynr
,
key_buff2
,
old_row
),
old_key
,
key_type
[
keynr
])))
break
;
/* purecov: inspected */
}
}
}
...
...
@@ -1146,7 +1150,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
new_error
=
txn_abort
(
sub_trans
);
/* purecov: deadcode */
}
else
if
(
changed_keys
)
else
if
(
!
changed_keys
.
is_clear_all
()
)
new_error
=
restore_keys
(
transaction
,
changed_keys
,
primary_key
,
old_row
,
&
old_prim_key
,
new_row
,
&
prim_key
,
thd_options
);
...
...
@@ -1231,9 +1235,9 @@ int ha_berkeley::remove_keys(DB_TXN *trans, const byte *record,
DBT
*
new_record
,
DBT
*
prim_key
,
key_map
keys
)
{
int
result
=
0
;
for
(
uint
keynr
=
0
;
key
s
;
keynr
++
,
keys
>>=
1
)
for
(
uint
keynr
=
0
;
key
nr
<
keys
.
length
();
keynr
++
)
{
if
(
keys
&
1
)
if
(
keys
.
is_set
(
keynr
)
)
{
int
new_error
=
remove_key
(
trans
,
keynr
,
record
,
prim_key
);
if
(
new_error
)
...
...
sql/ha_berkeley.h
View file @
4aa99ff7
...
...
@@ -107,7 +107,7 @@ class ha_berkeley: public handler
uint
extra_rec_buf_length
()
{
return
BDB_HIDDEN_PRIMARY_KEY_LENGTH
;
}
ha_rows
estimate_number_of_rows
();
bool
fast_key_read
()
{
return
1
;}
const
key_map
keys_to_use_for_scanning
()
{
return
key_map
(
~
0
)
;
}
const
key_map
&
keys_to_use_for_scanning
()
{
return
key_map_full
;
}
bool
has_transactions
()
{
return
1
;}
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
...
...
sql/mysql_priv.h
View file @
4aa99ff7
...
...
@@ -99,7 +99,7 @@ template <uint default_width> class Bitmap
template
<
>
class
Bitmap
<
64
>
{
longlong
map
;
u
longlong
map
;
public:
Bitmap
(
uint
prefix_to_set
=
0
)
{
set_prefix
(
prefix_to_set
);
}
Bitmap
<
64
>&
init
()
{
return
*
this
;
}
...
...
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