Zend\Db\Sql\Ddl\CreateTable - fix create temporary tables #5538

Merged
merged 1 commit into from Nov 27, 2013

Projects

None yet

3 participants

@turrsis
Contributor
turrsis commented Nov 24, 2013

this is recreate #4768

@samsonasik samsonasik commented on the diff Nov 25, 2013
...b/Sql/Platform/SqlServer/Ddl/CreateTableDecorator.php
+
+namespace Zend\Db\Sql\Platform\SqlServer\Ddl;
+
+use Zend\Db\Adapter\Platform\PlatformInterface;
+use Zend\Db\Sql\Ddl\CreateTable;
+use Zend\Db\Sql\Platform\PlatformDecoratorInterface;
+
+class CreateTableDecorator extends CreateTable implements PlatformDecoratorInterface
+{
+ /**
+ * @var CreateTable
+ */
+ protected $createTable;
+
+ /**
+ * @param CreateTable $subject
@samsonasik
samsonasik Nov 25, 2013 Contributor

miss @return self docblock

@samsonasik samsonasik commented on an outdated diff Nov 25, 2013
...b/Sql/Platform/SqlServer/Ddl/CreateTableDecorator.php
+ }
+
+ /**
+ * @param null|PlatformInterface $platform
+ * @return string
+ */
+ public function getSqlString(PlatformInterface $platform = null)
+ {
+ // localize variables
+ foreach (get_object_vars($this->createTable) as $name => $value) {
+ $this->{$name} = $value;
+ }
+ return parent::getSqlString($platform);
+ }
+
+ protected function processTable(PlatformInterface $adapterPlatform = null)
@samsonasik
samsonasik Nov 25, 2013 Contributor

docblock ?

@ralphschindler ralphschindler and 1 other commented on an outdated diff Nov 26, 2013
library/Zend/Db/Sql/Ddl/CreateTable.php
@@ -63,7 +63,14 @@ class CreateTable extends AbstractSql implements SqlInterface
*/
public function __construct($table = '', $isTemporary = false)
{
- $this->table = $table;
+ if (is_array($table)) {
@ralphschindler
ralphschindler Nov 26, 2013 Member

This code does not address the temporary table fix. Can you remove it?

@turrsis
turrsis Nov 27, 2013 Contributor

done

@ralphschindler ralphschindler added a commit that referenced this pull request Nov 27, 2013
@ralphschindler ralphschindler PR #5538
Merge branch 'hotfix/db-create-temporary-table' of git://github.com/turrsis/zf2 into turrsis-hotfix/db-create-temporary-table

* 'hotfix/db-create-temporary-table' of git://github.com/turrsis/zf2:
  fix create temporary tables
87cf528
@ralphschindler ralphschindler added a commit that referenced this pull request Nov 27, 2013
@ralphschindler ralphschindler PR #5538
Merge branch 'turrsis-hotfix/db-create-temporary-table' into develop

* turrsis-hotfix/db-create-temporary-table:
  Added hook to SqlServer decorator for DDL\CreateTable
  fix create temporary tables
cc9f6d0
@ralphschindler ralphschindler merged commit 73b346e into zendframework:develop Nov 27, 2013

1 check failed

default The Travis CI build failed
Details
@turrsis turrsis deleted the unknown repository branch Jan 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment