Bug #17368 General log and slow query log don't work
Submitted: 14 Feb 2006 10:04 Modified: 4 May 2006 15:49
Reporter: Markus Popp Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.6/5.1.7 BK OS:Microsoft Windows (Windows XP)
Assigned to: Magnus Blåudd CPU Architecture:Any

[14 Feb 2006 10:04] Markus Popp
Description:
If you enable general log and slow query log in my.ini by

[mysqld]
log
log-slow-queries

there's no logging, neither in the file system (data directory), nor in the mysql.general_log and mysql.slow_log tables (which don't exist).

How to repeat:
see above

Suggested fix:
As with MySQL 5.1.7-beta with Linux, the general log and the slow query log should be stored in the mysql.general_log and mysql.slow_log tables.
[14 Feb 2006 18:27] Miguel Solorzano
I was able to repeat only on Windows even when started from the
shell prompt.
[14 Feb 2006 18:33] Markus Popp
That's correct - just as Bug 17367, this is specific to Windows.
[28 Feb 2006 15:20] Magnus Blåudd
The csv storage engine which is needed to log to table is not in the windows version. It will have to be added.
[1 Mar 2006 20:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/3348
[1 Mar 2006 20:21] Magnus Blåudd
This also causes the following failure of "event_slow_query" on windows.

events_slow_query              [ fail ]

Errors are (from C:/cygwin/home/mysqldev/pb/mysql-5.1-new/push-lars@mysql.com-20060301173527.info/mysql-5.1.8-beta-standard/mysql-test/var-n_stm-5/log/mysqltest-time) :
mysqltest: At line 27: query 'TRUNCATE mysql.slow_log' failed: 1146: Table 'mysql.slow_log' doesn't exist
(the last lines may be the most important ones)

Ending Tests
Shutting-down MySQL daemon
[21 Mar 2006 14:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/3994
[5 Apr 2006 8:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4476
[27 Apr 2006 20:08] Magnus Blåudd
CSV storage engine is now enabled in Windows builds
[29 Apr 2006 16:50] Patrick Galbraith
Is there a way to log to a file? I truly believe that this should still be an option. I'm tracing queries against the database for testing DBD::mysql, and tailing the CSV file is less than desireable.

Also, only "Execute" is shown in the log, "Prepare" is still empty.
[2 May 2006 7:06] Magnus Blåudd
Patch was pushed to 5.1.10
[4 May 2006 15:49] Paul Dubois
Noted in 5.1.10 changelog.

Logging to the <literal>mysql.general_log</literal> and
<literal>mysql.slow_log</literal> tables did not work for
Windows builds because the <literal>CSV</literal> storage
engine was unavailable. The <literal>CSV</literal> engine now
is enabled in Windows builds. (Bug #17368)