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
125c41bd
Commit
125c41bd
authored
Oct 16, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for new key_map code
parent
249798d8
Changes
3
Show 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 @
125c41bd
...
@@ -884,12 +884,12 @@ int ha_berkeley::write_row(byte * record)
...
@@ -884,12 +884,12 @@ int ha_berkeley::write_row(byte * record)
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
new_error
=
txn_abort
(
sub_trans
);
/* purecov: deadcode */
new_error
=
txn_abort
(
sub_trans
);
/* purecov: deadcode */
}
}
else
if
(
changed_keys
)
else
if
(
!
changed_keys
.
is_clear_all
()
)
{
{
new_error
=
0
;
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
,
if
((
new_error
=
remove_key
(
sub_trans
,
keynr
,
record
,
&
prim_key
)))
&
prim_key
)))
...
@@ -1033,11 +1033,14 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map changed_keys,
...
@@ -1033,11 +1033,14 @@ 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
rolled back. The last key set in changed_keys is the one that
triggered the duplicate key error (it wasn't inserted), so for
triggered the duplicate key error (it wasn't inserted), so for
that one just put back the old value. */
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
&&
if
(
changed_keys
.
is_set
(
keynr
))
{
if
(
changed_keys
.
is_subset
(
map1
)
&&
(
error
=
remove_key
(
trans
,
keynr
,
new_row
,
new_key
)))
(
error
=
remove_key
(
trans
,
keynr
,
new_row
,
new_key
)))
break
;
/* purecov: inspected */
break
;
/* purecov: inspected */
if
((
error
=
key_file
[
keynr
]
->
put
(
key_file
[
keynr
],
trans
,
if
((
error
=
key_file
[
keynr
]
->
put
(
key_file
[
keynr
],
trans
,
...
@@ -1047,6 +1050,7 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map changed_keys,
...
@@ -1047,6 +1050,7 @@ int ha_berkeley::restore_keys(DB_TXN *trans, key_map changed_keys,
break
;
/* purecov: inspected */
break
;
/* purecov: inspected */
}
}
}
}
}
err:
err:
DBUG_ASSERT
(
error
!=
DB_KEYEXIST
);
DBUG_ASSERT
(
error
!=
DB_KEYEXIST
);
...
@@ -1146,7 +1150,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
...
@@ -1146,7 +1150,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
DBUG_PRINT
(
"trans"
,(
"aborting subtransaction"
));
/* purecov: deadcode */
new_error
=
txn_abort
(
sub_trans
);
/* 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
,
new_error
=
restore_keys
(
transaction
,
changed_keys
,
primary_key
,
old_row
,
&
old_prim_key
,
new_row
,
&
prim_key
,
old_row
,
&
old_prim_key
,
new_row
,
&
prim_key
,
thd_options
);
thd_options
);
...
@@ -1231,9 +1235,9 @@ int ha_berkeley::remove_keys(DB_TXN *trans, const byte *record,
...
@@ -1231,9 +1235,9 @@ int ha_berkeley::remove_keys(DB_TXN *trans, const byte *record,
DBT
*
new_record
,
DBT
*
prim_key
,
key_map
keys
)
DBT
*
new_record
,
DBT
*
prim_key
,
key_map
keys
)
{
{
int
result
=
0
;
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
);
int
new_error
=
remove_key
(
trans
,
keynr
,
record
,
prim_key
);
if
(
new_error
)
if
(
new_error
)
...
...
sql/ha_berkeley.h
View file @
125c41bd
...
@@ -107,7 +107,7 @@ class ha_berkeley: public handler
...
@@ -107,7 +107,7 @@ class ha_berkeley: public handler
uint
extra_rec_buf_length
()
{
return
BDB_HIDDEN_PRIMARY_KEY_LENGTH
;
}
uint
extra_rec_buf_length
()
{
return
BDB_HIDDEN_PRIMARY_KEY_LENGTH
;
}
ha_rows
estimate_number_of_rows
();
ha_rows
estimate_number_of_rows
();
bool
fast_key_read
()
{
return
1
;}
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
;}
bool
has_transactions
()
{
return
1
;}
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
int
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
);
...
...
sql/mysql_priv.h
View file @
125c41bd
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
template
<
>
class
Bitmap
<
64
>
template
<
>
class
Bitmap
<
64
>
{
{
longlong
map
;
u
longlong
map
;
public:
public:
Bitmap
(
uint
prefix_to_set
=
0
)
{
set_prefix
(
prefix_to_set
);
}
Bitmap
(
uint
prefix_to_set
=
0
)
{
set_prefix
(
prefix_to_set
);
}
Bitmap
<
64
>&
init
()
{
return
*
this
;
}
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