diff options
author | unknown <marko@hundin.mysql.fi> | 2004-04-06 16:14:43 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-04-06 16:14:43 +0300 |
commit | 80fe399fee3a7752aecdfc888edfcf56a2be7b0a (patch) | |
tree | f7bc427aa7ce4a54802d6e8931ca1dfe64c7bfa8 /innobase/ibuf | |
parent | d809c4413e9f991bde407690aafdaaa3eaae9232 (diff) | |
download | mariadb-git-80fe399fee3a7752aecdfc888edfcf56a2be7b0a.tar.gz |
InnoDB: send diagnostic output to stderr or files
instead of stdout or fixed-size memory buffers
innobase/btr/btr0btr.c:
Output to stderr; quote table and index names
innobase/btr/btr0cur.c:
Output to stderr; quote table and index names
innobase/btr/btr0sea.c:
Output to stderr
innobase/buf/buf0buf.c:
Output to stderr; quote table and index names
innobase/buf/buf0flu.c:
Output to stderr
innobase/buf/buf0lru.c:
Output to stderr
innobase/buf/buf0rea.c:
Output to stderr
innobase/data/data0data.c:
Remove dtuple_validate() unless #ifdef UNIV_DEBUG
Remove unnecessary sprintf() calls
Output to stderr
innobase/data/data0type.c:
Output to stderr
innobase/dict/dict0boot.c:
Remove dummy call to printf()
innobase/dict/dict0crea.c:
Output diagnostic information to stream, not to memory
innobase/dict/dict0dict.c:
Output diagnostics to a file, not to a memory buffer
innobase/dict/dict0load.c:
Output to stderr; quote table and index names
innobase/eval/eval0eval.c:
Output to stderr
innobase/fil/fil0fil.c:
Output to stderr
innobase/fsp/fsp0fsp.c:
Output to stderr
Avoid sprintf()
innobase/fut/fut0lst.c:
Output to stderr
innobase/ha/ha0ha.c:
Output to stream, not to memory buffer
innobase/ibuf/ibuf0ibuf.c:
Output to stderr
Avoid sprintf()
innobase/include/buf0buf.h:
Output to stream, not to memory buffer
innobase/include/buf0buf.ic:
Use %p for displaying pointers
innobase/include/data0data.h:
Remove dtuple_sprintf()
innobase/include/dict0dict.h:
Output to stream, not to memory buffer
innobase/include/ha0ha.h:
Output to stream, not to memory buffer
innobase/include/ibuf0ibuf.h:
Output to stream, not to memory buffer
innobase/include/lock0lock.h:
Output to stream, not to memory buffer
innobase/include/log0log.h:
Output to stream, not to memory buffer
innobase/include/mtr0log.ic:
Output to stderr
Display pointers with %p
innobase/include/os0file.h:
Output to stream, not to memory buffer
innobase/include/rem0rec.h:
Remove rec_sprintf()
innobase/include/rem0rec.ic:
Output to stderr
innobase/include/row0sel.ic:
Output to stderr
innobase/include/row0upd.ic:
Quote table and index names
innobase/include/srv0srv.h:
Remove srv_sprintf_innodb_monitor()
innobase/include/sync0arr.h:
Output to stream, not to memory buffer
innobase/include/sync0sync.h:
Output to stream, not to memory buffer
innobase/include/trx0sys.h:
Output to stderr
innobase/include/trx0trx.h:
Output to stream, not to memory buffer
innobase/include/ut0ut.h:
Remove ut_sprintf_buf()
Add ut_print_name(), ut_print_namel() and ut_copy_file()
innobase/lock/lock0lock.c:
Output to stream, not to memory buffer
innobase/log/log0log.c:
Output to stderr
innobase/log/log0recv.c:
Output to stderr
innobase/mem/mem0dbg.c:
Output to stderr
innobase/mtr/mtr0log.c:
Display pointers with %p
innobase/mtr/mtr0mtr.c:
Output to stderr
innobase/os/os0file.c:
Output to stream, not to memory buffer
innobase/os/os0proc.c:
Output to stderr
innobase/os/os0thread.c:
Output to stderr
innobase/page/page0cur.c:
Output to stderr
innobase/page/page0page.c:
Avoid sprintf()
Output to stderr instead of stdout
innobase/pars/pars0opt.c:
Output to stderr instead of stdout
innobase/rem/rem0rec.c:
Remove rec_sprintf()
Output to stderr instead of stdout
innobase/row/row0ins.c:
Output diagnostics to stream instead of memory buffer
innobase/row/row0mysql.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0purge.c:
Output to stderr instead of stdout
innobase/row/row0row.c:
Quote table and index names
innobase/row/row0sel.c:
Output to stderr instead of stdout
Quote table and index names
innobase/row/row0umod.c:
Avoid sprintf()
Quote table and index names
innobase/row/row0undo.c:
Output to stderr instead of stdout
innobase/row/row0upd.c:
Avoid sprintf()
innobase/srv/srv0srv.c:
Output to stderr instead of stdout
innobase/srv/srv0start.c:
Handle srv_monitor_file
Make some global variables static
innobase/sync/sync0arr.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/sync/sync0rw.c:
Output to stderr instead of stdout
innobase/sync/sync0sync.c:
Output to stderr instead of stdout
Output to stream instead of memory buffer
innobase/trx/trx0purge.c:
Output to stderr instead of stdout
innobase/trx/trx0rec.c:
Quote index and table names
Avoid sprintf()
innobase/trx/trx0roll.c:
Quote identifier names
Output to stderr instead of stdout
innobase/trx/trx0sys.c:
Output to stderr instead of stdout
innobase/trx/trx0trx.c:
Output to stream instead of memory buffer
innobase/trx/trx0undo.c:
Output to stderr instead of stdout
innobase/ut/ut0ut.c:
Declare mysql_get_identifier_quote_char()
Remove ut_sprintf_buf()
Add ut_print_name() and ut_print_namel()
Add ut_copy_file()
sql/ha_innodb.cc:
innobase_mysql_print_thd(): output to stream, not to memory buffer
Add mysql_get_identifier_quote_char()
Remove unused function innobase_print_error()
Display pointers with %p
Buffer InnoDB output via files, not via statically allocated memory
Diffstat (limited to 'innobase/ibuf')
-rw-r--r-- | innobase/ibuf/ibuf0ibuf.c | 112 |
1 files changed, 51 insertions, 61 deletions
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index 0af47a8ccc2..2745af42ff7 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -409,7 +409,7 @@ ibuf_data_sizes_update( ibuf->size = ibuf->size + data->size - old_size; -/* printf("ibuf size %lu, space ibuf size %lu\n", ibuf->size, +/* fprintf(stderr, "ibuf size %lu, space ibuf size %lu\n", ibuf->size, data->size); */ } @@ -438,7 +438,7 @@ ibuf_data_init_for_space( #ifdef UNIV_LOG_DEBUG if (space % 2 == 1) { - printf("No ibuf op in replicate space\n"); + fputs("No ibuf op in replicate space\n", stderr); return(NULL); } @@ -728,7 +728,8 @@ ibuf_set_free_bits_low( bitmap_page = ibuf_bitmap_get_map_page(buf_frame_get_space_id(page), buf_frame_get_page_no(page), mtr); #ifdef UNIV_IBUF_DEBUG - /* printf("Setting page no %lu free bits to %lu should be %lu\n", + /* fprintf(stderr, + "Setting page no %lu free bits to %lu should be %lu\n", buf_frame_get_page_no(page), val, ibuf_index_page_calc_free(page)); */ @@ -782,7 +783,7 @@ ibuf_set_free_bits( buf_frame_get_page_no(page), IBUF_BITMAP_FREE, &mtr); if (old_val != max_val) { - /* printf( + /* fprintf(stderr, "Ibuf: page %lu old val %lu max val %lu\n", buf_frame_get_page_no(page), old_val, max_val); */ } @@ -791,7 +792,7 @@ ibuf_set_free_bits( #endif } #ifdef UNIV_IBUF_DEBUG -/* printf("Setting page no %lu free bits to %lu should be %lu\n", +/* fprintf(stderr, "Setting page no %lu free bits to %lu should be %lu\n", buf_frame_get_page_no(page), val, ibuf_index_page_calc_free(page)); */ @@ -970,7 +971,7 @@ ibuf_page_low( #ifdef UNIV_LOG_DEBUG if (space % 2 != 0) { - printf("No ibuf in a replicate space\n"); + fputs("No ibuf in a replicate space\n", stderr); return(FALSE); } @@ -1481,7 +1482,8 @@ ibuf_free_excess_pages( /* Not yet initialized */ #ifdef UNIV_DEBUG - /*printf("Ibuf for space %lu not yet initialized\n", space); */ + /*fprintf(stderr, + "Ibuf for space %lu not yet initialized\n", space); */ #endif return; @@ -1645,7 +1647,7 @@ ibuf_get_merge_page_nos( #ifdef UNIV_IBUF_DEBUG ut_a(*n_stored <= IBUF_MAX_N_PAGES_MERGED); #endif -/* printf("Ibuf merge batch %lu pages %lu volume\n", *n_stored, +/* fprintf(stderr, "Ibuf merge batch %lu pages %lu volume\n", *n_stored, sum_volumes); */ return(sum_volumes); } @@ -1751,8 +1753,8 @@ loop: page_nos, &n_stored); #ifdef UNIV_IBUF_DEBUG - /* printf("Ibuf contract sync %lu pages %lu volume %lu\n", sync, - n_stored, sum_sizes); */ + /* fprintf(stderr, "Ibuf contract sync %lu pages %lu volume %lu\n", + sync, n_stored, sum_sizes); */ #endif ibuf_exit(); @@ -2074,7 +2076,7 @@ ibuf_insert_low( mutex_exit(&ibuf_mutex); #ifdef UNIV_IBUF_DEBUG - printf("Ibuf too big\n"); + fputs("Ibuf too big\n", stderr); #endif /* Use synchronous contract (== TRUE) */ ibuf_contract(TRUE); @@ -2302,8 +2304,8 @@ ibuf_insert( if (err == DB_SUCCESS) { #ifdef UNIV_IBUF_DEBUG - /* printf("Ibuf insert for page no %lu of index %s\n", page_no, - index->name); */ + /* fprintf(stderr, "Ibuf insert for page no %lu of index %s\n", + page_no, index->name); */ #endif return(TRUE); @@ -2331,7 +2333,6 @@ ibuf_insert_to_index_page( rec_t* rec; page_t* bitmap_page; ulint old_bits; - char errbuf[1000]; ut_ad(ibuf_inside()); ut_ad(dtuple_check_typed(entry)); @@ -2361,16 +2362,13 @@ ibuf_insert_to_index_page( "InnoDB: Error: Insert buffer insert fails; page free %lu, dtuple size %lu\n", page_get_max_insert_size(page, 1), rec_get_converted_size(entry)); - - dtuple_sprintf(errbuf, 900, entry); - - fprintf(stderr, -"InnoDB: Cannot insert index record %s\n", errbuf); - - fprintf(stderr, -"InnoDB: The table where where this index record belongs\n" + fputs("InnoDB: Cannot insert index record ", + stderr); + dtuple_print(stderr, entry); + fputs( +"\nInnoDB: The table where where this index record belongs\n" "InnoDB: is now probably corrupt. Please run CHECK TABLE on\n" -"InnoDB: that table.\n"); +"InnoDB: that table.\n", stderr); bitmap_page = ibuf_bitmap_get_map_page( buf_frame_get_space_id(page), @@ -2384,8 +2382,8 @@ ibuf_insert_to_index_page( fprintf(stderr, "Bitmap bits %lu\n", old_bits); - fprintf(stderr, -"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n"); + fputs( +"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr); } } @@ -2443,22 +2441,21 @@ ibuf_delete_rec( if (!success) { fprintf(stderr, - "InnoDB: ERROR: Send the output to heikki.tuuri@innodb.com\n"); - fprintf(stderr, "InnoDB: ibuf cursor restoration fails!\n"); - fprintf(stderr, "InnoDB: ibuf record inserted to page %lu\n", - page_no); + "InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n" + "InnoDB: ibuf cursor restoration fails!\n" + "InnoDB: ibuf record inserted to page %lu\n", page_no); fflush(stderr); - rec_print(btr_pcur_get_rec(pcur)); - rec_print(pcur->old_rec); - dtuple_print(search_tuple); + rec_print(stderr, btr_pcur_get_rec(pcur)); + rec_print(stderr, pcur->old_rec); + dtuple_print(stderr, search_tuple); - rec_print(page_rec_get_next(btr_pcur_get_rec(pcur))); - fflush(stdout); + rec_print(stderr, page_rec_get_next(btr_pcur_get_rec(pcur))); + fflush(stderr); mtr_commit(mtr); - fprintf(stderr, "InnoDB: Validating insert buffer tree:\n"); + fputs("InnoDB: Validating insert buffer tree:\n", stderr); ut_a(btr_validate_tree(ibuf_data->index->tree)); fprintf(stderr, "InnoDB: ibuf tree ok\n"); @@ -2519,7 +2516,6 @@ ibuf_merge_or_delete_for_page( #endif ibool corruption_noticed = FALSE; mtr_t mtr; - char err_buf[500]; if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { @@ -2529,7 +2525,7 @@ ibuf_merge_or_delete_for_page( #ifdef UNIV_LOG_DEBUG if (space % 2 != 0) { - printf("No ibuf operation in a replicate space\n"); + fputs("No ibuf operation in a replicate space\n", stderr); return; } @@ -2579,8 +2575,8 @@ ibuf_merge_or_delete_for_page( mtr_start(&mtr); - fprintf(stderr, -" InnoDB: Dump of the ibuf bitmap page:\n"); + fputs(" InnoDB: Dump of the ibuf bitmap page:\n", + stderr); bitmap_page = ibuf_bitmap_get_map_page(space, page_no, &mtr); @@ -2588,7 +2584,7 @@ ibuf_merge_or_delete_for_page( mtr_commit(&mtr); - fprintf(stderr, "\nInnoDB: Dump of the page:\n"); + fputs("\nInnoDB: Dump of the page:\n", stderr); buf_page_print(page); @@ -2651,18 +2647,16 @@ loop: /* Do NOT merge to the 4.1 code base! */ if (trx_sys_downgrading_from_4_1_1) { - fprintf(stderr, + fputs( "InnoDB: Fatal error: you are downgrading from >= 4.1.1 to 4.0, but\n" -"InnoDB: the insert buffer was not empty.\n"); +"InnoDB: the insert buffer was not empty.\n", stderr); ut_error; } if (corruption_noticed) { - rec_sprintf(err_buf, 450, ibuf_rec); - - fprintf(stderr, -"InnoDB: Discarding record\n %s\n from the insert buffer!\n\n", err_buf); - + fputs("InnoDB: Discarding record\n ", stderr); + rec_print(stderr, ibuf_rec); + fputs("\n from the insert buffer!\n\n", stderr); } else if (page) { /* Now we have at pcur a record which should be inserted to the index page; NOTE that the call below @@ -2723,8 +2717,8 @@ reset_bit: page_no, IBUF_BITMAP_FREE, &mtr); ulint new_bits = ibuf_index_page_calc_free(page); #ifdef UNIV_IBUF_DEBUG - /* printf("Old bits %lu new bits %lu max size %lu\n", old_bits, - new_bits, + /* fprintf(stderr, "Old bits %lu new bits %lu max size %lu\n", + old_bits, new_bits, page_get_max_insert_size_after_reorganize(page, 1)); */ #endif if (old_bits != new_bits) { @@ -2736,7 +2730,8 @@ reset_bit: } #ifdef UNIV_IBUF_DEBUG - /* printf("Ibuf merge %lu records volume %lu to page no %lu\n", + /* fprintf(stderr, + "Ibuf merge %lu records volume %lu to page no %lu\n", n_inserts, volume, page_no); */ #endif mtr_commit(&mtr); @@ -2794,34 +2789,29 @@ Prints info of ibuf. */ void ibuf_print( /*=======*/ - char* buf, /* in/out: buffer where to print */ - char* buf_end)/* in: buffer end */ + FILE* file) /* in: file where to print */ { ibuf_data_t* data; #ifdef UNIV_IBUF_DEBUG ulint i; #endif - if (buf_end - buf < 500) { - return; - } mutex_enter(&ibuf_mutex); data = UT_LIST_GET_FIRST(ibuf->data_list); while (data) { - buf += sprintf(buf, - "Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n", - data->space, data->size, data->free_list_len, data->seg_size); - - buf += sprintf(buf, + fprintf(file, + "Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n" "%lu inserts, %lu merged recs, %lu merges\n", + data->space, data->size, data->free_list_len, data->seg_size, data->n_inserts, data->n_merged_recs, data->n_merges); #ifdef UNIV_IBUF_DEBUG for (i = 0; i < IBUF_COUNT_N_PAGES; i++) { if (ibuf_count_get(data->space, i) > 0) { - printf("Ibuf count for page %lu is %lu\n", + fprintf(stderr, + "Ibuf count for page %lu is %lu\n", i, ibuf_count_get(data->space, i)); } } |