If you peek at Varien_Db_Adapter_Pdo_Mysql
(I got there by looking into Mage_Core_Model_Resource_Setup
which does getConnection()->startSetup()
) you'll see that this call does some database-specific prepping:
public function startSetup()
{
$this->raw_query("SET SQL_MODE=''");
$this->raw_query("SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0");
$this->raw_query("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");
return $this;
}
public function endSetup()
{
$this->raw_query("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')");
$this->raw_query("SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)");
return $this;
}
Basically most of these are for compatibility and some of them speed up a few operations (for example disabling the foreign key checks).