db-tools.php dump creates fixtures that are incompatible with MariaDB

Created on 28 August 2021, over 3 years ago
Updated 11 February 2023, almost 2 years ago

Problem/Motivation

Running db-tools.php export creates a fixture that seems to be incompatible with MariaDB 10.3 as used in ddev. This is what the top of the fixture looks like:

<?php
// phpcs:ignoreFile
/**
 * @file
 * A database agnostic dump for testing purposes.
 *
 * This file was generated by the Drupal 9.3.0-dev db-tools.php script.
 */

use Drupal\Core\Database\Database;

$connection = Database::getConnection();
// Ensure any tables with a serial column with a value of 0 are created as
// expected.
$sql_mode = $connection->query("SELECT @@sql_mode;")->fetchField();
$connection->query("SET sql_mode = '$sql_mode,NO_AUTO_VALUE_ON_ZERO'");

At the end of the file this is added:

// Reset the SQL mode.
$connection->query("SET sql_mode = '$sql_mode'");

Steps to reproduce

Update a fixture file using ddev 1.17.x on a D 9.3.x codebase.

Proposed resolution

Work out if there's a way of doing this that is compatible with MariaDB.

Remaining tasks

Work out the problem.

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

πŸ› Bug report
Status

Closed: outdated

Version

10.1 ✨

Component
DatabaseΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024