only in patch2: unchanged: --- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php @@ -286,7 +286,7 @@ public function nextIdDelete() { // counter. try { $max_id = $this->query('SELECT MAX(value) FROM {sequences}')->fetchField(); - // We know we are using MySQL here, no need for the slower db_delete(). + // We know we are using MySQL here, no need for the slower \Drupal::database()->delete(). $this->query('DELETE FROM {sequences} WHERE value < :value', [':value' => $max_id]); } // During testing, this function is called from shutdown with the only in patch2: unchanged: --- a/core/lib/Drupal/Core/Database/database.api.php +++ b/core/lib/Drupal/Core/Database/database.api.php @@ -127,7 +127,7 @@ * INSERT, UPDATE, and DELETE queries need special care in order to behave * consistently across databases; you should never use db_query() to run * an INSERT, UPDATE, or DELETE query. Instead, use functions db_insert(), - * db_update(), and db_delete() to obtain a base query on your table, and then + * db_update(), and \Drupal::database()->delete() to obtain a base query on your table, and then * add dynamic conditions (as illustrated in @ref sec_dynamic above). * * As a note, db_insert() and similar functions are wrappers on connection only in patch2: unchanged: --- a/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php @@ -38,7 +38,7 @@ protected function update($name, $data) { } protected function delete($name) { - db_delete('config')->condition('name', $name)->execute(); + \Drupal::database()->delete('config')->condition('name', $name)->execute(); } } only in patch2: unchanged: --- a/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php @@ -27,7 +27,7 @@ public function testSubselectDelete() { $subquery = db_select('test', 't') ->fields('t', ['id']) ->condition('t.id', [$pid_to_delete], 'IN'); - $delete = db_delete('test_task') + $delete = \Drupal::database()->delete('test_task') ->condition('task', 'sleep') ->condition('pid', $subquery, 'IN'); @@ -44,7 +44,7 @@ public function testSubselectDelete() { public function testSimpleDelete() { $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $num_deleted = db_delete('test') + $num_deleted = \Drupal::database()->delete('test') ->condition('id', 1) ->execute(); $this->assertIdentical($num_deleted, 1, 'Deleted 1 record.'); @@ -72,7 +72,7 @@ public function testTruncate() { public function testSpecialColumnDelete() { $num_records_before = db_query('SELECT COUNT(*) FROM {test_special_columns}')->fetchField(); - $num_deleted = db_delete('test_special_columns') + $num_deleted = \Drupal::database()->delete('test_special_columns') ->condition('id', 1) ->execute(); $this->assertIdentical($num_deleted, 1, 'Deleted 1 special column record.');