However, at least for mysql, this doesn't include initialization or
session management SQL queries.
Using wireshark I see a number of extra queries, that are never logged,
like:
{{{
SET NAMES utf8
set autocommit=0
SET SQL_AUTO_IS_NULL = 0
set autocommit=1
set autocommit=0
rollback
set autocommit=1
}}}
I assume "commit" is also on this list, however not part of this test.
Being able to see all the queries is important in order to debug obscure
problems.
Thanks
--
Ticket URL: <https://code.djangoproject.com/ticket/21484>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I think for most use cases this would just add more noise to the logs. You
can always turn on query logging at the database level if you need it.
I'll leave this open for a second opinion and perhaps we can make a
documentation update to note this limitation if we don't change the
behavior.
--
Ticket URL: <https://code.djangoproject.com/ticket/21484#comment:1>
* component: Database layer (models, ORM) => Documentation
* stage: Unreviewed => Accepted
Comment:
In my opinion, the SQL logger aims at providing "application-level"
debugging. It answers the question "what queries does my application
emit?". The queries you're mentionning are "framework-level". If your
question is "what queries does my database receive?", like Tim, I suggest
turning on the database's query logging.
--
Ticket URL: <https://code.djangoproject.com/ticket/21484#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/21484#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"4d8d76e7a89858932b6f4f280a0ebf4cf94ab4b7"]:
{{{
#!CommitTicketReference repository=""
revision="4d8d76e7a89858932b6f4f280a0ebf4cf94ab4b7"
Fixed #21484 -- Documented that SQL logging does not include "framework
level" queries.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21484#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"a228545026e30d3223b3fbb13a262b5e005101ae"]:
{{{
#!CommitTicketReference repository=""
revision="a228545026e30d3223b3fbb13a262b5e005101ae"
[1.6.x] Fixed #21484 -- Documented that SQL logging does not include
"framework level" queries.
Backport of 4d8d76e7a8 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21484#comment:5>