CHECK TABLE output is reported too late in mysql error log

Bug #716879 reported by shinguz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBXT
Fix Committed
Undecided
Vladimir Kolesnikov

Bug Description

I have found the output of CHECK TABLE. It is written to the error
log. But only when I shut-down the database.

Version: 1.0.11-7 Pre-GA/MariaDB 5.2.4

Possible reason: PBXT reports these information with a printf command which reports to stdout/stderr. This is sent from mysqld to mysqld_safe which seems to cache somehow the output and just writes it at shutdown to the error log. But this is just a wild guess and I did not try this out.

In other parts of the code such information are written with the following function calls to the error log:

MySQL: sql_print_information(
InnoDB/XtraDB: fprintf(stderr,
PBXT: xt_logf(

What is the right way doing it I do not know. But I think it should be not too difficult to fix it. Maybe I can write a patch for this...

Anyway I think this the wrong way doing it. See also my "dreams" in the next part.

110208 21:27:30 [Note] Event Scheduler: Purging the queue. 0 events
110208 21:27:31 InnoDB: Starting shutdown...
110208 21:27:32 InnoDB: Shutdown completed; log sequence number 35865713

CHECK TABLE: ./foodmart/sales_fact
Record buffer size = 40
Fixed length rec. len. = 35
Handle data record size = 49
Min/max header size = 14/14
Min/avg/max record size = 42/42/42
Avg row len set for tab = not specified
Rows fixed length = YES
Maximum fixed size = 16384
Minimum variable size = 320
Minimum auto-increment = 0
Number of columns = 8
Number of fixed columns = 0
Columns req. for index = 5
Rec len req. for index = 21
Columns req. for blobs = 0
Number of blob columns = 0
Number of indices = 5
Minumum comp. rec. len. = 42
Average comp. rec. len. = 42
Maximum comp. rec. len. = 42
Free record count = 0
Deleted record count = 0
Allocated record count = 269720
110208 21:27:32 [Note] PrimeBase XT Engine shutdown...
110208 21:27:32 [Note] ./bin/mysqld: Shutdown complete

Revision history for this message
shinguz (oli-sennhauser) wrote :
Download full text (6.9 KiB)

Related to this bug I was dreaming: We live in a relational world. So everything should be a table...

Instead of writing those information to the error log (which does not even happen because of the bug) I would like to have written them in a table.

CHECK TABLE imho is anway the wrong command. I would prefer the ANALZYE TABLE command instead (but this is a detail).

So what I would like to have is:

ANALYZE TABLE foodmart.product;

and then:

SELECT * from pbxt.table_statistics;
+---------------+--------------+------------+--------------------+----------------------------+-------------------------+-----------------+-----------------+-----------------+-----------------+-----------------+----------------+-------------------+----------------+-------------------+--------------------+-------------------+-------------------------+----------------------------+----------------------------------+----------------------------+------------------------+-------------------+----------------------+-----------------------+---------------------------+---------------------------+---------------------------+-------------------+----------------------+------------------------+
| Table_catalog | Table_schema | Table_name | Record_buffer_size | Fixed_length_record_length | Handle_data_record_size | Min_header_size | Max_header_size | Min_record_size | Avg_record_size | Max_record_size | Avg_row_length | Rows_fixed_length | Max_fixed size | Min_variable size | Min_auto_increment | Number_of_columns | Number_of_fixed_columns | Columns_required_for_index | Record_length_required_for_index | Columns_required_for_blobs | Number_of_blob_columns | Number_of_indices | Extended_data_length | Extended_record_count | Min_compare_record_length | Avg_compare_record_length | Max_compare_record_length | Free_record_count | Deleted_record_count | Allocated_record_count |
+---------------+--------------+------------+--------------------+----------------------------+-------------------------+-----------------+-----------------+-----------------+-----------------+-----------------+----------------+-------------------+----------------+-------------------+--------------------+-------------------+-------------------------+----------------------------+----------------------------------+----------------------------+------------------------+-------------------+----------------------+-----------------------+---------------------------+---------------------------+---------------------------+-------------------+----------------------+------------------------+
| NULL | foodmart | product | 192 | 191 | 205 | 14 | 14 | 82 | 202 | 202 | NULL | YES | 16384 | 320 | 0 | 15 | 0 | 5 | 140 | 0 | 0 | 5 | NULL | NULL | 93 | 112 | 138 | 0 | ...

Read more...

Revision history for this message
shinguz (oli-sennhauser) wrote :

I have written a patch for this problem.
It seems to work. It writes the message immediately to the MySQL error.log
If it is the way you want to have it is up to you.

I was just searching the whole code and found, that there are 222 other places where there is just a printf instead of a xt_log. If you want me to make a patch for this as well please let me know.

Revision history for this message
shinguz (oli-sennhauser) wrote :

forgot to mention: the patch was built and tested against mysql 5.1.54/pbxt 2.0.01

Changed in pbxt:
status: New → Fix Committed
assignee: nobody → Vladimir Kolesnikov (vkolesnikov)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.