Apparently Insert throws a constraint violation exception when a column is not found.

Comments

Berdir’s picture

core/lib/Drupal/Core/Database/Connection.php

        // Wrap the exception in another exception, because PHP does not allow
        // overriding Exception::getMessage(). Its message is the extra database
        // debug information.
        $query_string = ($query instanceof DatabaseStatementInterface) ? $stmt->getQueryString() : $query;
        $message = $e->getMessage() . ": " . $query_string . "; " . print_r($args, TRUE);
        // Match all SQLSTATE 23xxx errors.
        if (substr($e->getCode(), -6, -3) == '23') {
          $exception = new IntegrityConstraintViolationException($message, $e->getCode(), $e);
        }
        else {
          $exception = new DatabaseExceptionWrapper($message, 0, $e);
        }

Sounds we incorrectly (?) get a match here on a SQLSTATE 23xxx error?

chx’s picture

Column not found is 42S22 so you get 42 out of the substr which even in the twisted world of PHP is not == '23'. We need to investigate more why HEAD passes without the tags column in the cache table.

chx’s picture

Status: Active » Closed (cannot reproduce)