diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2005-02-09 13:36:27 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2005-02-09 13:36:27 +0100 |
commit | 65e993cbd2b976b45302dc0a8f2d08850695fcf4 (patch) | |
tree | a69f6a3fa2e749c84be9b6baee6607b862cf6613 | |
parent | 0f320e8c7741ac3ebad379d8ec8d6468081d90e0 (diff) | |
parent | 37e2873fe38db47548ecac5bd3afaac23b8791be (diff) | |
download | mariadb-git-65e993cbd2b976b45302dc0a8f2d08850695fcf4.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
-rw-r--r-- | client/mysqltest.c | 5 | ||||
-rw-r--r-- | extra/my_print_defaults.c | 5 | ||||
-rw-r--r-- | extra/perror.c | 5 | ||||
-rw-r--r-- | extra/resolve_stack_dump.c | 5 | ||||
-rw-r--r-- | include/help_end.h | 1 | ||||
-rw-r--r-- | include/help_start.h | 2 | ||||
-rw-r--r-- | isam/pack_isam.c | 4 | ||||
-rw-r--r-- | myisam/myisamlog.c | 2 | ||||
-rw-r--r-- | mysql-test/r/heap_hash.result | 10 | ||||
-rw-r--r-- | mysql-test/t/heap_hash.test | 6 | ||||
-rw-r--r-- | mysys/my_rename.c | 2 | ||||
-rwxr-xr-x | netware/BUILD/nwbootstrap | 8 | ||||
-rw-r--r-- | netware/mysql_test_run.c | 5 | ||||
-rw-r--r-- | scripts/make_binary_distribution.sh | 8 | ||||
-rw-r--r-- | sql/ha_heap.cc | 13 | ||||
-rw-r--r-- | sql/mysqld.cc | 8 | ||||
-rw-r--r-- | sql/sql_select.cc | 1 |
17 files changed, 71 insertions, 19 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index d81e199ab1f..042f84dfb9e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2169,6 +2169,9 @@ static struct my_option my_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION, @@ -2187,6 +2190,8 @@ void usage() my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index f4da839f8e2..2ec6f8b406f 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -55,6 +55,9 @@ static struct my_option my_long_options[] = {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include <help_start.h> + static void usage(my_bool version) { printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, @@ -69,6 +72,8 @@ static void usage(my_bool version) printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/perror.c b/extra/perror.c index 27027520cbe..b377b360b5c 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -113,12 +113,15 @@ static HA_ERRORS ha_errlist[]= }; +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION, SYSTEM_TYPE,MACHINE_TYPE); } + static void usage(void) { print_version(); @@ -130,6 +133,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 06a670b935d..666125990d2 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -65,12 +65,16 @@ static struct my_option my_long_options[] = static void verify_sort(); + +#include <help_start.h> + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); } + static void usage() { print_version(); @@ -87,6 +91,7 @@ The numeric-dump-file should contain a numeric stack trace from mysqld.\n\ If the numeric-dump-file is not given, the stack trace is read from stdin.\n"); } +#include <help_end.h> static void die(const char* fmt, ...) diff --git a/include/help_end.h b/include/help_end.h index a63d9e7ca9f..3bd16c09e3b 100644 --- a/include/help_end.h +++ b/include/help_end.h @@ -2,5 +2,6 @@ #undef printf #undef puts #undef fputs +#undef fputc #undef putchar #endif diff --git a/include/help_start.h b/include/help_start.h index 38bb91f7655..7ffde1ab803 100644 --- a/include/help_start.h +++ b/include/help_start.h @@ -4,4 +4,6 @@ #define printf consoleprintf #define puts(s) consoleprintf("%s\n",s) #define fputs(s,f) puts(s) +#define fputc(s,f) consoleprintf("%c", s) +#define putchar(s) consoleprintf("%c", s) #endif diff --git a/isam/pack_isam.c b/isam/pack_isam.c index aa83b2b2a96..0134e0411b2 100644 --- a/isam/pack_isam.c +++ b/isam/pack_isam.c @@ -260,6 +260,8 @@ static struct my_option my_long_options[] = }; +#include <help_start.h> + static void print_version(void) { printf("%s Ver 5.10 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); @@ -283,6 +285,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include <help_end.h> + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 6679510227e..dc98d813266 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -247,6 +247,7 @@ static void get_options(register int *argc, register char ***argv) /* Fall through */ case 'I': case '?': +#include <help_start.h> printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); puts("By Monty, for your professional use\n"); @@ -268,6 +269,7 @@ static void get_options(register int *argc, register char ***argv) puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted."); puts("If one gives table names as arguments only these tables will be updated\n"); help=1; +#include <help_end.h> break; default: printf("illegal option: \"-%c\"\n",*pos); diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 4f5de197858..d3673cd2a63 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -355,3 +355,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where 1 SIMPLE t3 ref a a 40 func,const 6 Using where drop table t1, t2, t3; +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +a +1 +3 +explain select a from t1 where a in (1,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 2 Using where +drop table t1; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 6d8fdec4b9e..6d27f19dfad 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -251,3 +251,9 @@ explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a drop table t1, t2, t3; +# Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +explain select a from t1 where a in (1,3); +drop table t1; diff --git a/mysys/my_rename.c b/mysys/my_rename.c index d4f99e83247..b5d813ad787 100644 --- a/mysys/my_rename.c +++ b/mysys/my_rename.c @@ -45,7 +45,7 @@ int my_rename(const char *from, const char *to, myf MyFlags) } #endif #if defined(HAVE_RENAME) -#ifdef __WIN__ +#if defined(__WIN__) || defined(__NETWARE__) /* On windows we can't rename over an existing file: Remove any conflicting files: diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 25e843c87e3..2bd7150ec0d 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -171,15 +171,9 @@ do rm $file.org done -# create the libmysql.imp file in netware folder from libmysql/libmysql.def -# file -echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - # create the libmysql.imp file in netware folder from libmysql/libmysql.def file echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - +awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp # build linux tools echo "compiling linux tools..." diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index fd5725a6414..d8cfb79c1cb 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -192,7 +192,7 @@ void install_db(char *datadir) char error[PATH_MAX]; // input file - snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); + snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir); snprintf(output, PATH_MAX, "%s/install.out", datadir); snprintf(error, PATH_MAX, "%s/install.err", datadir); @@ -1160,7 +1160,8 @@ void setup(char *file) setenv("MASTER_MYPORT", "9306", 1); setenv("SLAVE_MYPORT", "9307", 1); setenv("MYSQL_TCP_PORT", "3306", 1); - + snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port); + setenv("MYSQL_CLIENT_TEST",file_path,1); } /****************************************************************************** diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 910aa38c33f..7a6e052f5c7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -242,8 +242,12 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - cp ./netware/static_init_db.sql ./netware/init_db.sql - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql +# cp ./netware/static_init_db.sql ./netware/init_db.sql +# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 96c19ce0705..3c2249ce281 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -60,8 +60,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) { /* Initialize variables for the opened table */ set_keys_for_scanning(); - if (table->tmp_table == NO_TMP_TABLE) - update_key_stats(); + update_key_stats(); } return (file ? 0 : 1); } @@ -103,6 +102,8 @@ void ha_heap::update_key_stats() for (uint i= 0; i < table->keys; i++) { KEY *key=table->key_info+i; + if (!key->rec_per_key) + continue; if (key->algorithm != HA_KEY_ALG_BTREE) { ha_rows hash_buckets= file->s->keydef[i].hash_buckets; @@ -122,8 +123,8 @@ int ha_heap::write_row(byte * buf) if (table->next_number_field && buf == table->record[0]) update_auto_increment(); res= heap_write(file,buf); - if (!res && table->tmp_table == NO_TMP_TABLE && - ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) update_key_stats(); return res; } @@ -135,8 +136,8 @@ int ha_heap::update_row(const byte * old_data, byte * new_data) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); res= heap_update(file,old_data,new_data); - if (!res && table->tmp_table == NO_TMP_TABLE && - ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) update_key_stats(); return res; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 503fb5bfb99..53dca59bc92 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -147,6 +147,10 @@ int deny_severity = LOG_WARNING; #include <sys/mman.h> #endif +#define zVOLSTATE_ACTIVE 6 +#define zVOLSTATE_DEACTIVE 2 +#define zVOLSTATE_MAINTENANCE 3 + #ifdef __NETWARE__ #include <nks/vm.h> #include <library.h> @@ -1667,7 +1671,9 @@ ulong neb_event_callback(struct EventBlock *eblock) voldata= (EventChangeVolStateEnter_s *)eblock->EBEventData; /* Deactivation of a volume */ - if ((voldata->oldState == 6 && voldata->newState == 2)) + if ((voldata->oldState == zVOLSTATE_ACTIVE && + voldata->newState == zVOLSTATE_DEACTIVE || + voldata->newState == zVOLSTATE_MAINTENANCE)) { /* Ensure that we bring down MySQL server only for MySQL data diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8353ca9333d..96265a96386 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5289,6 +5289,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, keyinfo->key_length=(uint16) reclength; keyinfo->name=(char*) "tmp"; keyinfo->algorithm= HA_KEY_ALG_UNDEF; + keyinfo->rec_per_key=0; if (null_pack_length) { key_part_info->null_bit=0; |