diff options
author | unknown <guilhem@mysql.com> | 2005-01-13 00:44:13 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2005-01-13 00:44:13 +0100 |
commit | d62ca959512601c6f225be694009f8d1ecca4b7c (patch) | |
tree | cb12f4f98575cfb4b4608feb0dc1b186566864bb /client | |
parent | 611fd7522ceda2450a70249048b5f4d26fac033b (diff) | |
download | mariadb-git-d62ca959512601c6f225be694009f8d1ecca4b7c.tar.gz |
Fix for BUG#7850: force the transaction isolation level to REPEATABLE READ when --single-transaction
client/mysqldump.c:
force the transaction isolation level to REPEATABLE READ when --single-transaction
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index d511dc3bbde..14ebe9ea8f7 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2200,8 +2200,15 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now) We use BEGIN for old servers. --single-transaction --master-data will fail on old servers, but that's ok as it was already silently broken (it didn't do a consistent read, so better tell people frankly, with the error). + + We want the first consistent read to be used for all tables to dump so we + need the REPEATABLE READ level (not anything lower, for example READ + COMMITTED would give one new consistent read per dumped table). */ return (mysql_query_with_error_report(mysql_con, 0, + "SET SESSION TRANSACTION ISOLATION " + "LEVEL REPEATABLE READ") || + mysql_query_with_error_report(mysql_con, 0, consistent_read_now ? "START TRANSACTION " "WITH CONSISTENT SNAPSHOT" : |