From f87b3be5d282aa404902921306be205081eb291b Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Thu, 9 Feb 2012 23:07:58 +0100
Subject: [PATCH] New: Add option to not set LOCK commands around INSERT into
 database mysql dump.

---
 htdocs/admin/tools/dolibarr_export.php | 7 ++++++-
 htdocs/admin/tools/export.php          | 1 +
 htdocs/langs/en_US/admin.lang          | 1 +
 htdocs/langs/fr_FR/admin.lang          | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index eca8ea908c1..1e888b09b55 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2006-2011 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2006-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -112,6 +112,7 @@ $label=getStaticMember($db, 'label');
 			if (! empty($conf->global->MAIN_FEATURES_LEVEL))
 			{
 			?>
+			<br>
 			<div class="formelementrow"><input type="radio" name="what" value="mysqlnobin" id="radio_dump_mysql_nobin" />
 			<label for="radio_dump_mysql">MySQL	Dump (php) <?php print img_warning('Backup can\'t be guaranted with this method. Prefer previous one'); ?></label>
 			</div>
@@ -208,6 +209,10 @@ $label=getStaticMember($db, 'label');
 				id="checkbox_dump_extended_ins" /> <label
 				for="checkbox_dump_extended_ins"> <?php echo $langs->trans("ExtendedInsert"); ?></label><br>
 
+			<input type="checkbox" name="disable-add-locks" value="no"
+				id="checkbox_dump_disable-add-locks" /> <label
+				for="checkbox_dump_disable-add-locks"> <?php echo $langs->trans("NoLockBeforeInsert"); ?></label><br>
+
 			<input type="checkbox" name="delayed" value="yes"
 				id="checkbox_dump_delayed" /> <label for="checkbox_dump_delayed"> <?php echo $langs->trans("DelayedInsert"); ?></label><br>
 
diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php
index 93d29f1ff4b..c8368b765d1 100644
--- a/htdocs/admin/tools/export.php
+++ b/htdocs/admin/tools/export.php
@@ -120,6 +120,7 @@ if ($what == 'mysql')
     {
         $param.=" -t";
     }
+    if ($_POST["disable-add-locks"]) $param.=" --add-locks=FALSE";
     if ($_POST["sql_data"])
     {
         $param.=" --tables";
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1773b82becb..78ba24a1318 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -166,6 +166,7 @@ AddDropTable=Add DROP TABLE command
 Datas=Data
 NameColumn=Name columns
 ExtendedInsert=Extended INSERT
+NoLockBeforeInsert=No lock commands around INSERT 
 DelayedInsert=Delayed insert
 EncodeBinariesInHexa=Encode binary data in hexadecimal
 IgnoreDuplicateRecords=Ignore errors of duplicate records (INSERT IGNORE)
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index c3bf04c5c7c..7deef9db821 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -167,6 +167,7 @@ AddDropTable= Ajouter ordres DROP TABLE
 Datas= Données
 NameColumn= Nomme les colonnes
 ExtendedInsert= Instructions INSERT étendues
+NoLockBeforeInsert=Pas d'instruction LOCK autour des INSERT 
 DelayedInsert= Insertion avec délai
 EncodeBinariesInHexa= Encoder les champs binaires en hexadécimal
 IgnoreDuplicateRecords=Ignorer les erreurs de doublons (INSERT IGNORE)
-- 
GitLab