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
09f106f9
Commit
09f106f9
authored
Apr 05, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into mysql.com:/home/jimw/my/mysql-5.0-clean
parents
e106a142
d4cc0761
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
19 deletions
+43
-19
sql/ha_innodb.cc
sql/ha_innodb.cc
+40
-16
sql/handler.cc
sql/handler.cc
+3
-3
No files found.
sql/ha_innodb.cc
View file @
09f106f9
...
@@ -748,17 +748,37 @@ ha_innobase::update_thd(
...
@@ -748,17 +748,37 @@ ha_innobase::update_thd(
}
}
/*************************************************************************
/*************************************************************************
Registers the InnoDB transaction in MySQL, to receive commit/rollback
Registers that InnoDB takes part in an SQL statement, so that MySQL knows to
events. This function must be called every time InnoDB starts a
roll back the statement if the statement results in an error. This MUST be
transaction internally. */
called for every SQL statement that may be rolled back by MySQL. Calling this
static
several times to register the same statement is allowed, too. */
inline
void
void
register_trans
(
innobase_register_stmt
(
/*===========*/
/*===========
========
*/
THD
*
thd
)
/* in:
thd to use the handle
*/
THD
*
thd
)
/* in:
MySQL thd (connection) object
*/
{
{
/* Register the sta
rt of the sta
tement */
/* Register the statement */
trans_register_ha
(
thd
,
FALSE
,
&
innobase_hton
);
trans_register_ha
(
thd
,
FALSE
,
&
innobase_hton
);
}
/*************************************************************************
Registers an InnoDB transaction in MySQL, so that the MySQL XA code knows
to call the InnoDB prepare and commit, or rollback for the transaction. This
MUST be called for every transaction for which the user may call commit or
rollback. Calling this several times to register the same transaction is
allowed, too.
This function also registers the current SQL statement. */
inline
void
innobase_register_trx_and_stmt
(
/*===========================*/
THD
*
thd
)
/* in: MySQL thd (connection) object */
{
/* NOTE that actually innobase_register_stmt() registers also
the transaction in the AUTOCOMMIT=1 mode. */
innobase_register_stmt
(
thd
);
if
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
if
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
...
@@ -914,7 +934,7 @@ innobase_query_caching_of_table_permitted(
...
@@ -914,7 +934,7 @@ innobase_query_caching_of_table_permitted(
if
(
trx
->
active_trans
==
0
)
{
if
(
trx
->
active_trans
==
0
)
{
register_trans
(
thd
);
innobase_register_trx_and_stmt
(
thd
);
trx
->
active_trans
=
1
;
trx
->
active_trans
=
1
;
}
}
...
@@ -1030,7 +1050,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
...
@@ -1030,7 +1050,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
if
(
prebuilt
->
trx
->
active_trans
==
0
)
{
if
(
prebuilt
->
trx
->
active_trans
==
0
)
{
register_trans
(
current_thd
);
innobase_register_trx_and_stmt
(
current_thd
);
prebuilt
->
trx
->
active_trans
=
1
;
prebuilt
->
trx
->
active_trans
=
1
;
}
}
...
@@ -1421,7 +1441,7 @@ innobase_start_trx_and_assign_read_view(
...
@@ -1421,7 +1441,7 @@ innobase_start_trx_and_assign_read_view(
if
(
trx
->
active_trans
==
0
)
{
if
(
trx
->
active_trans
==
0
)
{
register_trans
(
current_thd
);
innobase_register_trx_and_stmt
(
current_thd
);
trx
->
active_trans
=
1
;
trx
->
active_trans
=
1
;
}
}
...
@@ -5544,9 +5564,11 @@ ha_innobase::start_stmt(
...
@@ -5544,9 +5564,11 @@ ha_innobase::start_stmt(
/* Set the MySQL flag to mark that there is an active transaction */
/* Set the MySQL flag to mark that there is an active transaction */
if
(
trx
->
active_trans
==
0
)
{
if
(
trx
->
active_trans
==
0
)
{
register_trans
(
thd
);
innobase_register_trx_and_stmt
(
thd
);
trx
->
active_trans
=
1
;
trx
->
active_trans
=
1
;
}
}
else
{
innobase_register_stmt
(
thd
);
}
return
(
0
);
return
(
0
);
}
}
...
@@ -5616,9 +5638,11 @@ ha_innobase::external_lock(
...
@@ -5616,9 +5638,11 @@ ha_innobase::external_lock(
transaction */
transaction */
if
(
trx
->
active_trans
==
0
)
{
if
(
trx
->
active_trans
==
0
)
{
register_trans
(
thd
);
innobase_register_trx_and_stmt
(
thd
);
trx
->
active_trans
=
1
;
trx
->
active_trans
=
1
;
}
}
else
if
(
trx
->
n_mysql_tables_in_use
==
0
)
{
innobase_register_stmt
(
thd
);
}
trx
->
n_mysql_tables_in_use
++
;
trx
->
n_mysql_tables_in_use
++
;
prebuilt
->
mysql_has_locked
=
TRUE
;
prebuilt
->
mysql_has_locked
=
TRUE
;
...
@@ -5780,7 +5804,7 @@ ha_innobase::transactional_table_lock(
...
@@ -5780,7 +5804,7 @@ ha_innobase::transactional_table_lock(
/* Set the MySQL flag to mark that there is an active transaction */
/* Set the MySQL flag to mark that there is an active transaction */
if
(
trx
->
active_trans
==
0
)
{
if
(
trx
->
active_trans
==
0
)
{
register_trans
(
thd
);
innobase_register_trx_and_stmt
(
thd
);
trx
->
active_trans
=
1
;
trx
->
active_trans
=
1
;
}
}
...
...
sql/handler.cc
View file @
09f106f9
...
@@ -520,14 +520,14 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
...
@@ -520,14 +520,14 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg)
else
else
trans
=
&
thd
->
transaction
.
stmt
;
trans
=
&
thd
->
transaction
.
stmt
;
#ifndef DBUG_OFF
handlerton
**
ht
=
trans
->
ht
;
handlerton
**
ht
=
trans
->
ht
;
while
(
*
ht
)
while
(
*
ht
)
{
{
DBUG_ASSERT
(
*
ht
!=
ht_arg
);
if
(
*
ht
==
ht_arg
)
DBUG_VOID_RETURN
;
/* already registered, return */
ht
++
;
ht
++
;
}
}
#endif
trans
->
ht
[
trans
->
nht
++
]
=
ht_arg
;
trans
->
ht
[
trans
->
nht
++
]
=
ht_arg
;
trans
->
no_2pc
|=
(
ht_arg
->
prepare
==
0
);
trans
->
no_2pc
|=
(
ht_arg
->
prepare
==
0
);
if
(
thd
->
transaction
.
xid
.
is_null
())
if
(
thd
->
transaction
.
xid
.
is_null
())
...
...
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