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

[DoctrineBridge] Fix issue which prevent the profiler to explain a query #16306

Closed
wants to merge 2 commits into from

Conversation

Baachi
Copy link
Contributor

@Baachi Baachi commented Oct 21, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

We currently develop a application which only use the doctrine/dbal and not the orm. And we run into a issue that the profiler can't explained any query.
This is because the SQLLogger will pass null instead of an empty array. And the sanitizeQuery method will currently transform this to array(null) which leads to an error.

I created an fork, so everyone can reproduce this.
https://github.com/Baachi/symfony-standard

$c = $this->createCollector($queries);
$c->collect(new Request(), new Response());

$collected_queries = $c->getQueries();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be camel cased: $collectedQueries.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed it's also snaked_cased in the other test case. Feel free to fix that one as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it in all testcases

@jakzal
Copy link
Contributor

jakzal commented Oct 26, 2015

👍 should be merged to 2.3

status: reviewed

@fabpot
Copy link
Member

fabpot commented Oct 28, 2015

Thank you @Baachi.

fabpot added a commit that referenced this pull request Oct 28, 2015
…xplain a query (Baachi)

This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16306).

Discussion
----------

[DoctrineBridge] Fix issue which prevent the profiler to explain a query

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

We currently develop a application which only use the doctrine/dbal and not the orm. And we run into a issue that the profiler can't explained any query.
This is because the `SQLLogger` will pass `null` instead of an empty array. And the `sanitizeQuery` method will currently transform this to `array(null)` which leads to an error.

I created an fork, so everyone can reproduce this.
https://github.com/Baachi/symfony-standard

Commits
-------

3490e98 [DoctrineBridge] Fix issue which prevent the profiler to explain a query
@fabpot fabpot closed this Oct 28, 2015
This was referenced Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants