| @@ 420-431 (lines=12) @@ | ||
| 417 | return 32704; |
|
| 418 | } |
|
| 419 | ||
| 420 | public function testReturnsBinaryTypeDeclarationSQL() |
|
| 421 | { |
|
| 422 | self::assertSame('VARBINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array())); |
|
| 423 | self::assertSame('VARBINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 0))); |
|
| 424 | self::assertSame('VARBINARY(32704)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 32704))); |
|
| 425 | self::assertSame('BLOB(1M)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 32705))); |
|
| 426 | ||
| 427 | self::assertSame('BINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true))); |
|
| 428 | self::assertSame('BINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 0))); |
|
| 429 | self::assertSame('BINARY(32704)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 32704))); |
|
| 430 | self::assertSame('BLOB(1M)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 32705))); |
|
| 431 | } |
|
| 432 | ||
| 433 | /** |
|
| 434 | * @group DBAL-234 |
|
| @@ 784-795 (lines=12) @@ | ||
| 781 | return 32767; |
|
| 782 | } |
|
| 783 | ||
| 784 | public function testReturnsBinaryTypeDeclarationSQL() |
|
| 785 | { |
|
| 786 | self::assertSame('VARBINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array())); |
|
| 787 | self::assertSame('VARBINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 0))); |
|
| 788 | self::assertSame('VARBINARY(32767)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 32767))); |
|
| 789 | self::assertSame('LONG BINARY', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 32768))); |
|
| 790 | ||
| 791 | self::assertSame('BINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true))); |
|
| 792 | self::assertSame('BINARY(1)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 0))); |
|
| 793 | self::assertSame('BINARY(32767)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 32767))); |
|
| 794 | self::assertSame('LONG BINARY', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 32768))); |
|
| 795 | } |
|
| 796 | ||
| 797 | /** |
|
| 798 | * @group DBAL-234 |
|
| @@ 923-934 (lines=12) @@ | ||
| 920 | return 8000; |
|
| 921 | } |
|
| 922 | ||
| 923 | public function testReturnsBinaryTypeDeclarationSQL() |
|
| 924 | { |
|
| 925 | self::assertSame('VARBINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array())); |
|
| 926 | self::assertSame('VARBINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 0))); |
|
| 927 | self::assertSame('VARBINARY(8000)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 8000))); |
|
| 928 | self::assertSame('VARBINARY(MAX)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 8001))); |
|
| 929 | ||
| 930 | self::assertSame('BINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true))); |
|
| 931 | self::assertSame('BINARY(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 0))); |
|
| 932 | self::assertSame('BINARY(8000)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 8000))); |
|
| 933 | self::assertSame('VARBINARY(MAX)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 8001))); |
|
| 934 | } |
|
| 935 | ||
| 936 | /** |
|
| 937 | * @group DBAL-234 |
|
| @@ 439-450 (lines=12) @@ | ||
| 436 | return 2000; |
|
| 437 | } |
|
| 438 | ||
| 439 | public function testReturnsBinaryTypeDeclarationSQL() |
|
| 440 | { |
|
| 441 | self::assertSame('RAW(255)', $this->_platform->getBinaryTypeDeclarationSQL(array())); |
|
| 442 | self::assertSame('RAW(2000)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 0))); |
|
| 443 | self::assertSame('RAW(2000)', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 2000))); |
|
| 444 | self::assertSame('BLOB', $this->_platform->getBinaryTypeDeclarationSQL(array('length' => 2001))); |
|
| 445 | ||
| 446 | self::assertSame('RAW(255)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true))); |
|
| 447 | self::assertSame('RAW(2000)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 0))); |
|
| 448 | self::assertSame('RAW(2000)', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 2000))); |
|
| 449 | self::assertSame('BLOB', $this->_platform->getBinaryTypeDeclarationSQL(array('fixed' => true, 'length' => 2001))); |
|
| 450 | } |
|
| 451 | ||
| 452 | public function testDoesNotPropagateUnnecessaryTableAlterationOnBinaryType() |
|
| 453 | { |
|