| <?php |
|
|
| |
| |
| |
| |
| |
| |
|
|
| namespace Piwik\Db\Schema; |
|
|
| |
| |
| |
| class Tidb extends Mysql |
| { |
| public function getDatabaseType(): string |
| { |
| return 'TiDb'; |
| } |
|
|
| |
| |
| |
| |
| public function supportsComplexColumnUpdates(): bool |
| { |
| return false; |
| } |
|
|
| public function getDefaultCollationForCharset(string $charset): string |
| { |
| $collation = parent::getDefaultCollationForCharset($charset); |
|
|
| if ('utf8mb4' === $charset && 'utf8mb4_bin' === $collation) { |
| |
| return 'utf8mb4_0900_ai_ci'; |
| } |
|
|
| return $collation; |
| } |
|
|
| public function getDefaultPort(): int |
| { |
| return 4000; |
| } |
|
|
| public function getTableCreateOptions(): string |
| { |
| $engine = $this->getTableEngine(); |
| $charset = $this->getUsedCharset(); |
| $collation = $this->getUsedCollation(); |
| $rowFormat = $this->getTableRowFormat(); |
|
|
| if ('utf8mb4' === $charset && '' === $collation) { |
| $collation = 'utf8mb4_0900_ai_ci'; |
| } |
|
|
| $options = "ENGINE=$engine DEFAULT CHARSET=$charset"; |
|
|
| if ('' !== $collation) { |
| $options .= " COLLATE=$collation"; |
| } |
|
|
| if ('' !== $rowFormat) { |
| $options .= " $rowFormat"; |
| } |
|
|
| return $options; |
| } |
|
|
| public function isOptimizeInnoDBSupported(): bool |
| { |
| return false; |
| } |
|
|
| public function optimizeTables(array $tables, bool $force = false): bool |
| { |
| |
| return false; |
| } |
|
|
| public function supportsSortingInSubquery(): bool |
| { |
| |
| return false; |
| } |
|
|
| public function getSupportedReadIsolationTransactionLevel(): string |
| { |
| |
| return 'READ COMMITTED'; |
| } |
|
|
| public function hasReachedEOL(): bool |
| { |
| |
| return false; |
| } |
| } |
|
|