Skip to content

Commit 66f52cc

Browse files
committed
Merge remote-tracking branch 'falcon/MAGETWO-70061' into falcons-pr-bugfixes
2 parents d1e7899 + 8f75141 commit 66f52cc

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

lib/internal/Magento/Framework/DB/Ddl/Sequence.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,6 @@
1010
*/
1111
class Sequence
1212
{
13-
/**
14-
* Default table engine for sequences tables.
15-
*/
16-
const DEFAULT_ENGINE = 'INNODB';
17-
18-
/**
19-
* Database table engine for creating sequence table.
20-
*
21-
* @var string
22-
*/
23-
private $dbEngine;
24-
25-
/**
26-
* @param null $dbEngine The database table engine
27-
*/
28-
public function __construct($dbEngine = null)
29-
{
30-
$this->dbEngine = $dbEngine ?: self::DEFAULT_ENGINE;
31-
}
32-
3313
/**
3414
* Return SQL for create sequence
3515
*
@@ -48,9 +28,9 @@ public function getCreateSequenceDdl(
4828
$format = "CREATE TABLE %s (
4929
sequence_value %s %s NOT NULL AUTO_INCREMENT,
5030
PRIMARY KEY (sequence_value)
51-
) AUTO_INCREMENT = %d ENGINE = %s";
31+
) AUTO_INCREMENT = %d ENGINE = INNODB";
5232

53-
return sprintf($format, $name, $columnType, $unsigned ? 'UNSIGNED' : '', $startNumber, $this->dbEngine);
33+
return sprintf($format, $name, $columnType, $unsigned ? 'UNSIGNED' : '', $startNumber);
5434
}
5535

5636
/**

lib/internal/Magento/Framework/DB/Test/Unit/Ddl/SequenceTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ class SequenceTest extends \PHPUnit_Framework_TestCase
1212
{
1313
/**
1414
* @param array $params
15-
* @param string $engine
1615
* @param string $expectedQuery
1716
* @dataProvider createSequenceDdlDataProvider
1817
*/
19-
public function testGetCreateSequenceDdl(array $params, $engine, $expectedQuery)
18+
public function testGetCreateSequenceDdl(array $params, $expectedQuery)
2019
{
21-
$model = new Sequence($engine);
22-
$actualQuery = call_user_func_array([$model, 'getCreateSequenceDdl'], $params);
20+
$model = new Sequence();
21+
$actualQuery = $model->getCreateSequenceDdl(...array_values($params));
2322

2423
$cleanString = function ($string) {
2524
return trim(preg_replace('/\s+/', ' ', $string));
@@ -46,7 +45,6 @@ public function createSequenceDdlDataProvider()
4645
[
4746
'name' => 'someName'
4847
],
49-
null,
5048
'CREATE TABLE someName (
5149
sequence_value integer UNSIGNED NOT NULL AUTO_INCREMENT,
5250
PRIMARY KEY (sequence_value)
@@ -59,11 +57,10 @@ public function createSequenceDdlDataProvider()
5957
'columnType' => Table::TYPE_BIGINT,
6058
'unsigned' => false
6159
],
62-
'someEngine',
6360
'CREATE TABLE someName (
6461
sequence_value bigint NOT NULL AUTO_INCREMENT,
6562
PRIMARY KEY (sequence_value)
66-
) AUTO_INCREMENT = 123 ENGINE = someEngine'
63+
) AUTO_INCREMENT = 123 ENGINE = INNODB'
6764
]
6865
];
6966
}

0 commit comments

Comments
 (0)