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
b4974dac
Commit
b4974dac
authored
Dec 11, 2000
by
monty@donna.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed init that crashed BDB
Fixed newly introduced bug in update
parent
1e56deab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
25 deletions
+23
-25
.bzrignore
.bzrignore
+1
-0
sql/filesort.cc
sql/filesort.cc
+0
-3
sql/ha_berkeley.cc
sql/ha_berkeley.cc
+9
-14
sql/opt_range.cc
sql/opt_range.cc
+1
-1
sql/sql_update.cc
sql/sql_update.cc
+12
-7
No files found.
.bzrignore
View file @
b4974dac
...
...
@@ -174,3 +174,4 @@ support-files/mysql-log-rotate
support-files/mysql.server
support-files/mysql.spec
tags
libmysql_r/conf_to_src
sql/filesort.cc
View file @
b4974dac
...
...
@@ -325,9 +325,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file
->
extra
(
HA_EXTRA_CACHE
);
/* Quicker reads */
}
if
(
quick_select
)
error
=
select
->
quick
->
init
();
if
(
!
error
)
for
(;;)
{
...
...
sql/ha_berkeley.cc
View file @
b4974dac
...
...
@@ -1004,10 +1004,10 @@ int ha_berkeley::remove_key(DB_TXN *sub_trans, uint keynr, const byte *record,
We will never come here with keynr = primary_key
*/
dbug_assert
(
keynr
!=
primary_key
&&
prim_key
->
data
!=
key_buff2
);
DBC
*
cursor
;
if
(
!
(
error
=
file
->
cursor
(
key_file
[
keynr
],
sub_trans
,
&
cursor
,
0
)))
DBC
*
tmp_
cursor
;
if
(
!
(
error
=
file
->
cursor
(
key_file
[
keynr
],
sub_trans
,
&
tmp_
cursor
,
0
)))
{
if
(
!
(
error
=
cursor
->
c_get
(
cursor
,
if
(
!
(
error
=
cursor
->
c_get
(
tmp_
cursor
,
(
keynr
==
primary_key
?
prim_key
:
create_key
(
&
key
,
keynr
,
key_buff2
,
record
)),
...
...
@@ -1015,9 +1015,9 @@ int ha_berkeley::remove_key(DB_TXN *sub_trans, uint keynr, const byte *record,
packed_record
:
prim_key
),
DB_GET_BOTH
)))
{
// This shouldn't happen
error
=
cursor
->
c_del
(
cursor
,
0
);
error
=
tmp_cursor
->
c_del
(
tmp_
cursor
,
0
);
}
int
result
=
cursor
->
c_close
(
cursor
);
int
result
=
tmp_cursor
->
c_close
(
tmp_
cursor
);
if
(
!
error
)
error
=
result
;
}
...
...
@@ -1661,7 +1661,6 @@ longlong ha_berkeley::get_auto_increment()
else
{
DBT
row
,
old_key
;
DBC
*
auto_cursor
;
bzero
((
char
*
)
&
row
,
sizeof
(
row
));
uint
key_len
;
KEY
*
key_info
=
&
table
->
key_info
[
active_index
];
...
...
@@ -1673,13 +1672,11 @@ longlong ha_berkeley::get_auto_increment()
/* Store for compare */
memcpy
(
old_key
.
data
=
key_buff2
,
key_buff
,
(
old_key
.
size
=
last_key
.
size
));
error
=
1
;
if
(
!
(
file
->
cursor
(
key_file
[
active_index
],
transaction
,
&
auto_cursor
,
0
)))
{
/* Modify the compare so that we will find the next key */
key_info
->
handler
.
bdb_return_if_eq
=
1
;
/* We lock the next key as the new key will probl. be on the same page */
error
=
auto_cursor
->
c_get
(
auto_cursor
,
&
last_key
,
&
row
,
DB_SET_RANGE
|
DB_RMW
);
error
=
cursor
->
c_get
(
cursor
,
&
last_key
,
&
row
,
DB_SET_RANGE
|
DB_RMW
);
key_info
->
handler
.
bdb_return_if_eq
=
0
;
if
(
!
error
||
error
==
DB_NOTFOUND
)
{
...
...
@@ -1688,15 +1685,14 @@ longlong ha_berkeley::get_auto_increment()
biggest key with the given prefix
*/
error
=
1
;
if
(
!
auto_cursor
->
c_get
(
auto_cursor
,
&
last_key
,
&
row
,
DB_PREV
|
DB_RMW
)
&&
!
berkeley_cmp_packed_key
(
key_file
[
active_index
],
&
old_key
,
&
last_key
))
if
(
!
cursor
->
c_get
(
cursor
,
&
last_key
,
&
row
,
DB_PREV
|
DB_RMW
)
&&
!
berkeley_cmp_packed_key
(
key_file
[
active_index
],
&
old_key
,
&
last_key
))
{
error
=
0
;
// Found value
unpack_key
(
table
->
record
[
1
],
&
last_key
,
active_index
);
}
}
auto_cursor
->
c_close
(
auto_cursor
);
}
}
if
(
!
error
)
...
...
@@ -1712,7 +1708,6 @@ longlong ha_berkeley::get_auto_increment()
Analyzing, checking, and optimizing tables
****************************************************************************/
static
void
print_msg
(
THD
*
thd
,
const
char
*
table_name
,
const
char
*
op_name
,
const
char
*
msg_type
,
const
char
*
fmt
,
...)
{
...
...
sql/opt_range.cc
View file @
b4974dac
...
...
@@ -379,7 +379,7 @@ SQL_SELECT::~SQL_SELECT()
close_cached_file
(
&
file
);
}
#undef index // Fix or Unixware 7
#undef index // Fix
f
or Unixware 7
QUICK_SELECT
::
QUICK_SELECT
(
TABLE
*
table
,
uint
key_nr
,
bool
no_alloc
)
:
error
(
0
),
index
(
key_nr
),
max_used_key_length
(
0
),
head
(
table
),
...
...
sql/sql_update.cc
View file @
b4974dac
...
...
@@ -20,6 +20,8 @@
#include "mysql_priv.h"
#include "sql_acl.h"
#define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1));
/* Return 0 if row hasn't changed */
static
bool
compare_record
(
TABLE
*
table
)
...
...
@@ -76,15 +78,11 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
table
->
timestamp_field
->
query_id
==
thd
->
query_id
)
table
->
time_stamp
=
0
;
/* Reset the query_id string so that ->used_keys is based on the WHERE */
/* Change query_id so that ->used_keys is based on the WHERE */
table
->
used_keys
=
table
->
keys_in_use
;
table
->
quick_keys
=
0
;
reg2
Item
*
item
;
List_iterator
<
Item
>
it
(
fields
);
ulong
query_id
=
thd
->
query_id
-
1
;
while
((
item
=
it
++
))
((
Item_field
*
)
item
)
->
field
->
query_id
=
query_id
;
ulong
query_id
=
thd
->
query_id
;
thd
->
query_id
^=
MAX_ULONG_BIT
;
if
(
setup_fields
(
thd
,
table_list
,
values
,
0
,
0
)
||
setup_conds
(
thd
,
table_list
,
&
conds
))
{
...
...
@@ -92,6 +90,13 @@ int mysql_update(THD *thd,TABLE_LIST *table_list,List<Item> &fields,
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
}
old_used_keys
=
table
->
used_keys
;
/* Restore query_id for compare_record */
thd
->
query_id
=
query_id
;
List_iterator
<
Item
>
it
(
fields
);
Item
*
item
;
while
((
item
=
it
++
))
((
Item_field
*
)
item
)
->
field
->
query_id
=
query_id
;
// Don't count on usage of 'only index' when calculating which key to use
table
->
used_keys
=
0
;
select
=
make_select
(
table
,
0
,
0
,
conds
,
&
error
);
...
...
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