Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
mariadb
Commits
99ed0123
Commit
99ed0123
authored
14 years ago
by
Vasil Dimov
Browse files
Options
Download
Plain Diff
Merge mysql-5.5-innodb -> mysql-5.5
parents
1d75aeb9
f76a32c2
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
310 additions
and
149 deletions
+310
-149
client/mysqltest.cc
client/mysqltest.cc
+7
-5
mysql-test/suite/innodb/r/innodb_bug59410.result
mysql-test/suite/innodb/r/innodb_bug59410.result
+17
-0
mysql-test/suite/innodb/r/innodb_bug59641.result
mysql-test/suite/innodb/r/innodb_bug59641.result
+57
-0
mysql-test/suite/innodb/t/innodb_bug59410.test
mysql-test/suite/innodb/t/innodb_bug59410.test
+24
-0
mysql-test/suite/innodb/t/innodb_bug59641.test
mysql-test/suite/innodb/t/innodb_bug59641.test
+66
-0
sql/sql_class.cc
sql/sql_class.cc
+1
-0
storage/innobase/btr/btr0cur.c
storage/innobase/btr/btr0cur.c
+2
-2
storage/innobase/buf/buf0flu.c
storage/innobase/buf/buf0flu.c
+1
-1
storage/innobase/fil/fil0fil.c
storage/innobase/fil/fil0fil.c
+5
-1
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+44
-44
storage/innobase/handler/ha_innodb.h
storage/innobase/handler/ha_innodb.h
+5
-6
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+20
-23
storage/innobase/ibuf/ibuf0ibuf.c
storage/innobase/ibuf/ibuf0ibuf.c
+1
-12
storage/innobase/include/log0log.ic
storage/innobase/include/log0log.ic
+1
-1
storage/innobase/include/os0sync.h
storage/innobase/include/os0sync.h
+1
-4
storage/innobase/include/os0thread.h
storage/innobase/include/os0thread.h
+2
-31
storage/innobase/include/sync0sync.h
storage/innobase/include/sync0sync.h
+22
-13
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+11
-5
storage/innobase/include/trx0undo.h
storage/innobase/include/trx0undo.h
+9
-0
storage/innobase/include/univ.i
storage/innobase/include/univ.i
+14
-1
No files found.
client/mysqltest.cc
View file @
99ed0123
...
...
@@ -4598,13 +4598,14 @@ static int my_kill(int pid, int sig)
command called command
DESCRIPTION
shutdown [<timeout>]
shutdown
_server
[<timeout>]
*/
void do_shutdown_server(struct st_command *command)
{
int timeout=60, pid;
long timeout=60;
int pid;
DYNAMIC_STRING ds_pidfile_name;
MYSQL* mysql = &cur_con->mysql;
static DYNAMIC_STRING ds_timeout;
...
...
@@ -4619,8 +4620,9 @@ void do_shutdown_server(struct st_command *command)
if (ds_timeout.length)
{
timeout= atoi(ds_timeout.str);
if (timeout == 0)
char* endptr;
timeout= strtol(ds_timeout.str, &endptr, 10);
if (*endptr != '\0')
die("Illegal argument for timeout: '%s'", ds_timeout.str);
}
dynstr_free(&ds_timeout);
...
...
@@ -4662,7 +4664,7 @@ void do_shutdown_server(struct st_command *command)
DBUG_PRINT("info", ("Process %d does not exist anymore", pid));
DBUG_VOID_RETURN;
}
DBUG_PRINT("info", ("Sleeping, timeout: %d", timeout));
DBUG_PRINT("info", ("Sleeping, timeout: %
l
d", timeout));
my_sleep(1000000L);
}
...
...
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb/r/innodb_bug59410.result
0 → 100644
View file @
99ed0123
create table `bug59410_1`(`a` int)engine=innodb;
insert into `bug59410_1` values (1),(2),(3);
select 1 from `bug59410_1` where `a` <> any (
select 1 from `bug59410_1` where `a` <> 1 for update)
for update;
1
1
1
drop table bug59410_1;
create table bug59410_2(`a` char(1),`b` int)engine=innodb;
insert into bug59410_2 values('0',0);
set transaction isolation level read uncommitted;
start transaction;
set @a=(select b from bug59410_2 where
(select 1 from bug59410_2 where a group by @a=b)
group by @a:=b);
drop table bug59410_2;
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb/r/innodb_bug59641.result
0 → 100644
View file @
99ed0123
CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
COMMIT;
XA START '123';
INSERT INTO t VALUES(1,1);
XA END '123';
XA PREPARE '123';
XA START '456';
INSERT INTO t VALUES(3,47),(5,67);
UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
XA END '456';
XA PREPARE '456';
XA START '789';
UPDATE t SET b=4*a WHERE a=32;
XA END '789';
XA PREPARE '789';
call mtr.add_suppression("Found 3 prepared XA transactions");
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a b
1 1
2 2
3 47
4 4
5 134
8 16
16 16
32 128
COMMIT;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a b
1 1
2 2
3 47
4 4
5 134
8 16
16 16
32 128
COMMIT;
XA RECOVER;
formatID gtrid_length bqual_length data
1 3 0 789
1 3 0 456
1 3 0 123
XA ROLLBACK '123';
XA ROLLBACK '456';
XA COMMIT '789';
SELECT * FROM t;
a b
2 2
4 4
8 8
16 16
32 128
DROP TABLE t;
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb/t/innodb_bug59410.test
0 → 100644
View file @
99ed0123
#
# Bug#59410 read uncommitted: unlock row could not find a 3 mode lock on the record
#
--
source
include
/
have_innodb
.
inc
# only interested that the following do not produce something like
# InnoDB: Error: unlock row could not find a 2 mode lock on the record
# in the error log
create
table
`bug59410_1`
(
`a`
int
)
engine
=
innodb
;
insert
into
`bug59410_1`
values
(
1
),(
2
),(
3
);
select
1
from
`bug59410_1`
where
`a`
<>
any
(
select
1
from
`bug59410_1`
where
`a`
<>
1
for
update
)
for
update
;
drop
table
bug59410_1
;
create
table
bug59410_2
(
`a`
char
(
1
),
`b`
int
)
engine
=
innodb
;
insert
into
bug59410_2
values
(
'0'
,
0
);
set
transaction
isolation
level
read
uncommitted
;
start
transaction
;
set
@
a
=
(
select
b
from
bug59410_2
where
(
select
1
from
bug59410_2
where
a
group
by
@
a
=
b
)
group
by
@
a
:=
b
);
drop
table
bug59410_2
;
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb/t/innodb_bug59641.test
0 → 100644
View file @
99ed0123
# Bug #59641 Prepared XA transaction causes shutdown hang after a crash
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_innodb
.
inc
CREATE
TABLE
t
(
a
INT
PRIMARY
KEY
,
b
INT
)
ENGINE
=
InnoDB
;
INSERT
INTO
t
VALUES
(
2
,
2
),(
4
,
4
),(
8
,
8
),(
16
,
16
),(
32
,
32
);
COMMIT
;
XA
START
'123'
;
INSERT
INTO
t
VALUES
(
1
,
1
);
XA
END
'123'
;
XA
PREPARE
'123'
;
CONNECT
(
con1
,
localhost
,
root
,,);
CONNECTION
con1
;
XA
START
'456'
;
INSERT
INTO
t
VALUES
(
3
,
47
),(
5
,
67
);
UPDATE
t
SET
b
=
2
*
b
WHERE
a
BETWEEN
5
AND
8
;
XA
END
'456'
;
XA
PREPARE
'456'
;
CONNECT
(
con2
,
localhost
,
root
,,);
CONNECTION
con2
;
XA
START
'789'
;
UPDATE
t
SET
b
=
4
*
a
WHERE
a
=
32
;
XA
END
'789'
;
XA
PREPARE
'789'
;
# The server would issue this warning on restart.
call
mtr
.
add_suppression
(
"Found 3 prepared XA transactions"
);
# Kill the server without sending a shutdown command
--
exec
echo
"wait"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.1.
expect
--
shutdown_server
0
--
source
include
/
wait_until_disconnected
.
inc
# Restart the server.
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.1.
expect
--
enable_reconnect
--
source
include
/
wait_until_connected_again
.
inc
SET
TRANSACTION
ISOLATION
LEVEL
READ
UNCOMMITTED
;
SELECT
*
FROM
t
;
COMMIT
;
# Shut down the server. This would hang because of the bug.
--
exec
echo
"wait"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.1.
expect
--
shutdown_server
--
source
include
/
wait_until_disconnected
.
inc
# Restart the server.
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.1.
expect
--
enable_reconnect
--
source
include
/
wait_until_connected_again
.
inc
SET
TRANSACTION
ISOLATION
LEVEL
READ
UNCOMMITTED
;
SELECT
*
FROM
t
;
COMMIT
;
XA
RECOVER
;
XA
ROLLBACK
'123'
;
XA
ROLLBACK
'456'
;
XA
COMMIT
'789'
;
SELECT
*
FROM
t
;
DROP
TABLE
t
;
This diff is collapsed.
Click to expand it.
sql/sql_class.cc
View file @
99ed0123
...
...
@@ -3670,6 +3670,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state)
xs
->
xa_state
=
xa_state
;
xs
->
xid
.
set
(
xid
);
xs
->
in_thd
=
0
;
xs
->
rm_error
=
0
;
res
=
my_hash_insert
(
&
xid_cache
,
(
uchar
*
)
xs
);
}
mysql_mutex_unlock
(
&
LOCK_xid_cache
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/btr/btr0cur.c
View file @
99ed0123
...
...
@@ -2429,8 +2429,8 @@ make_external:
record on its page? */
was_first
=
page_cur_is_before_first
(
page_cursor
);
/*
The first parameter means that no l
ock check
ing
and undo logging
is made in the insert
*/
/*
L
ock check
s
and undo logging
were already performed by
btr_cur_upd_lock_and_undo().
*/
err
=
btr_cur_pessimistic_insert
(
BTR_NO_UNDO_LOG_FLAG
|
BTR_NO_LOCKING_FLAG
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/buf/buf0flu.c
View file @
99ed0123
...
...
@@ -1716,7 +1716,7 @@ buf_flush_batch(
ut_ad
(
flush_type
==
BUF_FLUSH_LRU
||
flush_type
==
BUF_FLUSH_LIST
);
#ifdef UNIV_SYNC_DEBUG
ut_ad
((
flush_type
!=
BUF_FLUSH_LIST
)
||
sync_thread_levels_empty_
gen
(
TRUE
));
||
sync_thread_levels_empty_
except_dict
(
));
#endif
/* UNIV_SYNC_DEBUG */
buf_pool_mutex_enter
(
buf_pool
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/fil/fil0fil.c
View file @
99ed0123
...
...
@@ -4527,8 +4527,8 @@ fil_aio_wait(
ret
=
os_aio_linux_handle
(
segment
,
&
fil_node
,
&
message
,
&
type
);
#else
ret
=
0
;
/* Eliminate compiler warning */
ut_error
;
ret
=
0
;
/* Eliminate compiler warning */
#endif
}
else
{
srv_set_io_thread_op_info
(
segment
,
"simulated aio handle"
);
...
...
@@ -4538,6 +4538,10 @@ fil_aio_wait(
}
ut_a
(
ret
);
if
(
UNIV_UNLIKELY
(
fil_node
==
NULL
))
{
ut_ad
(
srv_shutdown_state
==
SRV_SHUTDOWN_EXIT_THREADS
);
return
;
}
srv_set_io_thread_op_info
(
segment
,
"complete io for fil node"
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/handler/ha_innodb.cc
View file @
99ed0123
...
...
@@ -6242,10 +6242,6 @@ create_table_def(
DBUG_PRINT
(
"enter"
,
(
"table_name: %s"
,
table_name
));
ut_a
(
trx
->
mysql_thd
!=
NULL
);
if
(
IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS
(
table_name
,
(
THD
*
)
trx
->
mysql_thd
))
{
DBUG_RETURN
(
HA_ERR_GENERIC
);
}
/* MySQL does the name length check. But we do additional check
on the name length here */
...
...
@@ -6366,6 +6362,8 @@ err_col:
col_len
);
}
srv_lower_case_table_names
=
lower_case_table_names
;
error
=
row_create_table_for_mysql
(
table
,
trx
);
if
(
error
==
DB_DUPLICATE_KEY
)
{
...
...
@@ -6782,38 +6780,17 @@ ha_innobase::create(
DBUG_RETURN
(
HA_ERR_TO_BIG_ROW
);
}
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
thd
);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
trx_search_latch_release_if_reserved
(
parent_trx
);
trx
=
innobase_trx_allocate
(
thd
);
srv_lower_case_table_names
=
lower_case_table_names
;
strcpy
(
name2
,
name
);
normalize_table_name
(
norm_name
,
name2
);
/* Latch the InnoDB data dictionary exclusively so that no deadlocks
or lock waits can happen in it during a table create operation.
Drop table etc. do this latching in row0mysql.c. */
row_mysql_lock_data_dictionary
(
trx
);
/* Create the table definition in InnoDB */
flags
=
0
;
/* Validate create options if innodb_strict_mode is set. */
if
(
!
create_options_are_valid
(
thd
,
form
,
create_info
))
{
error
=
ER_ILLEGAL_HA_CREATE_OPTION
;
goto
cleanup
;
DBUG_RETURN
(
ER_ILLEGAL_HA_CREATE_OPTION
);
}
if
(
create_info
->
key_block_size
)
{
...
...
@@ -6955,16 +6932,37 @@ ha_innobase::create(
/* Check for name conflicts (with reserved name) for
any user indices to be created. */
if
(
innobase_index_name_is_reserved
(
t
rx
,
form
->
key_info
,
if
(
innobase_index_name_is_reserved
(
t
hd
,
form
->
key_info
,
form
->
s
->
keys
))
{
error
=
-
1
;
goto
cleanup
;
DBUG_RETURN
(
-
1
);
}
if
(
IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS
(
norm_name
,
thd
))
{
DBUG_RETURN
(
HA_ERR_GENERIC
);
}
if
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
{
flags
|=
DICT_TF2_TEMPORARY
<<
DICT_TF2_SHIFT
;
}
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
thd
);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
trx_search_latch_release_if_reserved
(
parent_trx
);
trx
=
innobase_trx_allocate
(
thd
);
/* Latch the InnoDB data dictionary exclusively so that no deadlocks
or lock waits can happen in it during a table create operation.
Drop table etc. do this latching in row0mysql.c. */
row_mysql_lock_data_dictionary
(
trx
);
error
=
create_table_def
(
trx
,
form
,
norm_name
,
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
?
name2
:
NULL
,
flags
);
...
...
@@ -7219,14 +7217,14 @@ ha_innobase::delete_table(
trx
=
innobase_trx_allocate
(
thd
);
srv_lower_case_table_names
=
lower_case_table_names
;
name_len
=
strlen
(
name
);
ut_a
(
name_len
<
1000
);
/* Drop the table in InnoDB */
srv_lower_case_table_names
=
lower_case_table_names
;
error
=
row_drop_table_for_mysql
(
norm_name
,
trx
,
thd_sql_command
(
thd
)
==
SQLCOM_DROP_DB
);
...
...
@@ -7342,8 +7340,6 @@ innobase_rename_table(
char
*
norm_to
;
char
*
norm_from
;
srv_lower_case_table_names
=
lower_case_table_names
;
// Magic number 64 arbitrary
norm_to
=
(
char
*
)
my_malloc
(
strlen
(
to
)
+
64
,
MYF
(
0
));
norm_from
=
(
char
*
)
my_malloc
(
strlen
(
from
)
+
64
,
MYF
(
0
));
...
...
@@ -7358,6 +7354,8 @@ innobase_rename_table(
row_mysql_lock_data_dictionary
(
trx
);
}
srv_lower_case_table_names
=
lower_case_table_names
;
error
=
row_rename_table_for_mysql
(
norm_from
,
norm_to
,
trx
,
lock_and_commit
);
...
...
@@ -10263,7 +10261,7 @@ innobase_commit_by_xid(
if
(
trx
)
{
innobase_commit_low
(
trx
);
trx_free_for_background
(
trx
);
return
(
XA_OK
);
}
else
{
return
(
XAER_NOTA
);
...
...
@@ -10289,7 +10287,9 @@ innobase_rollback_by_xid(
trx
=
trx_get_trx_by_xid
(
xid
);
if
(
trx
)
{
return
(
innobase_rollback_trx
(
trx
));
int
ret
=
innobase_rollback_trx
(
trx
);
trx_free_for_background
(
trx
);
return
(
ret
);
}
else
{
return
(
XAER_NOTA
);
}
...
...
@@ -10922,19 +10922,19 @@ static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
return
0
;
}
/***********************************************************************
/*********************************************************************
//
**
This function checks each index name for a table against reserved
system default primary index name 'GEN_CLUST_INDEX'. If a name matches,
this function pushes an warning message to the client, and returns true. */
system default primary index name 'GEN_CLUST_INDEX'. If a name
matches, this function pushes an warning message to the client,
and returns true.
@return true if the index name matches the reserved name */
extern
"C"
UNIV_INTERN
bool
innobase_index_name_is_reserved
(
/*============================*/
/* out: true if an index name
matches the reserved name */
const
trx_t
*
trx
,
/* in: InnoDB transaction handle */
const
KEY
*
key_info
,
/* in: Indexes to be created */
ulint
num_of_keys
)
/* in: Number of indexes to
THD
*
thd
,
/*!< in/out: MySQL connection */
const
KEY
*
key_info
,
/*!< in: Indexes to be created */
ulint
num_of_keys
)
/*!< in: Number of indexes to
be created. */
{
const
KEY
*
key
;
...
...
@@ -10946,7 +10946,7 @@ innobase_index_name_is_reserved(
if
(
innobase_strcasecmp
(
key
->
name
,
innobase_index_reserve_name
)
==
0
)
{
/* Push warning to mysql */
push_warning_printf
(
(
THD
*
)
trx
->
mysql_
thd
,
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WRONG_NAME_FOR_INDEX
,
"Cannot Create Index with name "
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/handler/ha_innodb.h
View file @
99ed0123
...
...
@@ -321,15 +321,14 @@ innobase_trx_allocate(
This function checks each index name for a table against reserved
system default primary index name 'GEN_CLUST_INDEX'. If a name
matches, this function pushes an warning message to the client,
and returns true. */
and returns true.
@return true if the index name matches the reserved name */
extern
"C"
bool
innobase_index_name_is_reserved
(
/*============================*/
/* out: true if the index name
matches the reserved name */
const
trx_t
*
trx
,
/* in: InnoDB transaction handle */
const
KEY
*
key_info
,
/* in: Indexes to be created */
ulint
num_of_keys
);
/* in: Number of indexes to
THD
*
thd
,
/*!< in/out: MySQL connection */
const
KEY
*
key_info
,
/*!< in: Indexes to be created */
ulint
num_of_keys
);
/*!< in: Number of indexes to
be created. */
This diff is collapsed.
Click to expand it.
storage/innobase/handler/handler0alter.cc
View file @
99ed0123
...
...
@@ -653,44 +653,37 @@ ha_innobase::add_index(
update_thd
();
heap
=
mem_heap_create
(
1024
);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads. */
trx_search_latch_release_if_reserved
(
prebuilt
->
trx
);
trx_start_if_not_started
(
prebuilt
->
trx
);
/* C
reate a background transaction for the operations on
the data dictionary tables. */
trx
=
innobase_trx_allocate
(
user_thd
);
trx_start_if_not_started
(
trx
);
/* C
heck if the index name is reserved. */
if
(
innobase_index_name_is_reserved
(
user_thd
,
key_info
,
num_of_keys
))
{
DBUG_RETURN
(
-
1
);
}
innodb_table
=
indexed_table
=
dict_table_get
(
prebuilt
->
table
->
name
,
FALSE
);
if
(
UNIV_UNLIKELY
(
!
innodb_table
))
{
error
=
HA_ERR_NO_SUCH_TABLE
;
goto
err_exit
;
DBUG_RETURN
(
HA_ERR_NO_SUCH_TABLE
);
}
/* Check if the index name is reserved. */
if
(
innobase_index_name_is_reserved
(
trx
,
key_info
,
num_of_keys
))
{
error
=
-
1
;
}
else
{
/* Check that index keys are sensible */
error
=
innobase_check_index_keys
(
key_info
,
num_of_keys
,
innodb_table
);
}
/* Check that index keys are sensible */
error
=
innobase_check_index_keys
(
key_info
,
num_of_keys
,
innodb_table
);
if
(
UNIV_UNLIKELY
(
error
))
{
err_exit:
mem_heap_free
(
heap
);
trx_general_rollback_for_mysql
(
trx
,
NULL
);
trx_free_for_mysql
(
trx
);
trx_commit_for_mysql
(
prebuilt
->
trx
);
DBUG_RETURN
(
error
);
}
heap
=
mem_heap_create
(
1024
);
trx_start_if_not_started
(
prebuilt
->
trx
);
/* Create a background transaction for the operations on
the data dictionary tables. */
trx
=
innobase_trx_allocate
(
user_thd
);
trx_start_if_not_started
(
trx
);
/* Create table containing all indexes to be built in this
alter table add index so that they are in the correct order
in the table. */
...
...
@@ -762,8 +755,12 @@ err_exit:
ut_d
(
dict_table_check_for_dup_indexes
(
innodb_table
,
FALSE
));
mem_heap_free
(
heap
);
trx_general_rollback_for_mysql
(
trx
,
NULL
);
row_mysql_unlock_data_dictionary
(
trx
);
goto
err_exit
;
trx_free_for_mysql
(
trx
);
trx_commit_for_mysql
(
prebuilt
->
trx
);
DBUG_RETURN
(
error
);
}
trx
->
table_id
=
indexed_table
->
id
;
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/ibuf/ibuf0ibuf.c
View file @
99ed0123
...
...
@@ -1179,18 +1179,7 @@ ibuf_page_low(
ibuf_bitmap_page_no_calc
(
zip_size
,
page_no
),
RW_NO_LATCH
,
NULL
,
BUF_GET_NO_LATCH
,
file
,
line
,
&
local_mtr
));
# ifdef UNIV_SYNC_DEBUG
/* This is for tracking Bug #58212. This check and message can
be removed once it has been established that our assumptions
about this condition are correct. The bug was only a one-time
occurrence, unable to repeat since then. */
void
*
latch
=
sync_thread_levels_contains
(
SYNC_IBUF_BITMAP
);
if
(
latch
)
{
fprintf
(
stderr
,
"Bug#58212 UNIV_SYNC_DEBUG"
" levels %p (%u,%u)
\n
"
,
latch
,
(
unsigned
)
space
,
(
unsigned
)
page_no
);
}
# endif
/* UNIV_SYNC_DEBUG */
ret
=
ibuf_bitmap_page_get_bits_low
(
bitmap_page
,
page_no
,
zip_size
,
MTR_MEMO_BUF_FIX
,
&
local_mtr
,
IBUF_BITMAP_IBUF
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/log0log.ic
View file @
99ed0123
...
...
@@ -435,7 +435,7 @@ log_free_check(void)
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(sync_thread_levels_empty_
gen(TRUE
));
ut_ad(sync_thread_levels_empty_
except_dict(
));
#endif /* UNIV_SYNC_DEBUG */
if (log_sys->check_flush_or_checkpoint) {
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/os0sync.h
View file @
99ed0123
...
...
@@ -150,10 +150,7 @@ os_event_free(
os_event_t
event
);
/*!< in: event to free */
/**********************************************************//**
Waits for an event object until it is in the signaled state. If
srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
waiting thread when the event becomes signaled (or immediately if the
event is already in the signaled state).
Waits for an event object until it is in the signaled state.
Typically, if the event has been signalled after the os_event_reset()
we'll return immediately because event->is_set == TRUE.
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/os0thread.h
View file @
99ed0123
...
...
@@ -107,8 +107,9 @@ UNIV_INTERN
void
os_thread_exit
(
/*===========*/
void
*
exit_value
)
;
/*!< in: exit value; in Windows this void*
void
*
exit_value
)
/*!< in: exit value; in Windows this void*
is cast as a DWORD */
UNIV_COLD
__attribute__
((
noreturn
));
/*****************************************************************//**
Returns the thread identifier of current thread.
@return current thread identifier */
...
...
@@ -117,13 +118,6 @@ os_thread_id_t
os_thread_get_curr_id
(
void
);
/*========================*/
/*****************************************************************//**
Returns handle to the current thread.
@return current thread handle */
UNIV_INTERN
os_thread_t
os_thread_get_curr
(
void
);
/*====================*/
/*****************************************************************//**
Advises the os to give up remainder of the thread's time slice. */
UNIV_INTERN
void
...
...
@@ -136,29 +130,6 @@ void
os_thread_sleep
(
/*============*/
ulint
tm
);
/*!< in: time in microseconds */
/******************************************************************//**
Gets a thread priority.
@return priority */
UNIV_INTERN
ulint
os_thread_get_priority
(
/*===================*/
os_thread_t
handle
);
/*!< in: OS handle to the thread */
/******************************************************************//**
Sets a thread priority. */
UNIV_INTERN
void
os_thread_set_priority
(
/*===================*/
os_thread_t
handle
,
/*!< in: OS handle to the thread */
ulint
pri
);
/*!< in: priority: one of OS_PRIORITY_... */
/******************************************************************//**
Gets the last operating system error code for the calling thread.
@return last error on Windows, 0 otherwise */
UNIV_INTERN
ulint
os_thread_get_last_error
(
void
);
/*==========================*/
#ifndef UNIV_NONINL
#include "os0thread.ic"
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/sync0sync.h
View file @
99ed0123
...
...
@@ -413,13 +413,6 @@ sync_thread_reset_level(
/*====================*/
void
*
latch
);
/*!< in: pointer to a mutex or an rw-lock */
/******************************************************************//**
Checks that the level array for the current thread is empty.
@return TRUE if empty */
UNIV_INTERN
ibool
sync_thread_levels_empty
(
void
);
/*==========================*/
/******************************************************************//**
Checks if the level array for the current thread contains a
mutex or rw-latch at the specified level.
@return a matching latch, or NULL if not found */
...
...
@@ -430,17 +423,33 @@ sync_thread_levels_contains(
ulint
level
);
/*!< in: latching order level
(SYNC_DICT, ...)*/
/******************************************************************//**
Checks
if
the level array for the current thread is empty.
Checks
that
the level array for the current thread is empty.
@return a latch, or NULL if empty except the exceptions specified below */
UNIV_INTERN
void
*
sync_thread_levels_nonempty_gen
(
/*============================*/
ibool
dict_mutex_allowed
);
/*!< in: TRUE if dictionary mutex is
allowed to be owned by the thread,
also purge_is_running mutex is
allowed */
#define sync_thread_levels_empty_gen(d) (!sync_thread_levels_nonempty_gen(d))
ibool
dict_mutex_allowed
)
/*!< in: TRUE if dictionary mutex is
allowed to be owned by the thread */
__attribute__
((
warn_unused_result
));
/******************************************************************//**
Checks if the level array for the current thread is empty,
except for data dictionary latches. */
#define sync_thread_levels_empty_except_dict() \
(!sync_thread_levels_nonempty_gen(TRUE))
/******************************************************************//**
Checks if the level array for the current thread is empty,
except for the btr_search_latch.
@return a latch, or NULL if empty except the exceptions specified below */
UNIV_INTERN
void
*
sync_thread_levels_nonempty_trx
(
/*============================*/
ibool
has_search_latch
)
/*!< in: TRUE if and only if the thread
is supposed to hold btr_search_latch */
__attribute__
((
warn_unused_result
));
/******************************************************************//**
Gets the debug information for a reserved mutex. */
UNIV_INTERN
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/trx0trx.h
View file @
99ed0123
...
...
@@ -44,6 +44,9 @@ extern sess_t* trx_dummy_sess;
/** Number of transactions currently allocated for MySQL: protected by
the kernel mutex */
extern
ulint
trx_n_mysql_transactions
;
/** Number of transactions currently in the XA PREPARED state: protected by
the kernel mutex */
extern
ulint
trx_n_prepared
;
/********************************************************************//**
Releases the search latch if trx has reserved it. */
...
...
@@ -108,6 +111,14 @@ trx_free(
/*=====*/
trx_t
*
trx
);
/*!< in, own: trx object */
/********************************************************************//**
At shutdown, frees a transaction object that is in the PREPARED state. */
UNIV_INTERN
void
trx_free_prepared
(
/*==============*/
trx_t
*
trx
)
/*!< in, own: trx object */
UNIV_COLD
__attribute__
((
nonnull
));
/********************************************************************//**
Frees a transaction object for MySQL. */
UNIV_INTERN
void
...
...
@@ -569,11 +580,6 @@ struct trx_struct{
ib_int64_t
mysql_log_offset
;
/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
os_thread_id_t
mysql_thread_id
;
/* id of the MySQL thread associated
with this transaction object */
ulint
mysql_process_no
;
/* since in Linux, 'top' reports
process id's and not thread id's, we
store the process number too */
/*------------------------------*/
ulint
n_mysql_tables_in_use
;
/* number of Innobase tables
used in the processing of the current
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/trx0undo.h
View file @
99ed0123
...
...
@@ -296,6 +296,15 @@ void
trx_undo_insert_cleanup
(
/*====================*/
trx_t
*
trx
);
/*!< in: transaction handle */
/********************************************************************//**
At shutdown, frees the undo logs of a PREPARED transaction. */
UNIV_INTERN
void
trx_undo_free_prepared
(
/*===================*/
trx_t
*
trx
)
/*!< in/out: PREPARED transaction */
UNIV_COLD
__attribute__
((
nonnull
));
#endif
/* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/univ.i
View file @
99ed0123
...
...
@@ -51,7 +51,7 @@ Created 1/20/1994 Heikki Tuuri
#
define
INNODB_VERSION_MAJOR
1
#
define
INNODB_VERSION_MINOR
1
#
define
INNODB_VERSION_BUGFIX
6
#
define
INNODB_VERSION_BUGFIX
7
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
...
...
@@ -255,6 +255,19 @@ easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */
#
else
#
define
UNIV_INTERN
#
endif
#
if
defined
__GNUC__
&
&
(__GNUC__
>
4
||
__GNUC__
==
4
&
&
__GNUC_MINOR__
>=
3
)
/** Starting with GCC 4.3, the "cold" attribute is used to inform the
compiler that a function is unlikely executed. The function is
optimized for size rather than speed and on many targets it is placed
into special subsection of the text section so all cold functions
appears close together improving code locality of non-cold parts of
program. The paths leading to call of cold functions within code are
marked as unlikely by the branch prediction mechanism. optimize a
rarely invoked function for size instead for speed. */
#
define
UNIV_COLD
__attribute__
((
cold
))
#
else
#
define
UNIV_COLD
/* empty */
#
endif
#
ifndef
UNIV_MUST_NOT_INLINE
/* Definition for inline version */
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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