=== modified file 'innobase/include/srv0srv.h' --- innobase/include/srv0srv.h 2008-07-31 21:47:57 +0000 +++ innobase/include/srv0srv.h 2009-04-07 11:24:24 +0000 @@ -78,6 +78,7 @@ extern ulint srv_log_file_size; extern ulint srv_log_buffer_size; extern ulong srv_flush_log_at_trx_commit; +extern ulong srv_cardinality_algorithm; extern byte srv_latin1_ordering[256];/* The sort order table of the latin1 character set */ === modified file 'innobase/page/page0cur.c' --- innobase/page/page0cur.c 2005-07-05 09:10:20 +0000 +++ innobase/page/page0cur.c 2009-04-07 11:32:30 +0000 @@ -15,6 +15,7 @@ #include "mtr0log.h" #include "log0recv.h" #include "rem0cmp.h" +#include "srv0srv.h" static ulint page_rnd = 976722341; @@ -490,6 +491,8 @@ } page_rnd += 87584577; + if (srv_cardinality_algorithm == 1) + page_rnd&= 0xFFFFFFFF; rnd = page_rnd % page_get_n_recs(page); === modified file 'innobase/srv/srv0srv.c' --- innobase/srv/srv0srv.c 2008-12-12 22:48:26 +0000 +++ innobase/srv/srv0srv.c 2009-04-07 10:52:13 +0000 @@ -114,6 +114,7 @@ ulint srv_log_file_size = ULINT_MAX; /* size in database pages */ ulint srv_log_buffer_size = ULINT_MAX; /* size in database pages */ ulong srv_flush_log_at_trx_commit = 1; +ulong srv_cardinality_algorithm = 0; byte srv_latin1_ordering[256] /* The sort order table of the latin1 character set. The following table is === modified file 'sql/ha_innodb.h' --- sql/ha_innodb.h 2007-10-03 05:47:30 +0000 +++ sql/ha_innodb.h 2009-04-07 10:51:50 +0000 @@ -234,6 +234,7 @@ extern ulong srv_thread_concurrency; extern ulong srv_commit_concurrency; extern ulong srv_flush_log_at_trx_commit; +extern ulong srv_cardinality_algorithm; } bool innobase_init(void); === modified file 'sql/mysqld.cc' --- sql/mysqld.cc 2009-03-19 13:44:58 +0000 +++ sql/mysqld.cc 2009-04-07 11:06:13 +0000 @@ -4908,6 +4908,7 @@ OPT_INNODB_LOG_ARCH_DIR, OPT_INNODB_LOG_ARCHIVE, OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT, + OPT_INNODB_CARDINALITY_ALGORITHM, OPT_INNODB_FLUSH_METHOD, OPT_INNODB_DOUBLEWRITE, OPT_INNODB_CHECKSUMS, @@ -5263,6 +5264,11 @@ (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, OPT_INNODB_DEFAULT, 0, 0, 0, 0, 0}, #ifdef HAVE_INNOBASE_DB + {"innodb_cardinality_algorithm", OPT_INNODB_CARDINALITY_ALGORITHM, + "Set to 0 (default) for 64bit algorithm on 64bit boxes, 1 for 32bit algorithm on 64bit boxes.", + (gptr*) &srv_cardinality_algorithm, + (gptr*) &srv_cardinality_algorithm, + 0, GET_ULONG, OPT_ARG, 0, 0, 1, 0, 0, 0}, {"innodb_checksums", OPT_INNODB_CHECKSUMS, "Enable InnoDB checksums validation (enabled by default). \ Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums, (gptr*) &innobase_use_checksums, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, === modified file 'sql/set_var.cc' --- sql/set_var.cc 2009-02-10 22:47:54 +0000 +++ sql/set_var.cc 2009-04-07 11:10:12 +0000 @@ -465,6 +465,9 @@ sys_var_long_ptr sys_innodb_flush_log_at_trx_commit( "innodb_flush_log_at_trx_commit", &srv_flush_log_at_trx_commit); +sys_var_long_ptr sys_innodb_cardinality_algorithm( + "innodb_cardinality_algorithm", + &srv_cardinality_algorithm); sys_var_const_os_str_ptr sys_innodb_data_file_path("innodb_data_file_path", &innobase_data_file_path); sys_var_const_os_str_ptr sys_innodb_data_home_dir("innodb_data_home_dir", @@ -811,6 +814,7 @@ &sys_innodb_thread_concurrency, &sys_innodb_commit_concurrency, &sys_innodb_flush_log_at_trx_commit, + &sys_innodb_cardinality_algorithm, #endif &sys_trust_routine_creators, &sys_trust_function_creators, @@ -915,6 +919,7 @@ {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS}, {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG }, {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONGLONG }, + {sys_innodb_cardinality_algorithm.name, (char*) &sys_innodb_cardinality_algorithm, SHOW_SYS }, {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL}, {sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS}, {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},