Commit 9e757030 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix MySQL tests not running, and some more temporary table stuff

parent bc3508de
......@@ -23,7 +23,7 @@ namespace Doctrine\DBAL\Logging;
/**
* A SQL logger that logs to the standard output using echo/var_dump.
*
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
......
......@@ -40,7 +40,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$createTempTableSQL = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' ('
. $platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
$this->_conn->exec($createTempTableSQL);
$this->_conn->executeUpdate($createTempTableSQL);
$table = new Table("nontemporary");
$table->addColumn("id", "integer");
......@@ -54,6 +54,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $this->_conn->getSchemaManager()->listTableDetails($table->getName());
$this->assertEquals("nontemporary", $table->getName());
$this->_conn->insert("nontemporary", array("id" => 1));
$this->_conn->exec($platform->getDropTemporaryTableSQL($tempTable));
$this->_conn->insert("nontemporary", array("id" => 2));
......
......@@ -48,10 +48,11 @@ class DbalFunctionalTestCase extends DbalTestCase
if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) {
$queries = "";
for($i = count($this->_sqlLoggerStack->queries)-1; $i > max(count($this->_sqlLoggerStack->queries)-25, 0) && isset($this->_sqlLoggerStack->queries[$i]); $i--) {
$query = $this->_sqlLoggerStack->queries[$i];
$i = count($this->_sqlLoggerStack->queries);
foreach (array_reverse($this->_sqlLoggerStack->queries) AS $query) {
$params = array_map(function($p) { if (is_object($p)) return get_class($p); else return "'".$p."'"; }, $query['params'] ?: array());
$queries .= ($i+1).". SQL: '".$query['sql']."' Params: ".implode(", ", $params).PHP_EOL;
$i--;
}
$trace = $e->getTrace();
......
......@@ -3,15 +3,15 @@
<php>
<var name="db_type" value="pdo_mysql"/>
<var name="db_host" value="localhost" />
<!--var name="db_username" value="" /-->
<!--var name="db_password" value="" /-->
<var name="db_username" value="" />
<var name="db_password" value="" />
<var name="db_name" value="doctrine_tests" />
<var name="db_port" value="3306"/>
<var name="tmpdb_type" value="pdo_mysql"/>
<var name="tmpdb_host" value="localhost" />
<!--var name="tmpdb_username" value="" /-->
<!--var name="tmpdb_password" value="" /-->
<var name="tmpdb_username" value="" />
<var name="tmpdb_password" value="" />
<var name="tmpdb_name" value="doctrine_tests_tmp" />
<var name="tmpdb_port" value="3306"/>
</php>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment