Commit 6c0ac56f authored by unknown's avatar unknown

Merge


sql/sql_show.cc:
  merged
parents 36cee1bd 568cb597
...@@ -181,3 +181,7 @@ mysql-test/mysql-test-run ...@@ -181,3 +181,7 @@ mysql-test/mysql-test-run
BitKeeper/tmp/gone BitKeeper/tmp/gone
mysqld.S mysqld.S
mysqld.sym 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" ...@@ -7,4 +7,10 @@ extra_flags="$pentium_cflags $fast_cflags"
extra_configs="$pentium_configs" extra_configs="$pentium_configs"
strip=yes 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" . "$path/FINISH.sh"
...@@ -8,4 +8,10 @@ c_warnings="$c_warnings $debug_extra_warnings" ...@@ -8,4 +8,10 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs" 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" . "$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. ...@@ -289,6 +289,151 @@ Use pointers rather than array indexing when operating on strings.
@end itemize @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 The Index was empty, and ugly, so I removed it. (jcole, Sep 7, 2000)
@c @node Index @c @node Index
......
This diff is collapsed.
...@@ -26,6 +26,7 @@ typedef struct st_line_buffer ...@@ -26,6 +26,7 @@ typedef struct st_line_buffer
uint bufread; /* Number of bytes to get with each read(). */ uint bufread; /* Number of bytes to get with each read(). */
uint eof; uint eof;
ulong max_size; ulong max_size;
ulong read_length; /* Length of last read string */
} LINE_BUFFER; } LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "my_readline.h" #include "my_readline.h"
#include <signal.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 gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr); void sql_element_free(void *ptr);
...@@ -903,7 +903,6 @@ static bool add_line(String &buffer,char *line,char *in_string) ...@@ -903,7 +903,6 @@ static bool add_line(String &buffer,char *line,char *in_string)
continue; continue;
#ifdef USE_MB #ifdef USE_MB
int l; int l;
/* if ((l = ismbchar(pos, pos+MBMAXLEN))) { Wei He: I think it's wrong! */
if (use_mb(default_charset_info) && if (use_mb(default_charset_info) &&
(l = my_ismbchar(default_charset_info, pos, strend))) { (l = my_ismbchar(default_charset_info, pos, strend))) {
while (l--) while (l--)
...@@ -2163,7 +2162,9 @@ com_status(String *buffer __attribute__((unused)), ...@@ -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, "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, "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, "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) if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket)
tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port); tee_fprintf(stdout, "TCP port:\t\t%d\n", mysql.port);
else else
......
...@@ -122,7 +122,6 @@ static struct option long_options[] = { ...@@ -122,7 +122,6 @@ static struct option long_options[] = {
{"socket", required_argument, 0, 'S'}, {"socket", required_argument, 0, 'S'},
{"sleep", required_argument, 0, 'i'}, {"sleep", required_argument, 0, 'i'},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"connect-timeout", required_argument, 0, 't'},
#ifndef DONT_ALLOW_USER_CHANGE #ifndef DONT_ALLOW_USER_CHANGE
{"user", required_argument, 0, 'u'}, {"user", required_argument, 0, 'u'},
#endif #endif
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee>
**/ **/
#define DUMP_VERSION "8.11" #define DUMP_VERSION "8.12"
#include <global.h> #include <global.h>
#include <my_sys.h> #include <my_sys.h>
...@@ -863,9 +863,14 @@ static char *add_load_option(char *ptr,const char *object, ...@@ -863,9 +863,14 @@ static char *add_load_option(char *ptr,const char *object,
{ {
if (object) if (object)
{ {
ptr= strxmov(ptr," ",statement," '",NullS); if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */
ptr= field_escape(ptr,object,(uint) strlen(object)); ptr= strxmov(ptr," ",statement," ",object,NullS);
*ptr++= '\''; else /* char constant; escape */
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
} }
return ptr; return ptr;
} /* add_load_option */ } /* add_load_option */
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
** * * ** * *
** ************************* ** *************************
*/ */
#define IMPORT_VERSION "2.6" #define IMPORT_VERSION "2.7"
#include <global.h> #include <global.h>
#include <my_sys.h> #include <my_sys.h>
...@@ -456,9 +456,14 @@ static char *add_load_option(char *ptr,const char *object,const char *statement) ...@@ -456,9 +456,14 @@ static char *add_load_option(char *ptr,const char *object,const char *statement)
{ {
if (object) if (object)
{ {
ptr= strxmov(ptr," ",statement," '",NullS); if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */
ptr= field_escape(ptr,object,(uint) strlen(object)); ptr= strxmov(ptr," ",statement," ",object,NullS);
*ptr++= '\''; else /* char constant; escape */
{
ptr= strxmov(ptr," ",statement," '",NullS);
ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
} }
return ptr; return ptr;
} }
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size, ...@@ -26,7 +26,7 @@ static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size); ulong max_size);
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str); static bool init_line_buffer_from_string(LINE_BUFFER *buffer,my_string str);
static uint fill_buffer(LINE_BUFFER *buffer); 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) LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
...@@ -46,12 +46,13 @@ 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 *batch_readline(LINE_BUFFER *line_buff)
{ {
char *pos; char *pos;
uint out_length; ulong out_length;
if (!(pos=intern_read_line(line_buff,&out_length))) if (!(pos=intern_read_line(line_buff,&out_length)))
return 0; return 0;
if (out_length && pos[out_length-1] == '\n') if (out_length && pos[out_length-1] == '\n')
out_length--; /* Remove '\n' */ out_length--; /* Remove '\n' */
line_buff->read_length=out_length;
pos[out_length]=0; pos[out_length]=0;
return pos; return pos;
} }
...@@ -187,7 +188,7 @@ static uint fill_buffer(LINE_BUFFER *buffer) ...@@ -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; char *pos;
uint length; uint length;
...@@ -210,7 +211,7 @@ char *intern_read_line(LINE_BUFFER *buffer,uint *out_length) ...@@ -210,7 +211,7 @@ char *intern_read_line(LINE_BUFFER *buffer,uint *out_length)
pos--; /* break line here */ pos--; /* break line here */
} }
buffer->end_of_line=pos+1; 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); DBUG_RETURN(buffer->start_of_line);
} }
} }
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.29a-gamma) AM_INIT_AUTOMAKE(mysql, 3.23.30-gamma)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -436,10 +436,16 @@ AM_CONDITIONAL(ASSEMBLER, test ASSEMBLER_x86 = "" -o ASSEMBLER_x86 = "") ...@@ -436,10 +436,16 @@ AM_CONDITIONAL(ASSEMBLER, test ASSEMBLER_x86 = "" -o ASSEMBLER_x86 = "")
AC_MSG_CHECKING(whether to use RAID) AC_MSG_CHECKING(whether to use RAID)
AC_ARG_WITH(raid, AC_ARG_WITH(raid,
[ --with-raid Enable RAID Support], [ --with-raid Enable RAID Support],
[ AC_DEFINE(USE_RAID) [ USE_RAID=$withval ],
AC_MSG_RESULT(yes) ], [ USE_RAID=no ]
[ AC_MSG_RESULT(no) ]
) )
if test "$USE_RAID" = "yes"
then
AC_MSG_RESULT([yes])
AC_DEFINE([USE_RAID])
else
AC_MSG_RESULT([no])
fi
# Use this to set the place used for unix socket used to local communication. # Use this to set the place used for unix socket used to local communication.
AC_ARG_WITH(unix-socket-path, AC_ARG_WITH(unix-socket-path,
......
...@@ -18,11 +18,12 @@ ...@@ -18,11 +18,12 @@
#include "heapdef.h" #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 */ /* 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; int error;
uint key; uint key;
...@@ -30,13 +31,15 @@ int heap_check_heap(HP_INFO *info) ...@@ -30,13 +31,15 @@ int heap_check_heap(HP_INFO *info)
DBUG_ENTER("heap_check_keys"); DBUG_ENTER("heap_check_keys");
for (error=key=0 ; key < share->keys ; key++) 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); 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; int error;
uint i,found,max_links,seek,links; uint i,found,max_links,seek,links;
...@@ -76,6 +79,9 @@ static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength) ...@@ -76,6 +79,9 @@ static int check_one_key(HP_KEYDEF *keydef, ulong records, ulong blength)
} }
DBUG_PRINT("info", DBUG_PRINT("info",
("records: %ld seeks: %d max links: %d hitrate: %.2f", ("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; return error;
} }
...@@ -37,7 +37,7 @@ int _hp_close(register HP_INFO *info) ...@@ -37,7 +37,7 @@ int _hp_close(register HP_INFO *info)
int error=0; int error=0;
DBUG_ENTER("_hp_close"); DBUG_ENTER("_hp_close");
#ifndef DBUG_OFF #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; error=my_errno=HA_ERR_CRASHED;
} }
......
...@@ -145,6 +145,7 @@ void _hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink) ...@@ -145,6 +145,7 @@ void _hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink)
return; return;
} }
#ifndef NEW_HASH_FUNCTION
/* Calc hashvalue for a key */ /* Calc hashvalue for a key */
...@@ -152,13 +153,14 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ...@@ -152,13 +153,14 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
{ {
register ulong nr=1, nr2=4; register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg; HP_KEYSEG *seg,*endseg;
uchar *pos;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{ {
uchar *pos=(uchar*) key;
key+=seg->length;
if (seg->type == HA_KEYTYPE_TEXT) 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); nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3; nr2+=3;
...@@ -166,7 +168,7 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ...@@ -166,7 +168,7 @@ ulong _hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
} }
else 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); nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3; nr2+=3;
...@@ -182,13 +184,13 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ...@@ -182,13 +184,13 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
{ {
register ulong nr=1, nr2=4; register ulong nr=1, nr2=4;
HP_KEYSEG *seg,*endseg; HP_KEYSEG *seg,*endseg;
uchar *pos,*end;
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) 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) 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); nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) my_sort_order[(uint) *pos]))+ (nr << 8);
nr2+=3; nr2+=3;
...@@ -196,7 +198,7 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ...@@ -196,7 +198,7 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
} }
else 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); nr^=(ulong) ((((uint) nr & 63)+nr2)*((uint) *pos))+ (nr << 8);
nr2+=3; nr2+=3;
...@@ -206,6 +208,85 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ...@@ -206,6 +208,85 @@ ulong _hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
return((ulong) nr); 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 */ /* 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) 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, ...@@ -38,6 +38,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef,
pthread_mutex_lock(&THR_LOCK_heap); pthread_mutex_lock(&THR_LOCK_heap);
if (!(share=_hp_find_named_heap(name))) if (!(share=_hp_find_named_heap(name)))
{ {
DBUG_PRINT("info",("Initializing new table"));
for (i=key_segs=max_length=0 ; i < keys ; i++) for (i=key_segs=max_length=0 ; i < keys ; i++)
{ {
key_segs+= keydef[i].keysegs; key_segs+= keydef[i].keysegs;
......
...@@ -65,7 +65,7 @@ int main(int argc, char **argv) ...@@ -65,7 +65,7 @@ int main(int argc, char **argv)
sprintf(key,"%6d",j); sprintf(key,"%6d",j);
bmove(record+1,key,6); bmove(record+1,key,6);
error=heap_write(file,record); error=heap_write(file,record);
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -100,7 +100,7 @@ int main(int argc, char **argv) ...@@ -100,7 +100,7 @@ int main(int argc, char **argv)
if (! error) if (! error)
deleted++; deleted++;
} }
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
......
...@@ -133,7 +133,7 @@ char *argv[]; ...@@ -133,7 +133,7 @@ char *argv[];
write_count++; key1[n1]++; key3[n3]=1; write_count++; key1[n1]++; key3[n3]=1;
key_check+=n1; key_check+=n1;
} }
if (testflag == 1 && heap_check_heap(file)) if (testflag == 1 && heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -141,7 +141,7 @@ char *argv[]; ...@@ -141,7 +141,7 @@ char *argv[];
} }
if (testflag == 1) if (testflag == 1)
goto end; goto end;
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -173,7 +173,7 @@ char *argv[]; ...@@ -173,7 +173,7 @@ char *argv[];
key1[atoi(record+keyinfo[0].seg[0].start)]--; key1[atoi(record+keyinfo[0].seg[0].start)]--;
key3[atoi(record+keyinfo[2].seg[0].start)]=0; key3[atoi(record+keyinfo[2].seg[0].start)]=0;
key_check-=atoi(record); key_check-=atoi(record);
if (testflag == 2 && heap_check_heap(file)) if (testflag == 2 && heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -183,7 +183,7 @@ char *argv[]; ...@@ -183,7 +183,7 @@ char *argv[];
puts("Warning: Skipping delete test because no dupplicate keys"); puts("Warning: Skipping delete test because no dupplicate keys");
} }
if (testflag==2) goto end; if (testflag==2) goto end;
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -239,14 +239,14 @@ char *argv[]; ...@@ -239,14 +239,14 @@ char *argv[];
update++; update++;
key_check=key_check-atoi(record)+n1; 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"); puts("Heap keys crashed");
goto err; goto err;
} }
} }
if (testflag == 3) goto end; if (testflag == 3) goto end;
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -284,7 +284,7 @@ char *argv[]; ...@@ -284,7 +284,7 @@ char *argv[];
goto end; goto end;
} }
dupp_keys--; dupp_keys--;
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -320,7 +320,7 @@ char *argv[]; ...@@ -320,7 +320,7 @@ char *argv[];
goto end; goto end;
} }
dupp_keys-=2; dupp_keys-=2;
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -353,7 +353,7 @@ char *argv[]; ...@@ -353,7 +353,7 @@ char *argv[];
printf("next: Found: %d records of %d\n",ant,write_count-delete); printf("next: Found: %d records of %d\n",ant,write_count-delete);
goto end; goto end;
} }
if (heap_check_heap(file)) if (heap_check_heap(file,0))
{ {
puts("Heap keys crashed"); puts("Heap keys crashed");
goto err; goto err;
...@@ -556,7 +556,8 @@ char *argv[]; ...@@ -556,7 +556,8 @@ char *argv[];
} }
pos++; 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"); puts("Heap keys crashed");
goto err; goto err;
......
...@@ -156,7 +156,7 @@ extern int heap_rlast(HP_INFO *info,byte *record); ...@@ -156,7 +156,7 @@ extern int heap_rlast(HP_INFO *info,byte *record);
extern void heap_clear(HP_INFO *info); extern void heap_clear(HP_INFO *info);
extern int heap_rkey(HP_INFO *info,byte *record,int inx,const byte *key); 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 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); extern byte *heap_position(HP_INFO *info);
/* The following is for programs that uses the old HEAP interface where /* 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) ...@@ -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->current_table=find_table(info->open_tables,
info->end_table,filepos); info->end_table-1,filepos);
isam_info=info->current_table->table; isam_info=info->current_table->table;
isam_info->update&= HA_STATE_CHANGED; isam_info->update&= HA_STATE_CHANGED;
return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf, return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf,
......
...@@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names) ...@@ -393,7 +393,7 @@ static int examine_log(my_string file_name, char **table_names)
char *pos,*to; char *pos,*to;
/* Fix if old DOS files to new format */ /* Fix if old DOS files to new format */
for (pos=file_info.name; pos=strchr(pos,'\\') ; pos++) for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++)
*pos= '/'; *pos= '/';
pos=file_info.name; pos=file_info.name;
......
-- require r/have_bdb.require
show variables like "have_bdb";
-- require r/have_isam.require
show variables like "have_isam";
...@@ -17,16 +17,16 @@ else ...@@ -17,16 +17,16 @@ else
fix_bin=. fix_bin=.
fi fi
vardir=var
logdir=$vardir/log
if [ x$1 = x"-slave" ] if [ x$1 = x"-slave" ]
then then
shift 1 shift 1
data=var/slave-data data=var/slave-data
ldata=$fix_bin/var/slave-data ldata=$fix_bin/var/slave-data
logdir=var/log
else else
data=var/lib data=var/lib
ldata=$fix_bin/var/lib ldata=$fix_bin/var/lib
logdir=var/log
fi fi
mdata=$data/mysql mdata=$data/mysql
...@@ -45,9 +45,13 @@ hostname=`hostname` # Install this too in the user table ...@@ -45,9 +45,13 @@ hostname=`hostname` # Install this too in the user table
resolved=127.0.0.1 resolved=127.0.0.1
#create the directories
[ -d $vardir ] || mkdir $vardir
[ -d $logdir ] || mkdir $logdir
# Create database directories mysql & test # Create database directories mysql & test
if [ -d $data ] ; then rm -rf $data ; fi if [ -d $data ] ; then rm -rf $data ; fi
mkdir -p $data $data/mysql $data/test mkdir $data $data/mysql $data/test
#for error messages #for error messages
if [ x$BINARY_DIST = x1 ] ; then if [ x$BINARY_DIST = x1 ] ; then
...@@ -59,9 +63,6 @@ mkdir share ...@@ -59,9 +63,6 @@ mkdir share
ln -sf ../../sql/share share/mysql ln -sf ../../sql/share share/mysql
fi fi
#create the directory for logs
mkdir -p $logdir
# Initialize variables # Initialize variables
c_d="" i_d="" c_d="" i_d=""
c_h="" i_h="" c_h="" i_h=""
......
This diff is collapsed.
bandID payoutID new_col
6 1 NULL
3 4 NULL
1 6 NULL
2 6 NULL
4 9 NULL
5 10 NULL
7 12 NULL
8 12 NULL
bandID payoutID new_col
1 6 NULL
2 6 NULL
3 4 NULL
4 9 NULL
5 10 NULL
6 1 NULL
7 12 NULL
8 12 NULL
Field Type Null Key Default Extra Privileges
GROUP_ID int(10) unsigned PRI 0 select,insert,update,references
LANG_ID smallint(5) unsigned PRI 0 select,insert,update,references
NAME char(80) MUL select,insert,update,references
n
3
9
10
12
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL
t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL
a b
1 1
3 3
5 5
6 6
a b c
1 1 NULL
3 3 3
5 5 NULL
8 8 8
9 9 9
a b
1 1
5 5
3 3
4 4
6 6
a b c
1 1 NULL
5 5 NULL
3 3 NULL
4 4 NULL
6 6 6
skey sval
1 hello
2 hey
_rowid _rowid skey sval
1 1 1 hello
2 2 2 hey
a b
a 1
a 2
a 3
a 4
a 5
b 2
b 3
b 4
c 1
c 2
c 3
d 1
d 2
d 5
e 1
k 1
ordid ord
1 sdj
2 sdj
ordid ord
1 abc
2 abc
3 abc
1 sdj
2 sdj
3 sdj
1 zzz
id code name
1 1 Tim
2 1 Monty
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
id code name
2 1 Monty
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
8 1 Sinisa
id code name
3 2 David
4 2 Erik
5 3 Sasha
6 3 Jeremy
7 4 Matt
8 1 Sinisa
12 1 Ralph
id parent_id level
8 102 2
9 102 2
15 102 2
id parent_id level
1001 100 0
1002 101 1
1003 101 1
1004 101 1
1005 101 1
1006 101 1
1007 101 1
1008 102 2
1009 102 2
1015 102 2
1016 103 2
1017 103 2
1018 103 2
1019 103 2
1020 103 2
1021 104 2
1022 104 2
1024 104 2
1025 105 2
1026 105 2
1027 105 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1034 106 2
1035 106 2
1036 107 2
1037 107 2
1038 107 2
1040 107 2
1157 100 0
1179 105 2
1183 104 2
1193 105 2
1202 107 2
1203 107 2
id parent_id level
1001 100 0
1002 101 1
1003 101 1
1004 101 1
1005 101 1
1006 101 1
1007 101 1
1008 102 2
1010 102 2
1015 102 2
1016 103 2
1017 103 2
1018 103 2
1019 103 2
1020 103 2
1021 104 2
1023 104 2
1024 104 2
1025 105 2
1026 105 2
1027 105 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1034 106 2
1035 106 2
1036 107 2
1037 107 2
1039 107 2
1041 107 2
1158 100 0
1180 105 2
1184 104 2
1194 105 2
1202 107 2
1204 107 2
id parent_id level
1008 102 2
1015 102 2
1010 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used
level id
1 1002
1 1003
1 1004
1 1005
1 1006
1 1007
level id parent_id
1 1002 101
1 1003 101
1 1004 101
1 1005 101
1 1006 101
1 1007 101
gesuchnr benutzer_id
1 1
2 1
a
2
a b
a 1
a 2
a 3
a 4
a 5
b 2
b 3
b 4
c 1
c 2
c 3
d 1
d 2
d 5
e 1
k 1
n after rollback
n after commit
4 after commit
n after commit
4 after commit
5 after commit
n
4
5
6
afterbegin_id afterbegin_nom
1 hamdouni
afterrollback_id afterrollback_nom
afterautocommit0_id afterautocommit0_nom
2 mysql
afterrollback_id afterrollback_nom
id val
id val
pippo 12
id val
ID NAME
1 Jochen
_userid
marc@anyware.co.uk
_userid
marc@anyware.co.uk
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
user_id name phone ref_email detail
10292 sanjeev 29153373 sansh777@hotmail.com xxx
10292 shirish 2333604 shirish@yahoo.com ddsds
10292 sonali 323232 sonali@bolly.com filmstar
10293 shirish 2333604 shirish@yahoo.com ddsds
user_id name phone ref_email detail
10293 shirish 2333604 shirish@yahoo.com ddsds
user_id name phone ref_email detail
10291 sanjeev 29153373 sansh777@hotmail.com xxx
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A NULL NULL NULL
t1 0 PRIMARY 2 b A 0 NULL NULL
t1 0 b 1 b A 0 NULL NULL
t1 0 c 1 c A 0 NULL NULL
t1 1 a 1 a A NULL NULL NULL
t1 1 a_2 1 a A NULL NULL NULL
col1 col2
1 1
2 3
3 4
4 4
5 2
col1 col2
1 1
2 3
3 4
4 7
5 2
col1 col2 co3
1 1 0
2 3 0
3 4 0
4 7 0
5 2 0
col1 col2 co3
1 1 0
2 9 0
3 4 0
4 7 0
5 2 0
a b
1 3
2 3
3 3
a b
1 3
2 3
3 3
a b
a b
1 3
2 3
3 3
a b
1 3
2 3
3 3
id ggid email passwd
1 test1 xxx
id ggid email passwd
1 test1 xxx
id ggid email passwd
2 test2 yyy
user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key
user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1
user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2
user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3
user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4
user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5
id parent_id level
8 102 2
9 102 2
15 102 2
id parent_id level
1001 100 0
1003 101 1
1004 101 1
1008 102 2
1024 102 2
1017 103 2
1022 104 2
1024 104 2
1028 105 2
1029 105 2
1030 105 2
1031 106 2
1032 106 2
1033 106 2
1203 107 2
1202 107 2
1020 103 2
1157 100 0
1193 105 2
1040 107 2
1002 101 1
1015 102 2
1006 101 1
1034 106 2
1035 106 2
1016 103 2
1007 101 1
1036 107 2
1018 103 2
1026 105 2
1027 105 2
1183 104 2
1038 107 2
1025 105 2
1037 107 2
1021 104 2
1019 103 2
1005 101 1
1179 105 2
id parent_id level
1002 100 0
1004 101 1
1005 101 1
1009 102 2
1025 102 2
1018 103 2
1023 104 2
1025 104 2
1029 105 2
1030 105 2
1031 105 2
1032 106 2
1033 106 2
1034 106 2
1204 107 2
1203 107 2
1021 103 2
1158 100 0
1194 105 2
1041 107 2
1003 101 1
1016 102 2
1007 101 1
1035 106 2
1036 106 2
1017 103 2
1008 101 1
1037 107 2
1019 103 2
1027 105 2
1028 105 2
1184 104 2
1039 107 2
1026 105 2
1038 107 2
1022 104 2
1020 103 2
1006 101 1
1180 105 2
id parent_id level
1009 102 2
1025 102 2
1016 102 2
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 where used; Using index
level id
1 1004
1 1005
1 1003
1 1007
1 1008
1 1006
level id parent_id
1 1004 101
1 1005 101
1 1003 101
1 1007 101
1 1008 101
1 1006 101
level id
1 1003
1 1004
1 1005
1 1006
1 1007
1 1008
id parent_id level
1002 100 0
1009 102 2
1025 102 2
1018 103 2
1023 104 2
1025 104 2
1029 105 2
1030 105 2
1031 105 2
1032 106 2
1033 106 2
1034 106 2
1204 107 2
1203 107 2
1021 103 2
1158 100 0
1194 105 2
1041 107 2
1016 102 2
1035 106 2
1036 106 2
1017 103 2
1037 107 2
1019 103 2
1027 105 2
1028 105 2
1184 104 2
1039 107 2
1026 105 2
1038 107 2
1022 104 2
1020 103 2
1180 105 2
count(*)
1
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296
922337203685477580 92233720368547758000
922337203685477580 92233720368547758080
-922337203685477580 -92233720368547758000
-922337203685477580 -92233720368547758080
9223372036854775807 -009223372036854775808
9223372036854775807 -9223372036854775808
+9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000
a
18446744073709551615
18446744073709551615
name
concat("*",name,"*")
**
**
**
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
** **
name
concat("*",name,"*")
**
**
**
min(name) min(concat("*",name,"*")) max(name) max(concat("*",name,"*"))
** **
name
name
name
a b
hello hello
a b
a b
hello hello
CASE "b" when "a" then 1 when "b" then 2 END
2
CASE "c" when "a" then 1 when "b" then 2 END
NULL
CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END
3
CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END
ok
CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END
ok
CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end
a
CASE when 1=0 then "true" else "false" END
false
CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END
one
CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END
two
(CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0
2
(CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0
2.00
case 1/0 when "a" then "true" else "false" END
false
case 1/0 when "a" then "true" END
NULL
(case 1/0 when "a" then "true" END) | 0
NULL
(case 1/0 when "a" then "true" END) + 0.0
NULL
case when 1>0 then "TRUE" else "FALSE" END
TRUE
case when 1<0 then "TRUE" else "FALSE" END
FALSE
1+2/*hello*/+3
6
1
1
1 /*!32301 +1
2
1
1
1--1
2
1 --2
+1
4
1
1
table type possible_keys key key_len ref rows Extra
t1 index PRIMARY PRIMARY 12 NULL 2 where used; Using index
id
000000000001
id
000000000001
isbn city libname a
007 Berkeley Berkeley Public1 1
007 Berkeley Berkeley Public2 1
000 New York New York Public Libra 6
001 New York NYC Lib 1
006 San Fran San Fransisco Public 1
isbn city libname a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2
b
NULL
b
1a20 1e+ 1e+10
1 10000000001
a$1 $b c$
1 2 3
encrypt('foo', 'ff')
ffTU0fyIP09Z.
a tmsp
a tmsp
5 19711006010203
6 19711006010203
8 19711006010203
id
NULL
-1
0
1
2
3
4
5
6
7
8
9
10
id facility
NULL NULL
-1
0
1 /L
2 A01
3 ANC
4 F01
5 FBX
6 MT
7 P
8 RV
9 SRV
10 VMT
id-5 facility
NULL NULL
-6
-5
-4 /L
-3 A01
-2 ANC
-1 F01
0 FBX
1 MT
2 P
3 RV
4 SRV
5 VMT
id concat(facility)
NULL NULL
-1
0
1 /L
2 A01
3 ANC
4 F01
5 FBX
6 MT
7 P
8 RV
9 SRV
10 VMT
a max(id) b
10 10 VMT
9 9 SRV
8 8 RV
7 7 P
6 6 MT
5 5 FBX
4 4 F01
3 3 ANC
2 2 A01
1 1 /L
-1 -1
0 0
NULL NULL NULL
grp count(*)
0 7
1 6
FACILITY
NULL
/L
A01
ANC
F01
FBX
MT
P
RV
SRV
VMT
FACILITY
NULL
/L
A01
ANC
F01
FBX
MT
P
RV
SRV
VMT
count(*)
12
count(facility)
12
count(*)
13
count(*)
1
count(*)
0
count(*)
12
count(*)
1
count(*)
12
UserId
UserId
UserId
UserId
b
1
table type possible_keys key key_len ref rows Extra
t3 index a a 4 NULL 6 Using index; Using temporary
t2 index a a 4 NULL 5 Using index; Distinct
t1 eq_ref PRIMARY PRIMARY 4 t2.a 1 where used; Distinct
a
1
table type possible_keys key key_len ref rows Extra
t1 index PRIMARY PRIMARY 4 NULL 2 Using index; Using temporary
t3 ref a a 5 t1.a 12 Using index; Distinct
a
1
2
1
1
name
aa
ab
name
aa
ab
1
1
key_link_id link
NULL NULL
table type possible_keys key key_len ref rows Extra
t1 index id id 4 NULL 2 Using index; Using temporary
t2 index id id 8 NULL 1 Using index; Distinct
t3 index id id 8 NULL 1 Using index; Distinct
j_lj_t2 index id id 4 NULL 2 where used; Using index; Distinct
t2_lj index id id 8 NULL 1 where used; Using index; Distinct
j_lj_t3 index id id 4 NULL 2 where used; Using index; Distinct
t3_lj index id id 8 NULL 1 where used; Using index; Distinct
id
2
count(*)
0
nr b str
nr b str
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
1<=>0 0<=>NULL NULL<=>0
0 0 0
1.0<=>0.0 0.0<=>NULL NULL<=>0.0
0 0 0
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
id value id value t1.value<=>t2.value
1 NULL 1 NULL 1
id value
1 NULL
id value
1 NULL
id value
id str
1 NULL
2 NULL
id str
3 foo
table type possible_keys key key_len ref rows Extra
t1 ref str str 11 const 1 where used
table type possible_keys key key_len ref rows Extra
t1 const str str 11 const 1
table type possible_keys key key_len ref rows Extra
t1 ALL str NULL NULL NULL 4 where used
table type possible_keys key key_len ref rows Extra
t1 const str str 11 const 1
Comment
No tables used
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
4 0.90587321329654 4 0.90587321329654
7 0.89568988462614 7 0.89568988462614
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
4 0.90587321329654 4 0.90587321329654
7 0.89568988462614 7 0.89568988462614
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
7 0.89568988462614 7 0.89568988462614
4 0.90587321329654 4 0.90587321329654
a MATCH (message) AGAINST ('steve') a MATCH (message) AGAINST ('steve')
7 0.89568988462614 7 0.89568988462614
a rel a rel
1 0 1 0
2 0 2 0
3 0 3 0
5 0 5 0
6 0 6 0
7 0.89568988462614 7 0.89568988462614
4 0.90587321329654 4 0.90587321329654
a MATCH b AGAINST ('lala lkjh') a MATCH b AGAINST ('lala lkjh')
1 0.67003110026735 1 0.67003110026735
2 0 2 0
3 0 3 0
a MATCH c AGAINST ('lala lkjh') a MATCH c AGAINST ('lala lkjh')
1 0 1 0
2 0.67756324121582 2 0.67756324121582
3 0 3 0
a MATCH b,c AGAINST ('lala lkjh') a MATCH b,c AGAINST ('lala lkjh')
1 0.64840710366884 1 0.64840710366884
2 0.66266459031789 2 0.66266459031789
3 0 3 0
a b
Only MyISAM tables support collections
Full-text indexes are called collections
a b
Full-text indexes are called collections
a b
Full-text indexes are called collections
Only MyISAM tables support collections
encrypt('foo', 'ff')
ffTU0fyIP09Z.
visitor_id mts
48985536 20000319013932
173865424 20000318233615
357917728 20000319145027
465931136 20000318160953
1092858576 20000319013445
visitor_id mts
48985536 20000319013932
173865424 20000318233615
357917728 20000319145027
465931136 20000318160953
1092858576 20000319013445
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
1<=>0 0<=>NULL NULL<=>0
0 0 0
1.0<=>0.0 0.0<=>NULL NULL<=>0.0
0 0 0
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
id value id value t1.value<=>t2.value
1 NULL 1 NULL 1
id value
1 NULL
id value
1 NULL
id value
a c sum(a)
1 a 1
2 b 2
3 c 3
4 E 4
5 C 5
6 D 6
a c sum(a)
sum(a)
NULL
a
1
3
6
5
2
4
a
1
3
6
5
2
4
count(distinct a) count(distinct grp)
6 3
count(distinct a) count(distinct grp)
6 3
sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
21 6 3.5000 1.7078 7 0 1 6 E
grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c)
NULL 0 0 NULL NULL 0 0 NULL NULL
1 1 1 1.0000 0.0000 1 1 1 1 a a
2 5 2 2.5000 0.5000 3 2 2 3 b c
3 15 3 5.0000 0.8165 7 4 4 6 C E
grp sum
NULL NULL
1 7
2 20
3 44.816496580928
grp a c
NULL NULL
1 2 a
2 5 c
3 9 E
2 3 c
id avg(value1) std(value1)
1 1.000000 0.816497
2 11.000000 0.816497
name avg(value1) std(value1)
Set One 1.000000 0.816497
Set Two 11.000000 0.816497
id avg(rating)
1 3.0000
2 NULL
3 2.0000
count(*)
3
count(*)
1
count(*)
0
count(*)
0
count(a)
1
count(a)
0
count(a)
0
count(b)
2
count(b)
0
count(c)
0
COUNT(i) i COUNT(i)*i
1 1 1
COUNT(i) (i+0) COUNT(i)*(i+0)
1 1 1
sum(num)
147.58
sum(num)
50.15
45.63
51.80
field
field
A
field
A
field
A
NULL
field
NULL
id
2
5
9
a
abc
abcd
a
test
a
test
floor(5.5) floor(-5.5)
5 -6
ceiling(5.5) ceiling(-5.5)
6 -5
truncate(52.64,1) truncate(52.64,2) truncate(52.64,-1) truncate(52.64,-2)
52.6 52.64 50 0
round(5.5) round(-5.5)
6 -6
round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2)
5.6 5.64 10 0
abs(-10) sign(-5) sign(5) sign(0)
10 -1 1 0
log(exp(10)) exp(log(sqrt(10))*2)
10.000000 10.000000
pow(10,log10(10)) power(2,4)
10.000000 16.000000
rand(999999) rand()
0.18435012473199 0.76373626176616
PI() sin(pi()/2) cos(pi()/2) tan(pi()) cot(1) asin(1) acos(0) atan(1)
3.141593 1.000000 0.000000 -0.000000 0.64209262 1.570796 1.570796 0.785398
degrees(pi()) radians(360)
180 6.2831853071796
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
255.255.255.255.255.255.255.255
inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
1099511627775 4294902271 511
inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511)
255.255.255.255.255 255.255.1.255 0.0.1.255
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2
2 0 3 1.60 3 3 3 4
1 | (1+1) 5 & 3 bit_count(7)
3 1 3
1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 1<< 63 >> 60
4294967296 -9223372036854775808 0 1 0 8
s1 regexp s2
1
1
1
1
1
1
1
0
0
0
NULL
NULL
NULL
NULL
interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0
5 2 4 0 TWO 0 1 1.1
find_in_set("b","a,b,c") find_in_set("c","a,b,c") find_in_set("dd","a,bbb,dd") find_in_set("bbb","a,bbb,dd")
2 3 3 2
find_in_set("d","a,b,c") find_in_set("dd","a,bbb,d") find_in_set("bb","a,bbb,dd")
0 0 0
make_set(0,'a','b','c') make_set(-1,'a','b','c') make_set(1,'a','b','c') make_set(2,'a','b','c') make_set(1+2,concat('a','b'),'c')
a,b,c a b ab,c
make_set(NULL,'a','b','c') make_set(1|4,'a',NULL,'c') make_set(1+2,'a',NULL,'c')
NULL a,c a
export_set(9,"Y","N","-",5) export_set(9,"Y","N") export_set(9,"Y","N","")
Y-N-N-Y-N Y,N,N,Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N YNNYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
elt(2,1) field(NULL,"a","b","c")
NULL 0
find_in_set("","a,b,c") find_in_set("","a,b,c,") find_in_set("",",a,b,c")
0 4 1
find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0
...@@ -60,3 +60,40 @@ rpad('abcd',1,'ab') lpad('abcd',1,'ab') ...@@ -60,3 +60,40 @@ rpad('abcd',1,'ab') lpad('abcd',1,'ab')
a a a a
LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD')
HAROLD HARRY HAROLD HARRY
least(1,2,3) | greatest(16,32,8) least(5,4)*1 greatest(-1.0,1.0)*1 least(3,2,1)*1.0 greatest(1,1.1,1.0) least("10",9) greatest("A","B","0")
33 4 1.0 1.0 1.1 9 B
decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000)
1
decode(encode("abcdef","monty"),"monty")="abcdef"
1
reverse("")
insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2)
aa b a
elt(2,1) field(NULL,"a","b","c") reverse("")
NULL 0
locate("a","b",2) locate("","a",1)
0 1
ltrim("a") rtrim("a") trim(BOTH "" from "a") trim(BOTH " " from "a")
a a a a
concat("1","2")|0 concat("1",".5")+0.0
12 1.5
substring_index("www.tcx.se","",3)
length(repeat("a",100000000)) length(repeat("a",1000*64))
NULL 64000
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
1 0 3
position(("1" in (1,2,3)) in "01")
2
length(repeat("a",65500)) length(concat(repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",10000)))) length(insert(repeat("a",40000),1,30000,repeat("b",50000)))
65500 64000 50000 60000
length(repeat("a",1000000)) length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",32000)))) length(insert(repeat("a",48000),1,1000,repeat("a",48000)))
1000000 96000 160000 95000
Date Unix
1998-9-16 09:26:00 905927160
1998-9-16 09:26:00 905927160
domain
hello.de
domain
test.de
database() user()
test test@localhost
version()>="3.23.29"
1
0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
1 1 1 0 0 1 -1 1 0
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
1 1 1 1 1 1
"a "="A" "A "="a" "a " <= "A b"
1 1 1
"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%"
1 1 1 1 1 1 1 1
"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d"
0 0 0 0 0 0 0
'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%'
0 0 0 1 1
'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab"
1 1 0 0 1
"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
1 1
"aba" regexp concat("^","a")
1
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
1 1 0 1 0 1 1 1
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
this is a 2 2.0
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
1 1 1
'b' between 'a' and 'c' 'B' between 'a' and 'c'
1 1
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
1 1 1
-1.49 or -1.49 0.6 or 0.6
1 1
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
1 and 2 between 2 and 10 2 between 2 and 10 and 1
1 1
1 and 0 or 2 2 or 1 and 0
1 1
from_days(to_days("960101")) to_days(960201)-to_days("19960101") to_days(date_add(curdate(), interval 1 day))-to_days(curdate()) weekday("1997-11-29")
1996-01-01 31 1 5
period_add("9602",-12) period_diff(199505,"9404")
199502 13
now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(now())
0 0 0
from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0
1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22")
02:30:01 23001 54742
now()-curdate()*1000000-curtime()
0
strcmp(current_timestamp(),concat(current_date()," ",current_time()))
0
date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")
January Thursday 2nd 1997 97 01 02 03 04 05 4
date_format("1997-01-02", concat("%M %W %D ","%Y %y %m %d %h %i %s %w"))
January Thursday 2nd 1997 97 01 02 12 00 00 4
dayofmonth("1997-01-02") dayofmonth(19970323)
2 23
month("1997-01-02") year("98-02-03") dayofyear("1997-12-31")
1 1998 365
DAYOFYEAR("1997-03-03") WEEK("1998-03-03") QUARTER(980303)
62 9 1
HOUR("1997-03-03 23:03:22") MINUTE("23:03:22") SECOND(230322)
23 3 22
week(19980101) week(19970101) week(19980101,1) week(19970101,1)
0 1 1 1
week(19981231) week(19971231) week(19981231,1) week(19971231,1)
52 53 53 53
week(19950101) week(19950101,1)
1 0
yearweek('1981-12-31',1) yearweek('1982-01-01',1) yearweek('1982-12-31',1) yearweek('1983-01-01',1)
198153 198153 198252 198252
date_format('1998-12-31','%x-%v') date_format('1999-01-01','%x-%v')
1998-53 1998-53
date_format('1999-12-31','%x-%v') date_format('2000-01-01','%x-%v')
1999-52 1999-52
yearweek('1987-01-01',1) yearweek('1987-01-01')
198701 198653
dayname("1962-03-03") dayname("1962-03-03")+0
Saturday 5
monthname("1972-03-04") monthname("1972-03-04")+0
March 3
time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
00|12|0|12|00|AM|12:00:00 AM|00|00:00:00
time_format(19980131010203,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
01|01|1|1|02|AM|01:02:03 AM|03|01:02:03
time_format(19980131131415,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
13|01|13|1|14|PM|01:14:15 PM|15|13:14:15
time_format(19980131010015,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
01|01|1|1|00|AM|01:00:15 AM|15|01:00:15
date_format(concat('19980131',131415),'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w')
13|01|13|1|14|PM|01:14:15 PM|15|13:14:15| January|Saturday|31st|1998|98|Sat|Jan|031|01|31|01|15|6
date_format(19980021000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T| %M|%W|%D|%Y|%y|%a|%b|%j|%m|%d|%h|%s|%w')
NULL
date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)
1998-01-01 00:00:00
date_add("1997-12-31 23:59:59",INTERVAL 1 MINUTE)
1998-01-01 00:00:59
date_add("1997-12-31 23:59:59",INTERVAL 1 HOUR)
1998-01-01 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 DAY)
1998-01-01 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 MONTH)
1998-01-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 1 YEAR)
1998-12-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1" MINUTE_SECOND)
1998-01-01 00:01:00
date_add("1997-12-31 23:59:59",INTERVAL "1:1" HOUR_MINUTE)
1998-01-01 01:00:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1" DAY_HOUR)
1998-01-02 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1 1" YEAR_MONTH)
1999-01-31 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "1:1:1" HOUR_SECOND)
1998-01-01 01:01:00
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1" DAY_MINUTE)
1998-01-02 01:00:59
date_add("1997-12-31 23:59:59",INTERVAL "1 1:1:1" DAY_SECOND)
1998-01-02 01:01:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 SECOND)
1997-12-31 23:59:59
date_sub("1998-01-01 00:00:00",INTERVAL 1 MINUTE)
1997-12-31 23:59:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 HOUR)
1997-12-31 23:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 DAY)
1997-12-31 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 MONTH)
1997-12-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL 1 YEAR)
1997-01-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" MINUTE_SECOND)
1997-12-31 23:58:59
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" HOUR_MINUTE)
1997-12-31 22:59:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1" DAY_HOUR)
1997-12-30 23:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1 1" YEAR_MONTH)
1996-12-01 00:00:00
date_sub("1998-01-01 00:00:00",INTERVAL "1:1:1" HOUR_SECOND)
1997-12-31 22:58:59
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1" DAY_MINUTE)
1997-12-30 22:59:00
date_sub("1998-01-01 00:00:00",INTERVAL "1 1:1:1" DAY_SECOND)
1997-12-30 22:58:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 SECOND)
1998-01-02 03:46:39
date_add("1997-12-31 23:59:59",INTERVAL -100000 MINUTE)
1997-10-23 13:19:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 HOUR)
2009-05-29 15:59:59
date_add("1997-12-31 23:59:59",INTERVAL -100000 DAY)
1724-03-17 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL 100000 MONTH)
NULL
date_add("1997-12-31 23:59:59",INTERVAL -100000 YEAR)
NULL
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" MINUTE_SECOND)
1998-01-07 22:40:00
date_add("1997-12-31 23:59:59",INTERVAL "-10000:1" HOUR_MINUTE)
1996-11-10 07:58:59
date_add("1997-12-31 23:59:59",INTERVAL "10000:1" DAY_HOUR)
2025-05-19 00:59:59
date_add("1997-12-31 23:59:59",INTERVAL "-100 1" YEAR_MONTH)
1897-11-30 23:59:59
date_add("1997-12-31 23:59:59",INTERVAL "10000:99:99" HOUR_SECOND)
1999-02-21 17:40:38
date_add("1997-12-31 23:59:59",INTERVAL " -10000 99:99" DAY_MINUTE)
1970-08-11 19:20:59
date_add("1997-12-31 23:59:59",INTERVAL "10000 99:99:99" DAY_SECOND)
2025-05-23 04:40:38
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
1998-01-01 00:00:00
INTERVAL 1 DAY + "1997-12-31"
1998-01-01
"1998-01-01 00:00:00" - INTERVAL 1 SECOND
1997-12-31 23:59:59
date_sub("1998-01-02",INTERVAL 31 DAY)
1997-12-02
date_add("1997-12-31",INTERVAL 1 SECOND)
1997-12-31 00:00:01
date_add("1997-12-31",INTERVAL 1 DAY)
1998-01-01
date_add(NULL,INTERVAL 100000 SECOND)
NULL
date_add("1997-12-31 23:59:59",INTERVAL NULL SECOND)
NULL
date_add("1997-12-31 23:59:59",INTERVAL NULL MINUTE_SECOND)
NULL
date_add("9999-12-31 23:59:59",INTERVAL 1 SECOND)
NULL
date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND)
NULL
date_add('1998-01-30',Interval 1 month)
1998-02-28
date_add('1998-01-30',Interval '2:1' year_month)
2000-02-29
date_add('1996-02-29',Interval '1' year)
1997-02-28
extract(YEAR FROM "1999-01-02 10:11:12")
1999
extract(YEAR_MONTH FROM "1999-01-02")
199901
extract(DAY FROM "1999-01-02")
2
extract(DAY_HOUR FROM "1999-01-02 10:11:12")
210
extract(DAY_MINUTE FROM "02 10:11:12")
21011
extract(DAY_SECOND FROM "225 10:11:12")
225101112
extract(HOUR FROM "1999-01-02 10:11:12")
10
extract(HOUR_MINUTE FROM "10:11:12")
1011
extract(HOUR_SECOND FROM "10:11:12")
101112
extract(MINUTE FROM "10:11:12")
11
extract(MINUTE_SECOND FROM "10:11:12")
1112
extract(SECOND FROM "1999-01-02 10:11:12")
12
userid MIN(t1.score)
1 1
2 2
3 3
userid MIN(t1.score)
1 1
2 2
userid MIN(t1.score+0.0)
1 1.0
2 2.0
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
value description bug_id
BBBBBBBBBBBBB - conversion 9
BBBBBBBBBBBBB - conversion 10
BBBBBBBBBBBBB - generic 7
BBBBBBBBBBBBB - generic 14
BBBBBBBBBBBBB - eeeeeeeee NULL
kkkkkkkkkkk lllllllllll 6
kkkkkkkkkkk lllllllllll 8
kkkkkkkkkkk lllllllllll 12
Test Procedures NULL
Documentation NULL
Host communication NULL
value description COUNT(bug_id)
BBBBBBBBBBBBB - conversion 2
BBBBBBBBBBBBB - eeeeeeeee 0
BBBBBBBBBBBBB - generic 2
Documentation 0
Host communication 0
kkkkkkkkkkk lllllllllll 3
Test Procedures 0
Variable_name Value
have_bdb YES
Variable_name Value
have_isam YES
Variable_name Value
have_raid YES
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a NULL NULL NULL NULL
a b
2 2
3 3
4 4
a b
4 4
a b
2 2
3 3
4 6
a b
1 1
2 2
3 3
4 4
a
869751
802616
a
869751
802616
a
736494
a
736494
869751
a
226312
736494
802616
869751
table type possible_keys key key_len ref rows Extra
t1 range uniq_id uniq_id 4 NULL 4 where used; Using index
x y
1 3
1 1
x y x y
1 1 1 1
2 2 2 2
1 3 1 1
2 4 2 2
2 5 2 2
2 6 2 2
table type possible_keys key key_len ref rows Extra
t1 ALL x NULL NULL NULL 6
t2 eq_ref y y 4 t1.x 1
max(a)
1
a b
1 6
1 5
1 4
1 3
1 2
1 1
a b
1 6
1 5
1 4
1 3
1 2
1 1
1 6
1 5
1 4
1 3
1 2
1 1
max(id)
1
max(id)
2
f1 f2
16 ted
12 ted
12 ted
12 ted
12 ted
id domain id t2
1 mysql.com 1 mysql.com
2 hotmail.com 2 hotmail.com
3 aol.com 3 aol.com
payoutID
1
4
6
9
10
11
12
14
16
19
20
22
id id
107 107
75 75
id count(t2.id)
75 1
107 1
id count(t2.id)
75 1
107 1
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
NULL NULL NULL NULL NULL NULL
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL 4 7 D 7
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL 4 7 D 7
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E NULL NULL NULL NULL
3 5 C NULL NULL NULL NULL
3 6 D NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
1 1 a 3 4 A 4
2 2 b 3 5 B 5
2 3 c 3 6 C 6
3 4 E NULL NULL NULL NULL
3 5 C 3 6 C 6
3 6 D 4 7 D 7
NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
3 4 E NULL NULL NULL NULL
3 5 C NULL NULL NULL NULL
3 6 D NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
grp a c id a c d
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
2 2 b NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
Comment
Impossible WHERE noticed after reading const tables
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 7
t2 eq_ref PRIMARY PRIMARY 8 t1.a 1 where used
grp a c id a c d a
1 1 a 1 1 a 1 1
2 2 b NULL NULL NULL NULL NULL
2 3 c NULL NULL NULL NULL NULL
3 4 E 3 4 A 4 4
3 5 C 3 5 B 5 5
3 6 D 3 6 C 6 6
NULL NULL NULL NULL NULL NULL NULL
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
3 4 E 3 4 A 4
3 5 C 3 5 B 5
3 6 D 3 6 C 6
grp a c id a c d
1 1 a 1 1 a 1
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
fill desc_larga_cat cred_total Grup Places PlacesOcupades
10360 asdfggfg 6.0 0 55 0
10360 asdfggfg 6.0 12 333 0
10360 asdfggfg 6.0 33 8 0
10360 asdfggfg 6.0 45 10 0
10360 asdfggfg 6.0 55 2 0
10360 asdfggfg 6.0 7887 85 0
10360 asdfggfg 6.0 32767 7 0
10361 Components i Circuits Electronics I 6.0 30 2 0
10361 Components i Circuits Electronics I 6.0 40 3 0
10362 Laboratori d`Ordinadors 4.5 10 12 0
10362 Laboratori d`Ordinadors 4.5 11 111 0
fill idPla
10360 NULL
10361 NULL
10362 NULL
fill idPla
10360 1
10361 NULL
10362 NULL
name name id
Antonio Paz El Gato 1
Antonio Paz Perrito 2
Lilliana Angelovska NULL NULL
Thimble Smith Happy 3
name name id
Lilliana Angelovska NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used; Not exists
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used
count(*)
4
name name id
Antonio Paz El Gato 1
Antonio Paz Perrito 2
Lilliana Angelovska NULL NULL
Thimble Smith Happy 3
name name id
Lilliana Angelovska NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used; Not exists
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 3
t2 ALL NULL NULL NULL NULL 3 where used
count(*)
4
name name id id
Antonio Paz El Gato 1 1
Antonio Paz Perrito 2 1
Lilliana Angelovska NULL NULL NULL
Thimble Smith Happy 3 3
name name id id
Antonio Paz El Gato 1 1
Antonio Paz Perrito 2 1
NULL Happy 3 1
NULL El Gato 1 2
NULL Perrito 2 2
NULL Happy 3 2
NULL El Gato 1 3
NULL Perrito 2 3
Thimble Smith Happy 3 3
name name id owner id
Antonio Paz El Gato 1 1 1
Antonio Paz Perrito 2 1 1
Lilliana Angelovska NULL NULL NULL 1
Thimble Smith NULL NULL NULL 1
Antonio Paz NULL NULL NULL 2
Lilliana Angelovska NULL NULL NULL 2
Thimble Smith NULL NULL NULL 2
Antonio Paz NULL NULL NULL 3
Lilliana Angelovska NULL NULL NULL 3
Thimble Smith Happy 3 3 3
id str
4 bar
3 foo
id str
1 NULL
2 NULL
n m o n m o
1 2 11 1 2 3
1 2 7 1 2 3
1 2 9 1 2 3
1 3 9 NULL NULL NULL
n m o n m o
1 2 7 1 2 3
1 2 9 1 2 3
1 3 9 NULL NULL NULL
1 2 11 1 2 3
id2
3
id2
3
color name
red apple
yellow banana
green lime
black grape
blue blueberry
count color
10 green
5 black
15 white
7 green
count color color name
10 green green lime
7 green green lime
5 black black grape
count name
10 lime
7 lime
5 grape
count name
10 lime
7 lime
5 grape
pcode count
kld2000 1
klw1000 0
klw1020 0
klw1500 0
klw2000 0
klw2001 0
klw2002 0
klw2500 0
kmw1000 0
kmw1500 0
kmw2000 0
kmw2001 0
kmw2100 0
kmw3000 0
kmw3200 0
kvw2000 26
kvw2001 0
kvw3000 36
kvw3001 0
kvw3002 0
kvw3500 26
kvw3501 0
kvw3502 0
kvw3800 0
kvw3801 0
kvw3802 0
kvw3900 0
kvw3901 0
kvw3902 0
kvw4000 0
kvw4001 0
kvw4002 0
kvw4200 0
kvw4500 0
kvw5000 0
kvw5001 0
kvw5500 0
kvw5510 0
kvw5600 0
kvw5601 0
kvw6000 2
pcode count
kld2000 1
klw1000 0
klw1020 0
klw1500 0
klw2000 0
klw2001 0
klw2002 0
klw2500 0
kmw1000 0
kmw1500 0
kmw2000 0
kmw2001 0
kmw2100 0
kmw3000 0
kmw3200 0
kvw2000 26
kvw2001 0
kvw3000 36
kvw3001 0
kvw3002 0
kvw3500 26
kvw3501 0
kvw3502 0
kvw3800 0
kvw3801 0
kvw3802 0
kvw3900 0
kvw3901 0
kvw3902 0
kvw4000 0
kvw4001 0
kvw4002 0
kvw4200 0
kvw4500 0
kvw5000 0
kvw5001 0
kvw5500 0
kvw5510 0
kvw5600 0
kvw5601 0
kvw6000 2
id pid rep_del id pid rep_del
1 NULL NULL 2 1 NULL
2 1 NULL NULL NULL NULL
id pid rep_del id pid rep_del
1 NULL NULL 2 1 NULL
2 1 NULL NULL NULL NULL
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 2
t2 index id id 8 NULL 1 where used; Using index; Not exists
id name id idx
2 no NULL NULL
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
time date timestamp
12:22:22 1997-02-03 19970102000000
t1.time+0 t1.date+0 t1.timestamp+0 concat(date," ",time)
122222 19970203 19970102000000 1997-02-03 12:22:22
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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