diff -u b/core/includes/database.inc b/core/includes/database.inc --- b/core/includes/database.inc +++ b/core/includes/database.inc @@ -686,8 +686,13 @@ * The name of the table to be copied. * @param string $destination * The name for the new table. + * + * @return \Drupal\Core\Database\StatementInterface + * The result of the executed query. + * + * @see \Drupal\Core\Database\Schema::copyTable() */ -function db_copy_table($source, $destination) { +function db_copy_table_schema($source, $destination) { return Database::getConnection()->schema()->copyTable($source, $destination); } diff -u b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php --- b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php @@ -90,7 +90,7 @@ $this->assertTrue($index_exists, 'Index was renamed.'); // Copy the schema of the table. - db_copy_table('test_table2', 'test_table3'); + db_copy_table_schema('test_table2', 'test_table3'); // Index should be copied. $index_exists = Database::getConnection()->schema()->indexExists('test_table3', 'test_field'); @@ -102,24 +102,24 @@ $count = db_select('test_table3')->countQuery()->execute()->fetchField(); $this->assertEqual($count, 0, 'The new table has no content.'); - // Ensure that the proper exceptions are thrown for db_copy_table(). + // Ensure that the proper exceptions are thrown for db_copy_table_schema(). $fail = FALSE; try { - db_copy_table('test_table4', 'test_table5'); + db_copy_table_schema('test_table4', 'test_table5'); } catch (SchemaObjectDoesNotExistException $e) { $fail = TRUE; } - $this->assertTrue($fail, 'Ensure that db_copy_table throws an exception when the source table does not exists.'); + $this->assertTrue($fail, 'Ensure that db_copy_table_schema throws an exception when the source table does not exists.'); $fail = FALSE; try { - db_copy_table('test_table2', 'test_table3'); + db_copy_table_schema('test_table2', 'test_table3'); } catch (SchemaObjectExistsException $e) { $fail = TRUE; } - $this->assertTrue($fail, 'Ensure that db_copy_table throws an exception when the destination table does already exists.'); + $this->assertTrue($fail, 'Ensure that db_copy_table_schema throws an exception when the destination table does already exists.'); // We need the default so that we can insert after the rename. db_field_set_default('test_table2', 'test_field', 0);