Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table not found error is not returning TableNotFoundException for MSSQL #6747

Open
MaximilianGewers opened this issue Jan 28, 2025 · 0 comments

Comments

@MaximilianGewers
Copy link

MaximilianGewers commented Jan 28, 2025

Bug Report

Q A
Version My current 3.9.4 - but Also occurs on 4.2.2
Previous Version if the bug is a regression 3.8.2

Summary

I am using a MSSQL database (mcr.microsoft.com/mssql/server:2019-latest) and with Symfony (6.4). Symfony through doctrine has features that interact with the DB. Which have stopped working and my suspicion is a DBAL bug.

Current behavior

The first create and drop works as expected (the table does get created and dropped), however on the third drop (where I suspect the bug lies) a PDOException is being thrown with the message:

An exception occurred while executing a query: SQLSTATE[42S02]: [Microsoft]  
  [ODBC Driver 18 for SQL Server][SQL Server]Cannot drop the table 'schema_su  
  bscriber_check_4e0c48ec448e18', because it does not exist or you do not hav  
  e permission.

The this drop is surrounded by a try catch explicitly listening to a Doctrine\DBAL\Exception\TableNotFoundException. I am using a SA( System Admin) account and should not have any permission issues.

Expected behavior

I believe a Doctrine\DBAL\Exception\TableNotFoundException should be thrown in this case instead as the table is not found.

How to reproduce

A project with symfony and a MSSQL DB. Then run bin/console doctrine:schema:validate

composer.json

        "doctrine/annotations": "*",
        "doctrine/dbal": "^4.2",
        "doctrine/doctrine-bundle": "^2.13",
        "doctrine/doctrine-migrations-bundle": "^3.4",
        "doctrine/orm": "^3.3",
        "symfony/cache": "6.4.*",
        "symfony/console": "6.4.*",
        "symfony/debug-bundle": "6.4.*",
        "symfony/dotenv": "6.4.*",
        "symfony/flex": "^2.4",
        "symfony/framework-bundle": "6.4.*",
        "symfony/http-client": "6.4.*",
        "symfony/mailer": "6.4.*",
        "symfony/monolog-bundle": "^3.8",
        "symfony/property-access": "6.4.*",
        "symfony/property-info": "6.4.*",
        "symfony/proxy-manager-bridge": "6.4.*",
        "symfony/rate-limiter": "6.4.*",
        "symfony/runtime": "6.4.*",
        "symfony/security-bundle": "6.4.*",
        "symfony/serializer": "6.4.*",
        "symfony/stimulus-bundle": "^2.14",
        "symfony/uid": "6.4.*",
        "symfony/webpack-encore-bundle": "^2.1",
        "symfony/yaml": "6.4.*"

WIP - I am working on a way to share some code or a repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant