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

v2.10.2 - SQLSTATE[HY000]: General error: Extraneous additional parameters #3975

Closed
oojacoboo opened this issue Apr 22, 2020 · 11 comments · Fixed by #4173
Closed

v2.10.2 - SQLSTATE[HY000]: General error: Extraneous additional parameters #3975

oojacoboo opened this issue Apr 22, 2020 · 11 comments · Fixed by #4173

Comments

@oojacoboo
Copy link

Bug Report

When using the Doctrine PDO connection object to bind params to a prepared statement, the following error is being caused.

SQLSTATE[HY000]: General error: Extraneous additional parameters

This issue did not exist with 2.10.1. I also believe it's related to $stmt->fetchAll(\PDO::FETCH_ASSOC).

Q A
Version 2.10.2
@greg0ire
Copy link
Member

Here is the list of changes between the 2 versions: v2.10.1...2.10.2

Do you think it might have to do with 24cefe5 ?

Is there a stack trace you could share?

@oojacoboo
Copy link
Author

Here is the trace:

[
  ...
  {
      "file": "/srv/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php",
      "line": 252,
      "function": "fetchAll",
      "class": "PDOStatement",
      "type": "->",
      "args": [
        2,
        null,
        null
      ]
    }
  ],
  "message": "SQLSTATE[HY000]: General error: Extraneous additional parameters",
  "file": "/srv/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php",
  "line": 252,
  "class": "PDOException",
  "user": [],
  "tags": [],
  "extra": [],
  "timestamp": "2020-04-22 18:28:31 UTC",
  "level": "critical",
  "environment": "dev",
  "app_version": "4.0.0-stage+20200419180027"
}

And yes, that could certainly be related. It looks like Propel dealt with an issue related to this years ago- found some issues on github.

@greg0ire
Copy link
Member

greg0ire commented Apr 23, 2020

Possible next steps:

  • Confirming that by editing the code and just removing the 3rd argument
  • Checking the PDOStatement::fetchAll() docs to see if there is anything about this
  • Contributing a PR that passes the third argument only when necessary, depending on the first one

@Carpenter0100
Copy link

Carpenter0100 commented Apr 24, 2020

I am running into the same issue and can confirm that this PR is the cause: 24cefe5

edit:
Only pass fetchArgument AND ctorArgs if it is not null.

@greg0ire
Copy link
Member

@duncan3dc please have a look at this

@DanielSchwiperich
Copy link

Can also confirm and set a conflict for 2.10.2 in composer.json which fixed our pipeline so far

@grzegorztomasiak

This comment has been minimized.

@DanielSchwiperich
Copy link

Problem still existis in 2.10.3 released today.

So far this helps

"conflict": {
    "doctrine/dbal": "2.10.2|2.10.3"
  },

@bytehead
Copy link

The problem still exists in 2.10.4.

"conflict": {
    "doctrine/dbal": "2.10.2|2.10.3|2.10.4"
  },

@bytehead
Copy link

thank you @morozov and @BenMorel! 🎉

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants