Skip to content

False positive for "Using nullable columns (xxx) in a primary key index is deprecated."? #12119

@k00ni

Description

@k00ni

Bug Report

Q A
Version 4.3.2

Summary

When running PHPUnit tests it shows false-positive deprecation warnings triggered by DBAL. I hope this is the correct repository, because this currently happens when also using Doctrine.

Ref: doctrine/dbal#6787

Current behavior

It triggers deprecation warnings, even though related tables don't match the criteria.

Image

Here as text:

Remaining indirect deprecation notices (4)

  1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

All mentioned columns are being defined as NOT NULL, for instance:

Image

Expected behavior

No deprecation warnings at all.

How to reproduce

I added a reproducer:

https://github.com/k00ni/dbal-nullable-columns-primary-key

There is a basic workflow to demonstrate the deprecations:

https://github.com/k00ni/dbal-nullable-columns-primary-key/actions/runs/16804524077/job/47593473139#step:9:127

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions