Ok. You're right.
It seems that --no-defaults option with the read_default_file
parameter in #12880 is not tested.
Also, I consider we should add --single-transaction and --quick
options by default.
Could you please create new ticket with the details via
https://trac.edgewall.org/newticket?
====
diff --git a/trac/db/mysql_backend.py b/trac/db/mysql_backend.py
index f607bce30..01cb4fc1d 100644
--- a/trac/db/mysql_backend.py
+++ b/trac/db/mysql_backend.py
@@ -240,7 +240,8 @@ class MySQLConnector(Component):
db_params = db_prop.setdefault('params', {})
db_name = os.path.basename(db_prop['path'])
- args = [self.mysqldump_path, '--no-defaults']
+ defaults_opt = '--no-defaults'
+ args = []
if 'host' in db_prop:
args.extend(['-h', db_prop['host']])
if 'port' in db_prop:
@@ -252,14 +253,15 @@ class MySQLConnector(Component):
args.append('--compress')
elif name == 'named_pipe' and as_int(value, 0):
args.append('--protocol=pipe')
- elif name == 'read_default_file': # Must be first
- args.insert(1, '--defaults-file=' + value)
+ elif name == 'read_default_file':
+ defaults_opt = '--defaults-file=' + value
elif name == 'unix_socket':
args.extend(['--protocol=socket', '--socket=' + value])
elif name not in ('init_command', 'read_default_group'):
self.log.warning("Invalid connection string parameter '%s'",
name)
- args.extend(['-r', dest_file, db_name])
+ args = [self.mysqldump_path, defaults_opt, '--single-transaction',
+ '--quick'] + args + ['-r', dest_file, db_name]
environ = os.environ.copy()
if 'password' in db_prop:
====
--
Jun Omae <
jun...@gmail.com> (大前 潤)