summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r--system/database/drivers/mysql/mysql_utility.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index 8aa051755..e2de82d0b 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -76,6 +76,13 @@ class CI_DB_mysql_utility extends CI_DB_utility {
// Build the output
$output = '';
+
+ // Do we need to include a statement to disable FK checks?
+ if ($fk_checks === FALSE)
+ {
+ $output .= "SET foreign_key_checks = 0;".$newline;
+ }
+
foreach ( (array) $tables as $table)
{
// Is the table in the "ignore" list?
@@ -181,6 +188,12 @@ class CI_DB_mysql_utility extends CI_DB_utility {
$output .= $newline.$newline;
}
+ // Do we need to include a statement to re-enable FK checks?
+ if ($fk_checks === FALSE)
+ {
+ $output .= "SET foreign_key_checks = 1;".$newline;
+ }
+
return $output;
}