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
b4f34fdd
Commit
b4f34fdd
authored
Dec 13, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.0
into deer.(none):/home/hf/work/mysql-4.0.1224
parents
0abfaa98
6d9aca50
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
26 deletions
+113
-26
client/mysql.cc
client/mysql.cc
+4
-4
innobase/btr/btr0cur.c
innobase/btr/btr0cur.c
+2
-1
innobase/include/row0upd.h
innobase/include/row0upd.h
+1
-1
innobase/include/sync0sync.ic
innobase/include/sync0sync.ic
+0
-2
innobase/row/row0umod.c
innobase/row/row0umod.c
+106
-18
No files found.
client/mysql.cc
View file @
b4f34fdd
...
...
@@ -358,7 +358,7 @@ int main(int argc,char *argv[])
put_info
(
"Welcome to the MySQL monitor. Commands end with ; or
\\
g."
,
INFO_INFO
);
sprintf
((
char
*
)
glob_buffer
.
ptr
(),
"Your MySQL connection id is %l
d
to server version: %s
\n
"
,
"Your MySQL connection id is %l
u
to server version: %s
\n
"
,
mysql_thread_id
(
&
mysql
),
mysql_get_server_info
(
&
mysql
));
put_info
((
char
*
)
glob_buffer
.
ptr
(),
INFO_INFO
);
...
...
@@ -1359,7 +1359,7 @@ com_help (String *buffer __attribute__((unused)),
}
if
(
connected
)
tee_fprintf
(
stdout
,
"
\n
Connection id: %l
d
(Can be used with mysqladmin kill)
\n\n
"
,
"
\n
Connection id: %l
u
(Can be used with mysqladmin kill)
\n\n
"
,
mysql_thread_id
(
&
mysql
));
else
tee_fprintf
(
stdout
,
"Not connected! Reconnect with 'connect'!
\n\n
"
);
...
...
@@ -2109,7 +2109,7 @@ com_connect(String *buffer, char *line)
if
(
connected
)
{
sprintf
(
buff
,
"Connection id: %l
d
"
,
mysql_thread_id
(
&
mysql
));
sprintf
(
buff
,
"Connection id: %l
u
"
,
mysql_thread_id
(
&
mysql
));
put_info
(
buff
,
INFO_INFO
);
sprintf
(
buff
,
"Current database: %s
\n
"
,
current_db
?
current_db
:
"*** NONE ***"
);
...
...
@@ -2323,7 +2323,7 @@ com_status(String *buffer __attribute__((unused)),
{
MYSQL_RES
*
result
;
LINT_INIT
(
result
);
tee_fprintf
(
stdout
,
"
\n
Connection id:
\t\t
%l
d
\n
"
,
mysql_thread_id
(
&
mysql
));
tee_fprintf
(
stdout
,
"
\n
Connection id:
\t\t
%l
u
\n
"
,
mysql_thread_id
(
&
mysql
));
if
(
!
mysql_query
(
&
mysql
,
"select DATABASE(),USER()"
)
&&
(
result
=
mysql_use_result
(
&
mysql
)))
{
...
...
innobase/btr/btr0cur.c
View file @
b4f34fdd
...
...
@@ -1175,7 +1175,8 @@ btr_cur_upd_lock_and_undo(
if
(
!
(
index
->
type
&
DICT_CLUSTERED
))
{
/* We do undo logging only when we update a clustered index
record */
return
(
lock_sec_rec_modify_check_and_lock
(
0
,
rec
,
index
,
thr
));
return
(
lock_sec_rec_modify_check_and_lock
(
flags
,
rec
,
index
,
thr
));
}
/* Check if we have to wait for a lock: enqueue an explicit lock
...
...
innobase/include/row0upd.h
View file @
b4f34fdd
...
...
@@ -292,7 +292,7 @@ row_upd_index_parse(
/* Update vector field */
struct
upd_field_struct
{
ulint
field_no
;
/* field number in an index, usually
the clustered index, but in up
a
dating
the clustered index, but in updating
a secondary index record in btr0cur.c
this is the position in the secondary
index */
...
...
innobase/include/sync0sync.ic
View file @
b4f34fdd
...
...
@@ -257,8 +257,6 @@ mutex_enter_func(
mutex->file_name = file_name;
mutex->line = line;
mutex->thread_id = os_thread_get_curr_id();
return; /* Succeeded! */
}
...
...
innobase/row/row0umod.c
View file @
b4f34fdd
...
...
@@ -377,8 +377,14 @@ row_undo_mod_del_mark_or_remove_sec_low(
}
/***************************************************************
Delete marks or removes a secondary index entry if found. */
UNIV_INLINE
Delete marks or removes a secondary index entry if found.
NOTE that if we updated the fields of a delete-marked secondary index record
so that alphabetically they stayed the same, e.g., 'abc' -> 'aBc', we cannot
return to the original values because we do not know them. But this should
not cause problems because in row0sel.c, in queries we always retrieve the
clustered index record or an earlier version of it, if the secondary index
record through which we do the search is delete-marked. */
static
ulint
row_undo_mod_del_mark_or_remove_sec
(
/*================================*/
...
...
@@ -403,20 +409,31 @@ row_undo_mod_del_mark_or_remove_sec(
}
/***************************************************************
Delete unmarks a secondary index entry which must be found. */
Delete unmarks a secondary index entry which must be found. It might not be
delete-marked at the moment, but it does not harm to unmark it anyway. We also
need to update the fields of the secondary index record if we updated its
fields but alphabetically they stayed the same, e.g., 'abc' -> 'aBc'. */
static
void
row_undo_mod_del_unmark_sec
(
/*========================*/
ulint
row_undo_mod_del_unmark_sec_and_undo_update
(
/*========================================*/
/* out: DB_FAIL or DB_SUCCESS or
DB_OUT_OF_FILE_SPACE */
ulint
mode
,
/* in: search mode: BTR_MODIFY_LEAF or
BTR_MODIFY_TREE */
undo_node_t
*
node
,
/* in: row undo node */
que_thr_t
*
thr
,
/* in: query thread */
dict_index_t
*
index
,
/* in: index */
dtuple_t
*
entry
)
/* in: index entry */
{
mem_heap_t
*
heap
;
btr_pcur_t
pcur
;
btr_cur_t
*
btr_cur
;
ulint
err
;
upd_t
*
update
;
rec_t
*
rec
;
ulint
err
=
DB_SUCCESS
;
ibool
found
;
big_rec_t
*
dummy_big_rec
;
mtr_t
mtr
;
char
err_buf
[
1000
];
...
...
@@ -425,8 +442,8 @@ row_undo_mod_del_unmark_sec(
log_free_check
();
mtr_start
(
&
mtr
);
found
=
row_search_index_entry
(
index
,
entry
,
BTR_MODIFY_LEAF
,
&
pcur
,
&
mtr
);
found
=
row_search_index_entry
(
index
,
entry
,
mode
,
&
pcur
,
&
mtr
);
if
(
!
found
)
{
fprintf
(
stderr
,
"InnoDB: error in sec index entry del undo in
\n
"
...
...
@@ -443,17 +460,47 @@ row_undo_mod_del_unmark_sec(
"%s
\n
InnoDB: Make a detailed bug report and send it
\n
"
,
err_buf
);
fprintf
(
stderr
,
"InnoDB: to mysql@lists.mysql.com
\n
"
);
}
else
{
btr_cur
=
btr_pcur_get_btr_cur
(
&
pcur
);
rec
=
btr_cur_get_rec
(
btr_cur
);
err
=
btr_cur_del_mark_set_sec_rec
(
BTR_NO_LOCKING_FLAG
,
btr_cur
,
FALSE
,
thr
,
&
mtr
);
ut_ad
(
err
==
DB_SUCCESS
);
ut_a
(
err
==
DB_SUCCESS
);
heap
=
mem_heap_create
(
100
);
update
=
row_upd_build_sec_rec_difference_binary
(
index
,
entry
,
rec
,
heap
);
if
(
upd_get_n_fields
(
update
)
==
0
)
{
/* Do nothing */
}
else
if
(
mode
==
BTR_MODIFY_LEAF
)
{
/* Try an optimistic updating of the record, keeping
changes within the page */
err
=
btr_cur_optimistic_update
(
BTR_KEEP_SYS_FLAG
|
BTR_NO_LOCKING_FLAG
,
btr_cur
,
update
,
0
,
thr
,
&
mtr
);
if
(
err
==
DB_OVERFLOW
||
err
==
DB_UNDERFLOW
)
{
err
=
DB_FAIL
;
}
}
else
{
ut_a
(
mode
==
BTR_MODIFY_TREE
);
err
=
btr_cur_pessimistic_update
(
BTR_KEEP_SYS_FLAG
|
BTR_NO_LOCKING_FLAG
,
btr_cur
,
&
dummy_big_rec
,
update
,
0
,
thr
,
&
mtr
);
}
mem_heap_free
(
heap
);
}
btr_pcur_close
(
&
pcur
);
mtr_commit
(
&
mtr
);
return
(
err
);
}
/***************************************************************
...
...
@@ -501,13 +548,14 @@ static
ulint
row_undo_mod_del_mark_sec
(
/*======================*/
/* out: DB_SUCCESS */
/* out: DB_SUCCESS
or DB_OUT_OF_FILE_SPACE
*/
undo_node_t
*
node
,
/* in: row undo node */
que_thr_t
*
thr
)
/* in: query thread */
{
mem_heap_t
*
heap
;
dtuple_t
*
entry
;
dict_index_t
*
index
;
ulint
err
;
heap
=
mem_heap_create
(
1024
);
...
...
@@ -516,7 +564,21 @@ row_undo_mod_del_mark_sec(
entry
=
row_build_index_entry
(
node
->
row
,
index
,
heap
);
row_undo_mod_del_unmark_sec
(
node
,
thr
,
index
,
entry
);
err
=
row_undo_mod_del_unmark_sec_and_undo_update
(
BTR_MODIFY_LEAF
,
node
,
thr
,
index
,
entry
);
if
(
err
==
DB_FAIL
)
{
err
=
row_undo_mod_del_unmark_sec_and_undo_update
(
BTR_MODIFY_TREE
,
node
,
thr
,
index
,
entry
);
}
if
(
err
!=
DB_SUCCESS
)
{
mem_heap_free
(
heap
);
return
(
err
);
}
node
->
index
=
dict_table_get_next_index
(
node
->
index
);
}
...
...
@@ -532,7 +594,7 @@ static
ulint
row_undo_mod_upd_exist_sec
(
/*=======================*/
/* out: DB_SUCCESS or
error code
*/
/* out: DB_SUCCESS or
DB_OUT_OF_FILE_SPACE
*/
undo_node_t
*
node
,
/* in: row undo node */
que_thr_t
*
thr
)
/* in: query thread */
{
...
...
@@ -558,6 +620,16 @@ row_undo_mod_upd_exist_sec(
/* Build the newest version of the index entry */
entry
=
row_build_index_entry
(
node
->
row
,
index
,
heap
);
/* NOTE that if we updated the fields of a
delete-marked secondary index record so that
alphabetically they stayed the same, e.g.,
'abc' -> 'aBc', we cannot return to the original
values because we do not know them. But this should
not cause problems because in row0sel.c, in queries
we always retrieve the clustered index record or an
earlier version of it, if the secondary index record
through which we do the search is delete-marked. */
err
=
row_undo_mod_del_mark_or_remove_sec
(
node
,
thr
,
index
,
entry
);
if
(
err
!=
DB_SUCCESS
)
{
...
...
@@ -568,12 +640,28 @@ row_undo_mod_upd_exist_sec(
/* We may have to update the delete mark in the
secondary index record of the previous version of
the row */
the row. We also need to update the fields of
the secondary index record if we updated its fields
but alphabetically they stayed the same, e.g.,
'abc' -> 'aBc'. */
row_upd_index_replace_new_col_vals
(
entry
,
index
,
node
->
update
,
NULL
);
err
=
row_undo_mod_del_unmark_sec_and_undo_update
(
BTR_MODIFY_LEAF
,
node
,
thr
,
index
,
entry
);
if
(
err
==
DB_FAIL
)
{
err
=
row_undo_mod_del_unmark_sec_and_undo_update
(
BTR_MODIFY_TREE
,
node
,
thr
,
index
,
entry
);
}
row_undo_mod_del_unmark_sec
(
node
,
thr
,
index
,
entry
);
if
(
err
!=
DB_SUCCESS
)
{
mem_heap_free
(
heap
);
return
(
err
);
}
}
node
->
index
=
dict_table_get_next_index
(
node
->
index
);
...
...
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