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
c477002f
Commit
c477002f
authored
Sep 12, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix results for mix_innodb_myisam_binlog
Optimize calls to current_thd
parent
04c43fca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
40 deletions
+39
-40
mysql-test/r/mix_innodb_myisam_binlog.result
mysql-test/r/mix_innodb_myisam_binlog.result
+6
-3
mysql-test/t/mix_innodb_myisam_binlog.test
mysql-test/t/mix_innodb_myisam_binlog.test
+0
-3
sql/ha_innodb.cc
sql/ha_innodb.cc
+33
-34
No files found.
mysql-test/r/mix_innodb_myisam_binlog.result
View file @
c477002f
...
...
@@ -19,7 +19,8 @@ begin;
insert into t1 values(2);
insert into t2 select * from t1;
rollback;
Warning: Some non-transactional changed tables couldn't be rolled back
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.000001 79 Query 1 79 use `test`; BEGIN
...
...
@@ -35,7 +36,8 @@ savepoint my_savepoint;
insert into t1 values(4);
insert into t2 select * from t1;
rollback to savepoint my_savepoint;
Warning: Some non-transactional changed tables couldn't be rolled back
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
commit;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
...
...
@@ -55,7 +57,8 @@ savepoint my_savepoint;
insert into t1 values(6);
insert into t2 select * from t1;
rollback to savepoint my_savepoint;
Warning: Some non-transactional changed tables couldn't be rolled back
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
insert into t1 values(7);
commit;
select a from t1 order by a;
...
...
mysql-test/t/mix_innodb_myisam_binlog.test
View file @
c477002f
...
...
@@ -35,7 +35,6 @@ begin;
insert
into
t1
values
(
2
);
insert
into
t2
select
*
from
t1
;
# should say some changes to non-transact1onal tables couldn't be rolled back
--
error
1196
rollback
;
show
binlog
events
from
79
;
...
...
@@ -49,7 +48,6 @@ insert into t1 values(3);
savepoint
my_savepoint
;
insert
into
t1
values
(
4
);
insert
into
t2
select
*
from
t1
;
--
error
1196
rollback
to
savepoint
my_savepoint
;
commit
;
...
...
@@ -64,7 +62,6 @@ insert into t1 values(5);
savepoint
my_savepoint
;
insert
into
t1
values
(
6
);
insert
into
t2
select
*
from
t1
;
--
error
1196
rollback
to
savepoint
my_savepoint
;
insert
into
t1
values
(
7
);
commit
;
...
...
sql/ha_innodb.cc
View file @
c477002f
...
...
@@ -393,7 +393,7 @@ check_trx_exists(
{
trx_t
*
trx
;
ut_a
(
thd
==
current_thd
);
DBUG_ASSERT
(
thd
==
current_thd
);
trx
=
(
trx_t
*
)
thd
->
transaction
.
all
.
innobase_tid
;
...
...
@@ -1807,7 +1807,7 @@ build_template(
ibool
fetch_all_in_key
=
FALSE
;
ulint
i
;
ut_a
(
templ_type
!=
ROW_MYSQL_REC_FIELDS
||
thd
==
current_thd
);
DBUG_ASSERT
(
templ_type
!=
ROW_MYSQL_REC_FIELDS
||
thd
==
current_thd
);
clust_index
=
dict_table_get_first_index_noninline
(
prebuilt
->
table
);
...
...
@@ -1978,8 +1978,8 @@ ha_innobase::write_row(
DBUG_ENTER
(
"ha_innobase::write_row"
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
statistic_increment
(
ha_write_count
,
&
LOCK_status
);
...
...
@@ -2351,8 +2351,8 @@ ha_innobase::update_row(
DBUG_ENTER
(
"ha_innobase::update_row"
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
if
(
table
->
time_stamp
)
{
update_timestamp
(
new_row
+
table
->
time_stamp
-
1
);
...
...
@@ -2413,8 +2413,8 @@ ha_innobase::delete_row(
DBUG_ENTER
(
"ha_innobase::delete_row"
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
if
(
last_query_id
!=
user_thd
->
query_id
)
{
prebuilt
->
sql_stat_start
=
TRUE
;
...
...
@@ -2591,8 +2591,8 @@ ha_innobase::index_read(
DBUG_ENTER
(
"index_read"
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
statistic_increment
(
ha_read_key_count
,
&
LOCK_status
);
...
...
@@ -2705,12 +2705,9 @@ ha_innobase::change_active_index(
statistic_increment
(
ha_read_key_count
,
&
LOCK_status
);
DBUG_ENTER
(
"change_active_index"
);
DBUG_ASSERT
(
user_thd
==
current_thd
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
ut_a
(
user_thd
==
current_thd
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
(
trx_t
*
)
user_thd
->
transaction
.
all
.
innobase_tid
);
active_index
=
keynr
;
...
...
@@ -2795,8 +2792,8 @@ ha_innobase::general_fetch(
DBUG_ENTER
(
"general_fetch"
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
innodb_srv_conc_enter_innodb
(
prebuilt
->
trx
);
...
...
@@ -3029,8 +3026,8 @@ ha_innobase::rnd_pos(
statistic_increment
(
ha_read_rnd_count
,
&
LOCK_status
);
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
if
(
prebuilt
->
clust_index_was_generated
)
{
/* No primary key was defined for the table and we
...
...
@@ -3078,8 +3075,8 @@ ha_innobase::position(
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
uint
len
;
ut_a
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
DBUG_ASSERT
(
prebuilt
->
trx
==
(
trx_t
*
)
current_thd
->
transaction
.
all
.
innobase_tid
);
if
(
prebuilt
->
clust_index_was_generated
)
{
/* No primary key was defined for the table and we
...
...
@@ -3361,7 +3358,7 @@ ha_innobase::create(
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
current_
thd
);
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 */
...
...
@@ -3474,10 +3471,10 @@ ha_innobase::create(
}
}
if
(
current_
thd
->
query
!=
NULL
)
{
if
(
thd
->
query
!=
NULL
)
{
error
=
row_table_add_foreign_constraints
(
trx
,
current_
thd
->
query
,
norm_name
);
thd
->
query
,
norm_name
);
error
=
convert_error_code_to_mysql
(
error
,
NULL
);
...
...
@@ -3534,13 +3531,13 @@ ha_innobase::delete_table(
trx_t
*
parent_trx
;
trx_t
*
trx
;
char
norm_name
[
1000
];
THD
*
thd
=
current_thd
;
DBUG_ENTER
(
"ha_innobase::delete_table"
);
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
current_
thd
);
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 */
...
...
@@ -3555,8 +3552,8 @@ ha_innobase::delete_table(
trx
=
trx_allocate_for_mysql
();
trx
->
mysql_thd
=
current_
thd
;
trx
->
mysql_query_str
=
&
(
(
*
current_thd
).
query
);
trx
->
mysql_thd
=
thd
;
trx
->
mysql_query_str
=
&
(
thd
->
query
);
name_len
=
strlen
(
name
);
...
...
@@ -3609,11 +3606,12 @@ innobase_drop_database(
char
*
ptr
;
int
error
;
char
namebuf
[
10000
];
THD
*
thd
=
current_thd
;
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
current_
thd
);
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 */
...
...
@@ -3636,8 +3634,8 @@ innobase_drop_database(
my_casedn_str
(
system_charset_info
,
namebuf
);
#endif
trx
=
trx_allocate_for_mysql
();
trx
->
mysql_thd
=
current_
thd
;
trx
->
mysql_query_str
=
&
(
(
*
current_thd
).
query
);
trx
->
mysql_thd
=
thd
;
trx
->
mysql_query_str
=
&
(
thd
->
query
);
error
=
row_drop_database_for_mysql
(
namebuf
,
trx
);
...
...
@@ -3677,13 +3675,14 @@ ha_innobase::rename_table(
trx_t
*
trx
;
char
norm_from
[
1000
];
char
norm_to
[
1000
];
THD
*
thd
=
current_thd
;
DBUG_ENTER
(
"ha_innobase::rename_table"
);
/* Get the transaction associated with the current thd, or create one
if not yet created */
parent_trx
=
check_trx_exists
(
current_
thd
);
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 */
...
...
@@ -3697,8 +3696,8 @@ ha_innobase::rename_table(
}
trx
=
trx_allocate_for_mysql
();
trx
->
mysql_thd
=
current_
thd
;
trx
->
mysql_query_str
=
&
(
(
*
current_thd
).
query
);
trx
->
mysql_thd
=
thd
;
trx
->
mysql_query_str
=
&
(
thd
->
query
);
name_len1
=
strlen
(
from
);
name_len2
=
strlen
(
to
);
...
...
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