Bug#19660 mysqldump --single-transaction should be with CONSISTENT SNAPSHOT
This commit is contained in:
parent
1530b51d8f
commit
728588da38
@ -2407,7 +2407,7 @@ static int do_reset_master(MYSQL *mysql_con)
|
||||
}
|
||||
|
||||
|
||||
static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
|
||||
static int start_transaction(MYSQL *mysql_con)
|
||||
{
|
||||
/*
|
||||
We use BEGIN for old servers. --single-transaction --master-data will fail
|
||||
@ -2422,10 +2422,8 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
|
||||
"SET SESSION TRANSACTION ISOLATION "
|
||||
"LEVEL REPEATABLE READ") ||
|
||||
mysql_query_with_error_report(mysql_con, 0,
|
||||
consistent_read_now ?
|
||||
"START TRANSACTION "
|
||||
"WITH CONSISTENT SNAPSHOT" :
|
||||
"BEGIN"));
|
||||
"/*!40100 WITH CONSISTENT SNAPSHOT */"));
|
||||
}
|
||||
|
||||
|
||||
@ -2652,7 +2650,7 @@ int main(int argc, char **argv)
|
||||
if ((opt_lock_all_tables || opt_master_data) &&
|
||||
do_flush_tables_read_lock(sock))
|
||||
goto err;
|
||||
if (opt_single_transaction && start_transaction(sock, test(opt_master_data)))
|
||||
if (opt_single_transaction && start_transaction(sock))
|
||||
goto err;
|
||||
if (opt_delete_master_logs && do_reset_master(sock))
|
||||
goto err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user