diff options
author | Kamil Tekiela <tekiela246@gmail.com> | 2022-11-07 02:10:07 +0300 |
---|---|---|
committer | Kamil Tekiela <tekiela246@gmail.com> | 2022-11-08 03:32:09 +0300 |
commit | 1f4f414b404954a92cdff5b51ec0865ab182074a (patch) | |
tree | da3af49c7bfa2abd28c1d487367491af679ad744 | |
parent | 4405b8afa42ad4057189a48b1ab6ca14d04403fc (diff) |
Fix wrong type for keyBlockSizes
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
-rw-r--r-- | libraries/classes/Index.php | 8 | ||||
-rw-r--r-- | libraries/classes/Table.php | 7 |
2 files changed, 5 insertions, 10 deletions
diff --git a/libraries/classes/Index.php b/libraries/classes/Index.php index 94cb50b641..13482ec6d9 100644 --- a/libraries/classes/Index.php +++ b/libraries/classes/Index.php @@ -88,7 +88,7 @@ class Index * * @var int */ - private $keyBlockSize = null; + private $keyBlockSize = 0; /** * Parser option for the index @@ -341,7 +341,7 @@ class Index } if (isset($params['Key_block_size'])) { - $this->keyBlockSize = $params['Key_block_size']; + $this->keyBlockSize = (int) $params['Key_block_size']; } if (! isset($params['Parser'])) { @@ -383,10 +383,8 @@ class Index /** * Return the key block size - * - * @return int */ - public function getKeyBlockSize() + public function getKeyBlockSize(): int { return $this->keyBlockSize; } diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index a7f6e19f39..45d695d94b 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -2125,11 +2125,8 @@ class Table implements Stringable } $keyBlockSizes = $index->getKeyBlockSize(); - if (! empty($keyBlockSizes)) { - $sqlQuery .= sprintf( - ' KEY_BLOCK_SIZE = %s', - $this->dbi->escapeString((string) $keyBlockSizes) - ); + if ($keyBlockSizes !== 0) { + $sqlQuery .= ' KEY_BLOCK_SIZE = ' . $keyBlockSizes; } // specifying index type is allowed only for primary, unique and index only |