From 5adbc611dd70bcba787e4c2b8c264a0253cdd875 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 11:33:03 +0400 Subject: [PATCH 1/8] Fix for bug #2629 NULLIF() doesn't behave as described in manual --- mysql-test/r/func_if.result | 6 ++++++ mysql-test/t/func_if.test | 6 ++++++ sql/item_cmpfunc.cc | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index 0ab41258091..470004d2646 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -40,6 +40,12 @@ a aa aaa drop table t1; +select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); +NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test") +NULL NULL NULL NULL +select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL); +NULLIF(1,NULL) NULLIF(1.0, NULL) NULLIF("test", NULL) +1 1.0 test create table t1 (num double(12,2)); insert into t1 values (144.54); select sum(if(num is null,0.00,num)) from t1; diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 85553d1a2fd..1f95239bf4b 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -20,6 +20,12 @@ select if(u=1,binary st,st) s from t1 order by s; select if(u=1,st,binary st) s from t1 where st like "%a%" order by s; drop table t1; +# +# Bug 2629 +# +select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); +select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL); + # # Problem with IF() # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 82f368970e2..d84dab3425a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -616,7 +616,7 @@ double Item_func_nullif::val() { double value; - if (!(this->*cmp_func)() || null_value) + if (!(this->*cmp_func)()) { null_value=1; return 0.0; @@ -630,7 +630,7 @@ longlong Item_func_nullif::val_int() { longlong value; - if (!(this->*cmp_func)() || null_value) + if (!(this->*cmp_func)()) { null_value=1; return 0; @@ -644,7 +644,7 @@ String * Item_func_nullif::val_str(String *str) { String *res; - if (!(this->*cmp_func)() || null_value) + if (!(this->*cmp_func)()) { null_value=1; return 0; From 924255133bcac1ae37bd8140f7590809307fb03b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 11:48:20 +0200 Subject: [PATCH 2/8] InnoDB: Remove log debug code when UNIV_LOG_DEBUG is not defined innobase/include/log0log.h: Remove debug variables unless #ifdef UNIV_LOG_DEBUG innobase/include/log0log.ic: Remove log_check_log_recs() unless #ifdef UNIV_LOG_DEBUG innobase/log/log0log.c: Remove log_debug_writes unless #ifdef UNIV_LOG_DEBUG log_io_complete_checkpoint(): Remove parameter; move debug output to log_io_complete(), the only caller Test log_debug_writes only #ifdef UNIV_LOG_DEBUG innobase/log/log0recv.c: Test log_debug_writes only #ifdef UNIV_LOG_DEBUG --- innobase/include/log0log.h | 4 +++ innobase/include/log0log.ic | 2 ++ innobase/log/log0log.c | 55 +++++++++++++++++++++++++++++-------- innobase/log/log0recv.c | 20 ++++++++++++-- 4 files changed, 67 insertions(+), 14 deletions(-) diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h index 24ec28a56e6..9fba0c46407 100644 --- a/innobase/include/log0log.h +++ b/innobase/include/log0log.h @@ -18,7 +18,9 @@ typedef struct log_struct log_t; typedef struct log_group_struct log_group_t; extern ibool log_do_write; +#ifdef UNIV_LOG_DEBUG extern ibool log_debug_writes; +#endif /* UNIV_LOG_DEBUG */ /* Wait modes for log_write_up_to */ #define LOG_NO_WAIT 91 @@ -713,11 +715,13 @@ struct log_struct{ ulint max_buf_free; /* recommended maximum value of buf_free, after which the buffer is flushed */ +#ifdef UNIV_LOG_DEBUG ulint old_buf_free; /* value of buf free when log was last time opened; only in the debug version */ dulint old_lsn; /* value of lsn when log was last time opened; only in the debug version */ +#endif /* UNIV_LOG_DEBUG */ ibool check_flush_or_checkpoint; /* this is set to TRUE when there may be need to flush the log buffer, or diff --git a/innobase/include/log0log.ic b/innobase/include/log0log.ic index 587291883f7..6e32a45cdc5 100644 --- a/innobase/include/log0log.ic +++ b/innobase/include/log0log.ic @@ -10,6 +10,7 @@ Created 12/9/1995 Heikki Tuuri #include "mach0data.h" #include "mtr0mtr.h" +#ifdef UNIV_LOG_DEBUG /********************************************************** Checks by parsing that the catenated log segment for a single mtr is consistent. */ @@ -21,6 +22,7 @@ log_check_log_recs( in the log_sys->buf log buffer */ ulint len, /* in: segment length in bytes */ dulint buf_start_lsn); /* in: buffer start lsn */ +#endif /* UNIV_LOG_DEBUG */ /**************************************************************** Gets a log block flush bit. */ diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c index ec0db57564a..8b4cbe034b9 100644 --- a/innobase/log/log0log.c +++ b/innobase/log/log0log.c @@ -31,7 +31,9 @@ ulint log_fsp_current_free_limit = 0; log_t* log_sys = NULL; ibool log_do_write = TRUE; +#ifdef UNIV_LOG_DEBUG ibool log_debug_writes = FALSE; +#endif /* UNIV_LOG_DEBUG */ /* These control how often we print warnings if the last checkpoint is too old */ @@ -85,9 +87,8 @@ the previous */ Completes a checkpoint write i/o to a log file. */ static void -log_io_complete_checkpoint( -/*=======================*/ - log_group_t* group); /* in: log group */ +log_io_complete_checkpoint(void); +/*============================*/ /********************************************************** Completes an archiving i/o. */ static @@ -931,10 +932,11 @@ log_group_check_flush_completion( #endif /* UNIV_SYNC_DEBUG */ if (!log_sys->one_flushed && group->n_pending_writes == 0) { - +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Log flushed first to group %lu\n", group->id); } +#endif /* UNIV_LOG_DEBUG */ log_sys->written_to_some_lsn = log_sys->write_lsn; log_sys->one_flushed = TRUE; @@ -942,10 +944,12 @@ log_group_check_flush_completion( return(LOG_UNLOCK_NONE_FLUSHED_LOCK); } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes && (group->n_pending_writes == 0)) { printf("Log flushed to group %lu\n", group->id); } +#endif /* UNIV_LOG_DEBUG */ return(0); } @@ -1021,7 +1025,15 @@ log_io_complete( fil_flush(group->space_id); } - log_io_complete_checkpoint(group); +#ifdef UNIV_LOG_DEBUG + if (log_debug_writes) { + fprintf(stderr, + "Checkpoint info written to group %lu\n", + group->id); + } +#endif /* UNIV_LOG_DEBUG */ + + log_io_complete_checkpoint(); return; } @@ -1086,11 +1098,13 @@ log_group_file_header_flush( dest_offset = nth_file * group->file_size; +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf( "Writing log file header to group %lu file %lu\n", group->id, nth_file); } +#endif /* UNIV_LOG_DEBUG */ if (log_do_write) { log_sys->n_log_ios++; @@ -1174,6 +1188,7 @@ loop: write_len = len; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf( @@ -1197,6 +1212,7 @@ loop: + i * OS_FILE_LOG_BLOCK_SIZE)); } } +#endif /* UNIV_LOG_DEBUG */ /* Calculate the checksums for each log block and write them to the trailer fields of the log blocks */ @@ -1324,6 +1340,7 @@ loop: return; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Writing log from %lu %lu up to lsn %lu %lu\n", ut_dulint_get_high(log_sys->written_to_all_lsn), @@ -1331,6 +1348,7 @@ loop: ut_dulint_get_high(log_sys->lsn), ut_dulint_get_low(log_sys->lsn)); } +#endif /* UNIV_LOG_DEBUG */ log_sys->n_pending_writes++; @@ -1556,9 +1574,8 @@ log_complete_checkpoint(void) Completes an asynchronous checkpoint info write i/o to a log file. */ static void -log_io_complete_checkpoint( -/*=======================*/ - log_group_t* group) /* in: log group */ +log_io_complete_checkpoint(void) +/*============================*/ { mutex_enter(&(log_sys->mutex)); @@ -1566,10 +1583,6 @@ log_io_complete_checkpoint( log_sys->n_pending_checkpoint_writes--; - if (log_debug_writes) { - printf("Checkpoint info written to group %lu\n", group->id); - } - if (log_sys->n_pending_checkpoint_writes == 0) { log_complete_checkpoint(); } @@ -1894,12 +1907,14 @@ log_checkpoint( log_sys->next_checkpoint_lsn = oldest_lsn; +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Making checkpoint no %lu at lsn %lu %lu\n", ut_dulint_get_low(log_sys->next_checkpoint_no), ut_dulint_get_high(oldest_lsn), ut_dulint_get_low(oldest_lsn)); } +#endif /* UNIV_LOG_DEBUG */ log_groups_write_checkpoint_info(); @@ -2279,9 +2294,11 @@ loop: exit(1); } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Created archive file %s\n", name); } +#endif /* UNIV_LOG_DEBUG */ ret = os_file_close(file_handle); @@ -2310,6 +2327,7 @@ loop: len = group->file_size - (next_offset % group->file_size); } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf( "Archiving starting at lsn %lu %lu, len %lu to group %lu\n", @@ -2317,6 +2335,7 @@ loop: ut_dulint_get_low(start_lsn), len, group->id); } +#endif /* UNIV_LOG_DEBUG */ log_sys->n_pending_archive_ios++; @@ -2407,10 +2426,12 @@ log_archive_write_complete_groups(void) trunc_files = n_files - 1; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes && trunc_files) { printf("Complete file(s) archived to group %lu\n", group->id); } +#endif /* UNIV_LOG_DEBUG */ /* Calculate the archive file space start lsn */ start_lsn = ut_dulint_subtract(log_sys->next_archived_lsn, @@ -2433,9 +2454,11 @@ log_archive_write_complete_groups(void) fil_space_truncate_start(group->archive_space_id, trunc_files * group->file_size); +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Archiving writes completed\n"); } +#endif /* UNIV_LOG_DEBUG */ } /********************************************************** @@ -2452,9 +2475,11 @@ log_archive_check_completion_low(void) if (log_sys->n_pending_archive_ios == 0 && log_sys->archiving_phase == LOG_ARCHIVE_READ) { +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Archiving read completed\n"); } +#endif /* UNIV_LOG_DEBUG */ /* Archive buffer has now been read in: start archive writes */ @@ -2598,6 +2623,7 @@ loop: log_sys->next_archived_lsn = limit_lsn; +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf("Archiving from lsn %lu %lu to lsn %lu %lu\n", ut_dulint_get_high(log_sys->archived_lsn), @@ -2605,6 +2631,7 @@ loop: ut_dulint_get_high(limit_lsn), ut_dulint_get_low(limit_lsn)); } +#endif /* UNIV_LOG_DEBUG */ /* Read the log segment to the archive buffer */ @@ -2703,11 +2730,13 @@ log_archive_close_groups( group->archived_file_no += 2; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { printf( "Incrementing arch file no to %lu in log group %lu\n", group->archived_file_no + 2, group->id); } +#endif /* UNIV_LOG_DEBUG */ } } @@ -3155,6 +3184,7 @@ loop: ut_a(0 == ut_dulint_cmp(lsn, log_sys->lsn)); } +#ifdef UNIV_LOG_DEBUG /********************************************************** Checks by parsing that the catenated log segment for a single mtr is consistent. */ @@ -3207,6 +3237,7 @@ log_check_log_recs( return(TRUE); } +#endif /* UNIV_LOG_DEBUG */ /********************************************************** Peeks the current lsn. */ diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 323d6c63f71..7f06fb587cc 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -471,6 +471,7 @@ recv_find_max_checkpoint( log_group_read_checkpoint_info(group, field); if (!recv_check_cp_is_consistent(buf)) { +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Checkpoint in group %lu at %lu invalid, %lu\n", @@ -479,6 +480,7 @@ recv_find_max_checkpoint( + LOG_CHECKPOINT_CHECKSUM_1)); } +#endif /* UNIV_LOG_DEBUG */ goto not_consistent; } @@ -492,11 +494,13 @@ recv_find_max_checkpoint( checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO); +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Checkpoint number %lu found in group %lu\n", ut_dulint_get_low(checkpoint_no), group->id); } +#endif /* UNIV_LOG_DEBUG */ if (ut_dulint_cmp(checkpoint_no, max_no) >= 0) { *max_group = group; @@ -1113,13 +1117,15 @@ recv_recover_page( start_lsn = recv->start_lsn; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Applying log rec type %lu len %lu to space %lu page no %lu\n", (ulint)recv->type, recv->len, recv_addr->space, recv_addr->page_no); } - +#endif /* UNIV_LOG_DEBUG */ + recv_parse_or_apply_log_rec_body(recv->type, buf, buf + recv->len, page, &mtr); mach_write_to_8(page + UNIV_PAGE_SIZE @@ -1944,11 +1950,13 @@ loop: recv_sys->recovered_offset += len; recv_sys->recovered_lsn = new_recovered_lsn; +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Parsed a single log rec type %lu len %lu space %lu page no %lu\n", (ulint)type, len, space, page_no); } +#endif /* UNIV_LOG_DEBUG */ if (type == MLOG_DUMMY_RECORD) { /* Do nothing */ @@ -2007,12 +2015,14 @@ loop: */ } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Parsed a multi log rec type %lu len %lu space %lu page no %lu\n", (ulint)type, len, space, page_no); } - +#endif /* UNIV_LOG_DEBUG */ + total_len += len; n_recs++; @@ -2415,6 +2425,7 @@ recv_group_scan_log_recs( start_lsn = end_lsn; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Scanned group %lu up to log sequence number %lu %lu\n", @@ -2422,6 +2433,7 @@ recv_group_scan_log_recs( ut_dulint_get_high(*group_scanned_lsn), ut_dulint_get_low(*group_scanned_lsn)); } +#endif /* UNIV_LOG_DEBUG */ } /************************************************************ @@ -2745,10 +2757,12 @@ recv_recovery_from_checkpoint_finish(void) recv_apply_hashed_log_recs(TRUE); } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Log records applied to the database\n"); } +#endif /* UNIV_LOG_DEBUG */ if (recv_needed_recovery) { trx_sys_print_mysql_master_log_pos(); @@ -3060,6 +3074,7 @@ ask_again: break; } +#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Archive read starting at lsn %lu %lu, len %lu from file %s\n", @@ -3067,6 +3082,7 @@ ask_again: ut_dulint_get_low(start_lsn), len, name); } +#endif /* UNIV_LOG_DEBUG */ fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, group->archive_space_id, read_offset / UNIV_PAGE_SIZE, From 2c5fb79089ee415250628bd59f7682636a4d2535 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 12:18:02 +0200 Subject: [PATCH 3/8] InnoDB: remove debug code from non-debug version innobase/include/que0que.h: Remove que_graph_is_select() Make que_node_print_info() a static function innobase/include/que0que.ic: Remove que_graph_is_select() innobase/que/que0que.c: Remove que_node_print_info() unless #ifdef UNIV_DEBUG --- innobase/include/que0que.h | 16 ---------------- innobase/include/que0que.ic | 18 ------------------ innobase/que/que0que.c | 4 +++- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h index e1874edcaf2..bcd7aed7e88 100644 --- a/innobase/include/que0que.h +++ b/innobase/include/que0que.h @@ -307,22 +307,6 @@ que_thr_peek_stop( mutex reserved is necessary before deciding the actual stopping */ que_thr_t* thr); /* in: query thread */ -/*************************************************************************** -Returns TRUE if the query graph is for a SELECT statement. */ -UNIV_INLINE -ibool -que_graph_is_select( -/*================*/ - /* out: TRUE if a select */ - que_t* graph); /* in: graph */ -/************************************************************************** -Prints info of an SQL query graph node. */ - -void -que_node_print_info( -/*================*/ - que_node_t* node); /* in: query graph node */ - /* Query graph query thread node: the fields are protected by the kernel mutex with the exceptions named below */ diff --git a/innobase/include/que0que.ic b/innobase/include/que0que.ic index ae4ed10560f..a63922f8c80 100644 --- a/innobase/include/que0que.ic +++ b/innobase/include/que0que.ic @@ -238,21 +238,3 @@ que_thr_peek_stop( return(FALSE); } - -/*************************************************************************** -Returns TRUE if the query graph is for a SELECT statement. */ -UNIV_INLINE -ibool -que_graph_is_select( -/*================*/ - /* out: TRUE if a select */ - que_t* graph) /* in: graph */ -{ - if (graph->fork_type == QUE_FORK_SELECT_SCROLL - || graph->fork_type == QUE_FORK_SELECT_NON_SCROLL) { - - return(TRUE); - } - - return(FALSE); -} diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index 279f9fc21aa..bff0fe61248 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -1034,9 +1034,10 @@ que_thr_stop_for_mysql_no_error( trx->n_active_thrs--; } +#ifdef UNIV_DEBUG /************************************************************************** Prints info of an SQL query graph node. */ - +static void que_node_print_info( /*================*/ @@ -1093,6 +1094,7 @@ que_node_print_info( fprintf(stderr, "Node type %lu: %s, address %p\n", type, str, node); } +#endif /* UNIV_DEBUG */ /************************************************************************** Performs an execution step on a query thread. */ From 2bda791f27e9a045cdf37fffba8e7b52739157a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 12:48:17 +0200 Subject: [PATCH 4/8] InnoDB: Remove unused directory "cry" BitKeeper/deleted/.del-makefilewin~f993e50b7f057fde: Delete: innobase/cry/makefilewin --- innobase/cry/makefilewin | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 innobase/cry/makefilewin diff --git a/innobase/cry/makefilewin b/innobase/cry/makefilewin deleted file mode 100644 index 9e791b8d073..00000000000 --- a/innobase/cry/makefilewin +++ /dev/null @@ -1,12 +0,0 @@ -include ..\include\makefile.i - -doall: cr.exe dcr.exe wro.exe - -cr.exe: cry0cry.c - $(CCOM) $(CFLW) -o cr.exe -I.. cry0cry.c ..\ut.lib ..\os.lib - -dcr.exe: cry0dcr.c - $(CCOM) $(CFLW) -o dcr.exe -I.. cry0dcr.c ..\ut.lib ..\os.lib - -wro.exe: cry0wro.c - $(CCOM) $(CFLW) -o wro.exe -I.. cry0wro.c ..\ut.lib ..\os.lib From 771233cefb7a8ad816b9582412dbccec29203b2c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 13:51:35 +0200 Subject: [PATCH 5/8] Increase max size of number of elements in key. This fixed a bug when using count(DISTINCT) with lot of distinct values and big 'max_heap_table_size' --- include/my_tree.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/my_tree.h b/include/my_tree.h index 7cc7c615ba6..6aec50215ca 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -20,7 +20,9 @@ extern "C" { #endif -#define MAX_TREE_HIGHT 40 /* = max 1048576 leafs in tree */ +/* Worst case tree is half full. This gives use 2^(MAX_TREE_HIGHT/2) leafs */ +#define MAX_TREE_HIGHT 64 + #define ELEMENT_KEY(tree,element)\ (tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\ *((void**) (element+1))) From 8d2bb926fbe5431faf2ae768ecad6240954295fd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 15:26:33 +0200 Subject: [PATCH 6/8] InnoDB: Make btr_cur_unmark_extern_fields() a static function innobase/btr/btr0cur.c: Make btr_cur_unmark_extern_fields() a static function innobase/include/btr0cur.h: Remove btr_cur_unmark_extern_fields() --- innobase/btr/btr0cur.c | 12 +++++++++++- innobase/include/btr0cur.h | 10 ---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index 6e1794c2ff7..a9f92dbc181 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -65,6 +65,16 @@ this many index pages */ /*--------------------------------------*/ #define BTR_BLOB_HDR_SIZE 8 +/*********************************************************************** +Marks all extern fields in a record as owned by the record. This function +should be called if the delete mark of a record is removed: a not delete +marked record always owns all its extern fields. */ +static +void +btr_cur_unmark_extern_fields( +/*=========================*/ + rec_t* rec, /* in: record in a clustered index */ + mtr_t* mtr); /* in: mtr */ /*********************************************************************** Adds path information to the cursor for the current page, for which the binary search has been performed. */ @@ -2922,7 +2932,7 @@ btr_cur_mark_dtuple_inherited_extern( Marks all extern fields in a record as owned by the record. This function should be called if the delete mark of a record is removed: a not delete marked record always owns all its extern fields. */ - +static void btr_cur_unmark_extern_fields( /*=========================*/ diff --git a/innobase/include/btr0cur.h b/innobase/include/btr0cur.h index 221f479df40..f1334656d53 100644 --- a/innobase/include/btr0cur.h +++ b/innobase/include/btr0cur.h @@ -435,16 +435,6 @@ btr_cur_mark_dtuple_inherited_extern( ulint n_ext_vec, /* in: number of elements in ext_vec */ upd_t* update); /* in: update vector */ /*********************************************************************** -Marks all extern fields in a record as owned by the record. This function -should be called if the delete mark of a record is removed: a not delete -marked record always owns all its extern fields. */ - -void -btr_cur_unmark_extern_fields( -/*=========================*/ - rec_t* rec, /* in: record in a clustered index */ - mtr_t* mtr); /* in: mtr */ -/*********************************************************************** Marks all extern fields in a dtuple as owned by the record. */ void From 7812cd87378a3d7c63bf45dfbc796ee4b61898ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 18:55:44 +0200 Subject: [PATCH 7/8] InnoDB: Remove some debug variables unless UNIV_SEARCH_PERF_STAT is defined innobase/btr/btr0sea.c: Remove variable btr_search_n_succ unless #ifdef UNIV_SEARCH_PERF_STAT innobase/include/btr0sea.h: Remove variable btr_search_n_succ unless #ifdef UNIV_SEARCH_PERF_STAT innobase/page/page0cur.c: Make page_rnd a static variable Remove variable page_cur_short_succ unless #ifdef UNIV_SEARCH_PERF_STAT innobase/include/page0cur.h: Remove variable page_cur_short_succ unless #ifdef UNIV_SEARCH_PERF_STAT --- innobase/btr/btr0sea.c | 2 ++ innobase/include/btr0sea.h | 2 ++ innobase/include/page0cur.h | 5 ++++- innobase/page/page0cur.c | 7 ++++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c index 9421ca48718..f629dea74de 100644 --- a/innobase/btr/btr0sea.c +++ b/innobase/btr/btr0sea.c @@ -22,7 +22,9 @@ Created 2/17/1996 Heikki Tuuri ulint btr_search_this_is_zero = 0; /* A dummy variable to fool the compiler */ +#ifdef UNIV_SEARCH_PERF_STAT ulint btr_search_n_succ = 0; +#endif /* UNIV_SEARCH_PERF_STAT */ ulint btr_search_n_hash_fail = 0; byte btr_sea_pad1[64]; /* padding to prevent other memory update diff --git a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h index 68396d47193..ce4140ecf92 100644 --- a/innobase/include/btr0sea.h +++ b/innobase/include/btr0sea.h @@ -214,7 +214,9 @@ extern rw_lock_t* btr_search_latch_temp; #define btr_search_latch (*btr_search_latch_temp) +#ifdef UNIV_SEARCH_PERF_STAT extern ulint btr_search_n_succ; +#endif /* UNIV_SEARCH_PERF_STAT */ extern ulint btr_search_n_hash_fail; /* After change in n_fields or n_bytes in info, this many rounds are waited diff --git a/innobase/include/page0cur.h b/innobase/include/page0cur.h index c3f0decdb4b..c85669ed4df 100644 --- a/innobase/include/page0cur.h +++ b/innobase/include/page0cur.h @@ -32,8 +32,11 @@ Created 10/4/1994 Heikki Tuuri which extend it */ #define PAGE_CUR_DBG 6 - +#ifdef PAGE_CUR_ADAPT +# ifdef UNIV_SEARCH_PERF_STAT extern ulint page_cur_short_succ; +# endif /* UNIV_SEARCH_PERF_STAT */ +#endif /* PAGE_CUR_ADAPT */ /************************************************************* Gets pointer to the page frame where the cursor is positioned. */ diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c index b08efacf43a..890452cfceb 100644 --- a/innobase/page/page0cur.c +++ b/innobase/page/page0cur.c @@ -16,11 +16,12 @@ Created 10/4/1994 Heikki Tuuri #include "log0recv.h" #include "rem0cmp.h" -ulint page_cur_short_succ = 0; - -ulint page_rnd = 976722341; +static ulint page_rnd = 976722341; #ifdef PAGE_CUR_ADAPT +# ifdef UNIV_SEARCH_PERF_STAT +ulint page_cur_short_succ = 0; +# endif /* UNIV_SEARCH_PERF_STAT */ /******************************************************************** Tries a search shortcut based on the last insert. */ From e5fa42d9e8d2b73b1ea6468a506961088b54a85b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Mar 2004 11:42:35 -0600 Subject: [PATCH 8/8] Fix usage line. --- myisam/myisam_ftdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c index 2c6872627d7..d06cb46bdc1 100644 --- a/myisam/myisam_ftdump.c +++ b/myisam/myisam_ftdump.c @@ -261,7 +261,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), static void usage() { - printf("Use: ft_dump \n"); + printf("Use: myisam_ftdump \n"); my_print_help(my_long_options); my_print_variables(my_long_options); exit(1);