Hi there.

SchemaTest has some problems with not MySQL database.
For example I work to port Oracle Driver for D8 now, and this test fails.

1) Function db_copy_table_schema is fully supported only by MySQL.
We need to allow other database drivers pass this test.
See #2056133: Add db_copy_table_schema

2) Method SchemaTest::testSchema() have wrong implementation of database specific data type.
If we do not set 'type' param in field specification test will pass only with core database drivers.

3) Precision range for fields with numeric types is hardcoded in SchemaTest::testSchemaAddField() method.
Precision range is not the same in different databases:
- MySQL has a range of 1 to 65;
- PgSQL allow up to 1000 digits;
- Oracle limited to 38 digits.

Comments

andypost’s picture

  1. +++ b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
    @@ -315,8 +324,12 @@ function testSchemaAddField() {
    +    // Precision range is not the same in different databases:
    +    // - MySQL has a range of 1 to 65;
    +    // - PgSQL allow up to 1000 digits;
    +    // - Oracle limited to 38 digits.
    

    we need mention sqlite here because it's a core test

  2. +++ b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
    @@ -162,6 +170,7 @@ function testSchema() {
    +          'type' => 'timestamp',
    

    nice catch

  3. +++ b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
    @@ -89,37 +89,45 @@ function testSchema() {
    -    // Copy the schema of the table.
    -    db_copy_table_schema('test_table2', 'test_table3');
    

    suppose this shows us that bug exists in implementation
    Not sure that hidding it makes sense

jhedstrom’s picture

Status: Needs review » Needs work

Needs work per #1.

bojanz’s picture

Is this a duplicate of #2061879: Remove Schema::copyTable, or is there more work that needs to happen?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

daffie’s picture

Status: Needs work » Closed (outdated)

The SchemaTest passes for all supported databases.