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
4b6b06fd
Commit
4b6b06fd
authored
Feb 09, 2006
by
mikron@mikael-ronstr-ms-dator.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL 2826: Error handling of ALTER TABLE for partitioning
A little more complete handling
parent
b290744c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_partition.cc
sql/sql_partition.cc
+20
-5
sql/sql_table.cc
sql/sql_table.cc
+10
-2
No files found.
sql/mysql_priv.h
View file @
4b6b06fd
...
...
@@ -1190,6 +1190,7 @@ typedef struct st_table_log_memory_entry
bool
write_table_log_entry
(
TABLE_LOG_ENTRY
*
table_log_entry
,
TABLE_LOG_MEMORY_ENTRY
**
active_entry
);
bool
write_execute_table_log_entry
(
uint
first_entry
,
bool
complete
,
TABLE_LOG_MEMORY_ENTRY
**
active_entry
);
void
release_table_log_memory_entry
(
TABLE_LOG_MEMORY_ENTRY
*
log_entry
);
void
release_table_log
();
...
...
sql/sql_partition.cc
View file @
4b6b06fd
...
...
@@ -5100,7 +5100,7 @@ release_part_info_log_entries(TABLE_LOG_MEMORY_ENTRY *log_entry)
while
(
log_entry
)
{
release_table_log_memory_entry
(
log_entry
);
log_entry
=
log_entry
->
next_log_entry
;
log_entry
=
log_entry
->
next_
active_
log_entry
;
}
DBUG_VOID_RETURN
;
}
...
...
@@ -5145,7 +5145,8 @@ write_log_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt, bool install_frm)
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
break
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
&
exec_log_entry
))
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
break
;
part_info
->
exec_log_entry
=
exec_log_entry
;
unlock_global_table_log
();
...
...
@@ -5286,7 +5287,8 @@ write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
if
(
write_table_log_entry
(
&
table_log_entry
,
&
log_entry
))
break
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
&
exec_log_entry
))
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
break
;
release_part_info_log_entries
(
old_first_log_entry
);
unlock_global_table_log
();
...
...
@@ -5345,7 +5347,8 @@ write_log_add_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
break
;
log_entry
=
part_info
->
first_log_entry
;
/* Ensure first entry is the last dropped partition */
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
&
exec_log_entry
))
if
(
write_execute_table_log_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
break
;
release_part_info_log_entries
(
old_first_log_entry
);
unlock_global_table_log
();
...
...
@@ -5426,9 +5429,21 @@ static
bool
write_log_completed
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
)
{
DBUG_ENTER
(
"write_log_ph2_change_partition"
);
partition_info
*
part_info
=
lpt
->
part_info
;
TABLE_LOG_MEMORY_ENTRY
*
log_entry
=
part_info
->
exec_log_entry
;
DBUG_ENTER
(
"write_log_completed"
);
lock_global_table_log
();
DBUG_ASSERT
(
part_info
->
exec_log_entry
);
if
(
write_execute_table_log_entry
(
0UL
,
TRUE
,
&
part_info
->
exec_log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
release_part_info_log_entries
(
part_info
->
first_log_entry
);
part_info
->
first_log_entry
=
NULL
;
part_info
->
exec_log_entry
->
next_active_log_entry
=
NULL
;
release_part_info_log_entries
(
part_info
->
exec_log_entry
);
part_info
->
exec_log_entry
=
NULL
;
unlock_global_table_log
();
DBUG_RETURN
(
FALSE
);
}
...
...
sql/sql_table.cc
View file @
4b6b06fd
...
...
@@ -367,6 +367,8 @@ write_table_log_header()
int4store
(
&
global_table_log
.
file_entry
[
8
],
const_var
);
if
(
write_table_log_file_entry
(
0UL
))
error
=
TRUE
;
if
(
!
error
)
error
=
sync_table_log
();
DBUG_RETURN
(
error
);
}
...
...
@@ -688,14 +690,20 @@ write_table_log_entry(TABLE_LOG_ENTRY *table_log_entry,
bool
write_execute_table_log_entry
(
uint
first_entry
,
bool
complete
,
TABLE_LOG_MEMORY_ENTRY
**
active_entry
)
{
bool
write_header
;
char
*
file_entry
=
(
char
*
)
global_table_log
.
file_entry
;
DBUG_ENTER
(
"write_execute_table_log_entry"
);
VOID
(
sync_table_log
());
file_entry
[
0
]
=
'e'
;
if
(
!
complete
)
{
VOID
(
sync_table_log
());
file_entry
[
0
]
=
'e'
;
}
else
file_entry
[
0
]
=
'i'
;
file_entry
[
1
]
=
0
;
/* Ignored for execute entries */
int4store
(
&
file_entry
[
2
],
first_entry
);
file_entry
[
6
]
=
0
;
...
...
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