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
32221d9b
Commit
32221d9b
authored
Apr 12, 2005
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
parents
f93ebc20
b3e54c9a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
24 deletions
+69
-24
mysql-test/r/flush_block_commit.result
mysql-test/r/flush_block_commit.result
+15
-0
mysql-test/t/flush_block_commit.test
mysql-test/t/flush_block_commit.test
+21
-0
sql/handler.cc
sql/handler.cc
+16
-17
sql/sql_class.cc
sql/sql_class.cc
+4
-3
sql/sql_parse.cc
sql/sql_parse.cc
+11
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-2
No files found.
mysql-test/r/flush_block_commit.result
View file @
32221d9b
...
@@ -37,3 +37,18 @@ show create database test;
...
@@ -37,3 +37,18 @@ show create database test;
Database Create Database
Database Create Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
drop table t1;
create table t1 (a int) engine=innodb;
reset master;
set autocommit=0;
insert t1 values (1);
flush tables with read lock;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 98
commit;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 98
unlock tables;
drop table t1;
set autocommit=1;
mysql-test/t/flush_block_commit.test
View file @
32221d9b
...
@@ -76,3 +76,24 @@ select * from t1;
...
@@ -76,3 +76,24 @@ select * from t1;
show
create
database
test
;
show
create
database
test
;
drop
table
t1
;
drop
table
t1
;
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
connection
con1
;
create
table
t1
(
a
int
)
engine
=
innodb
;
reset
master
;
set
autocommit
=
0
;
insert
t1
values
(
1
);
connection
con2
;
flush
tables
with
read
lock
;
show
master
status
;
connection
con1
;
send
commit
;
connection
con2
;
sleep
1
;
show
master
status
;
unlock
tables
;
connection
con1
;
reap
;
drop
table
t1
;
set
autocommit
=
1
;
sql/handler.cc
View file @
32221d9b
...
@@ -587,6 +587,11 @@ int ha_commit_trans(THD *thd, bool all)
...
@@ -587,6 +587,11 @@ int ha_commit_trans(THD *thd, bool all)
#ifdef USING_TRANSACTIONS
#ifdef USING_TRANSACTIONS
if
(
trans
->
nht
)
if
(
trans
->
nht
)
{
{
if
(
is_real_trans
&&
wait_if_global_read_lock
(
thd
,
0
,
0
))
{
ha_rollback_trans
(
thd
,
all
);
DBUG_RETURN
(
1
);
}
DBUG_EXECUTE_IF
(
"crash_commit_before"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_before"
,
abort
(););
if
(
!
trans
->
no_2pc
&&
trans
->
nht
>
1
)
if
(
!
trans
->
no_2pc
&&
trans
->
nht
>
1
)
{
{
...
@@ -596,7 +601,7 @@ int ha_commit_trans(THD *thd, bool all)
...
@@ -596,7 +601,7 @@ int ha_commit_trans(THD *thd, bool all)
if
((
err
=
(
*
(
*
ht
)
->
prepare
)(
thd
,
all
)))
if
((
err
=
(
*
(
*
ht
)
->
prepare
)(
thd
,
all
)))
{
{
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
),
err
);
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
),
err
);
error
=
1
;
error
=
1
;
}
}
statistic_increment
(
thd
->
status_var
.
ha_prepare_count
,
&
LOCK_status
);
statistic_increment
(
thd
->
status_var
.
ha_prepare_count
,
&
LOCK_status
);
}
}
...
@@ -605,20 +610,28 @@ int ha_commit_trans(THD *thd, bool all)
...
@@ -605,20 +610,28 @@ int ha_commit_trans(THD *thd, bool all)
(
error
=
!
(
cookie
=
tc_log
->
log
(
thd
,
xid
)))))
(
error
=
!
(
cookie
=
tc_log
->
log
(
thd
,
xid
)))))
{
{
ha_rollback_trans
(
thd
,
all
);
ha_rollback_trans
(
thd
,
all
);
return
1
;
error
=
1
;
goto
end
;
}
}
DBUG_EXECUTE_IF
(
"crash_commit_after_log"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_after_log"
,
abort
(););
}
}
error
=
ha_commit_one_phase
(
thd
,
all
)
?
cookie
?
2
:
1
:
0
;
error
=
ha_commit_one_phase
(
thd
,
all
)
?
cookie
?
2
:
1
:
0
;
DBUG_EXECUTE_IF
(
"crash_commit_before_unlog"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_before_unlog"
,
abort
(););
if
(
cookie
)
if
(
cookie
)
tc_log
->
unlog
(
cookie
,
xid
);
tc_log
->
unlog
(
cookie
,
xid
);
DBUG_EXECUTE_IF
(
"crash_commit_after"
,
abort
(););
DBUG_EXECUTE_IF
(
"crash_commit_after"
,
abort
(););
end:
if
(
is_real_trans
)
start_waiting_global_read_lock
(
thd
);
}
}
#endif
/* USING_TRANSACTIONS */
#endif
/* USING_TRANSACTIONS */
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
/*
NOTE - this function does not care about global read lock.
A caller should.
*/
int
ha_commit_one_phase
(
THD
*
thd
,
bool
all
)
int
ha_commit_one_phase
(
THD
*
thd
,
bool
all
)
{
{
int
error
=
0
;
int
error
=
0
;
...
@@ -629,18 +642,6 @@ int ha_commit_one_phase(THD *thd, bool all)
...
@@ -629,18 +642,6 @@ int ha_commit_one_phase(THD *thd, bool all)
#ifdef USING_TRANSACTIONS
#ifdef USING_TRANSACTIONS
if
(
trans
->
nht
)
if
(
trans
->
nht
)
{
{
bool
need_start_waiters
=
0
;
if
(
is_real_trans
)
{
if
((
error
=
wait_if_global_read_lock
(
thd
,
0
,
0
)))
{
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
),
error
);
error
=
1
;
}
else
need_start_waiters
=
1
;
}
for
(
ht
=
trans
->
ht
;
*
ht
;
ht
++
)
for
(
ht
=
trans
->
ht
;
*
ht
;
ht
++
)
{
{
int
err
;
int
err
;
...
@@ -665,8 +666,6 @@ int ha_commit_one_phase(THD *thd, bool all)
...
@@ -665,8 +666,6 @@ int ha_commit_one_phase(THD *thd, bool all)
thd
->
variables
.
tx_isolation
=
thd
->
session_tx_isolation
;
thd
->
variables
.
tx_isolation
=
thd
->
session_tx_isolation
;
thd
->
transaction
.
cleanup
();
thd
->
transaction
.
cleanup
();
}
}
if
(
need_start_waiters
)
start_waiting_global_read_lock
(
thd
);
}
}
#endif
/* USING_TRANSACTIONS */
#endif
/* USING_TRANSACTIONS */
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
...
...
sql/sql_class.cc
View file @
32221d9b
...
@@ -202,10 +202,11 @@ THD::THD()
...
@@ -202,10 +202,11 @@ THD::THD()
#ifndef DBUG_OFF
#ifndef DBUG_OFF
dbug_sentry
=
THD_SENTRY_MAGIC
;
dbug_sentry
=
THD_SENTRY_MAGIC
;
#endif
#endif
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
net
.
vio
=
0
;
net
.
vio
=
0
;
#endif
#endif
net
.
last_error
[
0
]
=
0
;
// If error on boot
net
.
last_error
[
0
]
=
0
;
// If error on boot
net
.
query_cache_query
=
0
;
// If error on boot
ull
=
0
;
ull
=
0
;
system_thread
=
cleanup_done
=
abort_on_warning
=
no_warnings_for_error
=
0
;
system_thread
=
cleanup_done
=
abort_on_warning
=
no_warnings_for_error
=
0
;
peer_port
=
0
;
// For SHOW PROCESSLIST
peer_port
=
0
;
// For SHOW PROCESSLIST
...
@@ -214,7 +215,7 @@ THD::THD()
...
@@ -214,7 +215,7 @@ THD::THD()
#endif
#endif
#ifdef SIGNAL_WITH_VIO_CLOSE
#ifdef SIGNAL_WITH_VIO_CLOSE
active_vio
=
0
;
active_vio
=
0
;
#endif
#endif
pthread_mutex_init
(
&
LOCK_delete
,
MY_MUTEX_INIT_FAST
);
pthread_mutex_init
(
&
LOCK_delete
,
MY_MUTEX_INIT_FAST
);
/* Variables with default values */
/* Variables with default values */
...
...
sql/sql_parse.cc
View file @
32221d9b
...
@@ -4428,10 +4428,19 @@ mysql_execute_command(THD *thd)
...
@@ -4428,10 +4428,19 @@ mysql_execute_command(THD *thd)
else
else
if
(
thd
->
transaction
.
xa_state
==
XA_PREPARED
&&
thd
->
lex
->
xa_opt
==
XA_NONE
)
if
(
thd
->
transaction
.
xa_state
==
XA_PREPARED
&&
thd
->
lex
->
xa_opt
==
XA_NONE
)
{
{
if
(
ha_commit_one_phase
(
thd
,
1
))
if
(
wait_if_global_read_lock
(
thd
,
0
,
0
))
{
ha_rollback
(
thd
);
my_error
(
ER_XAER_RMERR
,
MYF
(
0
));
my_error
(
ER_XAER_RMERR
,
MYF
(
0
));
}
else
else
send_ok
(
thd
);
{
if
(
ha_commit_one_phase
(
thd
,
1
))
my_error
(
ER_XAER_RMERR
,
MYF
(
0
));
else
send_ok
(
thd
);
start_waiting_global_read_lock
(
thd
);
}
}
}
else
else
{
{
...
...
sql/sql_yacc.yy
View file @
32221d9b
...
@@ -7275,7 +7275,7 @@ keyword:
...
@@ -7275,7 +7275,7 @@ keyword:
| MULTILINESTRING {}
| MULTILINESTRING {}
| MULTIPOINT {}
| MULTIPOINT {}
| MULTIPOLYGON {}
| MULTIPOLYGON {}
| MUTEX_SYM
{}
| MUTEX_SYM
{}
| NAME_SYM {}
| NAME_SYM {}
| NAMES_SYM {}
| NAMES_SYM {}
| NATIONAL_SYM {}
| NATIONAL_SYM {}
...
@@ -7367,8 +7367,8 @@ keyword:
...
@@ -7367,8 +7367,8 @@ keyword:
| TIMESTAMP_ADD {}
| TIMESTAMP_ADD {}
| TIMESTAMP_DIFF {}
| TIMESTAMP_DIFF {}
| TIME_SYM {}
| TIME_SYM {}
| TYPE_SYM {}
| TYPES_SYM {}
| TYPES_SYM {}
| TYPE_SYM {}
| UDF_RETURNS_SYM {}
| UDF_RETURNS_SYM {}
| FUNCTION_SYM {}
| FUNCTION_SYM {}
| UNCOMMITTED_SYM {}
| UNCOMMITTED_SYM {}
...
...
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