mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
[ticket/17524] test index key length only on MySQL where it does apply
PHPBB-17524
This commit is contained in:
parent
83c6ffce64
commit
993e637af9
1 changed files with 3 additions and 2 deletions
|
@ -409,6 +409,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||||
$this->assertTrue($this->db_tools->sql_table_exists('phpbb_foobar'));
|
$this->assertTrue($this->db_tools->sql_table_exists('phpbb_foobar'));
|
||||||
|
|
||||||
$index_data_row = $this->db_tools->sql_get_table_index_data('phpbb_foobar');
|
$index_data_row = $this->db_tools->sql_get_table_index_data('phpbb_foobar');
|
||||||
|
$mysql = $this->db->get_sql_layer() === 'mysqli'; // Index length only applies to MySQL indexes
|
||||||
foreach ($index_data_row as $index_name => $index_data)
|
foreach ($index_data_row as $index_name => $index_data)
|
||||||
{
|
{
|
||||||
switch ($index_name)
|
switch ($index_name)
|
||||||
|
@ -421,7 +422,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||||
$this->assertTrue($index_data['is_simple']);
|
$this->assertTrue($index_data['is_simple']);
|
||||||
$this->assertEquals(2, count($index_data['options']['lengths']));
|
$this->assertEquals(2, count($index_data['options']['lengths']));
|
||||||
$this->assertEmpty($index_data['options']['lengths'][0]);
|
$this->assertEmpty($index_data['options']['lengths'][0]);
|
||||||
$this->assertEquals(191, $index_data['options']['lengths'][1]);
|
$this->assertEquals($mysql ? 191 : null, $index_data['options']['lengths'][1]);
|
||||||
break;
|
break;
|
||||||
case 'i_uniq':
|
case 'i_uniq':
|
||||||
$this->assertEquals(['expiration_time', 'p256dh'], $index_data['columns']);
|
$this->assertEquals(['expiration_time', 'p256dh'], $index_data['columns']);
|
||||||
|
@ -431,7 +432,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||||
$this->assertFalse($index_data['is_simple']);
|
$this->assertFalse($index_data['is_simple']);
|
||||||
$this->assertEquals(2, count($index_data['options']['lengths']));
|
$this->assertEquals(2, count($index_data['options']['lengths']));
|
||||||
$this->assertEmpty($index_data['options']['lengths'][0]);
|
$this->assertEmpty($index_data['options']['lengths'][0]);
|
||||||
$this->assertEquals(100, $index_data['options']['lengths'][1]);
|
$this->assertEquals($mysql ? 100 : null, $index_data['options']['lengths'][1]);
|
||||||
break;
|
break;
|
||||||
case 'i_auth':
|
case 'i_auth':
|
||||||
$this->assertEquals(['auth'], $index_data['columns']);
|
$this->assertEquals(['auth'], $index_data['columns']);
|
||||||
|
|
Loading…
Add table
Reference in a new issue