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
daca4887
Commit
daca4887
authored
Nov 12, 2009
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Allow CREATE INDEX to be interrupted. (Issue #354)
rb://183
approved by Heikki Tuuri
parent
cba4f2af
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
5 deletions
+42
-5
ChangeLog
ChangeLog
+7
-0
handler/ha_innodb.cc
handler/ha_innodb.cc
+10
-3
include/db0err.h
include/db0err.h
+1
-0
row/row0merge.c
row/row0merge.c
+23
-2
row/row0mysql.c
row/row0mysql.c
+1
-0
No files found.
ChangeLog
View file @
daca4887
2009-11-12 The InnoDB Team
* handler/ha_innodb.cc, include/db0err.h,
row/row0merge.c, row/row0mysql.c:
Allow CREATE INDEX to be interrupted.
Also, when CHECK TABLE is interrupted, report ER_QUERY_INTERRUPTED.
2009-11-11 The InnoDB Team
2009-11-11 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb_bug47167.result,
* handler/ha_innodb.cc, mysql-test/innodb_bug47167.result,
...
...
handler/ha_innodb.cc
View file @
daca4887
...
@@ -785,6 +785,9 @@ convert_error_code_to_mysql(
...
@@ -785,6 +785,9 @@ convert_error_code_to_mysql(
case
DB_SUCCESS
:
case
DB_SUCCESS
:
return
(
0
);
return
(
0
);
case
DB_INTERRUPTED
:
my_error
(
ER_QUERY_INTERRUPTED
,
MYF
(
0
));
/* fall through */
case
DB_ERROR
:
case
DB_ERROR
:
default:
default:
return
(
-
1
);
/* unspecified error */
return
(
-
1
);
/* unspecified error */
...
@@ -7361,11 +7364,15 @@ ha_innobase::check(
...
@@ -7361,11 +7364,15 @@ ha_innobase::check(
ret
=
row_check_table_for_mysql
(
prebuilt
);
ret
=
row_check_table_for_mysql
(
prebuilt
);
if
(
ret
==
DB_SUCCESS
)
{
switch
(
ret
)
{
case
DB_SUCCESS
:
return
(
HA_ADMIN_OK
);
return
(
HA_ADMIN_OK
);
}
case
DB_INTERRUPTED
:
my_error
(
ER_QUERY_INTERRUPTED
,
MYF
(
0
));
return
(
-
1
);
default:
return
(
HA_ADMIN_CORRUPT
);
return
(
HA_ADMIN_CORRUPT
);
}
}
}
/*************************************************************//**
/*************************************************************//**
...
...
include/db0err.h
View file @
daca4887
...
@@ -32,6 +32,7 @@ enum db_err {
...
@@ -32,6 +32,7 @@ enum db_err {
/* The following are error codes */
/* The following are error codes */
DB_ERROR
,
DB_ERROR
,
DB_INTERRUPTED
,
DB_OUT_OF_MEMORY
,
DB_OUT_OF_MEMORY
,
DB_OUT_OF_FILE_SPACE
,
DB_OUT_OF_FILE_SPACE
,
DB_LOCK_WAIT
,
DB_LOCK_WAIT
,
...
...
row/row0merge.c
View file @
daca4887
...
@@ -1200,6 +1200,12 @@ row_merge_read_clustered_index(
...
@@ -1200,6 +1200,12 @@ row_merge_read_clustered_index(
in order to release the latch on the old page. */
in order to release the latch on the old page. */
if
(
btr_pcur_is_after_last_on_page
(
&
pcur
))
{
if
(
btr_pcur_is_after_last_on_page
(
&
pcur
))
{
if
(
UNIV_UNLIKELY
(
trx_is_interrupted
(
trx
)))
{
i
=
0
;
err
=
DB_INTERRUPTED
;
goto
err_exit
;
}
btr_pcur_store_position
(
&
pcur
,
&
mtr
);
btr_pcur_store_position
(
&
pcur
,
&
mtr
);
mtr_commit
(
&
mtr
);
mtr_commit
(
&
mtr
);
mtr_start
(
&
mtr
);
mtr_start
(
&
mtr
);
...
@@ -1557,6 +1563,7 @@ static __attribute__((nonnull))
...
@@ -1557,6 +1563,7 @@ static __attribute__((nonnull))
ulint
ulint
row_merge
(
row_merge
(
/*======*/
/*======*/
trx_t
*
trx
,
/*!< in: transaction */
const
dict_index_t
*
index
,
/*!< in: index being created */
const
dict_index_t
*
index
,
/*!< in: index being created */
merge_file_t
*
file
,
/*!< in/out: file containing
merge_file_t
*
file
,
/*!< in/out: file containing
index entries */
index entries */
...
@@ -1590,6 +1597,10 @@ row_merge(
...
@@ -1590,6 +1597,10 @@ row_merge(
for
(;
foffs0
<
ihalf
&&
foffs1
<
file
->
offset
;
foffs0
++
,
foffs1
++
)
{
for
(;
foffs0
<
ihalf
&&
foffs1
<
file
->
offset
;
foffs0
++
,
foffs1
++
)
{
ulint
ahalf
;
/*!< arithmetic half the input file */
ulint
ahalf
;
/*!< arithmetic half the input file */
if
(
UNIV_UNLIKELY
(
trx_is_interrupted
(
trx
)))
{
return
(
DB_INTERRUPTED
);
}
error
=
row_merge_blocks
(
index
,
file
,
block
,
error
=
row_merge_blocks
(
index
,
file
,
block
,
&
foffs0
,
&
foffs1
,
&
of
,
table
);
&
foffs0
,
&
foffs1
,
&
of
,
table
);
...
@@ -1617,6 +1628,10 @@ row_merge(
...
@@ -1617,6 +1628,10 @@ row_merge(
/* Copy the last blocks, if there are any. */
/* Copy the last blocks, if there are any. */
while
(
foffs0
<
ihalf
)
{
while
(
foffs0
<
ihalf
)
{
if
(
UNIV_UNLIKELY
(
trx_is_interrupted
(
trx
)))
{
return
(
DB_INTERRUPTED
);
}
if
(
!
row_merge_blocks_copy
(
index
,
file
,
block
,
&
foffs0
,
&
of
))
{
if
(
!
row_merge_blocks_copy
(
index
,
file
,
block
,
&
foffs0
,
&
of
))
{
return
(
DB_CORRUPTION
);
return
(
DB_CORRUPTION
);
}
}
...
@@ -1625,6 +1640,10 @@ row_merge(
...
@@ -1625,6 +1640,10 @@ row_merge(
ut_ad
(
foffs0
==
ihalf
);
ut_ad
(
foffs0
==
ihalf
);
while
(
foffs1
<
file
->
offset
)
{
while
(
foffs1
<
file
->
offset
)
{
if
(
UNIV_UNLIKELY
(
trx_is_interrupted
(
trx
)))
{
return
(
DB_INTERRUPTED
);
}
if
(
!
row_merge_blocks_copy
(
index
,
file
,
block
,
&
foffs1
,
&
of
))
{
if
(
!
row_merge_blocks_copy
(
index
,
file
,
block
,
&
foffs1
,
&
of
))
{
return
(
DB_CORRUPTION
);
return
(
DB_CORRUPTION
);
}
}
...
@@ -1653,6 +1672,7 @@ static
...
@@ -1653,6 +1672,7 @@ static
ulint
ulint
row_merge_sort
(
row_merge_sort
(
/*===========*/
/*===========*/
trx_t
*
trx
,
/*!< in: transaction */
const
dict_index_t
*
index
,
/*!< in: index being created */
const
dict_index_t
*
index
,
/*!< in: index being created */
merge_file_t
*
file
,
/*!< in/out: file containing
merge_file_t
*
file
,
/*!< in/out: file containing
index entries */
index entries */
...
@@ -1671,7 +1691,8 @@ row_merge_sort(
...
@@ -1671,7 +1691,8 @@ row_merge_sort(
do
{
do
{
ulint
error
;
ulint
error
;
error
=
row_merge
(
index
,
file
,
&
half
,
block
,
tmpfd
,
table
);
error
=
row_merge
(
trx
,
index
,
file
,
&
half
,
block
,
tmpfd
,
table
);
if
(
error
!=
DB_SUCCESS
)
{
if
(
error
!=
DB_SUCCESS
)
{
return
(
error
);
return
(
error
);
...
@@ -2490,7 +2511,7 @@ row_merge_build_indexes(
...
@@ -2490,7 +2511,7 @@ row_merge_build_indexes(
sorting and inserting. */
sorting and inserting. */
for
(
i
=
0
;
i
<
n_indexes
;
i
++
)
{
for
(
i
=
0
;
i
<
n_indexes
;
i
++
)
{
error
=
row_merge_sort
(
indexes
[
i
],
&
merge_files
[
i
],
error
=
row_merge_sort
(
trx
,
indexes
[
i
],
&
merge_files
[
i
],
block
,
&
tmpfd
,
table
);
block
,
&
tmpfd
,
table
);
if
(
error
==
DB_SUCCESS
)
{
if
(
error
==
DB_SUCCESS
)
{
...
...
row/row0mysql.c
View file @
daca4887
...
@@ -4157,6 +4157,7 @@ row_check_table_for_mysql(
...
@@ -4157,6 +4157,7 @@ row_check_table_for_mysql(
}
}
if
(
trx_is_interrupted
(
prebuilt
->
trx
))
{
if
(
trx_is_interrupted
(
prebuilt
->
trx
))
{
ret
=
DB_INTERRUPTED
;
break
;
break
;
}
}
...
...
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