Commit 59d860e9 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

Merge

parents fcae9ed0 6e26bfae
......@@ -184,3 +184,4 @@ mysqld.sym
.snprj/*
sql-bench/output/*
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
Docs/my_sys.doc
......@@ -7,4 +7,10 @@ extra_flags="$pentium_cflags $fast_cflags"
extra_configs="$pentium_configs"
strip=yes
# Use the optimized version if it exists
if test -d /usr/local/BerkeleyDB-opt/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-opt/"
fi
. "$path/FINISH.sh"
......@@ -8,4 +8,10 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
# Use the debug version if it exists
if test -d /usr/local/BerkeleyDB-dbug/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-dbug/"
fi
. "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs"
# Use the optimized version if it exists
if test -d /usr/local/BerkeleyDB-opt/
then
extra_configs="$extra_configs --with-berkeley-db=/usr/local/BerkeleyDB-opt/"
fi
. "$path/FINISH.sh"
......@@ -289,6 +289,151 @@ Use pointers rather than array indexing when operating on strings.
@end itemize
@node mysys functions
@chapter mysys functions
Functions i mysys: (For flags se my_sys.h)
int my_copy _A((const char *from,const char *to,myf MyFlags));
- Copy file
int my_delete _A((const char *name,myf MyFlags));
- Delete file
int my_getwd _A((string buf,uint size,myf MyFlags));
int my_setwd _A((const char *dir,myf MyFlags));
- Get and set working directory
string my_tempnam _A((const char *pfx,myf MyFlags));
- Make a uniq temp file name by using dir and adding something after
pfx to make name uniq. Name is made by adding a uniq 6 length-string
and TMP_EXT after pfx.
Returns pointer to malloced area for filename. Should be freed by
free().
File my_open _A((const char *FileName,int Flags,myf MyFlags));
File my_create _A((const char *FileName,int CreateFlags,
int AccsesFlags, myf MyFlags));
int my_close _A((File Filedes,myf MyFlags));
uint my_read _A((File Filedes,byte *Buffer,uint Count,myf MyFlags));
uint my_write _A((File Filedes,const byte *Buffer,uint Count,
myf MyFlags));
ulong my_seek _A((File fd,ulong pos,int whence,myf MyFlags));
ulong my_tell _A((File fd,myf MyFlags));
- Use instead of open,open-with-create-flag, close read and write
to get automatic error-messages (flag: MYF_WME) and only have
to test for != 0 if error (flag: MY_NABP).
int my_rename _A((const char *from,const char *to,myf MyFlags));
- Rename file
FILE *my_fopen _A((const char *FileName,int Flags,myf MyFlags));
FILE *my_fdopen _A((File Filedes,int Flags,myf MyFlags));
int my_fclose _A((FILE *fd,myf MyFlags));
uint my_fread _A((FILE *stream,byte *Buffer,uint Count,myf MyFlags));
uint my_fwrite _A((FILE *stream,const byte *Buffer,uint Count,
myf MyFlags));
ulong my_fseek _A((FILE *stream,ulong pos,int whence,myf MyFlags));
ulong my_ftell _A((FILE *stream,myf MyFlags));
- Same read-interface for streams as for files
gptr _mymalloc _A((uint uSize,const char *sFile,
uint uLine, myf MyFlag));
gptr _myrealloc _A((string pPtr,uint uSize,const char *sFile,
uint uLine, myf MyFlag));
void _myfree _A((gptr pPtr,const char *sFile,uint uLine));
int _sanity _A((const char *sFile,unsigned int uLine));
gptr _myget_copy_of_memory _A((const byte *from,uint length,
const char *sFile, uint uLine,
myf MyFlag));
- malloc(size,myflag) is mapped to this functions if not compiled
with -DSAFEMALLOC
void TERMINATE _A((void));
- Writes malloc-info on stdout if compiled with -DSAFEMALLOC.
int my_chsize _A((File fd,ulong newlength,myf MyFlags));
- Change size of file
void my_error _D((int nr,myf MyFlags, ...));
- Writes message using error number (se mysys/errors.h) on
stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called.
void my_message _A((const char *str,myf MyFlags));
- Writes message-string on
stdout or curses if MYSYS_PROGRAM_USES_CURSES() is called.
void my_init _A((void ));
- Start each program (in main) with this.
void my_end _A((int infoflag));
- Gives info about program.
- If infoflag & MY_CHECK_ERROR prints if some files are left open
- If infoflag & MY_GIVE_INFO prints timing info and malloc info
about prog.
int my_redel _A((const char *from, const char *to, int MyFlags));
- Delete from before rename of to to from. Copyes state from old
file to new file. If MY_COPY_TIME is set sets old time.
int my_copystat _A((const char *from, const char *to, int MyFlags));
- Copye state from old file to new file.
If MY_COPY_TIME is set sets copy also time.
string my_filename _A((File fd));
- Give filename of open file.
int dirname _A((string to,const char *name));
- Copy name of directory from filename.
int test_if_hard_path _A((const char *dir_name));
- Test if dirname is a hard path (Starts from root)
void convert_dirname _A((string name));
- Convert dirname acording to system.
- In MSDOS changes all caracters to capitals and changes '/' to
'\'
string fn_ext _A((const char *name));
- Returns pointer to extension in filename
string fn_format _A((string to,const char *name,const char *dsk,
const char *form,int flag));
format a filename with replace of library and extension and
converts between different systems.
params to and name may be identicall
function dosn't change name if name != to
Flag may be: 1 force replace filnames library with 'dsk'
2 force replace extension with 'form' */
4 force Unpack filename (replace ~ with home)
8 Pack filename as short as possibly for output to
user.
All open requests should allways use at least:
"open(fn_format(temp_buffe,name,"","",4),...)" to unpack home and
convert filename to system-form.
string fn_same _A((string toname,const char *name,int flag));
- Copys directory and extension from name to toname if neaded.
copy can be forced by same flags that in fn_format.
int wild_compare _A((const char *str,const char *wildstr));
- Compare if str matches wildstr. Wildstr can contain "*" and "?"
as match-characters.
Returns 0 if match.
void get_date _A((string to,int timeflag));
- Get current date in a form ready for printing.
void soundex _A((string out_pntr, string in_pntr))
- Makes in_pntr to a 5 chars long string. All words that sounds
alike have the same string.
int init_key_cache _A((ulong use_mem,ulong leave_this_much_mem));
- Use cacheing of keys in MISAM, PISAM, and ISAM.
KEY_CACHE_SIZE is a good size.
- Remember to lock databases for optimal cacheing
void end_key_cache _A((void));
- End key-cacheing.
@c The Index was empty, and ugly, so I removed it. (jcole, Sep 7, 2000)
@c @node Index
......
......@@ -28445,20 +28445,20 @@ Most of the options to @code{safe_mysqld} are the same as the options to
@table @code
@item --basedir=path
@item --core-file-size=#
@item --datadir=path
@item --defaults-extra-file=path
@item --defaults-file=path
@item --open-files=#
Size of the core file @code{mysqld} should be able to create. Passed to
@code{ulimit -c}.
@item --datadir=path
@item --err-log=path
@item --ledir=path
Path to @code{mysqld}
@item --log=path
@item --mysqld=mysqld-version
Name of the mysqld version in the @code{ledir} directory you want to start.
@item --no-defaults
@item --open-files=#
Number of files @code{mysqld} should be able to open. Passed to
@code{ulimit -n}.
Number of files @code{mysqld} should be able to open. Passed to @code{ulimit -n}.
@item --open-files=#
Size of the core file @code{mysqld} should be able to create. Passed to @code{ulimit -c}.
@item --pid-file=path
@item --port=#
@item --socket=path
......@@ -38289,10 +38289,11 @@ To be consistent with our setup, you should put your result files in
test produces more than one result, you should use @code{test_name.a.result},
@code{test_name.b.result}, etc
@item
Failed test results are put in a file with the same name as the result file
followed by @code{.reject} extenstion. If your test case is failing, you
should do a diff on the two files. If you cannot see how they are different,
examine both with @code{od -c} and also check their lengths.
Failed test results are put in a file with the same base name as the
result file with the @code{.reject} extenstion. If your test case is
failing, you should do a diff on the two files. If you cannot see how
they are different, examine both with @code{od -c} and also check their
lengths.
@item
You can prefix a query with @code{!} if the test can continue after that query
returns an error.
......@@ -40056,8 +40057,11 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.30
@itemize @bullet
@item
Added option @code{--mysqld=#} to @code{safe_mysqld}
@item
Allow hex constants in the @code{--fields-*-by} and
@code{--lines-terminated-by} options to @code{mysqldump}. By Paul DuBois.
@code{--lines-terminated-by} options to @code{mysqldump} and
@code{mysqlimport}. By Paul DuBois.
@item
Added option @code{--safe-show-databases}.
@item
......@@ -26,6 +26,7 @@ typedef struct st_line_buffer
uint bufread; /* Number of bytes to get with each read(). */
uint eof;
ulong max_size;
ulong read_length; /* Length of last read string */
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
......
......@@ -39,7 +39,7 @@
#include "my_readline.h"
#include <signal.h>
const char *VER="11.9";
const char *VER="11.10";
gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
......@@ -903,7 +903,6 @@ static bool add_line(String &buffer,char *line,char *in_string)
continue;
#ifdef USE_MB
int l;
/* if ((l = ismbchar(pos, pos+MBMAXLEN))) { Wei He: I think it's wrong! */
if (use_mb(default_charset_info) &&
(l = my_ismbchar(default_charset_info, pos, strend))) {
while (l--)
......@@ -2163,7 +2162,9 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf(stdout, "Server version:\t\t%s\n", mysql_get_server_info(&mysql));
tee_fprintf(stdout, "Protocol version:\t%d\n", mysql_get_proto_info(&mysql));
tee_fprintf(stdout, "Connection:\t\t%s\n", mysql_get_host_info(&mysql));
tee_fprintf(stdout, "Language:\t\t%s\n", mysql.charset->name);
tee_fprintf(stdout, "Client characterset:\t%s\n",
default_charset_info->name);
tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->name);
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port);
else
......
......@@ -122,7 +122,6 @@ static struct option long_options[] = {
{"socket", required_argument, 0, 'S'},
{"sleep", required_argument, 0, 'i'},
#include "sslopt-longopts.h"
{"connect-timeout", required_argument, 0, 't'},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'},
#endif
......
......@@ -37,7 +37,7 @@
** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee>
**/
#define DUMP_VERSION "8.11"
#define DUMP_VERSION "8.12"
#include <global.h>
#include <my_sys.h>
......@@ -863,9 +863,14 @@ static char *add_load_option(char *ptr,const char *object,
{
if (object)
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */
ptr= strxmov(ptr," ",statement," ",object,NullS);
else /* char constant; escape */
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
}
return ptr;
} /* add_load_option */
......
......@@ -25,7 +25,7 @@
** * *
** *************************
*/
#define IMPORT_VERSION "2.6"
#define IMPORT_VERSION "2.7"
#include <global.h>
#include <my_sys.h>
......
......@@ -1098,10 +1098,7 @@ void str_to_file(const char* fname, char* str, int size)
void reject_dump(const char* record_file, char* buf, int size)
{
char reject_file[FN_REFLEN];
if (strlen(record_file) >= FN_REFLEN-8)
die("too long path name for reject");
strmov(strmov(reject_file, record_file),".reject");
str_to_file(reject_file, buf, size);
str_to_file(fn_format(reject_file, record_file,"",".reject",2), buf, size);
}
......@@ -1282,9 +1279,6 @@ int main(int argc, char** argv)
if (!( mysql_init(&cur_con->mysql)))
die("Failed in mysql_init()");
mysql_options(&cur_con->mysql, MYSQL_READ_DEFAULT_GROUP, "mysql");
cur_con->name = my_strdup("default", MYF(MY_WME));
if (!cur_con->name)
die("Out of memory");
......
......@@ -26,7 +26,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size);
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
static uint fill_buffer(LINE_BUFFER *buffer);
static char *intern_read_line(LINE_BUFFER *buffer,uint *out_length);
static char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
......@@ -46,12 +46,13 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
char *batch_readline(LINE_BUFFER *line_buff)
{
char *pos;
uint out_length;
ulong out_length;
if (!(pos=intern_read_line(line_buff,&out_length)))
return 0;
if (out_length && pos[out_length-1] == '\n')
out_length--; /* Remove '\n' */
line_buff->read_length=out_length;
pos[out_length]=0;
return pos;
}
......@@ -187,7 +188,7 @@ static uint fill_buffer(LINE_BUFFER *buffer)
char *intern_read_line(LINE_BUFFER *buffer,uint *out_length)
char *intern_read_line(LINE_BUFFER *buffer,ulong *out_length)
{
char *pos;
uint length;
......@@ -210,7 +211,7 @@ char *intern_read_line(LINE_BUFFER *buffer,uint *out_length)
pos--; /* break line here */
}
buffer->end_of_line=pos+1;
*out_length=(uint) (pos + 1 - buffer->eof - buffer->start_of_line);
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
DBUG_RETURN(buffer->start_of_line);
}
}
......@@ -18,11 +18,12 @@
#include "heapdef.h"
static int check_one_key(HP_KEYDEF *keydef,ulong records,ulong blength);
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status);
/* Returns 0 if the HEAP is ok */
int heap_check_heap(HP_INFO *info)
int heap_check_heap(HP_INFO *info,my_bool print_status)
{
int error;
uint key;
......@@ -30,13 +31,15 @@ int heap_check_heap(HP_INFO *info)
DBUG_ENTER("heap_check_keys");
for (error=key=0 ; key < share->keys ; key++)
error|=check_one_key(share->keydef+key,share->records,share->blength);
error|=check_one_key(share->keydef+key,key, share->records,share->blength,
print_status);
DBUG_RETURN(error);
}
static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status)
{
int error;
uint i,found,max_links,seek,links;
......@@ -76,6 +79,9 @@ static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
}
DBUG_PRINT("info",
("records: %ld seeks: %d max links: %d hitrate: %.2f",
records,seek,max_links,(float) seek / (float) records));
records,seek,max_links,(float) seek / (float) (records ? records : 1)));
if (print_status)
printf("Key: %d records: %ld seeks: %d max links: %d hitrate: %.2f\n",
keynr, records, seek, max_links, (float) seek / (float) records);
return error;
}
......@@ -37,7 +37,7 @@ int _hp_close(register HP_INFO *info)
int error=0;
DBUG_ENTER("_hp_close");
#ifndef DBUG_OFF
if (info->s->changed && heap_check_heap(info))
if (info->s->changed && heap_check_heap(info,0))
{
error=my_errno=HA_ERR_CRASHED;
}
......
......@@ -145,6 +145,7 @@ void _hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
return;
}
#ifndef NEW_HASH_FUNCTION
/* Calc hashvalue for a key */
......@@ -152,13 +153,14 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg;
uchar *pos;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) key;
key+=seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (pos=(uchar*) key,key+=seg->length ; pos < (uchar*) key ; pos++)
for (; pos < (uchar*) key ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3;
......@@ -166,7 +168,7 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
}
else
{
for (pos=(uchar*) key,key+=seg->length ; pos < (uchar*) key ; pos++)
for (; pos < (uchar*) key ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3;
......@@ -182,13 +184,13 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg;
uchar *pos,*end;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) rec+seg->start,*end=pos+seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (pos=(uchar*) rec+seg->start,end=pos+seg->length ; pos < end ; pos++)
for (; pos < end ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3;
......@@ -196,7 +198,7 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
}
else
{
for (pos=(uchar*) rec+seg->start,end=pos+seg->length ; pos < end ; pos++)
for (; pos < end ; pos++)
{
nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3;
......@@ -206,6 +208,85 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
return((ulong) nr);
}
#else
/*
* Fowler/Noll/Vo hash
*
* The basis of the hash algorithm was taken from an idea sent by email to the
* IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and
* Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com)
* later improved on their algorithm.
*
* The magic is in the interesting relationship between the special prime
* 16777619 (2^24 + 403) and 2^32 and 2^8.
*
* This hash produces the fewest collisions of any function that we've seen so
* far, and works well on both numbers and strings.
*/
ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{
register ulong nr=0;
HP_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) key;
key+=seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for (; pos < (uchar*) key ; pos++)
{
nr *=16777619;
nr ^=((uint) my_sort_order[(uint) *pos]);
}
}
else
{
for ( ; pos < (uchar*) key ; pos++)
{
nr *=16777619;
nr ^=(uint) *pos;
}
}
}
return((ulong) nr);
}
/* Calc hashvalue for a key in a record */
ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{
register ulong nr=0;
HP_KEYSEG *seg,*endseg;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
uchar *pos=(uchar*) rec+seg->start,*end=pos+seg->length;
if (seg->type == HA_KEYTYPE_TEXT)
{
for ( ; pos < end ; pos++)
{
nr *=16777619;
nr ^=(uint) my_sort_order[(uint) *pos];
}
}
else
{
for ( ; pos < end ; pos++)
{
nr *=16777619;
nr ^=(uint) *pos;
}
}
}
return((ulong) nr);
}
#endif
/* Compare keys for two records. Returns 0 if they are identical */
int _hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)
......
......@@ -38,6 +38,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
pthread_mutex_lock(&THR_LOCK_heap);
if (!(share=_hp_find_named_heap(name)))
{
DBUG_PRINT("info",("Initializing new table"));
for (i=key_segs=max_length=0 ; i < keys ; i++)
{
key_segs+= keydef[i].keysegs;
......
......@@ -65,7 +65,7 @@ int main(int argc, char **argv)
sprintf(key,"%6d",j);
bmove(record+1,key,6);
error=heap_write(file,record);
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -100,7 +100,7 @@ int main(int argc, char **argv)
if (! error)
deleted++;
}
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......
......@@ -133,7 +133,7 @@ char *argv[];
write_count++; key1[n1]++; key3[n3]=1;
key_check+=n1;
}
if (testflag == 1 && heap_check_heap(file))
if (testflag == 1 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -141,7 +141,7 @@ char *argv[];
}
if (testflag == 1)
goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -173,7 +173,7 @@ char *argv[];
key1[atoi(record+keyinfo[0].seg[0].start)]--;
key3[atoi(record+keyinfo[2].seg[0].start)]=0;
key_check-=atoi(record);
if (testflag == 2 && heap_check_heap(file))
if (testflag == 2 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -183,7 +183,7 @@ char *argv[];
puts("Warning: Skipping delete test because no dupplicate keys");
}
if (testflag==2) goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -239,14 +239,14 @@ char *argv[];
update++;
key_check=key_check-atoi(record)+n1;
}
if (testflag == 3 && heap_check_heap(file))
if (testflag == 3 && heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
}
}
if (testflag == 3) goto end;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -284,7 +284,7 @@ char *argv[];
goto end;
}
dupp_keys--;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -320,7 +320,7 @@ char *argv[];
goto end;
}
dupp_keys-=2;
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -353,7 +353,7 @@ char *argv[];
printf("next: Found: %d records of %d\n",ant,write_count-delete);
goto end;
}
if (heap_check_heap(file))
if (heap_check_heap(file,0))
{
puts("Heap keys crashed");
goto err;
......@@ -556,7 +556,8 @@ char *argv[];
}
pos++;
}
if (heap_check_heap(file) || heap_check_heap(file2))
printf("- Checking heap tables\n");
if (heap_check_heap(file,1) || heap_check_heap(file2,1))
{
puts("Heap keys crashed");
goto err;
......
......@@ -156,7 +156,7 @@ extern int heap_rlast(HP_INFO *info,byte *record);
extern void heap_clear(HP_INFO *info);
extern int heap_rkey(HP_INFO *info,byte *record,int inx,const byte *key);
extern gptr heap_find(HP_INFO *info,int inx,const byte *key);
extern int heap_check_heap(HP_INFO *info);
extern int heap_check_heap(HP_INFO *info, my_bool print_status);
extern byte *heap_position(HP_INFO *info);
/* The following is for programs that uses the old HEAP interface where
......
......@@ -82,7 +82,7 @@ int mrg_rrnd(MRG_INFO *info,byte *buf,mrg_off_t filepos)
}
}
info->current_table=find_table(info->open_tables,
info->end_table,filepos);
info->end_table-1,filepos);
isam_info=info->current_table->table;
isam_info->update&= HA_STATE_CHANGED;
return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf,
......
......@@ -17,16 +17,16 @@ else
fix_bin=.
fi
vardir=var
logdir=$vardir/log
if [ x$1 = x"-slave" ]
then
shift 1
data=var/slave-data
ldata=$fix_bin/var/slave-data
logdir=var/log
else
data=var/lib
ldata=$fix_bin/var/lib
logdir=var/log
fi
mdata=$data/mysql
......@@ -45,9 +45,13 @@ hostname=`hostname` # Install this too in the user table
resolved=127.0.0.1
#create the directories
[ -d $vardir ] || mkdir $vardir
[ -d $logdir ] || mkdir $logdir
# Create database directories mysql & test
if [ -d $data ] ; then rm -rf $data ; fi
mkdir -p $data $data/mysql $data/test
mkdir $data $data/mysql $data/test
#for error messages
if [ x$BINARY_DIST = x1 ] ; then
......@@ -59,9 +63,6 @@ mkdir share
ln -sf ../../sql/share share/mysql
fi
#create the directory for logs
mkdir -p $logdir
# Initialize variables
c_d="" i_d=""
c_h="" i_h=""
......
......@@ -54,35 +54,32 @@ TOT_TEST=0
USERT=0
SYST=0
REALT=0
MY_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time"
MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
TIMEFILE="$MYSQL_TMP_DIR/mysqltest-time"
RES_SPACE=" "
MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \
myisammrg heap sql"
GCOV_MSG=/tmp/mysqld-gcov.out
GCOV_ERR=/tmp/mysqld-gcov.err
GCOV_MSG=$MYSQL_TMP_DIR/mysqld-gcov.out
GCOV_ERR=$MYSQL_TMP_DIR/mysqld-gcov.err
MASTER_RUNNING=0
SLAVE_RUNNING=0
[ -d $MY_TMP_DIR ] || mkdir -p $MY_TMP_DIR
#++
# mysqld Environment Parameters
#--
MYRUN_DIR=var/run
MYRUN_DIR=$MYSQL_TEST_DIR/var/run
MASTER_MYPORT=9306
MASTER_MYDDIR="$MYSQL_TEST_DIR/var/lib"
MASTER_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql.sock"
MASTER_MYPID="$MYSQL_TEST_DIR/var/run/mysqld.pid"
MASTER_MYSOCK="$MYSQL_TMP_DIR/mysql.sock"
MASTER_MYPID="$MYRUN_DIR/mysqld.pid"
MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld.log"
MASTER_MYERR="$MYSQL_TEST_DIR/var/log/mysqld.err"
SLAVE_MYPORT=9307
SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
SLAVE_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql-slave.sock"
SLAVE_MYPID="$MYSQL_TEST_DIR/var/run/mysqld-slave.pid"
SLAVE_MYSOCK="$MYSQL_TMP_DIR/mysql-slave.sock"
SLAVE_MYPID="$MYRUN_DIR/mysqld-slave.pid"
SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld-slave.log"
SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err"
......@@ -92,6 +89,15 @@ else
MY_BASEDIR=$BASEDIR
fi
# Create the directories
# This should be fixed to be not be dependent on the contence of MYSQL_TMP_DIR
# or MYRUN_DIR
# (mkdir -p is not portable)
[ -d $MYSQL_TEST_DIR/var ] || mkdir $MYSQL_TEST_DIR/var
[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
[ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
#++
# Program Definitions
#--
......@@ -124,15 +130,15 @@ else
MYSQLD="$BASEDIR/bin/mysqld"
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
INSTALL_DB="../scripts/install_test_db -bin"
INSTALL_DB="./install_test_db -bin"
fi
SLAVE_MYSQLD=$MYSQLD #this will be changed later if we are doing gcov
MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent -v"
GDB_MASTER_INIT=/tmp/gdbinit.master
GDB_SLAVE_INIT=/tmp/gdbinit.slave
GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
while test $# -gt 0; do
case "$1" in
......@@ -151,6 +157,16 @@ while test $# -gt 0; do
fi
DO_GDB=1
;;
--ddd )
if [ x$BINARY_DIST = x1 ] ; then
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option"
fi
DO_DDD=1
;;
--debug)
EXTRA_MASTER_MYSQLD_OPT=--debug=d:t:O,$MYSQL_TMP_DIR/master.trace
EXTRA_SLAVE_MYSQLD_OPT=--debug=d:t:O,$MYSQL_TMP_DIR/slave.trace
;;
-- ) shift; break ;;
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
* ) break ;;
......@@ -200,7 +216,7 @@ total_inc () {
report_stats () {
if [ $TOT_FAIL = 0 ]; then
$ECHO "All tests successful."
$ECHO "All $TOT_TEST tests were successful."
else
xten=`$EXPR $TOT_PASS \* 10000`
raw=`$EXPR $xten / $TOT_TEST`
......@@ -216,7 +232,6 @@ mysql_install_db () {
$ECHO "Removing Stale Files"
$RM -rf $MASTER_MYDDIR $SLAVE_MYDDIR $SLAVE_MYLOG $MASTER_MYLOG \
$SLAVE_MYERR $MASTER_MYERR
[ -d $MYRUN_DIR ] || mkdir -p $MYRUN_DIR
$ECHO "Installing Master Databases"
$INSTALL_DB
if [ $? != 0 ]; then
......@@ -249,13 +264,15 @@ gcov_collect () {
cd $MYSQL_TEST_DIR
done
$ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
$ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
}
start_master()
{
[ x$MASTER_RUNNING = 1 ] && return
cd $BASEDIR # for gcov
# Remove old berkeley db log files that can confuse the server
$RM -f $MASTER_MYDDIR/log.*
#start master
master_args="--no-defaults --log-bin=master-bin \
--server-id=1 \
......@@ -266,8 +283,13 @@ start_master()
--pid-file=$MASTER_MYPID \
--socket=$MASTER_MYSOCK \
--log=$MASTER_MYLOG \
--language=english $EXTRA_MASTER_OPT"
if [ x$DO_GDB = x1 ]
--language=english $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT"
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $master_args" > $GDB_MASTER_INIT
ddd --debugger "gdb -x $GDB_MASTER_INIT" $MYSQLD &
prompt_user "Hit enter to continue after you've started the master"
elif [ x$DO_GDB = x1 ]
then
$ECHO "set args $master_args" > $GDB_MASTER_INIT
xterm -title "Master" -e gdb -x $GDB_MASTER_INIT $MYSQLD &
......@@ -292,6 +314,7 @@ start_slave()
master_info=$SLAVE_MASTER_INFO
fi
$RM -f $SLAVE_MYDDIR/log.*
slave_args="--no-defaults $master_info \
--exit-info=256 \
--log-bin=slave-bin --log-slave-updates \
......@@ -301,8 +324,13 @@ start_slave()
--port=$SLAVE_MYPORT \
--socket=$SLAVE_MYSOCK \
--log=$SLAVE_MYLOG \
--language=english $EXTRA_SLAVE_OPT"
if [ x$DO_GDB = x1 ]
--language=english $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
if [ x$DO_DDD = x1 ]
then
$ECHO "set args $master_args" > $GDB_SLAVE_INIT
ddd --debugger "gdb -x $GDB_SLAVE_INIT" $MYSQLD &
prompt_user "Hit enter to continue after you've started the master"
elif [ x$DO_GDB = x1 ]
then
$ECHO "set args $slave_args" > $GDB_SLAVE_INIT
xterm -title "Slave" -e gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD &
......@@ -447,12 +475,12 @@ run_testcase ()
cd $MYSQL_TEST_DIR
if [ -f $tf ] ; then
$RM -f r/$tname.*.reject
$RM -f r/$tname.*reject
mytime=`$TIME -p $MYSQL_TEST -R r/$tname.result $extra_flags \
< $tf 2> $TIMEFILE`
res=$?
if [ $res == 0 ]; then
if [ $res = 0 ]; then
mytime=`$CAT $TIMEFILE | $TR '\n' '-'`
USERT=`$ECHO $mytime | $CUT -d - -f 2 | $CUT -d ' ' -f 2`
......@@ -473,12 +501,12 @@ run_testcase ()
if [ $res == 0 ]; then
if [ $res = 0 ]; then
total_inc
pass_inc
$ECHO "$RES_SPACE [ pass ]"
else
if [ $res == 1 ]; then
if [ $res = 1 ]; then
total_inc
fail_inc
$ECHO "$RES_SPACE [ fail ]"
......@@ -504,16 +532,24 @@ run_testcase ()
}
######################################################################
# Main script starts here
######################################################################
[ "$DO_GCOV" -a ! -x "$GCOV" ] && error "No gcov found"
[ "$DO_GCOV" ] && gcov_prepare
# Ensure that no old mysqld test servers are running
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O connect_timeout=5 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 shutdown > /dev/null 2>&1
$ECHO "Installing Test Databases"
mysql_install_db
#do not automagically start deamons if we are in gdb or running only one test
#case
if [ -z "$DO_GDB" ] && [ -z "$1" ]
if [ -z "$DO_GDB" ] && [ -z "$1" ] && [ -z "$DO_DDD" ]
then
mysql_start
fi
......@@ -552,7 +588,7 @@ $ECHO
$RM -f $TIMEFILE
if [ -z "$DO_GDB" ] ;
if [ -z "$DO_GDB" ] && [ -z "$DO_DDD" ]
then
mysql_stop
fi
......
......@@ -28,12 +28,12 @@ table type possible_keys key key_len ref rows Extra
t1 ALL a NULL NULL NULL 5
t2 ALL b NULL NULL NULL 5 where used
a b a b
A B b A
a a b A
A B a a
A B b A
C c C c
a a a a
a a b A
b A A B
C c C c
a b
A B
a a
......@@ -242,11 +242,11 @@ HELLO 1
HELLO MY 1
a 1
hello 1
_field_140 min(t3._field_131) min(t3._field_135) min(t3._field_139) min(t3._field_137) min(link_alias_142._field_165) min(link_alias_133._field_72) min(t3._field_145) min(link_alias_148._field_156) min(t3._field_140) t3_id
_field_140 min(t3._field_131) min(t3._field_135) min(t3._field_139) min(t3._field_137) min(link_alias_142._field_165) min(link_alias_133._field_72) min(t3._field_145) min(link_alias_148._field_156) replace(min(t3._field_140), "\r","^M") t3_id
test
job
1 test job 1 0000-00-00 00:00:00 1999-02-25 22:43:32 0 High admin 0 tomato test
job
1 test job 1 0000-00-00 00:00:00 1999-02-25 22:43:32 0 High admin 0 tomato test^M
job^M
1 1
stamp
19990402000000
......
......@@ -14,6 +14,6 @@ INSERT INTO t1 VALUES ('A','B'),('b','A'),('C','c'),('D','E'),('a','a');
select * from t1,t1 as t2;
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
#select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by t1.a;
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
select * from t1 where a='a';
drop table t1;
......@@ -203,7 +203,7 @@ INSERT INTO t7 VALUES (1,0,'High',1);
INSERT INTO t7 VALUES (2,0,'Medium',2);
INSERT INTO t7 VALUES (3,0,'Low',3);
select t3._field_140,min(t3._field_131), min(t3._field_135), min(t3._field_139), min(t3._field_137), min(link_alias_142._field_165), min(link_alias_133._field_72), min(t3._field_145), min(link_alias_148._field_156), min(t3._field_140), t3.t3_id from t3 left join t4 on t4.seq_0_id = t3.t3_id left join t7 link_alias_142 on t4.seq_1_id = link_alias_142.t7_id left join t6 on t6.seq_0_id = t3.t3_id left join t1 link_alias_133 on t6.seq_1_id = link_alias_133.t1_id left join t2 on t2.seq_0_id = t3.t3_id left join t5 link_alias_148 on t2.seq_1_id = link_alias_148.t5_id where t3.t3_id in (1) group by t3.t3_id order by link_alias_142._field_166, _field_139, link_alias_133._field_72, _field_135, link_alias_148._field_156;
select t3._field_140,min(t3._field_131), min(t3._field_135), min(t3._field_139), min(t3._field_137), min(link_alias_142._field_165), min(link_alias_133._field_72), min(t3._field_145), min(link_alias_148._field_156), replace(min(t3._field_140), "\r","^M"),t3.t3_id from t3 left join t4 on t4.seq_0_id = t3.t3_id left join t7 link_alias_142 on t4.seq_1_id = link_alias_142.t7_id left join t6 on t6.seq_0_id = t3.t3_id left join t1 link_alias_133 on t6.seq_1_id = link_alias_133.t1_id left join t2 on t2.seq_0_id = t3.t3_id left join t5 link_alias_148 on t2.seq_1_id = link_alias_148.t5_id where t3.t3_id in (1) group by t3.t3_id order by link_alias_142._field_166, _field_139, link_alias_133._field_72, _field_135, link_alias_148._field_156;
drop table t1,t2,t3,t4,t5,t6,t7;
......
......@@ -108,6 +108,8 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax,
return hash_mask((*hash->calc_hashnr)(key,length),buffmax,maxlength);
}
#ifndef NEW_HASH_FUNCTION
/* Calc hashvalue for a key */
static uint calc_hashnr(const byte *key,uint length)
......@@ -134,6 +136,49 @@ static uint calc_hashnr_caseup(const byte *key,uint length)
return((uint) nr);
}
#else
/*
* Fowler/Noll/Vo hash
*
* The basis of the hash algorithm was taken from an idea sent by email to the
* IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and
* Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com)
* later improved on their algorithm.
*
* The magic is in the interesting relationship between the special prime
* 16777619 (2^24 + 403) and 2^32 and 2^8.
*
* This hash produces the fewest collisions of any function that we've seen so
* far, and works well on both numbers and strings.
*/
uint calc_hashnr(const byte *key, uint len)
{
const byte *end=key+len;
uint hash;
for (hash = 0; key < end; key++)
{
hash *= 16777619;
hash ^= (uint) *(uchar*) key;
}
return (hash);
}
uint calc_hashnr_caseup(const byte *key, uint len)
{
const byte *end=key+len;
uint hash;
for (hash = 0; key < end; key++)
{
hash *= 16777619;
hash ^= (uint) (uchar) toupper(*key);
}
return (hash);
}
#endif
static inline uint rec_hashnr(HASH *hash,const byte *record)
{
......
......@@ -10,7 +10,7 @@ $opt_config_file = undef();
$opt_example = 0;
$opt_help = 0;
$opt_log = "/tmp/mysqld_multi.log";
$opt_mysqladmin = "mysqladmin";
$opt_mysqladmin = "@bindir@/mysqladmin";
$opt_mysqld = "@libexecdir@/mysqld";
$opt_no_log = 0;
$opt_password = undef();
......
......@@ -51,6 +51,7 @@ parse_arguments() {
--open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;;
--core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;;
--timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;;
--mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;;
*)
if test -n "$pick_args"
then
......@@ -87,6 +88,7 @@ fi
MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}
MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@}
user=@MYSQLD_USER@
MYSQLD=mysqld
# these rely on $DATADIR by default, so we'll set them later on
pid_file=
......@@ -111,9 +113,9 @@ args=
parse_arguments `$print_defaults $defaults mysqld safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test ! -x $ledir/mysqld
if test ! -x $ledir/$MYSQLD
then
echo "The file $ledir/mysqld doesn't exist or is not executable"
echo "The file $ledir/$MYSQLD doesn't exist or is not executable"
echo "Please do a cd to the mysql installation directory and restart"
echo "this script from there as follows:"
echo "./bin/safe_mysqld".
......@@ -195,7 +197,7 @@ fi
# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check -O key_buffer=64M -O sort_buffer=64M $DATADIR/*/*.MYI
# $MY_BASEDIR_VERSION/bin/isamchk --silent --force -O sort_buffer=64M $DATADIR/*/*.ISM
echo "Starting mysqld daemon with databases from $DATADIR"
echo "Starting $MYSQLD daemon with databases from $DATADIR"
# Does this work on all systems?
#if type ulimit | grep "shell builtin" > /dev/null
......@@ -209,9 +211,9 @@ do
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
if test -z "$args"
then
$NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1
else
eval "$NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1"
eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1"
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
......@@ -225,12 +227,12 @@ do
# but should work for the rest of the servers.
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld`
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD`
echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
PROC=`ps xa | grep $ledir/mysqld | grep -v "grep" | tail -1`
PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1`
for T in $PROC
do
break
......@@ -238,7 +240,7 @@ do
# echo "TEST $I - $T **"
if kill -9 $T
then
echo "mysqld process hanging, pid $T - killed" | tee -a $err_log
echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
else
break
fi
......
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:24:55
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 15:29:27
ATIS table test
......@@ -6,14 +6,15 @@ Creating tables
Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (9768): 4 wallclock secs ( 0.64 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (9768): 3 wallclock secs ( 0.64 usr 0.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data
Time for select_simple_join (500): 1 wallclock secs ( 0.66 usr 0.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (200): 12 wallclock secs ( 4.45 usr 3.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 11 wallclock secs ( 1.77 usr 0.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 10 wallclock secs ( 1.59 usr 0.65 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_simple_join (500): 2 wallclock secs ( 0.62 usr 0.39 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (100): 2 wallclock secs ( 0.47 usr 0.35 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key_prefix_join (100): 10 wallclock secs ( 3.80 usr 2.75 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 11 wallclock secs ( 1.63 usr 1.04 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 10 wallclock secs ( 1.48 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Removing tables
Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 38 wallclock secs ( 9.13 usr 5.79 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 38 wallclock secs ( 8.65 usr 5.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:25:34
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 15:30:07
Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table
Time for insert (1000) 0 wallclock secs ( 0.06 usr 0.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 213 wallclock secs ( 0.17 usr 0.07 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 213 wallclock secs ( 0.17 usr 0.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_index (8): 4 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_index (8): 4 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 170 wallclock secs ( 0.07 usr 0.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 175 wallclock secs ( 0.06 usr 0.04 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 391 wallclock secs ( 0.31 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 396 wallclock secs ( 0.30 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:32:05
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 15:36:43
Testing of some unusual tables
All tests are done 1000 times with 1000 fields
Testing table with 1000 fields
Testing select * from table with 1 record
Time to select_many_fields(1000): 10 wallclock secs ( 3.93 usr 5.07 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_many_fields(1000): 10 wallclock secs ( 3.89 usr 5.32 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select all_fields from table with 1 record
Time to select_many_fields(1000): 16 wallclock secs ( 4.06 usr 5.04 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_many_fields(1000): 16 wallclock secs ( 4.05 usr 5.28 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES()
Time to insert_many_fields(1000): 5 wallclock secs ( 0.33 usr 0.07 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert_many_fields(1000): 5 wallclock secs ( 0.32 usr 0.07 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert (all_fields) VALUES()
Time to insert_many_fields(1000): 9 wallclock secs ( 0.02 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert_many_fields(1000): 9 wallclock secs ( 0.03 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 41 wallclock secs ( 8.35 usr 10.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 41 wallclock secs ( 8.30 usr 10.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:32:46
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 15:37:25
Testing the speed of connecting to the server and sending of data
All tests are done 10000 times
Testing connection/disconnect
Time to connect (10000): 14 wallclock secs ( 7.49 usr 2.43 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to connect (10000): 13 wallclock secs ( 7.51 usr 2.43 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test connect/simple select/disconnect
Time for connect+select_simple (10000): 15 wallclock secs ( 7.61 usr 3.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for connect+select_simple (10000): 16 wallclock secs ( 7.69 usr 3.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test simple select
Time for select_simple (10000): 2 wallclock secs ( 0.28 usr 0.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_simple (10000): 1 wallclock secs ( 0.31 usr 0.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing connect/select 1 row from table/disconnect
Time to connect+select_1_row (10000): 17 wallclock secs ( 7.59 usr 3.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to connect+select_1_row (10000): 17 wallclock secs ( 7.95 usr 3.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 1 row from table
Time to select_1_row (10000): 2 wallclock secs ( 0.35 usr 0.95 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_1_row (10000): 2 wallclock secs ( 0.46 usr 1.12 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 2 rows from table
Time to select_2_rows (10000): 3 wallclock secs ( 0.34 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_2_rows (10000): 3 wallclock secs ( 0.36 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test select with aritmetic (+)
Time for select_column+column (10000): 3 wallclock secs ( 0.26 usr 0.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_column+column (10000): 3 wallclock secs ( 0.28 usr 0.76 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing retrieval of big records (65000 bytes)
Time to select_big (10000): 20 wallclock secs ( 7.74 usr 6.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_big (10000): 19 wallclock secs ( 7.75 usr 6.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 76 wallclock secs (31.66 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 74 wallclock secs (32.31 usr 18.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 17:34:02
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 15:38:39
Testing the speed of creating and droping tables
Testing with 10000 tables and 10000 loop count
Testing create of tables
Time for create_MANY_tables (10000): 90 wallclock secs ( 1.79 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_MANY_tables (10000): 164 wallclock secs ( 1.93 usr 0.57 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables
Time to select_group_when_MANY_tables (10000): 6 wallclock secs ( 0.96 usr 0.87 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to select_group_when_MANY_tables (10000): 6 wallclock secs ( 0.84 usr 0.83 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing drop
Time for drop_table_when_MANY_tables (10000): 7 wallclock secs ( 0.62 usr 0.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_table_when_MANY_tables (10000): 7 wallclock secs ( 0.68 usr 0.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing create+drop
Time for create+drop (10000): 13 wallclock secs ( 2.68 usr 1.04 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 17 wallclock secs ( 4.18 usr 1.32 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 133 wallclock secs (10.24 usr 4.48 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create+drop (10000): 13 wallclock secs ( 2.77 usr 1.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 17 wallclock secs ( 4.14 usr 1.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 207 wallclock secs (10.36 usr 4.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 18:06:37
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 16:14:21
Testing the speed of selecting on keys that consist of many parts
The test-table has 10000 rows and the test is done with 500 ranges.
Creating table
Inserting 10000 rows
Time to insert (10000): 4 wallclock secs ( 0.76 usr 0.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (10000): 3 wallclock secs ( 0.72 usr 0.71 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing big selects on the table
Time for select_big (70:17207): 1 wallclock secs ( 0.14 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 229 wallclock secs ( 8.56 usr 5.62 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 166 wallclock secs (21.04 usr 6.26 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 389 wallclock secs (15.72 usr 4.52 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 227 wallclock secs ( 9.67 usr 5.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 153 wallclock secs (21.55 usr 6.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 355 wallclock secs (16.42 usr 4.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:100000): 40 wallclock secs ( 1.00 usr 0.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:100000): 38 wallclock secs ( 1.16 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing count(distinct) on the table
Time for count_distinct (2000:2000): 92 wallclock secs ( 0.69 usr 0.21 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 42 wallclock secs ( 0.43 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 63 wallclock secs ( 1.10 usr 0.62 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 64 wallclock secs ( 1.06 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (100:1000000): 80 wallclock secs ( 7.23 usr 8.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1170 wallclock secs (57.76 usr 27.85 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct (2000:2000): 102 wallclock secs ( 0.71 usr 0.21 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 42 wallclock secs ( 0.45 usr 0.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 62 wallclock secs ( 1.20 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 63 wallclock secs ( 1.16 usr 0.69 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (100:1000000): 81 wallclock secs ( 8.00 usr 9.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1127 wallclock secs (61.16 usr 29.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.29 gamma' at 2000-11-28 18:26:07
Testing server 'MySQL 3.23.30 gamma' at 2000-12-28 16:33:09
Wisconsin benchmark test
Time for create_table (3): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data
Time to insert (31000): 14 wallclock secs ( 1.82 usr 1.89 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to insert (31000): 14 wallclock secs ( 1.87 usr 1.88 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to delete_big (1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Running actual benchmark
Time for wisc_benchmark (114): 4 wallclock secs ( 1.88 usr 0.93 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for wisc_benchmark (114): 4 wallclock secs ( 1.71 usr 0.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 18 wallclock secs ( 3.70 usr 2.82 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 18 wallclock secs ( 3.58 usr 2.86 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
......@@ -1971,11 +1971,17 @@ ha_innobase::external_lock(
THR_LOCK_DATA **ha_innobase::store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
/*??????????????????*/
*to++= &lock;
return(to);
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
{
/* If we are not doing a LOCK TABLE, then allow multiple writers */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
lock_type <= TL_WRITE) &&
!thd->in_lock_tables)
lock_type = TL_WRITE_ALLOW_WRITE;
lock.type=lock_type;
}
*to++= &lock;
return(to);
}
/*********************************************************************
......
......@@ -1082,9 +1082,10 @@ inline static __volatile__ void trace_stack()
uchar **stack_bottom;
uchar** ebp;
LINT_INIT(ebp);
fprintf(stderr, "Attemping backtrace, please send the info below to \
bugs@lists.mysql.com. If you see no messages after this, something \
went terribly wrong - report this anyway\n");
fprintf(stderr,
"Attemping backtrace. You can use the following information to find out\n\
where mysqld died. If you see no messages after this, something went\n\
terribly wrong\n");
THD* thd = current_thd;
uint frame_count = 0;
__asm __volatile__ ("movl %%ebp,%0"
......@@ -1092,7 +1093,7 @@ went terribly wrong - report this anyway\n");
:"r"(ebp));
if (!ebp)
{
fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with \
fprintf(stderr, "frame pointer (ebp) is NULL, did you compile with\n\
-fomit-frame-pointer? Aborting backtrace\n");
return;
}
......@@ -1143,9 +1144,9 @@ static sig_handler handle_segfault(int sig)
segfaulted = 1;
fprintf(stderr,"\
mysqld got signal %d;\n\
The manual section 'Debugging a MySQL server' tells you how to use a \n\
debugger on the core file to produce a backtrace that may help you find out\n\
why mysqld died\n",sig);
The manual section 'Debugging a MySQL server' tells you how to use a\n\
stack trace and/or the core file to produce a readable backtrace that may\n\
help in finding out why mysqld died\n",sig);
#if defined(HAVE_LINUXTHREADS)
#ifdef __i386__
trace_stack();
......@@ -1622,12 +1623,14 @@ int main(int argc, char **argv)
{
server_id= !master_host ? 1 : 2;
switch (server_id) {
#ifdef EXTRA_DEBUG
case 1:
sql_print_error("\
Warning: one should set server_id to a non-0 value if log-bin is enabled.\n\
Will log updates to binary log, but will not accept connections from slaves");
break;
default:
#endif
case 2:
sql_print_error("\
Warning: one should set server_id to a non-0 value if master_host is set.\n\
The server will not act as a slave");
......@@ -2351,7 +2354,8 @@ enum options {
OPT_INNOBASE_DATA_HOME_DIR,OPT_INNOBASE_DATA_FILE_PATH,
OPT_INNOBASE_LOG_GROUP_HOME_DIR,
OPT_INNOBASE_LOG_ARCH_DIR, OPT_INNOBASE_LOG_ARCHIVE,
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT, OPT_SAFE_SHOW_DB
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT, OPT_SAFE_SHOW_DB,
OPT_GEMINI_SKIP,
};
static struct option long_options[] = {
......@@ -2462,6 +2466,9 @@ static struct option long_options[] = {
#endif
#ifdef HAVE_INNOBASE_DB
{"skip-innobase", no_argument, 0, (int) OPT_INNOBASE_SKIP},
#endif
#ifdef HAVE_GEMINI_DB
{"skip-gemini", no_argument, 0, (int) OPT_GEMINI_SKIP},
#endif
{"skip-concurrent-insert", no_argument, 0, (int) OPT_SKIP_CONCURRENT_INSERT},
{"skip-delay-key-write", no_argument, 0, (int) OPT_SKIP_DELAY_KEY_WRITE},
......@@ -2544,7 +2551,7 @@ CHANGEABLE_VAR changeable_vars[] = {
{ "lower_case_table_names", (long*) &lower_case_table_names,
IF_WIN(1,0), 0, 1, 0, 1 },
{ "max_allowed_packet", (long*) &max_allowed_packet,
1024*1024L, 80, 17*1024*1024L, MALLOC_OVERHEAD, 1024 },
1024*1024L, 80, 64*1024*1024L, MALLOC_OVERHEAD, 1024 },
{ "max_binlog_cache_size", (long*) &max_binlog_cache_size,
~0L, IO_SIZE, ~0L, 0, IO_SIZE },
{ "max_connections", (long*) &max_connections,
......@@ -3387,6 +3394,12 @@ static void get_options(int argc,char **argv)
have_berkeley_db=SHOW_OPTION_DISABLED;
break;
#endif
#ifdef HAVE_GEMINI_DB
case OPT_GEMINI_SKIP:
gemini_skip=1;
have_gemini_db=SHOW_OPTION_DISABLED;
break;
#endif
#ifdef HAVE_INNOBASE_DB
case OPT_INNOBASE_SKIP:
innobase_skip=1;
......
......@@ -1426,7 +1426,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
char path[FN_REFLEN];
(void) sprintf(path,"%s/%s/%s",mysql_data_home,new_db,tmp_name);
fn_format(path,path,"","",4+16+32);
fn_format(path,path,"","",4);
new_table=open_temporary_table(thd, path, new_db, tmp_name,0);
}
if (!new_table)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment