From 519bf5b6fc9ff01196e7be959c78687177a2c639 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 21 Feb 2006 14:55:54 +0100 Subject: [PATCH 01/60] Bug#11589 mysqltest, --ps-protocol, strange output, float/double/real with zerofill - Add zerofill in client if real/float/double is bound to string and fetched using binary protocol. --- libmysql/libmysql.c | 10 +++++++++- mysql-test/r/type_float.result | 16 ++++++++++++++++ mysql-test/t/type_float.test | 18 ++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 11ee7284cbf..59a28d0a1f1 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3850,7 +3850,15 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, sprintf(buff, "%.*f", (int) field->decimals, value); end= strend(buff); } - fetch_string_with_conversion(param, buff, (uint) (end - buff)); + uint length= (uint) (end-buff); + if (field->flags & ZEROFILL_FLAG && length < field->length && + field->length < MAX_DOUBLE_STRING_REP_LENGTH-1) + { + bmove_upp((char*) buff+field->length,buff+length, length); + bfill((char*) buff, field->length - length,'0'); + length= field->length; + } + fetch_string_with_conversion(param, buff, length); break; } } diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index c10cb7d71f7..a46ff64e0ba 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -244,3 +244,19 @@ create table t1 (s1 float(0,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (s1 float(1,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). +CREATE TABLE t1 ( +f1 real zerofill, +f2 double zerofill, +f3 float zerofill); +INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1); +PREPARE stmt1 FROM 'select f1, f2, f3 FROM t1'; +select f1, f2, f3 FROM t1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +select f1, f2, f3 FROM t1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +EXECUTE stmt1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +DROP TABLE t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 6a0814ef113..9893d3c7338 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -169,3 +169,21 @@ drop table t1, t2, t3; create table t1 (s1 float(0,2)); --error 1427 create table t1 (s1 float(1,2)); + +# +# MySQL Bugs: #11589: mysqltest --ps-protocol, strange output, float/double/real with zerofill +# + +CREATE TABLE t1 ( + f1 real zerofill, + f2 double zerofill, + f3 float zerofill); +INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1); + +let $my_stmt= select f1, f2, f3 FROM t1; +eval PREPARE stmt1 FROM '$my_stmt'; +select f1, f2, f3 FROM t1; +eval $my_stmt; +EXECUTE stmt1; + +DROP TABLE t1; From 7c2c8f07e43a5ce3998473bef6565e9e60ac533f Mon Sep 17 00:00:00 2001 From: "dkatz@damien-katzs-computer.local" <> Date: Fri, 27 Jul 2007 16:26:26 -0400 Subject: [PATCH 02/60] Bug #29419 "Specifying a join_buffer > 4GB on 64 bit machines not possible." Use size_t instead of uint when calculating join buffer size, because uint can be overflown on 64-bit platforms and join_buffer_size > 4 GB. The test case for this bug is a part of the test suite for bug #5731. --- sql/sql_select.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d8bf8466f58..89bdd22a3de 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13014,7 +13014,8 @@ static int join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) { reg1 uint i; - uint length,blobs,size; + uint length, blobs; + size_t size; CACHE_FIELD *copy,**blob_ptr; JOIN_CACHE *cache; JOIN_TAB *join_tab; @@ -13130,7 +13131,7 @@ store_record_in_cache(JOIN_CACHE *cache) length=cache->length; if (cache->blobs) length+=used_blob_length(cache->blob_ptr); - if ((last_record=(length+cache->length > (uint) (cache->end - pos)))) + if ((last_record= (length + cache->length > (size_t) (cache->end - pos)))) cache->ptr_record=cache->records; /* @@ -13176,7 +13177,7 @@ store_record_in_cache(JOIN_CACHE *cache) } } cache->pos=pos; - return last_record || (uint) (cache->end -pos) < cache->length; + return last_record || (size_t) (cache->end - pos) < cache->length; } From 39e53b4fee9296b214981b2ac19a4436a3d321fa Mon Sep 17 00:00:00 2001 From: "kaa@polly.local" <> Date: Wed, 29 Aug 2007 19:20:18 +0400 Subject: [PATCH 03/60] Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. This is required to allow key_buffer_size > 4 GB (bug #5731). --- include/my_sys.h | 26 +++++++++++++------------- mysys/my_largepage.c | 12 ++++++------ mysys/my_malloc.c | 16 ++++++++-------- mysys/safemalloc.c | 27 +++++++++++++-------------- 4 files changed, 40 insertions(+), 41 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index 7df2718c7b1..4f7e75a836e 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -147,14 +147,14 @@ extern ulonglong sf_malloc_mem_limit; #define TERMINATE(A) {} #define QUICK_SAFEMALLOC #define NORMAL_SAFEMALLOC -extern gptr my_malloc(uint Size,myf MyFlags); +extern gptr my_malloc(size_t Size, myf MyFlags); #define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); extern void my_no_flags_free(gptr ptr); -extern gptr my_memdup(const byte *from,uint length,myf MyFlags); +extern gptr my_memdup(const byte *from, size_t length, myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); -extern char *my_strdup_with_length(const char *from, uint length, - myf MyFlags); +extern char *my_strdup_with_length(const char *from, size_t length, + myf MyFlags); /* we do use FG (as a no-op) in below so that a typo on FG is caught */ #define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define CALLER_INFO_PROTO /* nothing */ @@ -165,7 +165,7 @@ extern char *my_strdup_with_length(const char *from, uint length, #ifdef HAVE_LARGE_PAGES extern uint my_get_large_page_size(void); -extern gptr my_large_malloc(uint size, myf my_flags); +extern gptr my_large_malloc(size_t size, myf my_flags); extern void my_large_free(gptr ptr, myf my_flags); #else #define my_get_large_page_size() (0) @@ -590,18 +590,18 @@ extern uint my_fwrite(FILE *stream,const byte *Buffer,uint Count, myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags); -extern gptr _mymalloc(uint uSize,const char *sFile, - uint uLine, myf MyFlag); -extern gptr _myrealloc(gptr pPtr,uint uSize,const char *sFile, - uint uLine, myf MyFlag); +extern gptr _mymalloc(size_t uSize, const char *sFile, + uint uLine, myf MyFlag); +extern gptr _myrealloc(gptr pPtr, size_t uSize, const char *sFile, + uint uLine, myf MyFlag); extern gptr my_multi_malloc _VARARGS((myf MyFlags, ...)); -extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag); +extern void _myfree(gptr pPtr, const char *sFile, uint uLine, myf MyFlag); extern int _sanity(const char *sFile,unsigned int uLine); -extern gptr _my_memdup(const byte *from,uint length, - const char *sFile, uint uLine,myf MyFlag); +extern gptr _my_memdup(const byte *from, size_t length, + const char *sFile, uint uLine, myf MyFlag); extern my_string _my_strdup(const char *from, const char *sFile, uint uLine, myf MyFlag); -extern char *_my_strdup_with_length(const char *from, uint length, +extern char *_my_strdup_with_length(const char *from, size_t length, const char *sFile, uint uLine, myf MyFlag); diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c index 9714c582acb..082b6368a64 100644 --- a/mysys/my_largepage.c +++ b/mysys/my_largepage.c @@ -26,7 +26,7 @@ #endif static uint my_get_large_page_size_int(void); -static gptr my_large_malloc_int(uint size, myf my_flags); +static gptr my_large_malloc_int(size_t size, myf my_flags); static my_bool my_large_free_int(gptr ptr, myf my_flags); /* Gets the size of large pages from the OS */ @@ -48,7 +48,7 @@ uint my_get_large_page_size(void) my_malloc_lock() in case of failure */ -gptr my_large_malloc(uint size, myf my_flags) +gptr my_large_malloc(size_t size, myf my_flags) { gptr ptr; DBUG_ENTER("my_large_malloc"); @@ -113,7 +113,7 @@ finish: #if HAVE_DECL_SHM_HUGETLB /* Linux-specific large pages allocator */ -gptr my_large_malloc_int(uint size, myf my_flags) +gptr my_large_malloc_int(size_t size, myf my_flags) { int shmid; gptr ptr; @@ -123,13 +123,13 @@ gptr my_large_malloc_int(uint size, myf my_flags) /* Align block size to my_large_page_size */ size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size; - shmid = shmget(IPC_PRIVATE, (size_t)size, SHM_HUGETLB | SHM_R | SHM_W); + shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W); if (shmid < 0) { if (my_flags & MY_WME) fprintf(stderr, - "Warning: Failed to allocate %d bytes from HugeTLB memory." - " errno %d\n", size, errno); + "Warning: Failed to allocate %lu bytesx from HugeTLB memory." + " errno %d\n", (ulong) size, errno); DBUG_RETURN(NULL); } diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 38d0263b495..256b14a9605 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -23,11 +23,11 @@ /* My memory allocator */ -gptr my_malloc(unsigned int size, myf my_flags) +gptr my_malloc(size_t size, myf my_flags) { gptr point; DBUG_ENTER("my_malloc"); - DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags)); + DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags)); if (!size) size=1; /* Safety */ @@ -63,11 +63,11 @@ void my_no_flags_free(gptr ptr) /* malloc and copy */ -gptr my_memdup(const byte *from, uint length, myf my_flags) +gptr my_memdup(const byte *from, size_t length, myf my_flags) { gptr ptr; if ((ptr=my_malloc(length,my_flags)) != 0) - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*)from, length); return(ptr); } @@ -75,19 +75,19 @@ gptr my_memdup(const byte *from, uint length, myf my_flags) char *my_strdup(const char *from, myf my_flags) { gptr ptr; - uint length=(uint) strlen(from)+1; + size_t length= strlen(from)+1; if ((ptr=my_malloc(length,my_flags)) != 0) - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*) from, length); return((my_string) ptr); } -char *my_strdup_with_length(const char *from, uint length, myf my_flags) +char *my_strdup_with_length(const char *from, size_t length, myf my_flags) { gptr ptr; if ((ptr=my_malloc(length+1,my_flags)) != 0) { - memcpy((byte*) ptr, (byte*) from,(size_t) length); + memcpy((byte*) ptr, (byte*) from, length); ((char*) ptr)[length]=0; } return((char*) ptr); diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index a7d8f372151..1cdbd1ecbf2 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -119,12 +119,12 @@ static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine); /* Allocate some memory. */ -gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) +gptr _mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) { struct st_irem *irem; char *data; DBUG_ENTER("_mymalloc"); - DBUG_PRINT("enter",("Size: %u",size)); + DBUG_PRINT("enter",("Size: %lu", (ulong) size)); if (!sf_malloc_quick) (void) _sanity (filename, lineno); @@ -151,8 +151,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) my_errno=errno; sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); - sprintf(buff,"needed %d byte (%ldk), memory in use: %ld bytes (%ldk)", - size, (size + 1023L) / 1024L, + sprintf(buff,"needed %u byte (%ldk), memory in use: %ld bytes (%ldk)", + (uint) size, (uint) (size + 1023L) / 1024L, sf_malloc_max_memory, (sf_malloc_max_memory + 1023L) / 1024L); my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); } @@ -207,8 +207,8 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) Free then old memoryblock */ -gptr _myrealloc(register gptr ptr, register uint size, - const char *filename, uint lineno, myf MyFlags) +gptr _myrealloc(register gptr ptr, register size_t size, + const char *filename, uint lineno, myf MyFlags) { struct st_irem *irem; char *data; @@ -373,8 +373,7 @@ void TERMINATE(FILE *file) { if (file) { - fprintf(file, "Warning: Not freed memory segments: %u\n", - sf_malloc_count); + fprintf(file, "Warning: Not freed memory segments: %u\n", sf_malloc_count); (void) fflush(file); } DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count)); @@ -503,8 +502,8 @@ int _sanity(const char *filename, uint lineno) /* malloc and copy */ -gptr _my_memdup(const byte *from, uint length, const char *filename, - uint lineno, myf MyFlags) +gptr _my_memdup(const byte *from, size_t length, const char *filename, + uint lineno, myf MyFlags) { gptr ptr; if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0) @@ -517,16 +516,16 @@ char *_my_strdup(const char *from, const char *filename, uint lineno, myf MyFlags) { gptr ptr; - uint length=(uint) strlen(from)+1; + size_t length= strlen(from)+1; if ((ptr=_mymalloc(length,filename,lineno,MyFlags)) != 0) memcpy((byte*) ptr, (byte*) from,(size_t) length); return((char*) ptr); } /* _my_strdup */ -char *_my_strdup_with_length(const char *from, uint length, - const char *filename, uint lineno, - myf MyFlags) +char *_my_strdup_with_length(const char *from, size_t length, + const char *filename, uint lineno, + myf MyFlags) { gptr ptr; if ((ptr=_mymalloc(length+1,filename,lineno,MyFlags)) != 0) From f02a1f2c9191949f85bc61daa3450d13d465bf4f Mon Sep 17 00:00:00 2001 From: "kaa@polly.local" <> Date: Wed, 29 Aug 2007 20:33:44 +0400 Subject: [PATCH 04/60] Limit join_buffer_size, sort_buffer_size and myisam_sort_buffer_size to 4GB on all platforms, since the related code in 5.0 is not 64-bit safe. This is patch is a part of work on bug #5731 and will be null-merged to 5.1. --- sql/mysqld.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 08c2b60fa79..967b94d6b5c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5829,7 +5829,7 @@ log and this option does nothing anymore.", "The size of the buffer that is used for full joins.", (gptr*) &global_system_variables.join_buff_size, (gptr*) &max_system_variables.join_buff_size, 0, GET_ULONG, - REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, + REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, UINT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, "Don't overwrite stale .MYD and .MYI even if no directory is specified.", @@ -5998,7 +5998,7 @@ The minimum value for this variable is 4096.", "The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.", (gptr*) &global_system_variables.myisam_sort_buff_size, (gptr*) &max_system_variables.myisam_sort_buff_size, 0, - GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0}, + GET_ULONG, REQUIRED_ARG, 8192*1024, 4, UINT_MAX32, 0, 1, 0}, {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, "Specifies how MyISAM index statistics collection code should threat NULLs. " "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), " @@ -6144,7 +6144,7 @@ The minimum value for this variable is 4096.", "Each thread that needs to do a sort allocates a buffer of this size.", (gptr*) &global_system_variables.sortbuff_size, (gptr*) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG, - MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD, + MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, UINT_MAX32, MALLOC_OVERHEAD, 1, 0}, #ifdef HAVE_BERKELEY_DB {"sync-bdb-logs", OPT_BDB_SYNC, From ab0373e78a5a711fdcd58c66119a72e6279e5547 Mon Sep 17 00:00:00 2001 From: "kaa@polly.local" <> Date: Wed, 29 Aug 2007 20:45:04 +0400 Subject: [PATCH 05/60] Backport of the keycache changes from http://lists.mysql.com/commits/31517 to make keycache 64-bit safe in 5.0. This is for bug #5731. --- include/keycache.h | 10 +++++----- mysys/mf_keycache.c | 25 +++++++++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/keycache.h b/include/keycache.h index 54c099fc474..424b4086cb4 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -46,7 +46,7 @@ typedef struct st_key_cache my_bool key_cache_inited; my_bool resize_in_flush; /* true during flush of resize operation */ my_bool can_be_used; /* usage of cache for read/write is allowed */ - ulong key_cache_mem_size; /* specified size of the cache memory */ + size_t key_cache_mem_size; /* specified size of the cache memory */ uint key_cache_block_size; /* size of the page buffer of a cache block */ ulong min_warm_blocks; /* min number of warm blocks; */ ulong age_threshold; /* age threshold for hot blocks */ @@ -101,11 +101,11 @@ typedef struct st_key_cache extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache; extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - ulong use_mem, uint division_limit, - uint age_threshold); + size_t use_mem, uint division_limit, + uint age_threshold); extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - ulong use_mem, uint division_limit, - uint age_threshold); + size_t use_mem, uint division_limit, + uint age_threshold); extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, uint age_threshold); extern byte *key_cache_read(KEY_CACHE *keycache, diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index af910678a1f..83363e6960d 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -301,10 +301,11 @@ static uint next_power(uint value) */ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - ulong use_mem, uint division_limit, - uint age_threshold) + size_t use_mem, uint division_limit, + uint age_threshold) { - uint blocks, hash_links, length; + ulong blocks, hash_links; + size_t length; int error; DBUG_ENTER("init_key_cache"); DBUG_ASSERT(key_cache_block_size >= 512); @@ -332,8 +333,8 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, DBUG_PRINT("info", ("key_cache_block_size: %u", key_cache_block_size)); - blocks= (uint) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) + - sizeof(HASH_LINK*) * 5/4 + key_cache_block_size)); + blocks= (ulong) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) + + sizeof(HASH_LINK*) * 5/4 + key_cache_block_size)); /* It doesn't make sense to have too few blocks (less than 8) */ if (blocks >= 8 && keycache->disk_blocks < 0) { @@ -351,18 +352,18 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) + ALIGN_SIZE(sizeof(HASH_LINK*) * keycache->hash_entries))) + - ((ulong) blocks * keycache->key_cache_block_size) > use_mem) + ((size_t) blocks * keycache->key_cache_block_size) > use_mem) blocks--; /* Allocate memory for cache page buffers */ if ((keycache->block_mem= - my_large_malloc((ulong) blocks * keycache->key_cache_block_size, - MYF(MY_WME)))) + my_large_malloc((size_t) blocks * keycache->key_cache_block_size, + MYF(MY_WME)))) { /* Allocate memory for blocks, hash_links and hash entries; For each block 2 hash links are allocated */ - if ((keycache->block_root= (BLOCK_LINK*) my_malloc((uint) length, + if ((keycache->block_root= (BLOCK_LINK*) my_malloc(length, MYF(0)))) break; my_large_free(keycache->block_mem, MYF(0)); @@ -375,7 +376,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, } blocks= blocks / 4*3; } - keycache->blocks_unused= (ulong) blocks; + keycache->blocks_unused= blocks; keycache->disk_blocks= (int) blocks; keycache->hash_links= hash_links; keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root + @@ -480,8 +481,8 @@ err: */ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - ulong use_mem, uint division_limit, - uint age_threshold) + size_t use_mem, uint division_limit, + uint age_threshold) { int blocks; struct st_my_thread_var *thread; From 0c199938073a2f1359732568707c430f3f0a473f Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Mon, 3 Sep 2007 12:57:47 +0400 Subject: [PATCH 06/60] Use SIZE_T_MAX instead of ulong as a limit for key_buffer_size to allow key_bufer_size > 4G on Windows in 5.1. This is for bug #5731. --- include/my_global.h | 3 +++ sql/mysqld.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/my_global.h b/include/my_global.h index 8b6cdef8daa..b9452adebbb 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -863,6 +863,9 @@ typedef SOCKET_SIZE_TYPE size_socket; #ifndef SSIZE_MAX #define SSIZE_MAX ((~((size_t) 0)) / 2) #endif +#ifndef SIZE_T_MAX +#define SIZE_T_MAX ~((size_t) 0) +#endif #ifndef HAVE_FINITE #define finite(x) (1.0 / fabs(x) > 0.0) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6ea1cf111bb..2b7867b4e88 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5969,7 +5969,7 @@ log and this option does nothing anymore.", (uchar**) &dflt_key_cache_var.param_buff_size, (uchar**) 0, 0, (GET_ULL | GET_ASK_ADDR), - REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~(ulong) 0, MALLOC_OVERHEAD, + REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, {"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, "This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache", From d8e67d455665e06e607fdd43f3e81e3668f76b2e Mon Sep 17 00:00:00 2001 From: "dkatz@damien-katzs-computer.local" <> Date: Wed, 5 Sep 2007 15:06:10 -0400 Subject: [PATCH 07/60] Bug #29804 UDF parameters don't contain correct string length Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself. Now the *_init functions get the constant as a null terminated string with the correct length supplied too. --- mysql-test/r/udf.result | 24 ++++++++++++++++++++++++ mysql-test/t/udf.test | 36 ++++++++++++++++++++++++++++++++++++ sql/item_func.cc | 3 ++- sql/udf_example.c | 35 +++++++++++++++++++++++++++++++++++ sql/udf_example.def | 2 ++ 5 files changed, 99 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index 2e9cf217ed6..885f5f8078e 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -296,4 +296,28 @@ Qcache_queries_in_cache 0 drop table t1; drop function metaphon; set GLOBAL query_cache_size=default; +CREATE TABLE const_len_bug ( +str_const varchar(4000), +result1 varchar(4000), +result2 varchar(4000) +); +CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN +set NEW.str_const = 'bar'; +set NEW.result2 = check_const_len(NEW.str_const); +END | +CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000)) +BEGIN +DECLARE result VARCHAR(4000); +SET result = check_const_len(str_const); +insert into const_len_bug values(str_const, result, ""); +END | +CREATE FUNCTION check_const_len RETURNS string SONAME "UDF_EXAMPLE_LIB"; +CALL check_const_len_sp("foo"); +SELECT * from const_len_bug; +str_const result1 result2 +bar Correct length Correct length +DROP FUNCTION check_const_len; +DROP PROCEDURE check_const_len_sp; +DROP TRIGGER check_const_len_trigger; +DROP TABLE const_len_bug; End of 5.0 tests. diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 75af1f4be4b..beb18206a2e 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -312,4 +312,40 @@ drop function metaphon; set GLOBAL query_cache_size=default; +# +# Bug #29804 UDF parameters don't contain correct string length +# + +CREATE TABLE const_len_bug ( + str_const varchar(4000), + result1 varchar(4000), + result2 varchar(4000) +); + +DELIMITER |; +CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN + set NEW.str_const = 'bar'; + set NEW.result2 = check_const_len(NEW.str_const); +END | + +CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000)) +BEGIN +DECLARE result VARCHAR(4000); +SET result = check_const_len(str_const); +insert into const_len_bug values(str_const, result, ""); +END | +DELIMITER ;| + +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_LIB"; + +CALL check_const_len_sp("foo"); + +SELECT * from const_len_bug; + +DROP FUNCTION check_const_len; +DROP PROCEDURE check_const_len_sp; +DROP TRIGGER check_const_len_trigger; +DROP TABLE const_len_bug; + --echo End of 5.0 tests. diff --git a/sql/item_func.cc b/sql/item_func.cc index c70cfa1ce2a..21579763635 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2924,7 +2924,8 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func, String *res= arguments[i]->val_str(&buffers[i]); if (arguments[i]->null_value) continue; - f_args.args[i]= (char*) res->ptr(); + f_args.args[i]= (char*) res->c_ptr(); + f_args.lengths[i]= res->length(); break; } case INT_RESULT: diff --git a/sql/udf_example.c b/sql/udf_example.c index 0f28c2a14b0..df3a69755ad 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -1106,4 +1106,39 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)), } + +my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message) +{ + if (args->arg_count != 1) + { + strmov(message, "CHECK_CONST_LEN accepts only one argument"); + return 1; + } + if (args->args[0] == 0) + { + initid->ptr= (char*)"Not constant"; + } + else if(strlen(args->args[0]) == args->lengths[0]) + { + initid->ptr= (char*)"Correct length"; + } + else + { + initid->ptr= (char*)"Wrong length"; + } + initid->max_length = 100; + return 0; +} + +char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)), + char *result, unsigned long *length, + char *is_null, char *error __attribute__((unused))) +{ + strmov(result, initid->ptr); + *length= strlen(result); + *is_null= 0; + return result; +} + + #endif /* HAVE_DLOPEN */ diff --git a/sql/udf_example.def b/sql/udf_example.def index 7a87147d7b6..3d569941cc8 100644 --- a/sql/udf_example.def +++ b/sql/udf_example.def @@ -23,3 +23,5 @@ EXPORTS avgcost is_const is_const_init + check_const_len + check_const_len_init From 8da409ac16e88ef4fff170521277b3ecb63489c6 Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Fri, 7 Sep 2007 11:58:04 +0400 Subject: [PATCH 08/60] This patch is a part of work on bug #5731 "key_buffer_size not properly restricted to 4GB". The patch limits read_buffer_size and read_rnd_buffer_size by 2 GB on all platforms for the following reasons: - I/O code in mysys, code in mf_iocache.c and in some storage engines do not currently work with sizes > 2 GB for those buffers - even if the above had been fixed, Windows POSIX read() and write() calls are not 2GB-safe, so setting those buffer to sizes > 2GB would not work correctly on 64-bit Windows. --- include/my_global.h | 3 --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ sql/mysqld.cc | 6 ++--- 4 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/include/my_global.h b/include/my_global.h index b91ff8a9e5b..7d34549c8b6 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -808,9 +808,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define DBL_MAX 1.79769313486231470e+308 #define FLT_MAX ((float)3.40282346638528860e+38) #endif -#ifndef SSIZE_MAX -#define SSIZE_MAX ((~((size_t) 0)) / 2) -#endif #if !defined(HAVE_ISINF) && !defined(isinf) #define isinf(X) 0 diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5a805b586fd..5c6294c2315 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5948,7 +5948,7 @@ The minimum value for this variable is 4096.", "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", (gptr*) &global_system_variables.read_buff_size, (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, - 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, + 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, {"read_only", OPT_READONLY, "Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege", @@ -5960,12 +5960,12 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.read_rnd_buff_size, (gptr*) &max_system_variables.read_rnd_buff_size, 0, GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, - SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, + INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, {"record_buffer", OPT_RECORD_BUFFER, "Alias for read_buffer_size", (gptr*) &global_system_variables.read_buff_size, (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, - 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, SSIZE_MAX, MALLOC_OVERHEAD, IO_SIZE, 0}, + 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT_MAX32, MALLOC_OVERHEAD, IO_SIZE, 0}, #ifdef HAVE_REPLICATION {"relay_log_purge", OPT_RELAY_LOG_PURGE, "0 = do not purge relay logs. 1 = purge them as soon as they are no more needed.", From f26d69e01a6ffbae92c202c800981e1b102e0eda Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 11 Sep 2007 15:00:52 +0200 Subject: [PATCH 09/60] Add support for specifying suites not located in mysql-test/suite/ Example otions that will all run binlog_stm_binlog.test in suite/binlog: --suite=binlog binlog.binlog_stm_binlog --suite=binlog binlog_stm_binlog binlog_stm_binlog --suite=suite/binlog binlog.binlog_stm_binlog --suite=suite/binlog binlog_stm_binlog --- mysql-test/lib/mtr_cases.pl | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index ba7fcb8ce10..9ba7d737b9e 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -151,19 +151,16 @@ sub collect_one_suite($$) mtr_verbose("Collecting: $suite"); - my $testdir; - my $resdir; + my $suitedir= "$::glob_mysql_test_dir"; # Default + if ( $suite ne "main" ) + { + $suitedir= mtr_path_exists("$suitedir/suite/$suite", + "$suitedir/$suite"); + mtr_verbose("suitedir: $suitedir"); + } - if ( $suite eq "main" ) - { - $testdir= "$::glob_mysql_test_dir/t"; - $resdir= "$::glob_mysql_test_dir/r"; - } - else - { - $testdir= "$::glob_mysql_test_dir/suite/$suite/t"; - $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; - } + my $testdir= "$suitedir/t"; + my $resdir= "$suitedir/r"; # ---------------------------------------------------------------------- # Build a hash of disabled testcases for this suite @@ -205,7 +202,7 @@ sub collect_one_suite($$) $tname = basename($tname); # Get rid of suite part - $tname =~ s/^$suite\.//; + $tname =~ s/^(.*)\.//; # Check if the extenstion has been specified. @@ -333,7 +330,7 @@ sub collect_one_test_case($$$$$$$$$) { my $tinfo= {}; - $tinfo->{'name'}= "$suite.$tname"; + $tinfo->{'name'}= basename($suite) . ".$tname"; $tinfo->{'result_file'}= "$resdir/$tname.result"; $tinfo->{'component_id'} = $component_id; push(@$cases, $tinfo); From 3c6ca8d6edf55764df93a831f61dc3855e82d91c Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/sin.intern.azundris.com" <> Date: Thu, 13 Sep 2007 16:19:46 +0200 Subject: [PATCH 10/60] Bug #15327: configure: --with-tcp-port option being partially ignored make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. if they didn't configure a value, assume "use a sensible default", which will be read from /etc/services or, failing that, from the factory default. That makes the order of preference - command-line option - my.cnf, where applicable - $MYSQL_TCP_PORT environment variable - /etc/services (unless configured --with-tcp-port) - default port (--with-tcp-port=... or factory default) --- client/mysql.cc | 11 +++++++--- client/mysql_upgrade.c | 9 +++++++-- client/mysqladmin.cc | 8 +++++++- client/mysqlbinlog.cc | 11 +++++++--- client/mysqlcheck.c | 8 +++++++- client/mysqldump.c | 8 +++++++- client/mysqlimport.c | 8 +++++++- client/mysqlmanagerc.c | 7 ++++++- client/mysqlshow.c | 8 +++++++- client/mysqltest.c | 8 +++++++- configure.in | 29 ++++++++++++++++++++++++++- include/mysql_version.h.in | 1 + libmysql/libmysql.c | 21 +++++++++++++++---- mysql-test/Makefile.am | 1 + mysql-test/mysql-test-run-shell.sh | 11 +++++++++- netware/mysql_test_run.c | 3 ++- netware/mysqld_safe.c | 2 +- scripts/Makefile.am | 1 + scripts/mysql_config.sh | 7 ++++++- scripts/mysql_fix_privilege_tables.sh | 1 + scripts/mysqld_safe-watch.sh | 2 +- server-tools/instance-manager/priv.h | 2 +- sql/mysqld.cc | 21 ++++++++++++++++++- tests/mysql_client_test.c | 8 +++++++- tests/ssl_test.c | 2 +- tests/thread_test.c | 8 +++++++- 26 files changed, 176 insertions(+), 30 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 368fce30d67..4f045e21cbd 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -673,9 +673,14 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, - (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, - 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, + (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.", (gptr*) ¤t_prompt, (gptr*) ¤t_prompt, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 64de3d19882..f2bd4a3fa35 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -88,8 +88,13 @@ static struct my_option my_long_options[]= {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", 0, - 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index c7033f6914f..54f67c5df2d 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -159,7 +159,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &tcp_port, (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a371981e24d..3d06a21c243 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -687,9 +687,14 @@ static struct my_option my_long_options[] = 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to connect to remote server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Use port to connect to the remote server.", - (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, - 0, 0, 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"position", 'j', "Deprecated. Use --start-position instead.", (gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index b69e9201a28..8205a83fdf4 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -123,7 +123,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqldump.c b/client/mysqldump.c index 1a024a923f5..1a809ca8b6c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -361,7 +361,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqlimport.c b/client/mysqlimport.c index e7bf1cfd889..066e892f78a 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -119,7 +119,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c index 1fdedab97fb..b4cc6320047 100644 --- a/client/mysqlmanagerc.c +++ b/client/mysqlmanagerc.c @@ -49,7 +49,12 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", (gptr*) &port, (gptr*) &port, 0, GET_UINT, REQUIRED_ARG, MYSQL_MANAGER_PORT, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 5be01cc5a52..7b1835055f5 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -188,7 +188,13 @@ static struct my_option my_long_options[] = {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef __WIN__ diff --git a/client/mysqltest.c b/client/mysqltest.c index d1ec753b54b..ff45f80d914 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4512,7 +4512,13 @@ static struct my_option my_long_options[] = GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &opt_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &opt_port, (gptr*) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication", (gptr*) &ps_protocol, (gptr*) &ps_protocol, 0, diff --git a/configure.in b/configure.in index 1da39ac1aa3..2e66b5eb333 100644 --- a/configure.in +++ b/configure.in @@ -710,7 +710,34 @@ AC_ARG_WITH(tcp-port, [ --with-tcp-port=port-number Which port to use for MySQL services (default 3306)], [ MYSQL_TCP_PORT=$withval ], - [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT ] + [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT + # if we actually defaulted (as opposed to the pathological case of + # --with-tcp-port= which might in theory + # happen if whole batch of servers was built from a script), set + # the default to zero to indicate that; we don't lose information + # that way, because 0 obviously indicates that we can get the + # default value from MYSQL_TCP_PORT. this seems really evil, but + # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a + # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not + # intend it to mean "use the default, in fact, look up a good default + # from /etc/services if you can", but really, really meant 3306 when + # they passed in 3306. When they pass in a specific value, let them + # have it; don't second guess user and think we know better, this will + # just make people cross. this makes the the logic work like this + # (which is complicated enough): + # + # - if a port was set during build, use that as a default. + # + # - otherwise, try to look up a port in /etc/services; if that fails, + # use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306) + # + # - allow the MYSQL_TCP_PORT environment variable to override that. + # + # - allow command-line parameters to override all of the above. + # + # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js, + # so don't mess with that. + MYSQL_TCP_PORT_DEFAULT=0 ] ) AC_SUBST(MYSQL_TCP_PORT) # We might want to document the assigned port in the manual. diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in index dac7ca661d1..04a43f2c968 100644 --- a/include/mysql_version.h.in +++ b/include/mysql_version.h.in @@ -15,6 +15,7 @@ #define FRM_VER @DOT_FRM_VERSION@ #define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ #define MYSQL_PORT @MYSQL_TCP_PORT@ +#define MYSQL_PORT_DEFAULT @MYSQL_TCP_PORT_DEFAULT@ #define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@" #define MYSQL_CONFIG_NAME "my" #define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@" diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 72bc4445d83..5388aa07b9d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -133,10 +133,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), { struct servent *serv_ptr; char *env; - if ((serv_ptr = getservbyname("mysql", "tcp"))) - mysql_port = (uint) ntohs((ushort) serv_ptr->s_port); - if ((env = getenv("MYSQL_TCP_PORT"))) - mysql_port =(uint) atoi(env); + + /* + if builder specifically requested a default port, use that + (even if it coincides with our factory default). + only if they didn't do we check /etc/services (and, failing + on that, fall back to the factory default of 3306). + either default can be overridden by the environment variable + MYSQL_TCP_PORT, which in turn can be overridden with command + line options. + */ + +#if MYSQL_PORT_DEFAULT == 0 + if ((serv_ptr = getservbyname("mysql", "tcp"))) + mysql_port = (uint) ntohs((ushort) serv_ptr->s_port); +#endif + if ((env = getenv("MYSQL_TCP_PORT"))) + mysql_port =(uint) atoi(env); } #endif } diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index ebc2bbb83e8..a764d1e851d 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -147,6 +147,7 @@ SUFFIXES = .sh -e 's!@''PERL''@!@PERL@!' \ -e 's!@''VERSION''@!@VERSION@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ + -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh index a81a3b8b607..c0ff3d3d88e 100644 --- a/mysql-test/mysql-test-run-shell.sh +++ b/mysql-test/mysql-test-run-shell.sh @@ -17,7 +17,16 @@ USE_MANAGER=0 MY_TZ=GMT-3 TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work LOCAL_SOCKET=@MYSQL_UNIX_ADDR@ -MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ + +if [ -z "$MYSQL_TCP_PORT" ]; then + MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ + if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then + ESP=`getent services mysql/tcp` + if [ $? -eq 0 ]; then + MYSQL_TCP_PORT=`echo "$ESP"|sed -e's-^[a-z]*[ ]*\([0-9]*\)/[a-z]*$-\1-g'` + fi + fi +fi umask 022 diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index 6bab2f0149c..a62de9013f9 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -1170,7 +1170,8 @@ void setup(char *file) setenv("MYSQL_BINLOG", file_path, 1); setenv("MASTER_MYPORT", "9306", 1); setenv("SLAVE_MYPORT", "9307", 1); - setenv("MYSQL_TCP_PORT", "3306", 1); + snprintf(file_path, PATH_MAX*2, "%d", MYSQL_PORT); + setenv("MYSQL_TCP_PORT", file_path, 1); snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port); setenv("MYSQL_CLIENT_TEST",file_path,1); snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port); diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index 9db8a441ca3..00e7d1bcd51 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -189,7 +189,7 @@ void start_defaults(int argc, char *argv[]) snprintf(address, PATH_MAX, "0.0.0.0"); // port - snprintf(port, PATH_MAX, "3306"); + snprintf(port, PATH_MAX, "%d", MYSQL_PORT); // default option default_option[0]= NULL; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d4944962884..2b6870717ba 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -174,6 +174,7 @@ SUFFIXES = .sh -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ + -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \ -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index f094cb060b7..ab58c512aac 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,9 +92,14 @@ fix_path pkgincludedir include/mysql include version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' -port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' +if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then + port=0 +else + port=@MYSQL_TCP_PORT@ +fi + # Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index a353273dc28..3b179957932 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -25,6 +25,7 @@ sql_only=0 basedir="@prefix@" verbose=0 args="" +# no elaborate fallback here; with no argument, it will happen in "mysql" port="" socket="" database="mysql" diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh index c837ba9a118..f853741c87b 100644 --- a/scripts/mysqld_safe-watch.sh +++ b/scripts/mysqld_safe-watch.sh @@ -66,7 +66,7 @@ fi echo "Starting mysqld demon with databases from $DATADIR" #Default communication ports -#MYSQL_TCP_PORT=3306 +#MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ if test -z "$MYSQL_UNIX_PORT" then MYSQL_UNIX_PORT="/tmp/mysql.sock" diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h index a746288f28b..2e55e0ac8e6 100644 --- a/server-tools/instance-manager/priv.h +++ b/server-tools/instance-manager/priv.h @@ -25,7 +25,7 @@ #include "my_pthread.h" /* IM-wide platform-independent defines */ -#define SERVER_DEFAULT_PORT 3306 +#define SERVER_DEFAULT_PORT MYSQL_PORT #define DEFAULT_MONITORING_INTERVAL 20 #define DEFAULT_PORT 2273 /* three-week timeout should be enough */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 61980fa1887..7e0c8c7e775 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1300,8 +1300,21 @@ static void set_ports() { // Get port if not from commandline struct servent *serv_ptr; mysqld_port= MYSQL_PORT; + + /* + if builder specifically requested a default port, use that + (even if it coincides with our factory default). + only if they didn't do we check /etc/services (and, failing + on that, fall back to the factory default of 3306). + either default can be overridden by the environment variable + MYSQL_TCP_PORT, which in turn can be overridden with command + line options. + */ + +#if MYSQL_PORT_DEFAULT == 0 if ((serv_ptr= getservbyname("mysql", "tcp"))) mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */ +#endif if ((env = getenv("MYSQL_TCP_PORT"))) mysqld_port= (uint) atoi(env); /* purecov: inspected */ } @@ -5399,7 +5412,13 @@ Disable with --skip-ndbcluster (will save memory).", {"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.", (gptr*) &pidfile_name_ptr, (gptr*) &pidfile_name_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection.", (gptr*) &mysqld_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &mysqld_port, (gptr*) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port-open-timeout", OPT_PORT_OPEN_TIMEOUT, "Maximum time in seconds to wait for the port to become free. " diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 75c86902972..4a1941a2cf8 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -15759,7 +15759,13 @@ static struct my_option client_test_long_options[] = {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection", (char **) &opt_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (char **) &opt_port, (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-arg", 'A', "Send embedded server this as a parameter.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/tests/ssl_test.c b/tests/ssl_test.c index 136f0a83cbe..ad6bc925cc6 100644 --- a/tests/ssl_test.c +++ b/tests/ssl_test.c @@ -44,7 +44,7 @@ int main(int argc, char **argv) "../SSL/MySQL-client-cert.pem", "../SSL/MySQL-ca-cert.pem", 0, 0); #endif - if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],3306,NULL,0))) + if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],MYSQL_PORT,NULL,0))) { fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql)); perror(""); diff --git a/tests/thread_test.c b/tests/thread_test.c index 0ad446282c2..0ba03694893 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -103,7 +103,13 @@ static struct my_option my_long_options[] = (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"query", 'Q', "Query to execute in each threads", (gptr*) &query, (gptr*) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection", (gptr*) &tcp_port, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + (gptr*) &tcp_port, (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket file to use for connection", (gptr*) &unix_socket, (gptr*) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, From cc3f0af2e199487c8b2cebd6c7b525168ad5a7a7 Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/sin.intern.azundris.com" <> Date: Sat, 15 Sep 2007 04:59:46 +0200 Subject: [PATCH 11/60] Bug #15327: configure: --with-tcp-port option being partially ignored after merge fix :-/ --- client/mysqlbinlog.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index f848a98e5a6..2110f27d887 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -762,7 +762,6 @@ static struct my_option my_long_options[] = "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - 0, 0, 0}, {"position", 'j', "Deprecated. Use --start-position instead.", (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL, REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE, From 9254e8fb01a515b207f3089568004e5b8afd7200 Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Thu, 20 Sep 2007 18:10:35 +0200 Subject: [PATCH 12/60] Bug#19828: Case sensitivity in hostname leads to inconsistent behavior clean up SHOW GRANTS so it will show host-names with case as entered. make REVOKE and friends case-sensitive to make things more intuitive. Patch by Martin Friebe. --- mysql-test/r/grant.result | 3 + mysql-test/r/grant3.result | 122 +++++++++++++++++++++++++++++++++++++ mysql-test/t/grant.test | 3 + mysql-test/t/grant3.test | 100 ++++++++++++++++++++++++++++++ sql/sql_acl.cc | 41 ++++++++++--- 5 files changed, 259 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index a4c51cca277..855352a2195 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1121,6 +1121,9 @@ SELECT * FROM test.t1; f1 f2 1 1 2 2 +REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; +REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; +REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; DROP DATABASE db27878; use test; DROP TABLE t1; diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result index 6193c4fd49d..cc7f46855b2 100644 --- a/mysql-test/r/grant3.result +++ b/mysql-test/r/grant3.result @@ -16,3 +16,125 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +grant select on test.* to CUser@localhost; +grant select on test.* to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +CUser LOCALHOST test Y +CUser localhost test Y +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +CUser localhost test Y +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +create table t1 (a int); +grant select on test.t1 to CUser@localhost; +grant select on test.t1 to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser LOCALHOST test t1 Select +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +grant select(a) on test.t1 to CUser@localhost; +grant select(a) on test.t1 to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser LOCALHOST test t1 Select +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +drop table t1; +grant select on test.* to CUser2@localhost; +grant select on test.* to CUser2@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +CUser2 LOCALHOST test Y +CUser2 localhost test Y +REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +CUser2 localhost test Y +REVOKE SELECT ON test.* FROM 'CUser2'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +DROP USER CUser2@localhost; +DROP USER CUser2@LOCALHOST; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 32eb262fd51..1d11a669811 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1144,6 +1144,9 @@ UPDATE v1 SET f2 = 4; SELECT * FROM test.t1; disconnect user1; connection default; +REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; +REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; +REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; DROP DATABASE db27878; use test; DROP TABLE t1; diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test index 115586e807d..fac577ef0ff 100644 --- a/mysql-test/t/grant3.test +++ b/mysql-test/t/grant3.test @@ -34,3 +34,103 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; + +# +# Bug: #19828 Case sensitivity in Grant/Revoke +# + +grant select on test.* to CUser@localhost; +grant select on test.* to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +#### table grants +create table t1 (a int); +grant select on test.t1 to CUser@localhost; +grant select on test.t1 to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +### column grants + +grant select(a) on test.t1 to CUser@localhost; +grant select(a) on test.t1 to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +drop table t1; + +# revoke on a specific DB only + +grant select on test.* to CUser2@localhost; +grant select on test.* to CUser2@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +REVOKE SELECT ON test.* FROM 'CUser2'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +DROP USER CUser2@localhost; +DROP USER CUser2@LOCALHOST; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f9bd2c6ba0d..6bc6cce5e72 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1132,7 +1132,7 @@ static void acl_update_db(const char *user, const char *host, const char *db, { if (!acl_db->host.hostname && !host[0] || acl_db->host.hostname && - !my_strcasecmp(system_charset_info, host, acl_db->host.hostname)) + !strcmp(host, acl_db->host.hostname)) { if (!acl_db->db && !db[0] || acl_db->db && !strcmp(db,acl_db->db)) @@ -4344,6 +4344,13 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) if (!(host=acl_db->host.hostname)) host= ""; + /* + We do not make SHOW GRANTS case-sensitive here (like REVOKE), + but make it case-insensitive because that's the way they are + actually applied, and showing fewer privileges than are applied + would be wrong from a security point of view. + */ + if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { @@ -4379,8 +4386,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) db.append(lex_user->user.str, lex_user->user.length, system_charset_info); db.append (STRING_WITH_LEN("'@'")); - db.append(lex_user->host.str, lex_user->host.length, - system_charset_info); + // host and lex_user->host are equal except for case + db.append(host, strlen(host), system_charset_info); db.append ('\''); if (want_access & GRANT_ACL) db.append(STRING_WITH_LEN(" WITH GRANT OPTION")); @@ -4407,6 +4414,13 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) if (!(host= grant_table->host.hostname)) host= ""; + /* + We do not make SHOW GRANTS case-sensitive here (like REVOKE), + but make it case-insensitive because that's the way they are + actually applied, and showing fewer privileges than are applied + would be wrong from a security point of view. + */ + if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { @@ -4487,8 +4501,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) global.append(lex_user->user.str, lex_user->user.length, system_charset_info); global.append(STRING_WITH_LEN("'@'")); - global.append(lex_user->host.str,lex_user->host.length, - system_charset_info); + // host and lex_user->host are equal except for case + global.append(host, strlen(host), system_charset_info); global.append('\''); if (table_access & GRANT_ACL) global.append(STRING_WITH_LEN(" WITH GRANT OPTION")); @@ -4543,6 +4557,13 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash, if (!(host= grant_proc->host.hostname)) host= ""; + /* + We do not make SHOW GRANTS case-sensitive here (like REVOKE), + but make it case-insensitive because that's the way they are + actually applied, and showing fewer privileges than are applied + would be wrong from a security point of view. + */ + if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { @@ -4586,8 +4607,8 @@ static int show_routine_grants(THD* thd, LEX_USER *lex_user, HASH *hash, global.append(lex_user->user.str, lex_user->user.length, system_charset_info); global.append(STRING_WITH_LEN("'@'")); - global.append(lex_user->host.str,lex_user->host.length, - system_charset_info); + // host and lex_user->host are equal except for case + global.append(host, strlen(host), system_charset_info); global.append('\''); if (proc_access & GRANT_ACL) global.append(STRING_WITH_LEN(" WITH GRANT OPTION")); @@ -5541,7 +5562,7 @@ bool mysql_revoke_all(THD *thd, List &list) host= ""; if (!strcmp(lex_user->user.str,user) && - !my_strcasecmp(system_charset_info, lex_user->host.str, host)) + !strcmp(lex_user->host.str, host)) { if (!replace_db_table(tables[1].table, acl_db->db, *lex_user, ~(ulong)0, 1)) { @@ -5572,7 +5593,7 @@ bool mysql_revoke_all(THD *thd, List &list) host= ""; if (!strcmp(lex_user->user.str,user) && - !my_strcasecmp(system_charset_info, lex_user->host.str, host)) + !strcmp(lex_user->host.str, host)) { if (replace_table_table(thd,grant_table,tables[2].table,*lex_user, grant_table->db, @@ -5618,7 +5639,7 @@ bool mysql_revoke_all(THD *thd, List &list) host= ""; if (!strcmp(lex_user->user.str,user) && - !my_strcasecmp(system_charset_info, lex_user->host.str, host)) + !strcmp(lex_user->host.str, host)) { if (!replace_routine_table(thd,grant_proc,tables[4].table,*lex_user, grant_proc->db, From e41434fb950e5bd29d400c371b33038cb87b7446 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 21 Sep 2007 09:48:30 +0200 Subject: [PATCH 13/60] Bug#30843 Bad Test addition to t/archive.test - Add extra insert --- mysql-test/r/archive.result | 4 +++- mysql-test/t/archive.test | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index b6a313ddf1a..a1c11417bd0 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -11124,9 +11124,10 @@ SELECT COUNT(auto) FROM t2; COUNT(auto) 1213 INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); +INSERT INTO t2 VALUES (5,000001,00,'after','delayed','insert',''); SELECT COUNT(auto) FROM t2; COUNT(auto) -1214 +1215 ALTER TABLE t2 DROP COLUMN fld6; SHOW CREATE TABLE t2; Table Create Table @@ -12354,6 +12355,7 @@ auto fld1 companynr fld3 fld4 fld5 3 011402 37 Romans scholastics jarring 4 011403 37 intercepted audiology tinily 4 011403 37 intercepted audiology tinily +5 000001 00 after delayed insert drop table t1, t2, t4; create table t1 (i int) engine=archive; insert into t1 values (1); diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 61033fca3f7..d1c45a259c6 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1348,7 +1348,15 @@ SELECT * FROM t2; # Test INSERT DELAYED and wait until the table has one more record SELECT COUNT(auto) FROM t2; INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -while (`SELECT COUNT(auto)!=1214 FROM t2`) + +# Insert another record since in Archive delayed values are only +# guaranteed to materialize based on either: +# 1) A new row showing up from a normal insert +# 2) A flush table has occurred. +INSERT INTO t2 VALUES (5,000001,00,'after','delayed','insert',''); + +# Wait for the delayed insert to appear +while (`SELECT COUNT(auto)!=1215 FROM t2`) { sleep 0.1; } From 10816b3a08647abdf4e621e0f707cb674c03cda3 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 21 Sep 2007 17:10:45 +0200 Subject: [PATCH 14/60] Bug#28359 Intermitted lost connection at 'reading authorization packet' errors - Increase default 'connect_timeout' value to 10 seconds --- sql/mysql_priv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 44eb5590a28..1d944f196ed 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -245,8 +245,13 @@ MY_LOCALE *my_locale_by_number(uint number); #define PRECISION_FOR_DOUBLE 53 #define PRECISION_FOR_FLOAT 24 +/* + Default time to wait before aborting a new client connection + that does not respond to "initial server greeting" timely +*/ +#define CONNECT_TIMEOUT 10 + /* The following can also be changed from the command line */ -#define CONNECT_TIMEOUT 5 // Do not wait long for connect #define DEFAULT_CONCURRENCY 10 #define DELAYED_LIMIT 100 /* pause after xxx inserts */ #define DELAYED_QUEUE_SIZE 1000 From 9c9c82e04ecd23e4aa5f44ecfb63a86f8f97b9d3 Mon Sep 17 00:00:00 2001 From: "iggy@alf.(none)" <> Date: Fri, 21 Sep 2007 11:38:23 -0400 Subject: [PATCH 15/60] Bug #15327: configure: --with-tcp-port option being partially ignored make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. --- win/configure.js | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/win/configure.js b/win/configure.js index a2502d96b80..38ca11f0439 100755 --- a/win/configure.js +++ b/win/configure.js @@ -31,6 +31,7 @@ try configureInTS.Close(); var default_comment = "Source distribution"; var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"); + var actual_port = 0; var configfile = fso.CreateTextFile("win\\configure.data", true); for (i=0; i < args.Count(); i++) @@ -58,10 +59,41 @@ try default_comment = parts[1]; break; case "MYSQL_TCP_PORT": - default_port = parts[1]; + actual_port = parts[1]; break; } } + if (actual_port == 0) + { + // if we actually defaulted (as opposed to the pathological case of + // --with-tcp-port= which might in theory + // happen if whole batch of servers was built from a script), set + // the default to zero to indicate that; we don't lose information + // that way, because 0 obviously indicates that we can get the + // default value from MYSQL_TCP_PORT. this seems really evil, but + // testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a + // a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not + // intend it to mean "use the default, in fact, look up a good default + // from /etc/services if you can", but really, really meant 3306 when + // they passed in 3306. When they pass in a specific value, let them + // have it; don't second guess user and think we know better, this will + // just make people cross. this makes the the logic work like this + // (which is complicated enough): + // + // - if a port was set during build, use that as a default. + // + // - otherwise, try to look up a port in /etc/services; if that fails, + // use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306) + // + // - allow the MYSQL_TCP_PORT environment variable to override that. + // + // - allow command-line parameters to override all of the above. + // + // the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js, + // so don't mess with that. + actual_port = default_port; + default_port = 0; + } configfile.WriteLine("SET (COMPILATION_COMMENT \"" + default_comment + "\")"); @@ -70,7 +102,8 @@ try GetValue(configureIn, "PROTOCOL_VERSION") + "\")"); configfile.WriteLine("SET (DOT_FRM_VERSION \"" + GetValue(configureIn, "DOT_FRM_VERSION") + "\")"); - configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + default_port + "\")"); + configfile.WriteLine("SET (MYSQL_TCP_PORT_DEFAULT \"" + default_port + "\")"); + configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + actual_port + "\")"); configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" + GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")"); var version = GetVersion(configureIn); From ed055965bf2e4f04be61372bb81f67d51231ae33 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 21 Sep 2007 17:52:02 +0200 Subject: [PATCH 16/60] - Increase default connect_timeout to avoid intermittent disconnects when test servers are put under load --- mysql-test/mysql-test-run.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 06447b9e69d..ad507440bb7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3708,6 +3708,11 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--language=%s", $prefix, $path_language); mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix); + # Increase default connect_timeout to avoid intermittent + # disconnects when test servers are put under load + # see BUG#28359 + mtr_add_arg($args, "%s--connect-timeout=60", $prefix); + if ( $opt_valgrind_mysqld ) { mtr_add_arg($args, "%s--skip-safemalloc", $prefix); From ac026cfeb6d8d3ded34db5c222f4d5b6dfb5262b Mon Sep 17 00:00:00 2001 From: "iggy@alf.(none)" <> Date: Fri, 21 Sep 2007 12:05:54 -0400 Subject: [PATCH 17/60] Bug #15327: configure: --with-tcp-port option being partially ignored make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. --- win/configure.js | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/win/configure.js b/win/configure.js index 7e10ac34697..c86ec0cf47c 100644 --- a/win/configure.js +++ b/win/configure.js @@ -31,6 +31,7 @@ try configureInTS.Close(); var default_comment = "Source distribution"; var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"); + var actual_port = 0; var configfile = fso.CreateTextFile("win\\configure.data", true); for (i=0; i < args.Count(); i++) @@ -59,10 +60,41 @@ try default_comment = parts[1]; break; case "MYSQL_TCP_PORT": - default_port = parts[1]; + actual_port = parts[1]; break; } } + if (actual_port == 0) + { + // if we actually defaulted (as opposed to the pathological case of + // --with-tcp-port= which might in theory + // happen if whole batch of servers was built from a script), set + // the default to zero to indicate that; we don't lose information + // that way, because 0 obviously indicates that we can get the + // default value from MYSQL_TCP_PORT. this seems really evil, but + // testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a + // a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not + // intend it to mean "use the default, in fact, look up a good default + // from /etc/services if you can", but really, really meant 3306 when + // they passed in 3306. When they pass in a specific value, let them + // have it; don't second guess user and think we know better, this will + // just make people cross. this makes the the logic work like this + // (which is complicated enough): + // + // - if a port was set during build, use that as a default. + // + // - otherwise, try to look up a port in /etc/services; if that fails, + // use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306) + // + // - allow the MYSQL_TCP_PORT environment variable to override that. + // + // - allow command-line parameters to override all of the above. + // + // the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js, + // so don't mess with that. + actual_port = default_port; + default_port = 0; + } configfile.WriteLine("SET (COMPILATION_COMMENT \"" + default_comment + "\")"); @@ -71,7 +103,8 @@ try GetValue(configureIn, "PROTOCOL_VERSION") + "\")"); configfile.WriteLine("SET (DOT_FRM_VERSION \"" + GetValue(configureIn, "DOT_FRM_VERSION") + "\")"); - configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + default_port + "\")"); + configfile.WriteLine("SET (MYSQL_TCP_PORT_DEFAULT \"" + default_port + "\")"); + configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + actual_port + "\")"); configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" + GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")"); var version = GetVersion(configureIn); From d8fd59a42300122a3e4a04ae5db16e63d4b26df4 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Sat, 22 Sep 2007 12:17:14 +0200 Subject: [PATCH 18/60] Bug#30843 Bad Test addition to t/archive.test --- mysql-test/r/archive.result | 9 ++++----- mysql-test/t/archive.test | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index a1c11417bd0..a0b13b14b17 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -11123,8 +11123,8 @@ auto fld1 companynr fld3 fld4 fld5 fld6 SELECT COUNT(auto) FROM t2; COUNT(auto) 1213 -INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -INSERT INTO t2 VALUES (5,000001,00,'after','delayed','insert',''); +INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert',''); +INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert',''); SELECT COUNT(auto) FROM t2; COUNT(auto) 1215 @@ -11139,7 +11139,7 @@ t2 CREATE TABLE `t2` ( `fld4` char(35) NOT NULL default '', `fld5` char(35) NOT NULL default '' ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -SELECT * from t2; +SELECT * from t2 WHERE auto != 100000; auto fld1 companynr fld3 fld4 fld5 1 000001 00 Omaha teethe neat 2 011401 37 breaking dreaded Steinberg @@ -12354,8 +12354,7 @@ auto fld1 companynr fld3 fld4 fld5 2 011401 37 breaking dreaded Steinberg 3 011402 37 Romans scholastics jarring 4 011403 37 intercepted audiology tinily -4 011403 37 intercepted audiology tinily -5 000001 00 after delayed insert +99999 011403 37 the delayed insert drop table t1, t2, t4; create table t1 (i int) engine=archive; insert into t1 values (1); diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index d1c45a259c6..2d29cab041d 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1347,13 +1347,13 @@ SELECT * FROM t2; # Test INSERT DELAYED and wait until the table has one more record SELECT COUNT(auto) FROM t2; -INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); +INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert',''); # Insert another record since in Archive delayed values are only # guaranteed to materialize based on either: # 1) A new row showing up from a normal insert # 2) A flush table has occurred. -INSERT INTO t2 VALUES (5,000001,00,'after','delayed','insert',''); +INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert',''); # Wait for the delayed insert to appear while (`SELECT COUNT(auto)!=1215 FROM t2`) @@ -1365,7 +1365,7 @@ SELECT COUNT(auto) FROM t2; # Adding test for alter table ALTER TABLE t2 DROP COLUMN fld6; SHOW CREATE TABLE t2; -SELECT * from t2; +SELECT * from t2 WHERE auto != 100000; # # Cleanup, test is over # From d07a83eadf60906e8c9151b678ee9f69634e4ca4 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 24 Sep 2007 12:42:44 +0200 Subject: [PATCH 19/60] Add test for named pipes on windows Improve test for shm on windows --- mysql-test/include/windows.inc | 9 +- mysql-test/r/named_pipe.result | 2153 ++++++++++++++++ mysql-test/r/shm.result | 2155 +++++++++++++++++ mysql-test/r/windows_shm.result | 2 - mysql-test/t/named_pipe-master.opt | 1 + mysql-test/t/named_pipe.test | 14 + ...{windows_shm-master.opt => shm-master.opt} | 2 +- mysql-test/t/shm.test | 19 + mysql-test/t/windows_shm.test | 9 - 9 files changed, 4348 insertions(+), 16 deletions(-) create mode 100644 mysql-test/r/named_pipe.result create mode 100644 mysql-test/r/shm.result delete mode 100644 mysql-test/r/windows_shm.result create mode 100644 mysql-test/t/named_pipe-master.opt create mode 100644 mysql-test/t/named_pipe.test rename mysql-test/t/{windows_shm-master.opt => shm-master.opt} (73%) create mode 100644 mysql-test/t/shm.test delete mode 100644 mysql-test/t/windows_shm.test diff --git a/mysql-test/include/windows.inc b/mysql-test/include/windows.inc index 05ec7b0e021..88553d8aa59 100644 --- a/mysql-test/include/windows.inc +++ b/mysql-test/include/windows.inc @@ -1,4 +1,5 @@ ---require r/true.require -disable_query_log; -select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE"; -enable_query_log; +if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) +{ + skip Need windows; +} + diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result new file mode 100644 index 00000000000..5d22fe4a69b --- /dev/null +++ b/mysql-test/r/named_pipe.result @@ -0,0 +1,2153 @@ +drop table if exists t1,t2,t3,t4; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR HY000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR HY000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +CREATE TABLE t1 ( +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk +Warnings: +Warning 1052 Column 'kundentyp' in group statement is ambiguous +drop table t1; diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result new file mode 100644 index 00000000000..09adebad10f --- /dev/null +++ b/mysql-test/r/shm.result @@ -0,0 +1,2155 @@ +drop table if exists t1,t2,t3,t4; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR HY000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR HY000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +CREATE TABLE t1 ( +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk +Warnings: +Warning 1052 Column 'kundentyp' in group statement is ambiguous +drop table t1; +mysqld is alive +End of 5.0 tests. diff --git a/mysql-test/r/windows_shm.result b/mysql-test/r/windows_shm.result deleted file mode 100644 index c60049bece8..00000000000 --- a/mysql-test/r/windows_shm.result +++ /dev/null @@ -1,2 +0,0 @@ -mysqld is alive -End of 5.0 tests. diff --git a/mysql-test/t/named_pipe-master.opt b/mysql-test/t/named_pipe-master.opt new file mode 100644 index 00000000000..e534ae1eae5 --- /dev/null +++ b/mysql-test/t/named_pipe-master.opt @@ -0,0 +1 @@ +--loose-enable-named-pipe diff --git a/mysql-test/t/named_pipe.test b/mysql-test/t/named_pipe.test new file mode 100644 index 00000000000..e3dfd24bb52 --- /dev/null +++ b/mysql-test/t/named_pipe.test @@ -0,0 +1,14 @@ +# We currently only have named pipe support on windows, so +# in order to optimize things we skip this test on all +# other platforms +--source include/windows.inc + +# Only run this test if named pipe is avaliable +let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1); +if (`SELECT '$nmp' != 'ON'`){ + skip No named pipe support; +} + +# Source select test case +-- source include/common-tests.inc + diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/shm-master.opt similarity index 73% rename from mysql-test/t/windows_shm-master.opt rename to mysql-test/t/shm-master.opt index 4476ea16360..d71395213b1 100644 --- a/mysql-test/t/windows_shm-master.opt +++ b/mysql-test/t/shm-master.opt @@ -1 +1 @@ ---skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1 +--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$MTR_BUILD_THREAD --loose-shared-memory=1 diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test new file mode 100644 index 00000000000..380607d8ebf --- /dev/null +++ b/mysql-test/t/shm.test @@ -0,0 +1,19 @@ +# We currently only have shm support on windows, so in order +# to optimize things we skip this test on all other platforms +--source include/windows.inc + +# Only run this test if shared memory is avaliable +let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1); +if (`SELECT '$shm' != 'ON'`){ + skip No shm support; +} + +# Source select test case +-- source include/common-tests.inc + +# +# Bug #24924: shared-memory-base-name that is too long causes buffer overflow +# +--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping + +--echo End of 5.0 tests. diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test deleted file mode 100644 index 1c6f05f2da0..00000000000 --- a/mysql-test/t/windows_shm.test +++ /dev/null @@ -1,9 +0,0 @@ -# Windows-specific tests ---source include/windows.inc - -# -# Bug #24924: shared-memory-base-name that is too long causes buffer overflow -# ---exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping - ---echo End of 5.0 tests. From e068e99cd0f7cc64c999c81f546daa9337402a8e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 26 Sep 2007 17:04:41 +0200 Subject: [PATCH 20/60] Bug#31167 Introduction of @@hostname breaks replication in a ring - Use a local uservariable to avoid @@hostname in binlog --- scripts/mysql_system_tables_data.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 5f0289ab197..8399ae796ef 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -15,7 +15,8 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +set @hostname= @@hostname; +REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; From c22a4a71f633d3308e0b13d1884b7b4b08875542 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 26 Sep 2007 17:28:20 +0200 Subject: [PATCH 21/60] Update result file(s) for 5.1 --- mysql-test/r/named_pipe.result | 14 +++++++------- mysql-test/r/shm.result | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result index 5d22fe4a69b..588b7570d8f 100644 --- a/mysql-test/r/named_pipe.result +++ b/mysql-test/r/named_pipe.result @@ -142,9 +142,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 ignore index (fld3,not_used); -ERROR HY000: Key 'not_used' doesn't exist in table 't2' +ERROR 42000: Key 'not_used' doesn't exist in table 't2' explain select fld3 from t2 use index (not_used); -ERROR HY000: Key 'not_used' doesn't exist in table 't2' +ERROR 42000: Key 'not_used' doesn't exist in table 't2' select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; fld3 honeysuckle @@ -605,11 +605,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref period period 4 test.t1.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort 1 SIMPLE t1 ref period period 4 test.t3.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort 1 SIMPLE t3 ref period period 4 test.t1.period 4181 select period from t1; period @@ -1429,7 +1429,7 @@ companynr companynr explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; fld1 companynr fld3 period 038008 37 reporters 1008 @@ -1502,8 +1502,8 @@ select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result index 09adebad10f..a99a8b0df5d 100644 --- a/mysql-test/r/shm.result +++ b/mysql-test/r/shm.result @@ -142,9 +142,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index explain select fld3 from t2 ignore index (fld3,not_used); -ERROR HY000: Key 'not_used' doesn't exist in table 't2' +ERROR 42000: Key 'not_used' doesn't exist in table 't2' explain select fld3 from t2 use index (not_used); -ERROR HY000: Key 'not_used' doesn't exist in table 't2' +ERROR 42000: Key 'not_used' doesn't exist in table 't2' select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; fld3 honeysuckle @@ -605,11 +605,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref period period 4 test.t1.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using filesort 1 SIMPLE t1 ref period period 4 test.t3.period 4181 explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort 1 SIMPLE t3 ref period period 4 test.t1.period 4181 select period from t1; period @@ -1429,7 +1429,7 @@ companynr companynr explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; fld1 companynr fld3 period 038008 37 reporters 1008 @@ -1502,8 +1502,8 @@ select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 100.00 Using where Warnings: Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; From e21bb2640aad40e766328b2016d7c68496113559 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Thu, 27 Sep 2007 08:48:39 +0200 Subject: [PATCH 22/60] Move DBUG_ENTER to begining of function to avoid build failure with debug on windows --- libmysql/libmysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 85c56a7ea40..14b1a682b49 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4681,14 +4681,14 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) MYSQL_ROWS *cur, **prev_ptr= &result->data; NET *net; + DBUG_ENTER("cli_read_binary_rows"); + if (!mysql) { set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); return 1; } - DBUG_ENTER("cli_read_binary_rows"); - net = &mysql->net; mysql= mysql->last_used_con; From e4d7e2168353270b04d5c0ba6221db6459f43519 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Tue, 2 Oct 2007 20:44:37 +0200 Subject: [PATCH 23/60] Bug#27597 mysqld-debug broken - "on" -> "restore" to avoid warning in MSVC when compiling with debug --- mysys/my_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index 32d3f07fd31..8154a5fce51 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -286,7 +286,7 @@ int handle_rtc_failure(int err_type, const char *file, int line, return 0; /* Error is handled */ } -#pragma runtime_checks("", on) +#pragma runtime_checks("", restore) #endif From 0111438b450bd08ac98eaab2b780815a28a6c7ea Mon Sep 17 00:00:00 2001 From: "tsmith@sita.local" <> Date: Tue, 2 Oct 2007 23:47:30 -0600 Subject: [PATCH 24/60] Bug #20358: InnoDB hang on the adaptive hash index latch in btr0sea.c Add --skip-innodb-adaptive-hash-index option, which is a way to work around the bug (by disabling the adaptive hash feature entirely). This may be useful even once the bug is fixed, for benchmarking purposes. There are some workloads for which the adaptive hash index is not effective. --- sql/ha_innodb.cc | 3 +++ sql/ha_innodb.h | 3 ++- sql/mysqld.cc | 9 ++++++++- sql/set_var.cc | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2d47c42cf1d..86d3e930122 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -174,6 +174,7 @@ my_bool innobase_file_per_table = FALSE; my_bool innobase_locks_unsafe_for_binlog = FALSE; my_bool innobase_rollback_on_timeout = FALSE; my_bool innobase_create_status_file = FALSE; +my_bool innobase_adaptive_hash_index = TRUE; static char *internal_innobase_data_file_path = NULL; @@ -1376,6 +1377,8 @@ innobase_init(void) srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; srv_use_checksums = (ibool) innobase_use_checksums; + srv_use_adaptive_hash_indexes = (ibool) innobase_adaptive_hash_index; + os_use_large_pages = (ibool) innobase_use_large_pages; os_large_page_size = (ulint) innobase_large_page_size; diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 585bc75fa36..3db983901b3 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -217,7 +217,8 @@ extern my_bool innobase_log_archive, innobase_use_native_aio, innobase_file_per_table, innobase_locks_unsafe_for_binlog, innobase_rollback_on_timeout, - innobase_create_status_file; + innobase_create_status_file, + innobase_adaptive_hash_index; extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before calling innobase_end() if you want InnoDB to shut down without diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 08c2b60fa79..a6c9eeec65a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4829,7 +4829,8 @@ enum options_mysqld OPT_MERGE, OPT_INNODB_ROLLBACK_ON_TIMEOUT, OPT_SECURE_FILE_PRIV, - OPT_KEEP_FILES_ON_CREATE + OPT_KEEP_FILES_ON_CREATE, + OPT_INNODB_ADAPTIVE_HASH_INDEX }; @@ -5057,6 +5058,12 @@ Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums, "The common part for InnoDB table spaces.", (gptr*) &innobase_data_home_dir, (gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"innodb_adaptive_hash_index", OPT_INNODB_ADAPTIVE_HASH_INDEX, + "Enable InnoDB adaptive hash index (enabled by default). " + "Disable with --skip-innodb-adaptive-hash-index.", + (gptr*) &innobase_adaptive_hash_index, + (gptr*) &innobase_adaptive_hash_index, + 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, (gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, diff --git a/sql/set_var.cc b/sql/set_var.cc index e1246617d84..268c82c2be2 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -901,6 +901,7 @@ struct show_var_st init_vars[]= { {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS}, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, + {"innodb_adaptive_hash_index", (char*) &innobase_adaptive_hash_index, SHOW_MY_BOOL}, {"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL}, {sys_innodb_fast_shutdown.name,(char*) &sys_innodb_fast_shutdown, SHOW_SYS}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, From bc9b4834e1f95f02008e41b8e5ce62968befd53a Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Thu, 4 Oct 2007 10:20:00 +0500 Subject: [PATCH 25/60] Fix for bug #31069: crash in 'sounds like' and for bug #31070: crash during conversion of charsets Problem: passing a 0 byte length string to some my_mb_wc_XXX() functions leads to server crash due to improper argument check. Fix: properly check arguments passed to my_mb_wc_XXX() functions. --- mysql-test/include/ctype_common.inc | 9 +++++++++ mysql-test/r/ctype_big5.result | 11 +++++++++++ mysql-test/r/ctype_euckr.result | 11 +++++++++++ mysql-test/r/ctype_gb2312.result | 11 +++++++++++ mysql-test/r/ctype_gbk.result | 11 +++++++++++ mysql-test/r/ctype_uca.result | 11 +++++++++++ strings/ctype-big5.c | 4 ++-- strings/ctype-cp932.c | 4 ++-- strings/ctype-euc_kr.c | 4 ++-- strings/ctype-gb2312.c | 4 +--- strings/ctype-sjis.c | 4 ++-- 11 files changed, 73 insertions(+), 11 deletions(-) diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 202c508a9c9..9ee0a40c8ce 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -51,6 +51,15 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%'; SELECT c1 as want1result from t1 where c1 like 'location%'; DROP TABLE t1; +# +# Bug #31070: crash during conversion of charsets +# +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +select a sounds like a from t1; +drop table t1; + DROP DATABASE d1; # Restore settings USE test; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 6574908101c..a2651db6308 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index 6017bc07763..2d9f8d217e6 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 314c336bab9..04c318e83a8 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index 241539ecf42..064c0bc2acf 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 91ee427efb4..3d8bd33fb19 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2371,6 +2371,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 89a40b15288..90917229769 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6256,12 +6256,12 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc,const uchar *s,const uchar *e) { - int hi=s[0]; + int hi; if (s >= e) return MY_CS_TOOSMALL; - if (hi<0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index e8c62b0315e..3752b2e4118 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -5352,12 +5352,12 @@ my_wc_mb_cp932(CHARSET_INFO *cs __attribute__((unused)), static int my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){ - int hi=s[0]; + int hi; if (s >= e) return MY_CS_TOOSMALL; - if (hi < 0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 25ac416ac60..50300f3c140 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8614,12 +8614,12 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e) { - int hi=s[0]; + int hi; if (s >= e) return MY_CS_TOOSMALL; - if (hi<0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 556f485945b..e81f9d3cf0c 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5665,12 +5665,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){ int hi; - hi=(int) s[0]; - if (s >= e) return MY_CS_TOOSMALL; - if (hi<0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 38a9c9a6428..92d6b4dc2ae 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4512,12 +4512,12 @@ mb: static int my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){ - int hi=s[0]; + int hi; if (s >= e) return MY_CS_TOOSMALL; - if (hi < 0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; From c623e73e8f8479c0d921025c7fcae1eb8ebd8b27 Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Thu, 4 Oct 2007 08:27:03 +0200 Subject: [PATCH 26/60] Bug #30444: 5.0 mysqldump silently allows wrong backup to be taken against a 4.0 database The combination of --single-transaction and --master-data requires START TRANSACTION WITH CONSISTENT SNAPSHOT which is available from mysqld 4.1 on. When trying this against an older server, print diagnostic, then, if --force is not given, abort. No test-case given since it would require a mysqld < 4.1. --- client/mysqldump.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index 3bf9fff1b86..a2a03334ba3 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2428,6 +2428,18 @@ static int start_transaction(MYSQL *mysql_con) need the REPEATABLE READ level (not anything lower, for example READ COMMITTED would give one new consistent read per dumped table). */ + if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data) + { + fprintf(stderr, "-- %s: the combination of --single-transaction and " + "--master-data requires a MySQL server version of at least 4.1 " + "(current server's version is %s). %s\n", + ignore_errors ? "Warning" : "Error", + mysql_con->server_version ? mysql_con->server_version : "unknown", + ignore_errors ? "Continuing due to --force, backup may not be consistent across all tables!" : "Aborting."); + if (!ignore_errors) + exit(EX_MYSQLERR); + } + return (mysql_query_with_error_report(mysql_con, 0, "SET SESSION TRANSACTION ISOLATION " "LEVEL REPEATABLE READ") || From 6e6727d24480effb2fe401bab970ad12f80ca7fe Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Thu, 4 Oct 2007 12:09:22 +0500 Subject: [PATCH 27/60] merging: results adjusted --- mysql-test/r/ctype_big5.result | 2 ++ mysql-test/r/ctype_euckr.result | 2 ++ mysql-test/r/ctype_gb2312.result | 2 ++ mysql-test/r/ctype_gbk.result | 2 ++ mysql-test/r/ctype_uca.result | 2 ++ 5 files changed, 10 insertions(+) diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 485b6ec00ae..b190273cc64 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -54,6 +54,8 @@ location DROP TABLE t1; create table t1 (a set('a') not null); insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value select cast(a as char(1)) from t1; cast(a as char(1)) diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index 2d9f8d217e6..b9619370d4c 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -54,6 +54,8 @@ location DROP TABLE t1; create table t1 (a set('a') not null); insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value select cast(a as char(1)) from t1; cast(a as char(1)) diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 04c318e83a8..90c94c3b299 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -54,6 +54,8 @@ location DROP TABLE t1; create table t1 (a set('a') not null); insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value select cast(a as char(1)) from t1; cast(a as char(1)) diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index bc717736e3e..fe90c7bff29 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -54,6 +54,8 @@ location DROP TABLE t1; create table t1 (a set('a') not null); insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value select cast(a as char(1)) from t1; cast(a as char(1)) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 8a4f0fd3698..e676d5a5ca0 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2589,6 +2589,8 @@ location DROP TABLE t1; create table t1 (a set('a') not null); insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value select cast(a as char(1)) from t1; cast(a as char(1)) From 1ba3f4f56b57bcf6266beae20da6a06eda436964 Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Thu, 4 Oct 2007 12:34:00 +0400 Subject: [PATCH 28/60] Issue a warning if a user sets an option or a variable to a value that is greater than a defined maximum for the option/variable. This is for bug #29446 "Specifying a myisam_sort_buffer > 4GB on 64 bit machines not possible". Support for myisam_sort_buffer_size > 4 GB on 64-bit Windows will be looked at later in 5.2. --- mysql-test/r/variables.result | 2 ++ mysql-test/t/variables.test | 1 + mysys/my_getopt.c | 16 ++++++++++++++++ sql/set_var.cc | 15 +++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 3d76f8e4a90..9e52fbeac1a 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -218,6 +218,8 @@ show variables like 'net_buffer_length'; Variable_name Value net_buffer_length 1024 set net_buffer_length=2000000000; +Warnings: +Warning 1292 Truncated incorrect net_buffer_length value: '2000000000' show variables like 'net_buffer_length'; Variable_name Value net_buffer_length 1048576 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 0ad85a32568..ccd487a72ea 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -139,6 +139,7 @@ show global variables like 'net_%'; show session variables like 'net_%'; set net_buffer_length=1; show variables like 'net_buffer_length'; +--warning 1292 set net_buffer_length=2000000000; show variables like 'net_buffer_length'; diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 623c48b2e55..71630e1b4c2 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -19,6 +19,7 @@ #include #include #include +#include static void default_reporter(enum loglevel level, const char *format, ...); my_error_reporter my_getopt_error_reporter= &default_reporter; @@ -693,7 +694,15 @@ static longlong eval_num_suffix (char *argument, int *error, char *option_name) longlong num; *error= 0; + errno= 0; num= strtoll(argument, &endchar, 10); + if (errno == ERANGE) + { + my_getopt_error_reporter(ERROR_LEVEL, + "Incorrect integer value: '%s'", argument); + *error= 1; + return 0; + } if (*endchar == 'k' || *endchar == 'K') num*= 1024L; else if (*endchar == 'm' || *endchar == 'M') @@ -730,7 +739,14 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err) num= eval_num_suffix(arg, err, (char*) optp->name); if (num > 0 && (ulonglong) num > (ulonglong) optp->max_value && optp->max_value) /* if max value is not set -> no upper limit */ + { + char buf[22]; + my_getopt_error_reporter(WARNING_LEVEL, + "Truncated incorrect %s value: '%s'", + optp->name, llstr(num, buf)); + num= (ulonglong) optp->max_value; + } num= ((num - optp->sub_size) / block_size); num= (longlong) (num * block_size); return max(num, optp->min_value); diff --git a/sql/set_var.cc b/sql/set_var.cc index e1246617d84..5c76019efc6 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1532,16 +1532,31 @@ bool sys_var_thd_ulong::check(THD *thd, set_var *var) bool sys_var_thd_ulong::update(THD *thd, set_var *var) { ulonglong tmp= var->save_result.ulonglong_value; + char buf[22]; + bool truncated= false; /* Don't use bigger value than given with --maximum-variable-name=.. */ if ((ulong) tmp > max_system_variables.*offset) + { + truncated= true; + llstr(tmp, buf); tmp= max_system_variables.*offset; + } #if SIZEOF_LONG == 4 /* Avoid overflows on 32 bit systems */ if (tmp > (ulonglong) ~(ulong) 0) + { + truncated= true; + llstr(tmp, buf); tmp= ((ulonglong) ~(ulong) 0); + } #endif + if (truncated) + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRUNCATED_WRONG_VALUE, + ER(ER_TRUNCATED_WRONG_VALUE), name, + buf); if (option_limits) tmp= (ulong) getopt_ull_limit_value(tmp, option_limits); From f74d805e16e2bb6c277f6ea7357686dcef77378f Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Thu, 4 Oct 2007 14:22:35 +0400 Subject: [PATCH 29/60] Backport of the 5.0 patch to 4.1 Bug#28878: InnoDB tables with UTF8 character set and indexes cause wrong result for DML When making key reference buffers over CHAR fields whitespace (0x20) must be used to fill in the remaining space in the field's buffer. This is what Field_string::store() does. Fixed Field_string::get_key_image() to do the same. --- mysql-test/r/innodb_mysql.result | 36 ++++++++++++++++++++++++++++++++ mysql-test/t/innodb_mysql.test | 32 ++++++++++++++++++++++++++++ sql/field.cc | 3 ++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 029f3768f9b..93b93c6253c 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -182,4 +182,40 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables DROP TABLE t1; +CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8; +INSERT INTO t1 VALUES ('uk'),('bg'); +SELECT * FROM t1 WHERE a = 'uk'; +a +uk +DELETE FROM t1 WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; +a +UPDATE t1 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; +a +CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB; +INSERT INTO t2 VALUES ('uk'),('bg'); +SELECT * FROM t2 WHERE a = 'uk'; +a +uk +DELETE FROM t2 WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; +a +INSERT INTO t2 VALUES ('uk'); +UPDATE t2 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; +a +CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM; +INSERT INTO t3 VALUES ('uk'),('bg'); +SELECT * FROM t3 WHERE a = 'uk'; +a +uk +DELETE FROM t3 WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; +a +INSERT INTO t3 VALUES ('uk'); +UPDATE t3 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; +a +DROP TABLE t1,t2,t3; End of 4.1 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index b5e7fc6e405..4e20535549a 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -216,4 +216,36 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; DROP TABLE t1; +# +# Bug #28878: InnoDB tables with UTF8 character set and indexes cause wrong result for DML +# + +CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8; +INSERT INTO t1 VALUES ('uk'),('bg'); +SELECT * FROM t1 WHERE a = 'uk'; +DELETE FROM t1 WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; +UPDATE t1 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t1 WHERE a = 'uk'; + +CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB; +INSERT INTO t2 VALUES ('uk'),('bg'); +SELECT * FROM t2 WHERE a = 'uk'; +DELETE FROM t2 WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; +INSERT INTO t2 VALUES ('uk'); +UPDATE t2 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t2 WHERE a = 'uk'; + +CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM; +INSERT INTO t3 VALUES ('uk'),('bg'); +SELECT * FROM t3 WHERE a = 'uk'; +DELETE FROM t3 WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; +INSERT INTO t3 VALUES ('uk'); +UPDATE t3 SET a = 'us' WHERE a = 'uk'; +SELECT * FROM t3 WHERE a = 'uk'; + +DROP TABLE t1,t2,t3; + --echo End of 4.1 tests diff --git a/sql/field.cc b/sql/field.cc index 1b27e12e078..5b43b9b1955 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5211,7 +5211,8 @@ uint Field_string::get_key_image(char *buff, uint length, CHARSET_INFO *cs, length / field_charset->mbmaxlen); memcpy(buff, ptr, bytes); if (bytes < length) - bzero(buff + bytes, length - bytes); + field_charset->cset->fill(field_charset, buff + bytes, length - bytes, + ' '); return bytes; } From caaf8f56bd791eb30582ac1abe353f8d399d066b Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Fri, 5 Oct 2007 09:38:57 +0200 Subject: [PATCH 30/60] Bug#31227: memory overrun with decimal (6,6) and zerofill and group_concat Reserve the space for the leading 0 (before the decimal point) in DECIMAL(a,a) ZEROFILL. --- mysql-test/r/type_decimal.result | 8 +++++++ mysql-test/t/type_decimal.test | 13 ++++++++++- sql/my_decimal.cc | 39 ++++++++++++++++++++++++-------- 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 3cf24529421..65a72e0aa9b 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -683,6 +683,7 @@ select * from t1; a b 123.12345 123.1 drop table t1; +End of 4.1 tests CREATE TABLE t1 (EMPNUM CHAR(3) NOT NULL, HOURS DECIMAL(5)); @@ -799,3 +800,10 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; ROUND(qty,3) dps ROUND(qty,dps) 1.133 3 1.133 DROP TABLE t1; +create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); +insert into t1 values (-0.123456,0.123456); +select group_concat(f1),group_concat(f2) from t1; +group_concat(f1) group_concat(f2) +-0.123456 0.123456 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 5538f19f5f9..458583fca81 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -278,7 +278,7 @@ update t1 set b=a; select * from t1; drop table t1; -# End of 4.1 tests +--echo End of 4.1 tests # # Test for BUG#8397: decimal type in subselects (Item_cache_decimal) @@ -408,3 +408,14 @@ INSERT INTO t1 VALUES (1.1325,3); SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; DROP TABLE t1; + +# +# Bug #31227: memory overrun with decimal (6,6) and zerofill and group_concat +# valgrind will complain about this (the group_concat(f2)) on unpatched mysqld. +# +create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); +insert into t1 values (-0.123456,0.123456); +select group_concat(f1),group_concat(f2) from t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 4ef2ae5cf95..31a5b09370a 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -68,24 +68,43 @@ int decimal_operation_results(int result) } -/* - Converting decimal to string +/** + @brief Converting decimal to string - SYNOPSIS - my_decimal2string() + @details Convert given my_decimal to String; allocate buffer as needed. - return - E_DEC_OK - E_DEC_TRUNCATED - E_DEC_OVERFLOW - E_DEC_OOM + @param[in] mask what problems to warn on (mask of E_DEC_* values) + @param[in] d the decimal to print + @param[in] fixed_prec overall number of digits if ZEROFILL, 0 otherwise + @param[in] fixed_dec number of decimal places (if fixed_prec != 0) + @param[in] filler what char to pad with (ZEROFILL et al.) + @param[out] *str where to store the resulting string + + @return error coce + @retval E_DEC_OK + @retval E_DEC_TRUNCATED + @retval E_DEC_OVERFLOW + @retval E_DEC_OOM */ int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec, uint fixed_dec, char filler, String *str) { - int length= (fixed_prec ? (fixed_prec + 1) : my_decimal_string_length(d)); + /* + Calculate the size of the string: For DECIMAL(a,b), fixed_prec==a + holds true iff the type is also ZEROFILL, which in turn implies + UNSIGNED. Hence the buffer for a ZEROFILLed value is the length + the user requested, plus one for a possible decimal point, plus + one if the user only wanted decimal places, but we force a leading + zero on them. Because the type is implicitly UNSIGNED, we do not + need to reserve a character for the sign. For all other cases, + fixed_prec will be 0, and my_decimal_string_length() will be called + instead to calculate the required size of the buffer. + */ + int length= (fixed_prec + ? (fixed_prec + ((fixed_prec == fixed_dec) ? 1 : 0) + 1) + : my_decimal_string_length(d)); int result; if (str->alloc(length)) return check_result(mask, E_DEC_OOM); From 455c05abcf421415d4d67336d7f01ce41fc47d3c Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Fri, 5 Oct 2007 12:08:38 +0200 Subject: [PATCH 31/60] Bug #31253: crash comparing datetime to double convert(, datetime) in WHERE caused crash as function returned (void*)NULL, but did not flag SQL NULL. It does now. --- mysql-test/r/type_datetime.result | 9 +++++++++ mysql-test/t/type_datetime.test | 10 ++++++++++ sql/item.cc | 1 + 3 files changed, 20 insertions(+) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 9e47b5da2b6..f7009d561ba 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -427,3 +427,12 @@ f1 Warnings: Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1 drop table t1; +create table t1 (f1 time); +insert into t1 set f1 = '45:44:44'; +insert into t1 set f1 = '15:44:44'; +select * from t1 where (convert(f1,datetime)) != 1; +f1 +15:44:44 +Warnings: +Warning 1292 Truncated incorrect datetime value: '0000-00-00 45:44:44' +drop table t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index ffda593f320..880cde40a77 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -282,3 +282,13 @@ select * from t1 where f1 between 20020101 and 20070101000000; select * from t1 where f1 between 2002010 and 20070101000000; select * from t1 where f1 between 20020101 and 2007010100000; drop table t1; + +# +# Bug #31253: crash comparing datetime to double +# Should return 1st row only. Crashes if NULL propagation fails. +# +create table t1 (f1 time); +insert into t1 set f1 = '45:44:44'; +insert into t1 set f1 = '15:44:44'; +select * from t1 where (convert(f1,datetime)) != 1; +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index e9b2904e3da..5f73b016e50 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -274,6 +274,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) if (get_date(<ime, TIME_FUZZY_DATE)) { my_decimal_set_zero(decimal_value); + null_value= 1; // set NULL, stop processing return 0; } return date2my_decimal(<ime, decimal_value); From b4b7cf2a95f96892d5ae14608ca52107528b2b7d Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Fri, 5 Oct 2007 16:33:15 +0500 Subject: [PATCH 32/60] Fix for bug #30885: MEMORY returns incorrect data if BTREE index is used for NULL lookup Problem: creating an rb-tree key we store length (2 bytes) before the actual data for varchar key parts. The fact was missed for NULL key parts, when we set NULL byte and skip the rest. Fix: take into account the length of the varchar key parts for NULLs. --- heap/hp_hash.c | 6 ++++++ mysql-test/r/heap_btree.result | 8 ++++++++ mysql-test/t/heap_btree.test | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/heap/hp_hash.c b/heap/hp_hash.c index d8eee9c794c..251be1a3fe2 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -808,6 +808,12 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, if (!(*key++= (char) 1 - *old++)) { k_len-= seg->length; + /* + Take into account length (2 bytes) of varchar key parts + stored before the data. + */ + if (seg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) + k_len-= 2; continue; } } diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index 91f51a95936..21f5a549529 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -321,4 +321,12 @@ DROP TABLE t1; CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; +create table t1(a varchar(255), b varchar(255), +key using btree (a,b)) engine=memory; +insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0); +select * from t1 where a is null; +a b +NULL NULL +NULL 1 +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index d5a4fb7a734..5a238fc32c8 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -235,5 +235,14 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; +# +# Bug #30885: MEMORY returns incorrect data if BTREE index is used for NULL lookup +# +create table t1(a varchar(255), b varchar(255), + key using btree (a,b)) engine=memory; +insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0); +select * from t1 where a is null; +drop table t1; + --echo End of 5.0 tests From 1e4fac167781af727a7aeb5fef422542dc5163f1 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 14:42:38 +0200 Subject: [PATCH 33/60] Bug#31400 mysql-test-run inconvenience problems running a certain test - Allow test case names to be specied in various different ways --- mysql-test/lib/mtr_cases.pl | 140 ++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 60 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 9ba7d737b9e..3622f52940d 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -48,13 +48,14 @@ sub collect_test_cases ($) { { # Check that the tests specified was found # in at least one suite - foreach my $tname ( @::opt_cases ) + foreach my $test_name_spec ( @::opt_cases ) { my $found= 0; + my ($sname, $tname, $extension)= split_testname($test_name_spec); foreach my $test ( @$cases ) { - if ( $test->{'name'} eq $tname || - mtr_match_extension($test->{'name'}, $tname) ) + # test->{name} is always in suite.name format + if ( $test->{name} =~ /.*\.$tname/ ) { $found= 1; } @@ -144,6 +145,45 @@ sub collect_test_cases ($) { } +# Valid extensions and their corresonding component id +my %exts = ( 'test' => 'mysqld', + 'imtest' => 'im' + ); + + +# Returns (suitename, testname, extension) +sub split_testname { + my ($test_name)= @_; + + # Get rid of directory part and split name on .'s + my @parts= split(/\./, basename($test_name)); + + if (@parts == 1){ + # Only testname given, ex: alias + return (undef , $parts[0], undef); + } elsif (@parts == 2) { + # Either testname.test or suite.testname given + # Ex. main.alias or alias.test + + if (defined $exts{$parts[1]}) + { + return (undef , $parts[0], $parts[1]); + } + else + { + return ($parts[0], $parts[1], undef); + } + + } elsif (@parts == 3) { + # Fully specified suitename.testname.test + # ex main.alias.test + return ( $parts[0], $parts[1], $parts[2]); + } + + mtr_error("Illegal format of test name: $test_name"); +} + + sub collect_one_suite($$) { my $suite= shift; # Test suite name @@ -189,77 +229,55 @@ sub collect_one_suite($$) if ( @::opt_cases ) { - # Collect in specified order, no sort - foreach my $tname2 ( @::opt_cases ) + # Collect in specified order + foreach my $test_name_spec ( @::opt_cases ) { - my $tname= $tname2; # Don't modify @::opt_cases ! - my $elem= undef; - my $component_id= undef; + my ($sname, $tname, $extension)= split_testname($test_name_spec); - # Get rid of directory part (path). Leave the extension since it is used - # to understand type of the test. + # The test name parts have now been defined + #print " suite_name: $sname\n"; + #print " tname: $tname\n"; + #print " extension: $extension\n"; - $tname = basename($tname); + # Check cirrect suite if suitename is defined + next if (defined $sname and $suite ne $sname); - # Get rid of suite part - $tname =~ s/^(.*)\.//; - - # Check if the extenstion has been specified. - - if ( mtr_match_extension($tname, "test") ) + my $component_id; + if ( defined $extension ) { - $elem= $tname; - $tname=~ s/\.test$//; - $component_id= 'mysqld'; - } - elsif ( mtr_match_extension($tname, "imtest") ) - { - $elem= $tname; - $tname =~ s/\.imtest$//; - $component_id= 'im'; - } - - # If target component is known, check that the specified test case - # exists. - # - # Otherwise, try to guess the target component. - - if ( $component_id ) - { - if ( ! -f "$testdir/$elem") + my $full_name= "$testdir/$tname.$extension"; + # Extension was specified, check if the test exists + if ( ! -f $full_name) { - mtr_error("Test case $tname ($testdir/$elem) is not found"); + # This is only an error if suite was specified, otherwise it + # could exist in another suite + mtr_error("Test '$full_name' was not found in suite '$sname'") + if $sname; + + next; } + $component_id= $exts{$extension}; } else { - my $mysqld_test_exists = -f "$testdir/$tname.test"; - my $im_test_exists = -f "$testdir/$tname.imtest"; + # No extension was specified + my ($ext, $component); + while (($ext, $component)= each %exts) { + my $full_name= "$testdir/$tname.$ext"; - if ( $mysqld_test_exists and $im_test_exists ) - { - mtr_error("Ambiguous test case name ($tname)"); - } - elsif ( ! $mysqld_test_exists and ! $im_test_exists ) - { - # Silently skip, could exist in another suite - next; - } - elsif ( $mysqld_test_exists ) - { - $elem= "$tname.test"; - $component_id= 'mysqld'; - } - elsif ( $im_test_exists ) - { - $elem= "$tname.imtest"; - $component_id= 'im'; - } + if ( ! -f $full_name ) { + next; + } + $component_id= $component; + $extension= $ext; + } + # Test not found here, could exist in other suite + next unless $component_id; } collect_one_test_case($testdir,$resdir,$suite,$tname, - $elem,$cases,\%disabled,$component_id, - $suite_opts); + "$tname.$extension",$cases,\%disabled, + $component_id,$suite_opts); } } else @@ -319,6 +337,8 @@ sub collect_one_test_case($$$$$$$$$) { my $path= "$testdir/$elem"; + + print "collect_one_test_case\n"; # ---------------------------------------------------------------------- # Skip some tests silently # ---------------------------------------------------------------------- From 626faeecd9cb741f18e901cee0335ada914ee76f Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 17:54:19 +0200 Subject: [PATCH 34/60] Bug#31398 problems with mysql-test-run - "mysqld --verbose --help" need to be started in a writable directory --- mysql-test/mysql-test-run.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ad507440bb7..a835d3bc1a9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1334,12 +1334,13 @@ sub datadir_list_setup () { sub collect_mysqld_features () { my $found_variable_list_start= 0; + my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function # # Execute "mysqld --no-defaults --help --verbose" to get a # list of all features and settings # - my $list= `$exe_mysqld --no-defaults --verbose --help`; + my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --verbose --help`; foreach my $line (split('\n', $list)) { @@ -1394,7 +1395,7 @@ sub collect_mysqld_features () { } } } - + rmtree($tmpdir); mtr_error("Could not find version of MySQL") unless $mysql_version_id; mtr_error("Could not find variabes list") unless $found_variable_list_start; From 39a069b29622821d4b0723fe2f184e6014a2319c Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 18:18:50 +0200 Subject: [PATCH 35/60] Bug#31398 problems with mysql-test-run, part2 Write .reject file to r/ if it's writable else use opt_logdir --- client/mysqltest.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index a2412d4b30e..eae3b05f61a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1580,10 +1580,21 @@ void check_result(DYNAMIC_STRING* ds) and then show the diff */ char reject_file[FN_REFLEN]; - str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject", - *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : - MY_REPLACE_EXT), - ds->str, ds->length); + dirname_part(reject_file, result_file_name); + + if (access(reject_file, W_OK) == 0) + { + /* Result file directory is writable, save reject file there */ + fn_format(reject_file, result_file_name, NULL, + ".reject", MY_REPLACE_EXT); + } + else + { + /* Put reject file in opt_logdir */ + fn_format(reject_file, result_file_name, opt_logdir, + ".reject", MY_REPLACE_DIR | MY_REPLACE_EXT); + } + str_to_file(reject_file, ds->str, ds->length); dynstr_set(ds, NULL); /* Don't create a .log file */ From 9571e7ec872249c2a2e17f18da412855f8659bfd Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 18:22:28 +0200 Subject: [PATCH 36/60] Update for 5.1 format of dirname_part --- client/mysqltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 4a80ad8d715..335a1590e1b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1562,8 +1562,8 @@ void check_result(DYNAMIC_STRING* ds) Result mismatched, dump results to .reject file and then show the diff */ - char reject_file[FN_REFLEN]; - dirname_part(reject_file, result_file_name); + char reject_file[FN_REFLEN], reject_length; + dirname_part(reject_file, result_file_name, &reject_length); if (access(reject_file, W_OK) == 0) { From c78ef4128a954b18d17fa901c5d394ba8cbed924 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 18:24:48 +0200 Subject: [PATCH 37/60] Remove printout --- mysql-test/lib/mtr_cases.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 3622f52940d..a4266ab1931 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -337,8 +337,6 @@ sub collect_one_test_case($$$$$$$$$) { my $path= "$testdir/$elem"; - - print "collect_one_test_case\n"; # ---------------------------------------------------------------------- # Skip some tests silently # ---------------------------------------------------------------------- From c86bd100c8de4228a26da6682b4fc2f4125569ca Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 18:36:23 +0200 Subject: [PATCH 38/60] Bug#30560 Valgrind option to mysql-test-run with spaces in cause strange error --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a835d3bc1a9..d3f6c771a7c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5007,7 +5007,7 @@ sub valgrind_arguments { } # Add valgrind options, can be overriden by user - mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options)); + mtr_add_arg($args, '%s', $opt_valgrind_options); mtr_add_arg($args, $$exe); From eedde95a3308f5ab95f886bb3145be8d338264f3 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Fri, 5 Oct 2007 13:16:54 -0400 Subject: [PATCH 39/60] Change URLs. Our web server has been restructured several times, and references to it in our source code has stayed the same. This patch from Paul DuBois updates all URLs to modern semantics. --- debian/po/ca.po | 4 ++-- debian/po/cs.po | 4 ++-- debian/po/da.po | 4 ++-- debian/po/gl.po | 4 ++-- debian/po/ja.po | 4 ++-- debian/po/pt_BR.po | 4 ++-- debian/po/sv.po | 4 ++-- debian/po/tr.po | 4 ++-- mysql-test/lib/mtr_report.pl | 2 +- mysql-test/mysql-test-run-shell.sh | 2 +- ndb/include/ndbapi/Ndb.hpp | 2 +- netware/mysql_test_run.c | 2 +- scripts/mysqld_safe.sh | 2 +- sql/mysqld.cc | 4 ++-- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/debian/po/ca.po b/debian/po/ca.po index 9dc1fc0de77..5019f05c909 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -162,9 +162,9 @@ msgid "" msgstr "" #, fuzzy -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" #~ msgstr "" -#~ "Feu una ullada al document: http://www.mysql.com/doc/en/Upgrade.html" +#~ "Feu una ullada al document: http://dev.mysql.com/doc/mysql/en/upgrade.html" #, fuzzy #~ msgid "" diff --git a/debian/po/cs.po b/debian/po/cs.po index 33e4f213bb2..ada32a3469b 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -213,8 +213,8 @@ msgstr "" #~ "se tabulky mohly naruÅ¡it! Tento skript také rozÅ¡iÅ™uje tabulky privilegií, " #~ "ovÅ¡em nemÄ›l by uživatelům pÅ™idat více práv, než mÄ›li dosud." -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Také si pÅ™eÄtÄ›te http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Také si pÅ™eÄtÄ›te http://dev.mysql.com/doc/mysql/en/upgrade.html" #~ msgid "" #~ "MySQL will only install if you have a non-numeric hostname that is " diff --git a/debian/po/da.po b/debian/po/da.po index 5e93e3f7b33..cfaf2705254 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -215,8 +215,8 @@ msgstr "" #~ "kan blive ødelagt! Dette script forbedrer også rettighedstabellerne, men " #~ "burde ikke give nogen bruger flere rettigheder, end han havde tidligere," -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Læs også http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Læs også http://dev.mysql.com/doc/mysql/en/upgrade.html" #~ msgid "Install Hints" #~ msgstr "Installationstips" diff --git a/debian/po/gl.po b/debian/po/gl.po index 44fd58872cc..de5356e24f3 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -211,8 +211,8 @@ msgstr "" #~ "privilexios, pero non se supón que vaia dar a ningún usuario máis " #~ "dereitos dos que tiña antes." -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Lea tamén http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Lea tamén http://dev.mysql.com/doc/mysql/en/upgrade.html" #~ msgid "Install Hints" #~ msgstr "Consellos de instalación" diff --git a/debian/po/ja.po b/debian/po/ja.po index 14d97ed977b..5d9151da652 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -274,5 +274,5 @@ msgstr "" #~ "ã™ã€‚スクリプトã¯ã€ã©ã®ã‚ˆã†ãªãƒ¦ãƒ¼ã‚¶ã«å¯¾ã—ã¦ã‚‚ã€ä»¥å‰ã«ä¿æŒã—ã¦ã„ãŸä»¥ä¸Šã®æ¨©é™" #~ "を与ãˆã‚‹ã‚ˆã†ã«ã¯ãªã£ã¦ã„ã¾ã›ã‚“。" -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "http://www.mysql.com/doc/ja/Upgrade.html ã‚‚å‚ç…§ã—ã¦ãã ã•ã„" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "http://dev.mysql.com/doc/mysql/ja/upgrade.html ã‚‚å‚ç…§ã—ã¦ãã ã•ã„" diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index 51557b006e6..e7684ae7bd6 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -205,8 +205,8 @@ msgstr "" #~ "atribuirá a nenhum usuário mais direitos do que os mesmos já possuíam " #~ "anteriormente." -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Por favor, leia http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Por favor, leia http://dev.mysql.com/doc/mysql/en/upgrade.html" #, fuzzy #~ msgid "Install Hints" diff --git a/debian/po/sv.po b/debian/po/sv.po index 54ef9246236..62f471dea0f 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -165,8 +165,8 @@ msgstr "S #~ "tabellerna vara skadade! Detta skript utökar även privilegietabellerna " #~ "men är inte tänkte att ge någon användare mer befogenhet än vad han hade " #~ "tidigare," -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Läs även http://www.mysql.com/doc/en/Upgrade.html" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Läs även http://dev.mysql.com/doc/mysql/en/upgrade.html" #~ msgid "Install Hints" #~ msgstr "Installationstips" #~ msgid "" diff --git a/debian/po/tr.po b/debian/po/tr.po index 20b4df45b6e..b81d28957e1 100644 --- a/debian/po/tr.po +++ b/debian/po/tr.po @@ -162,8 +162,8 @@ msgid "" msgstr "" #, fuzzy -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Lütfen http://www.mysql.com/doc/en/Upgrade.html belgesini okuyun" +#~ msgid "Please also read http://dev.mysql.com/doc/mysql/en/upgrade.html" +#~ msgstr "Lütfen http://dev.mysql.com/doc/mysql/en/upgrade.html belgesini okuyun" #, fuzzy #~ msgid "" diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index ca66138d279..1694ad1cb2e 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -196,7 +196,7 @@ sub mtr_report_stats ($) { "of what went wrong.\n", "If you want to report this error, please read first ", "the documentation at\n", - "http://www.mysql.com/doc/en/MySQL_test_suite.html\n"; + "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n"; } if (!$::opt_extern) { diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh index c0ff3d3d88e..e0f151904f8 100644 --- a/mysql-test/mysql-test-run-shell.sh +++ b/mysql-test/mysql-test-run-shell.sh @@ -935,7 +935,7 @@ show_failed_diff () $DIFF -c $result_file $reject_file echo "-------------------------------------------------------" echo "Please follow the instructions outlined at" - echo "http://dev.mysql.com/doc/mysql/en/reporting-mysqltest-bugs.html" + echo "http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server" echo "to find the reason to this problem and how to report this." echo "" fi diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index f83db77739e..dbbf11612ed 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -17,7 +17,7 @@ @mainpage NDB API Programmers' Guide This guide assumes a basic familiarity with MySQL Cluster concepts found - on http://dev.mysql.com/doc/mysql/en/NDBCluster.html . + on http://dev.mysql.com/doc/mysql/en/mysql-cluster.html. Some of the fundamental ones are also described in section @ref secConcepts. The NDB API is a MySQL Cluster application interface diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index a62de9013f9..3bdbc242f9e 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -175,7 +175,7 @@ void report_stats() log_msg("\nThe .out and .err files in %s may give you some\n", result_dir); log_msg("hint of what went wrong.\n"); log_msg("\nIf you want to report this error, please first read the documentation\n"); - log_msg("at: http://www.mysql.com/doc/en/MySQL_test_suite.html\n"); + log_msg("at: http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n"); } log_msg("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60); diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 52fe282f916..e6b015e7d16 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -231,7 +231,7 @@ then echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/mysqld_safe". - echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more" echo "information" exit 1 fi diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b8c9c1bef37..d8b87b69c4b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2143,7 +2143,7 @@ bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size + You seem to be running 32-bit Linux and have %d concurrent connections.\n\ If you have not changed STACK_SIZE in LinuxThreads and built the binary \n\ yourself, LinuxThreads is quite likely to steal a part of the global heap for\n\ -the thread stack. Please read http://www.mysql.com/doc/en/Linux.html\n\n", +the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n", thread_count); } #endif /* HAVE_LINUXTHREADS */ @@ -2163,7 +2163,7 @@ Some pointers may be invalid and cause the dump to abort...\n"); fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id); } fprintf(stderr, "\ -The manual page at http://www.mysql.com/doc/en/Crashing.html contains\n\ +The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains\n\ information that should help you find out what is causing the crash.\n"); fflush(stderr); #endif /* HAVE_STACKTRACE */ From be40fefd738589b26a3d6d3674a4f75165c27905 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 19:23:44 +0200 Subject: [PATCH 40/60] Bug#27753 enable mysql-test-run.pl to ignore tests based on wildcard --- mysql-test/lib/mtr_cases.pl | 28 +++++++++++++++++++++++++--- mysql-test/mysql-test-run.pl | 8 ++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 5e176dce109..5aabb7f8863 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -27,6 +27,26 @@ sub collect_one_test_case ($$$$$$$); sub mtr_options_from_test_file($$); +my $do_test; +my $skip_test; + +sub init_pattern { + my ($from, $what)= @_; + if ( $from =~ /[a-z0-9]/ ) { + # Does not contain any regex, make the pattern match + # beginning of string + $from= "^$from"; + } + else { + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); + } + return $from; +} + + + ############################################################################## # # Collect information about test cases we are to run @@ -39,6 +59,9 @@ sub collect_test_cases ($) { my $testdir; my $resdir; + $do_test= init_pattern($::opt_do_test, "--do-test"); + $skip_test= init_pattern($::opt_skip_test, "--skip-test"); + if ( $suite eq "main" ) { $testdir= "$::glob_mysql_test_dir/t"; @@ -162,8 +185,7 @@ sub collect_test_cases ($) { } # Skip tests that does not match the --do-test= filter - next if $::opt_do_test and - ! defined mtr_match_prefix($elem,$::opt_do_test); + next if ($do_test and not $tname =~ /$do_test/o); collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, $component_id); @@ -288,7 +310,7 @@ sub collect_one_test_case($$$$$$$) { # Skip some tests but include in list, just mark them to skip # ---------------------------------------------------------------------- - if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) ) + if ( $skip_test and $tname =~ /$skip_test/o ) { $tinfo->{'skip'}= 1; return; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d3f6c771a7c..29d3265a462 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5080,12 +5080,16 @@ Options to control what test suites or cases to run skip-ndb[cluster] Skip all tests that need cluster skip-ndb[cluster]-slave Skip all tests that need a slave cluster ndb-extra Run extra tests from ndb directory - do-test=PREFIX Run test cases which name are prefixed with PREFIX + do-test=PREFIX or REGEX + Run test cases which name are prefixed with PREFIX + or fulfills REGEX + skip-test=PREFIX or REGEX + Skip test cases which name are prefixed with PREFIX + or fulfills REGEX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" skip-rpl Skip the replication test cases. skip-im Don't start IM, and skip the IM test cases - skip-test=PREFIX Skip test cases which name are prefixed with PREFIX big-test Set the environment variable BIG_TEST, which can be checked from test cases. From 6132e8288823eba31322be7b4182b3fe9afa5b17 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 5 Oct 2007 19:28:09 +0200 Subject: [PATCH 41/60] Update test case to allow the .reject file to be in either var/log or r/ --- mysql-test/t/mysqltest.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 8a38972c00f..ec188af0244 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1435,7 +1435,10 @@ select "this will be executed"; --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result; +--error 0,1 remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject; +--error 0,1 +remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject; # # Test that a test file that does not generate any output fails. From 0a07b64d8ac1a4f178d9ef4afc062e473cd574d8 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Fri, 5 Oct 2007 19:55:00 +0200 Subject: [PATCH 42/60] Fixed Bug #27789 "Wrong permissions of sql/share/language directories" --- extra/comp_err.c | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/comp_err.c b/extra/comp_err.c index 7cc4a0aa43f..79f591e45fb 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -167,6 +167,7 @@ int main(int argc, char *argv[]) DBUG_ENTER("main"); charsets_dir= DEFAULT_CHARSET_DIR; + my_umask_dir= 0777; if (get_options(&argc, &argv)) DBUG_RETURN(1); if (!(row_count= parse_input_file(TXTFILE, &error_head, &lang_head))) From d42135724f2cca53b99dbe2c87feb5be58fdf631 Mon Sep 17 00:00:00 2001 From: "tnurnberg@sin.intern.azundris.com" <> Date: Sat, 6 Oct 2007 03:01:30 +0200 Subject: [PATCH 43/60] Bug #31253: crash comparing datetime to double after-merge fixies --- mysql-test/r/type_datetime.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 1c8af2aa440..2a5d306cb23 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -434,7 +434,7 @@ select * from t1 where (convert(f1,datetime)) != 1; f1 15:44:44 Warnings: -Warning 1292 Truncated incorrect datetime value: '0000-00-00 45:44:44' +Warning 1292 Incorrect datetime value: '0000-00-00 45:44:44' drop table t1; set @org_mode=@@sql_mode; create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03'); From 29dca6ef333adfc018512d6c8618b706acbdd8f4 Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Mon, 8 Oct 2007 16:52:15 +0500 Subject: [PATCH 44/60] Fix for bug #31438: updatexml still crashes Problem: check missed if the second updatexml() argument is valid. Fix: check it. --- mysql-test/r/xml.result | 11 +++++++++++ mysql-test/t/xml.test | 11 +++++++++++ sql/item_xmlfunc.cc | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index a1f2c80e766..552f4896698 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1012,3 +1012,14 @@ select ExtractValue('a', '/a[@x=@y0123456789_0123456789_0123456789_012345 ERROR HY000: XPATH error: comparison of two nodesets is not supported: '=@y0123456789_0123456789_0123456' select ExtractValue('a', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]'); ERROR HY000: Unknown XPATH variable at: '$y0123456789_0123456789_01234567' +select updatexml(NULL, 1, 1), updatexml(1, NULL, 1), updatexml(1, 1, NULL); +updatexml(NULL, 1, 1) updatexml(1, NULL, 1) updatexml(1, 1, NULL) +NULL NULL NULL +select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL), +updatexml(NULL, 1, NULL); +updatexml(NULL, NULL, 1) updatexml(1, NULL, NULL) updatexml(NULL, 1, NULL) +NULL NULL NULL +select updatexml(NULL, NULL, NULL); +updatexml(NULL, NULL, NULL) +NULL +End of 5.1 tests diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 1d16652ab1e..6c7d9af1b63 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -533,3 +533,14 @@ select UpdateXML('a',repeat('a b ',1000),''); select ExtractValue('a', '/a[@x=@y0123456789_0123456789_0123456789_0123456789]'); --error 1105 select ExtractValue('a', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]'); + +# +# Bug #31438: updatexml still crashes +# + +select updatexml(NULL, 1, 1), updatexml(1, NULL, 1), updatexml(1, 1, NULL); +select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL), + updatexml(NULL, 1, NULL); +select updatexml(NULL, NULL, NULL); + +--echo End of 5.1 tests diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 15be9c97b6e..1a6c15a4d2e 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -2580,7 +2580,8 @@ void Item_xml_str_func::fix_length_and_dec() return; } - xp= args[1]->val_str(&tmp); + if (!(xp= args[1]->val_str(&tmp))) + return; my_xpath_init(&xpath); xpath.cs= collation.collation; xpath.debug= 0; From 6a7947b8ab0d2f5e2c946052828e6de5f825c378 Mon Sep 17 00:00:00 2001 From: "iggy@alf.(none)" <> Date: Mon, 8 Oct 2007 17:43:32 -0400 Subject: [PATCH 45/60] Bug#28535 mistake in mysqldump error message - Fixed error message. --- client/mysqldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 582e9e3b3b9..b6efe89be22 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1888,7 +1888,7 @@ static uint dump_events_for_db(char *db) if (create_delimiter(row[3], delimiter, sizeof(delimiter)) == NULL) { fprintf(stderr, "%s: Warning: Can't create delimiter for event '%s'\n", - event_name, my_progname); + my_progname, event_name); DBUG_RETURN(1); } From 19107288e470fed4b01577bc5c0d3a6b71601840 Mon Sep 17 00:00:00 2001 From: "iggy@alf.(none)" <> Date: Mon, 8 Oct 2007 22:30:41 -0400 Subject: [PATCH 46/60] Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and doesn't clean them up - Make sure to cleanup temporary files after use. --- client/mysql_upgrade.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 1646f2baf51..02829cd2178 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -456,7 +456,11 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, query, strlen(query), MYF(MY_FNABP | MY_WME))) + { + my_close(fd, MYF(0)); + my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); + } ret= run_tool(mysql_path, ds_res, From 479238517797315c10adc3246c571975f28de51c Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Tue, 9 Oct 2007 14:37:21 +0500 Subject: [PATCH 47/60] Fix for bug #31249: Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, fiel Problem: creating a temporary table we allocate the group buffer if needed followed by table bitmaps (see create_tmp_table()). Reserving less memory for the group buffer than actually needed (used) for values retrieval may lead to overlapping with followed bitmaps in the memory pool that in turn leads to unpredictable consequences. As we use Item->max_length sometimes to calculate group buffer size, it must be set to proper value. In this particular case Item_datetime_typecast::max_length is too small. Another problem is that we use max_length to calculate the group buffer key length for items represented as DATE/TIME fields which is superfluous. Fix: set Item_datetime_typecast::max_length properly, accurately calculate the group buffer key length for items represented as DATE/TIME fields in the buffer. --- mysql-test/r/type_datetime.result | 14 ++++++++++++++ mysql-test/t/type_datetime.test | 13 +++++++++++++ sql/item_timefunc.h | 4 +++- sql/sql_select.cc | 26 ++++++++++++++++++++++---- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 9e47b5da2b6..b96ed330d73 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -427,3 +427,17 @@ f1 Warnings: Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1 drop table t1; +create table t1 (a tinyint); +insert into t1 values (), (), (); +select sum(a) from t1 group by convert(a, datetime); +sum(a) +NULL +select convert(a, datetime) from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def convert(a, datetime) 12 29 0 Y 128 6 63 +convert(a, datetime) +NULL +NULL +NULL +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index ffda593f320..070230bae75 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -282,3 +282,16 @@ select * from t1 where f1 between 20020101 and 20070101000000; select * from t1 where f1 between 2002010 and 20070101000000; select * from t1 where f1 between 20020101 and 2007010100000; drop table t1; + +# +# Bug #31249: problem with convert(..., datetime) +# +create table t1 (a tinyint); +insert into t1 values (), (), (); +select sum(a) from t1 group by convert(a, datetime); +--enable_metadata +select convert(a, datetime) from t1; +--disable_metadata +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 8e925a0156f..94bee28bb6b 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -844,7 +844,9 @@ public: enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } void fix_length_and_dec() { - Item_typecast_maybe_null::fix_length_and_dec(); + collation.set(&my_charset_bin); + maybe_null= 1; + max_length= MAX_DATETIME_FULL_WIDTH * MY_CHARSET_BIN_MB_MAXLEN; decimals= DATETIME_DEC; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1d11f23d854..7d4421b2749 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13902,13 +13902,31 @@ calc_group_buffer(JOIN *join,ORDER *group) group_item->decimals); break; case STRING_RESULT: + { + enum enum_field_types type= group_item->field_type(); /* - Group strings are taken as varstrings and require an length field. - A field is not yet created by create_tmp_field() - and the sizes should match up. + As items represented as DATE/TIME fields in the group buffer + have STRING_RESULT result type, we increase the length + by 8 as maximum pack length of such fields. */ - key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH; + if (type == MYSQL_TYPE_TIME || + type == MYSQL_TYPE_DATE || + type == MYSQL_TYPE_DATETIME || + type == MYSQL_TYPE_TIMESTAMP) + { + key_length+= 8; + } + else + { + /* + Group strings are taken as varstrings and require an length field. + A field is not yet created by create_tmp_field() + and the sizes should match up. + */ + key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH; + } break; + } default: /* This case should never be choosen */ DBUG_ASSERT(0); From e908bb72e5e5dd9b2e022ff9871713bbf753e9b0 Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Tue, 9 Oct 2007 19:16:39 +0500 Subject: [PATCH 48/60] Fix for bug #29444: crash with partition refering to table in create-select Problem: creating a partitioned table during name resolution for the partition function we search for column names in all parts of the CREATE TABLE query. It is superfluous (and wrong) sometimes. Fix: launch name resolution for the partition function against the table we're creating. --- mysql-test/r/partition.result | 20 ++++++++++++++++++++ mysql-test/t/partition.test | 20 ++++++++++++++++++++ sql/item.cc | 4 +++- sql/sql_lex.cc | 1 + sql/sql_lex.h | 8 ++++++++ sql/sql_partition.cc | 7 +++++++ 6 files changed, 59 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 5d985d053fc..7120e3ea9e6 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1267,4 +1267,24 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) ERROR HY000: Incorrect usage of PARTITION and log table ALTER TABLE general_log ENGINE = CSV; SET GLOBAL general_log = default; +use test; +create table t2 (b int); +create table t1 (b int) +PARTITION BY RANGE (t2.b) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +ERROR 42S22: Unknown column 't2.b' in 'partition function' +create table t1 (a int) +PARTITION BY RANGE (b) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */ +drop table t1, t2; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 42db23dadef..2be2ab83c88 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1493,10 +1493,30 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000)); ALTER TABLE general_log ENGINE = CSV; SET GLOBAL general_log = default; +use test; # # Bug #27084 partitioning by list seems failing when using case # BUG #18198: Case no longer supported, test case removed # +# +# Bug #29444: crash with partition refering to table in create-select +# + +create table t2 (b int); +--error 1054 +create table t1 (b int) +PARTITION BY RANGE (t2.b) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +create table t1 (a int) +PARTITION BY RANGE (b) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +show create table t1; +drop table t1, t2; + --echo End of 5.1 tests diff --git a/sql/item.cc b/sql/item.cc index dc94615c6e6..3b592633ad0 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3860,7 +3860,9 @@ bool Item_field::fix_fields(THD *thd, Item **reference) context->first_name_resolution_table, context->last_name_resolution_table, reference, - IGNORE_EXCEPT_NON_UNIQUE, + thd->lex->use_only_table_context ? + REPORT_ALL_ERRORS : + IGNORE_EXCEPT_NON_UNIQUE, !any_privileges, TRUE)) == not_found_field) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 0a5f83af400..4ee66cb1e8d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -338,6 +338,7 @@ void lex_start(THD *thd) lex->query_tables= 0; lex->reset_query_tables_list(FALSE); lex->expr_allows_subselect= TRUE; + lex->use_only_table_context= FALSE; lex->name.str= 0; lex->name.length= 0; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 08104769704..50211f6b3f9 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1693,6 +1693,14 @@ typedef struct st_lex : public Query_tables_list */ const char *fname_start; const char *fname_end; + + /** + During name resolution search only in the table list given by + Name_resolution_context::first_name_resolution_table and + Name_resolution_context::last_name_resolution_table + (see Item_field::fix_fields()). + */ + bool use_only_table_context; LEX_STRING view_body_utf8; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 8a8a03cb4e4..0cc2cac2a1a 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -902,6 +902,7 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, const char *save_where; char* db_name; char db_name_string[FN_REFLEN]; + bool save_use_only_table_context; DBUG_ENTER("fix_fields_part_func"); if (part_info->fixed) @@ -958,8 +959,14 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, This is a tricky call to prepare for since it can have a large number of interesting side effects, both desirable and undesirable. */ + + save_use_only_table_context= thd->lex->use_only_table_context; + thd->lex->use_only_table_context= TRUE; + error= func_expr->fix_fields(thd, (Item**)0); + thd->lex->use_only_table_context= save_use_only_table_context; + context->table_list= save_table_list; context->first_name_resolution_table= save_first_table; context->last_name_resolution_table= save_last_table; From fa5eb277eceb71cc71fd8052cb12692ea4dffe4a Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Tue, 9 Oct 2007 22:40:22 +0500 Subject: [PATCH 49/60] metadata test of bug # 31249: problem with convert(..., datetime) removed as PS protocol gives slightly different metadata. --- mysql-test/r/type_datetime.result | 7 ------- mysql-test/t/type_datetime.test | 3 --- 2 files changed, 10 deletions(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 5929a315e8d..590e9b7c9e0 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -441,12 +441,5 @@ insert into t1 values (), (), (); select sum(a) from t1 group by convert(a, datetime); sum(a) NULL -select convert(a, datetime) from t1; -Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def convert(a, datetime) 12 29 0 Y 128 6 63 -convert(a, datetime) -NULL -NULL -NULL drop table t1; End of 5.0 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index b909b4894a3..20733a14d46 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -299,9 +299,6 @@ drop table t1; create table t1 (a tinyint); insert into t1 values (), (), (); select sum(a) from t1 group by convert(a, datetime); ---enable_metadata -select convert(a, datetime) from t1; ---disable_metadata drop table t1; --echo End of 5.0 tests From d207867cf53b9db500e6f93b93b386c1b58cae34 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Tue, 9 Oct 2007 18:45:29 -0600 Subject: [PATCH 50/60] Fix compiler warning (use correct data type) --- client/mysqltest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 335a1590e1b..39fe05e4928 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1562,7 +1562,8 @@ void check_result(DYNAMIC_STRING* ds) Result mismatched, dump results to .reject file and then show the diff */ - char reject_file[FN_REFLEN], reject_length; + char reject_file[FN_REFLEN]; + size_t reject_length; dirname_part(reject_file, result_file_name, &reject_length); if (access(reject_file, W_OK) == 0) From ced64f85823c7a9dcd6b9f952c136278567fa9f6 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Wed, 10 Oct 2007 14:00:57 -0600 Subject: [PATCH 51/60] Bug #31517: Potential crash due to access of NULL thd in mark_transaction_to_rollback() Introduced in mark_transaction_to_rollback(), part of fix for bug 24989; fix is to check thd for NULL before using it. --- sql/sql_class.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b67f63778dc..4a98a044e25 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2241,8 +2241,11 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) void mark_transaction_to_rollback(THD *thd, bool all) { - thd->is_fatal_sub_stmt_error= TRUE; - thd->transaction_rollback_request= all; + if (thd) + { + thd->is_fatal_sub_stmt_error= TRUE; + thd->transaction_rollback_request= all; + } } /*************************************************************************** Handling of XA id cacheing From f80541e37045a7f511998718d5b89d5e9942e6a6 Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Thu, 11 Oct 2007 14:28:12 +0400 Subject: [PATCH 52/60] Fix for bug #31174: "Repair" command on MyISAM crashes with small myisam_sort_buffer_size. An incorrect length of the sort buffer was used when calculating the maximum number of keys. When myisam_sort_buffer_size is small enough, this could result in the number of keys < number of BUFFPEK structures which in turn led to use of uninitialized BUFFPEKs. Fixed by correcting the buffer length calculation. --- myisam/sort.c | 6 ++++-- mysql-test/r/repair.result | 27 +++++++++++++++++++++++++++ mysql-test/t/repair.test | 31 ++++++++++++++++++++++++++++++- 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index b909a16e8e6..728e5b9673e 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -559,9 +559,10 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) if (!mergebuf) { length=param->sort_buffer_length; - while (length >= MIN_SORT_MEMORY && !mergebuf) + while (length >= MIN_SORT_MEMORY) { - mergebuf=my_malloc(length, MYF(0)); + if ((mergebuf= my_malloc(length, MYF(0)))) + break; length=length*3/4; } if (!mergebuf) @@ -897,6 +898,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file, count=error=0; maxcount=keys/((uint) (Tb-Fb) +1); + DBUG_ASSERT(maxcount > 0); LINT_INIT(to_start_filepos); if (to_file) to_start_filepos=my_b_tell(to_file); diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 355a8c25434..80b716131b9 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -83,3 +83,30 @@ test.t1 repair status OK SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; +CREATE TABLE t1(a CHAR(255), KEY(a)); +SET myisam_sort_buffer_size=4196; +INSERT INTO t1 VALUES +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SET myisam_repair_threads=@@global.myisam_repair_threads; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; +End of 4.1 tests diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 35e5e485cb9..e391e3e0076 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -83,4 +83,33 @@ SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; -# End of 4.1 tests +# +# BUG#31174 - "Repair" command on MyISAM crashes with small +# myisam_sort_buffer_size +# +CREATE TABLE t1(a CHAR(255), KEY(a)); +SET myisam_sort_buffer_size=4196; +INSERT INTO t1 VALUES +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'), +('0'),('0'),('0'),('0'),('0'),('0'),('0'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +SET myisam_repair_threads=@@global.myisam_repair_threads; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; + +--echo End of 4.1 tests From 84d1e3f8f045639f1d501dc62092f1a2a162ed67 Mon Sep 17 00:00:00 2001 From: "ramil/ram@mysql.com/ramil.myoffice.izhnet.ru" <> Date: Thu, 11 Oct 2007 17:20:34 +0500 Subject: [PATCH 53/60] Fix for bug #31154: field.h:1649: virtual int Field_bit::cmp(const uchar*, const uchar*): Assertion Problem: GROUP_CONCAT(DISTINCT BIT_FIELD...) uses a tree to store keys; which are constructed using a temporary table fields, see Item_func_group_concat::setup(). As a) we don't store null bits in the tree where the bit fields store parts of their data and b) there's no method to properly compare two table records we've got problem. Fix: convert BIT fields to INT in the temporary table used. --- mysql-test/r/func_gconcat.result | 42 ++++++++++++++++++++++++++++++++ mysql-test/t/func_gconcat.test | 28 +++++++++++++++++++++ sql/item_sum.cc | 31 ++++++++++++++++++----- 3 files changed, 95 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 35487c25ae3..73f756bc1d2 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -819,4 +819,46 @@ id group_concat(b.name) 1 óra,óra 2 óra,óra drop table t1; +create table t1(a bit not null); +insert into t1 values (), (), (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select group_concat(distinct a) from t1; +group_concat(distinct a) +0 +select group_concat(distinct a order by a) from t1; +group_concat(distinct a order by a) +0 +drop table t1; +create table t1(a bit(2) not null); +insert into t1 values (1), (0), (0), (3), (1); +select group_concat(distinct a) from t1; +group_concat(distinct a) +1,0,3 +select group_concat(distinct a order by a) from t1; +group_concat(distinct a order by a) +0,1,3 +select group_concat(distinct a order by a desc) from t1; +group_concat(distinct a order by a desc) +3,1,0 +drop table t1; +create table t1(a bit(2), b varchar(10), c bit); +insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1), +(1, 'e', 1), (3, 'f', 1), (0, 'g', 1); +select group_concat(distinct a, c) from t1; +group_concat(distinct a, c) +10,01,00,31,11 +select group_concat(distinct a, c order by a) from t1; +group_concat(distinct a, c order by a) +00,01,11,10,31 +select group_concat(distinct a, c) from t1; +group_concat(distinct a, c) +10,01,00,31,11 +select group_concat(distinct a, c order by a, c) from t1; +group_concat(distinct a, c order by a, c) +00,01,10,11,31 +select group_concat(distinct a, c order by a desc, c desc) from t1; +group_concat(distinct a, c order by a desc, c desc) +31,11,10,01,00 +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index ff3ba951870..c415ca6c6eb 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -562,4 +562,32 @@ insert into t1 (id, name) values (2, " select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; drop table t1; +# +# Bug #31154: group_concat() and bit fields; +# +create table t1(a bit not null); +insert into t1 values (), (), (); +select group_concat(distinct a) from t1; +select group_concat(distinct a order by a) from t1; +drop table t1; + +create table t1(a bit(2) not null); +insert into t1 values (1), (0), (0), (3), (1); +select group_concat(distinct a) from t1; +select group_concat(distinct a order by a) from t1; +select group_concat(distinct a order by a desc) from t1; +drop table t1; + +create table t1(a bit(2), b varchar(10), c bit); +insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1), +(1, 'e', 1), (3, 'f', 1), (0, 'g', 1); +select group_concat(distinct a, c) from t1; +select group_concat(distinct a, c order by a) from t1; +select group_concat(distinct a, c) from t1; +select group_concat(distinct a, c order by a, c) from t1; +select group_concat(distinct a, c order by a desc, c desc) from t1; + +drop table t1; + + --echo End of 5.0 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index c20d3fba705..48ad53fbf75 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3307,15 +3307,34 @@ bool Item_func_group_concat::setup(THD *thd) count_field_types(select_lex, tmp_table_param, all_fields, 0); tmp_table_param->force_copy_fields= force_copy_fields; DBUG_ASSERT(table == 0); - /* - Currently we have to force conversion of BLOB values to VARCHAR's - if we are to store them in TREE objects used for ORDER BY and - DISTINCT. This leads to truncation if the BLOB's size exceeds - Field_varstring::MAX_SIZE. - */ if (arg_count_order > 0 || distinct) + { + /* + Currently we have to force conversion of BLOB values to VARCHAR's + if we are to store them in TREE objects used for ORDER BY and + DISTINCT. This leads to truncation if the BLOB's size exceeds + Field_varstring::MAX_SIZE. + */ set_if_smaller(tmp_table_param->convert_blob_length, Field_varstring::MAX_SIZE); + + /* + Force the create_tmp_table() to convert BIT columns to INT + as we cannot compare two table records containg BIT fields + stored in the the tree used for distinct/order by. + Moreover we don't even save in the tree record null bits + where BIT fields store parts of their data. + */ + List_iterator_fast li(all_fields); + Item *item; + while ((item= li++)) + { + if (item->type() == Item::FIELD_ITEM && + ((Item_field*) item)->field->type() == FIELD_TYPE_BIT) + item->marker= 4; + } + } + /* We have to create a temporary table to get descriptions of fields (types, sizes and so on). From 709bb3948c0a23ab430151a01b716baf0d4b6d88 Mon Sep 17 00:00:00 2001 From: "mtaylor@solace.(none)" <> Date: Fri, 12 Oct 2007 02:15:32 -0700 Subject: [PATCH 54/60] Removed debian dir. It was a mistake to embed it in the tree in the first place. --- Makefile.am | 3 +- configure.in | 1 - debian/Makefile.am | 118 - debian/README.Maintainer | 99 - debian/additions/my.cnf | 134 - .../additions/mysql-server.lintian-overrides | 2 - debian/additions/ndb_mgmd.cnf | 35 - debian/changelog | 3275 ----------------- debian/compat | 1 - debian/control.in | 353 -- debian/copyright | 139 - debian/copyright.more | 60 - debian/defs.mk.in | 14 - ...ibmysqlclientSLIB-dev.README.Maintainer.in | 4 - debian/libmysqlclientSLIB-dev.dirs.in | 2 - debian/libmysqlclientSLIB-dev.docs.in | 1 - debian/libmysqlclientSLIB-dev.examples.in | 1 - debian/libmysqlclientSLIB-dev.files.in | 7 - debian/libmysqlclientSLIB-dev.links.in | 2 - debian/libmysqlclientSLIBoff.README.Debian.in | 30 - debian/libmysqlclientSLIBoff.dirs.in | 1 - debian/libmysqlclientSLIBoff.docs.in | 1 - debian/libmysqlclientSLIBoff.files.in | 1 - debian/libmysqlclientSLIBoff.postinst.in | 12 - debian/libndbclientNLIB-dev.dirs.in | 3 - debian/libndbclientNLIB-dev.files.in | 3 - debian/libndbclientNLIB-dev.links.in | 1 - debian/libndbclientNLIB.README.Debian.in | 30 - debian/libndbclientNLIB.dirs.in | 1 - debian/libndbclientNLIB.files.in | 1 - debian/libndbclientNLIB.postinst.in | 12 - debian/mysql-client-BASE.NEWS.in | 6 - debian/mysql-client-BASE.README.Debian.in | 4 - debian/mysql-client-BASE.dirs.in | 2 - debian/mysql-client-BASE.docs.in | 2 - debian/mysql-client-BASE.files.in | 18 - debian/mysql-client-BASE.lintian-overrides.in | 1 - debian/mysql-common.README.Debian.in | 20 - debian/mysql-common.dirs.in | 1 - debian/mysql-common.files.in | 2 - debian/mysql-common.postrm.in | 7 - debian/mysql-common.preinst.in | 215 -- debian/mysql-extra-BASE.dirs.in | 1 - debian/mysql-extra-BASE.files.in | 3 - debian/mysql-management-BASE.dirs.in | 1 - debian/mysql-management-BASE.files.in | 1 - ...l-management-BASE.mysql-management.init.in | 86 - debian/mysql-server-BASE.NEWS.in | 10 - debian/mysql-server-BASE.README.Debian.in | 125 - debian/mysql-server-BASE.config.in | 39 - debian/mysql-server-BASE.dirs.in | 13 - debian/mysql-server-BASE.docs.in | 2 - debian/mysql-server-BASE.files.in | 50 - debian/mysql-server-BASE.links.in | 1 - debian/mysql-server-BASE.lintian-overrides.in | 4 - ...ql-server-BASE.logcheck.ignore.paranoid.in | 10 - ...ysql-server-BASE.logcheck.ignore.server.in | 31 - ...server-BASE.logcheck.ignore.workstation.in | 31 - ...ysql-server-BASE.mysql-server.logrotate.in | 28 - debian/mysql-server-BASE.postinst.in | 276 -- debian/mysql-server-BASE.postrm.in | 92 - debian/mysql-server-BASE.preinst.in | 167 - debian/mysql-server-BASE.prerm.in | 8 - debian/mysql-server-BASE.templates.in | 71 - debian/mysql-server-PREV.preinst.in | 191 - debian/mysql-server.preinst.in | 191 - debian/mysql-storage-BASE.dirs.in | 1 - debian/mysql-storage-BASE.files.in | 1 - .../mysql-storage-BASE.mysql-storage.init.in | 85 - debian/mysql-test-BASE.dirs.in | 2 - debian/mysql-test-BASE.files.in | 6 - debian/mysql-tools-BASE.dirs.in | 2 - debian/mysql-tools-BASE.files.in | 13 - debian/po/POTFILES.in.in | 1 - debian/po/ca.po | 290 -- debian/po/cs.po | 259 -- debian/po/da.po | 283 -- debian/po/de.po | 195 - debian/po/es.po | 288 -- debian/po/eu.po | 163 - debian/po/fr.po | 204 - debian/po/gl.po | 279 -- debian/po/it.po | 184 - debian/po/ja.po | 278 -- debian/po/nb.po | 179 - debian/po/nl.po | 187 - debian/po/pt.po | 198 - debian/po/pt_BR.po | 339 -- debian/po/ro.po | 193 - debian/po/ru.po | 172 - debian/po/sv.po | 225 -- debian/po/templates.pot | 155 - debian/po/tr.po | 290 -- debian/rules | 405 -- debian/source.lintian-overrides.in | 6 - debian/watch | 3 - 96 files changed, 1 insertion(+), 10942 deletions(-) delete mode 100644 debian/Makefile.am delete mode 100644 debian/README.Maintainer delete mode 100644 debian/additions/my.cnf delete mode 100644 debian/additions/mysql-server.lintian-overrides delete mode 100644 debian/additions/ndb_mgmd.cnf delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control.in delete mode 100644 debian/copyright delete mode 100644 debian/copyright.more delete mode 100644 debian/defs.mk.in delete mode 100644 debian/libmysqlclientSLIB-dev.README.Maintainer.in delete mode 100644 debian/libmysqlclientSLIB-dev.dirs.in delete mode 100644 debian/libmysqlclientSLIB-dev.docs.in delete mode 100644 debian/libmysqlclientSLIB-dev.examples.in delete mode 100644 debian/libmysqlclientSLIB-dev.files.in delete mode 100644 debian/libmysqlclientSLIB-dev.links.in delete mode 100644 debian/libmysqlclientSLIBoff.README.Debian.in delete mode 100644 debian/libmysqlclientSLIBoff.dirs.in delete mode 100644 debian/libmysqlclientSLIBoff.docs.in delete mode 100644 debian/libmysqlclientSLIBoff.files.in delete mode 100644 debian/libmysqlclientSLIBoff.postinst.in delete mode 100644 debian/libndbclientNLIB-dev.dirs.in delete mode 100644 debian/libndbclientNLIB-dev.files.in delete mode 100644 debian/libndbclientNLIB-dev.links.in delete mode 100644 debian/libndbclientNLIB.README.Debian.in delete mode 100644 debian/libndbclientNLIB.dirs.in delete mode 100644 debian/libndbclientNLIB.files.in delete mode 100644 debian/libndbclientNLIB.postinst.in delete mode 100644 debian/mysql-client-BASE.NEWS.in delete mode 100644 debian/mysql-client-BASE.README.Debian.in delete mode 100644 debian/mysql-client-BASE.dirs.in delete mode 100644 debian/mysql-client-BASE.docs.in delete mode 100644 debian/mysql-client-BASE.files.in delete mode 100644 debian/mysql-client-BASE.lintian-overrides.in delete mode 100644 debian/mysql-common.README.Debian.in delete mode 100644 debian/mysql-common.dirs.in delete mode 100644 debian/mysql-common.files.in delete mode 100644 debian/mysql-common.postrm.in delete mode 100644 debian/mysql-common.preinst.in delete mode 100644 debian/mysql-extra-BASE.dirs.in delete mode 100644 debian/mysql-extra-BASE.files.in delete mode 100644 debian/mysql-management-BASE.dirs.in delete mode 100644 debian/mysql-management-BASE.files.in delete mode 100644 debian/mysql-management-BASE.mysql-management.init.in delete mode 100644 debian/mysql-server-BASE.NEWS.in delete mode 100644 debian/mysql-server-BASE.README.Debian.in delete mode 100644 debian/mysql-server-BASE.config.in delete mode 100644 debian/mysql-server-BASE.dirs.in delete mode 100644 debian/mysql-server-BASE.docs.in delete mode 100644 debian/mysql-server-BASE.files.in delete mode 100644 debian/mysql-server-BASE.links.in delete mode 100644 debian/mysql-server-BASE.lintian-overrides.in delete mode 100644 debian/mysql-server-BASE.logcheck.ignore.paranoid.in delete mode 100644 debian/mysql-server-BASE.logcheck.ignore.server.in delete mode 100644 debian/mysql-server-BASE.logcheck.ignore.workstation.in delete mode 100644 debian/mysql-server-BASE.mysql-server.logrotate.in delete mode 100644 debian/mysql-server-BASE.postinst.in delete mode 100644 debian/mysql-server-BASE.postrm.in delete mode 100644 debian/mysql-server-BASE.preinst.in delete mode 100644 debian/mysql-server-BASE.prerm.in delete mode 100644 debian/mysql-server-BASE.templates.in delete mode 100644 debian/mysql-server-PREV.preinst.in delete mode 100644 debian/mysql-server.preinst.in delete mode 100644 debian/mysql-storage-BASE.dirs.in delete mode 100644 debian/mysql-storage-BASE.files.in delete mode 100644 debian/mysql-storage-BASE.mysql-storage.init.in delete mode 100644 debian/mysql-test-BASE.dirs.in delete mode 100644 debian/mysql-test-BASE.files.in delete mode 100644 debian/mysql-tools-BASE.dirs.in delete mode 100644 debian/mysql-tools-BASE.files.in delete mode 100644 debian/po/POTFILES.in.in delete mode 100644 debian/po/ca.po delete mode 100644 debian/po/cs.po delete mode 100644 debian/po/da.po delete mode 100644 debian/po/de.po delete mode 100644 debian/po/es.po delete mode 100644 debian/po/eu.po delete mode 100644 debian/po/fr.po delete mode 100644 debian/po/gl.po delete mode 100644 debian/po/it.po delete mode 100644 debian/po/ja.po delete mode 100644 debian/po/nb.po delete mode 100644 debian/po/nl.po delete mode 100644 debian/po/pt.po delete mode 100644 debian/po/pt_BR.po delete mode 100644 debian/po/ro.po delete mode 100644 debian/po/ru.po delete mode 100644 debian/po/sv.po delete mode 100644 debian/po/templates.pot delete mode 100644 debian/po/tr.po delete mode 100755 debian/rules delete mode 100644 debian/source.lintian-overrides.in delete mode 100644 debian/watch diff --git a/Makefile.am b/Makefile.am index 66daff4bd68..c1bdbb22e8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,8 +33,7 @@ DIST_SUBDIRS = . include @docs_dirs@ zlib \ @thread_dirs@ pstack \ @sql_union_dirs@ scripts @man_dirs@ tests SSL\ BUILD netware os2 @libmysqld_dirs@ \ - @bench_dirs@ support-files @tools_dirs@ win \ - debian + @bench_dirs@ support-files @tools_dirs@ win # Run these targets before any others, also make part of clean target, # to make sure we create new links after a clean. diff --git a/configure.in b/configure.in index 0878f0331e4..71d5988480e 100644 --- a/configure.in +++ b/configure.in @@ -3017,7 +3017,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl cmd-line-utils/libedit/Makefile dnl win/Makefile dnl zlib/Makefile dnl - debian/Makefile debian/defs.mk debian/control dnl cmd-line-utils/readline/Makefile) AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) AC_OUTPUT diff --git a/debian/Makefile.am b/debian/Makefile.am deleted file mode 100644 index 14035865371..00000000000 --- a/debian/Makefile.am +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (C) 2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -## Process this file with automake to create Makefile.in -EXTRA_DIST = \ - mysql-test-BASE.files.in \ - libndbclientNLIB-dev.files.in \ - mysql-server-BASE.config.in \ - libndbclientNLIB.README.Debian.in \ - mysql-server-BASE.postrm.in \ - mysql-server-BASE.NEWS.in \ - libndbclientNLIB.postinst.in \ - mysql-server-BASE.links.in \ - libndbclientNLIB.files.in \ - source.lintian-overrides.in \ - mysql-server-BASE.docs.in \ - libmysqlclientSLIBoff.files.in \ - mysql-server-BASE.files.in \ - libndbclientNLIB-dev.links.in \ - libmysqlclientSLIBoff.postinst.in \ - mysql-extra-BASE.dirs.in \ - libmysqlclientSLIB-dev.links.in \ - mysql-server-BASE.dirs.in \ - libmysqlclientSLIB-dev.examples.in \ - mysql-client-BASE.lintian-overrides.in \ - copyright.more \ - libndbclientNLIB-dev.dirs.in \ - mysql-server-BASE.README.Debian.in \ - libmysqlclientSLIBoff.docs.in \ - compat \ - mysql-test-BASE.dirs.in \ - libmysqlclientSLIB-dev.files.in \ - libmysqlclientSLIBoff.dirs.in \ - mysql-server-BASE.logcheck.ignore.server.in \ - mysql-storage-BASE.mysql-storage.init.in \ - libmysqlclientSLIBoff.README.Debian.in \ - mysql-client-BASE.README.Debian.in \ - Makefile.am \ - mysql-server-BASE.prerm.in \ - mysql-common.dirs.in \ - defs.mk \ - defs.mk.in \ - mysql-server-BASE.mysql-server.logrotate.in \ - mysql-common.README.Debian.in \ - copyright \ - mysql-storage-BASE.dirs.in \ - mysql-common.preinst.in \ - mysql-client-BASE.files.in \ - mysql-server-BASE.templates.in \ - mysql-tools-BASE.dirs.in \ - mysql-management-BASE.mysql-management.init.in \ - watch \ - mysql-common.postrm.in \ - mysql-server-BASE.preinst.in \ - README.Maintainer \ - mysql-tools-BASE.files.in \ - mysql-client-BASE.NEWS.in \ - mysql-server-BASE.lintian-overrides.in \ - changelog \ - mysql-server-BASE.logcheck.ignore.paranoid.in \ - mysql-common.files.in \ - mysql-server-BASE.logcheck.ignore.workstation.in \ - mysql-extra-BASE.files.in \ - mysql-management-BASE.files.in \ - mysql-client-BASE.docs.in \ - libmysqlclientSLIB-dev.README.Maintainer.in \ - mysql-storage-BASE.files.in \ - additions \ - additions/ndb_mgmd.cnf \ - additions/mysql-server.lintian-overrides \ - additions/my.cnf \ - mysql-server-BASE.postinst.in \ - libndbclientNLIB.dirs.in \ - po \ - po/fr.po \ - po/sv.po \ - po/da.po \ - po/es.po \ - po/ja.po \ - po/tr.po \ - po/nb.po \ - po/POTFILES.in.in \ - po/cs.po \ - po/pt.po \ - po/gl.po \ - po/pt_BR.po \ - po/nl.po \ - po/templates.pot \ - po/de.po \ - po/eu.po \ - po/ro.po \ - po/ru.po \ - po/it.po \ - po/ca.po \ - mysql-client-BASE.dirs.in \ - control.in \ - libmysqlclientSLIB-dev.dirs.in \ - mysql-server-PREV.preinst.in \ - mysql-server.preinst.in \ - mysql-management-BASE.dirs.in \ - rules \ - libmysqlclientSLIB-dev.docs.in - -# Don't update the files from bitkeeper -%::SCCS/s.% - diff --git a/debian/README.Maintainer b/debian/README.Maintainer deleted file mode 100644 index 80b484d7a6c..00000000000 --- a/debian/README.Maintainer +++ /dev/null @@ -1,99 +0,0 @@ -########################################################################### -# Here are some information that are only of interest to the Debiani # -# maintainers of MySQL. # -########################################################################### - -# -# Remarks to dependencies -# -libwrap0-dev (>= 7.6-8.3) - According to bug report 114582 where where build problems on - IA-64/sid with at least two prior versions. -psmisc - /usr/bin/killall in the initscript - -zlib1g in libmysqlclient-dev: - "mysql_config --libs" adds "-lz" - -Build-Dep: - -debhelper (>=4.1.16): - See po-debconf(7). - -autoconf (>= 2.13-20), automake1.7 - Try to get rid of them. - -doxygen, tetex-bin, tetex-extra, gs - for ndb/docs/*tex - -mysql-server-5.0: Pre-Depends: mysql-common - This was necessary as mysql-server-5.0.preinst checks for unmodified - conffiles from mysql-server-4.1 and copies 5.0 ones over them to avoid - unnecessary dpkg questions. As mysql-server-5.0 is not unpacked at its - pre-inst stage, it had to copy those files from a package that is - definetly already unpacked which does not have to be the case with Depends. - -# -# Remarks to the start scripts -# - -## initscripts rely on mysqladmin from a different package -We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which -is in another package (mysql-client) and a passwordless access that's maybe -only available if the user configured his /root/.my.cnf. Can this be a problem? -* normal mode: not because the user is required to have it. Else: -* purge/remove: not, same as normal mode -* upgrade: not, same as normal mode -* first install: not, it depends on mysql-client which at least is unpacked - so mysqladmin is there (to ping). It is not yet configured - passwordles but if there's a server running then there's a - /root/.my.cnf. Anyways, we simply kill anything that's mysqld. - -## Passwordless access for the maintainer scripts -Another issue is that the scripts needs passwordless access. To ensure this -a debian-sys-maint user is configured which has process and shutdown privs. -The file with the randomly (that's important!) generated password must be -present as long as the databases remain installed because else a new install -would have no access. This file should be used like: - mysqladmin --defaults-file=/etc/mysql/debian.cnf restart -to avoid providing the password in plaintext on a commandline where it would -be visible to any user via the "ps" command. - -## When to start the daemon? -We aim to give the admin full control on when MySQL is running. -Issues to be faced here: -OLD: - 1. Debconf asks whether MySQL should be started on boot so update-rc.d is - only run if the answer has been yes. The admin is likely to forget - this decision but update-rc.d checks for an existing line in - /etc/runlevel.conf and leaves it intact. - 2. On initial install, if the answer is yes, the daemon has to be started. - 3. On upgrades it should only be started if it was already running, everything - else is confusing. Especiall relying on an debconf decision made month ago - is considered suboptimal. See bug #274264 - Implementation so far: - prerm (called on upgrade before stopping the server): - check for a running server and set flag if necessary - preinst (called on initial install and before unpacking when upgrading): - check for the debconf variable and set flag if necessary - postinst (called on initial install and after each upgrade after unpacking): - call update-rc.d if debconf says yes - call invoce-rc.d if the flag has been set - Problems remaining: - dpkg-reconfigure and setting mysql start on boot to yes did not start mysql - (ok "start on boot" literally does not mean "start now" so that might have been ok) -NEW: - 1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf, - the admin should use it - 2. On initial install the server is started. - 3. On upgrades the server is started exactly if it was running before so the - runlevel configuration is irrelevant. It will be preserved by the mean of - update-rc.d's builtin check. - Implementation: - prerm (called on upgrade before stopping the server): - check for a running server and set flag if necessary - preinst (called on initial install and before unpacking when upgrading): - check for $1 beeing (initial) "install" and set flag - postinst (called on initial install and after each upgrade after unpacking): - call update-rc.d - call invoce-rc.d if the flag has been set diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf deleted file mode 100644 index a569c041401..00000000000 --- a/debian/additions/my.cnf +++ /dev/null @@ -1,134 +0,0 @@ -# -# The MySQL database server configuration file. -# -# You can copy this to one of: -# - "/etc/mysql/my.cnf" to set global options, -# - "~/.my.cnf" to set user-specific options. -# -# One can use all long options that the program supports. -# Run program with --help to get a list of available options and with -# --print-defaults to see which it would actually understand and use. -# -# For explanations see -# http://dev.mysql.com/doc/mysql/en/server-system-variables.html - -# This will be passed to all mysql clients -# It has been reported that passwords should be enclosed with ticks/quotes -# escpecially if they contain "#" chars... -# Remember to edit /etc/mysql/debian.cnf when changing the socket location. -[client] -port = 3306 -socket = /var/run/mysqld/mysqld.sock - -# Here is entries for some specific programs -# The following values assume you have at least 32M ram - -# This was formally known as [safe_mysqld]. Both versions are currently parsed. -[mysqld_safe] -socket = /var/run/mysqld/mysqld.sock -nice = 0 - -[mysqld] -# -# * Basic Settings -# -user = mysql -pid-file = /var/run/mysqld/mysqld.pid -socket = /var/run/mysqld/mysqld.sock -port = 3306 -basedir = /usr -datadir = /var/lib/mysql -tmpdir = /tmp -language = /usr/share/mysql/english -skip-external-locking -# -# Instead of skip-networking the default is now to listen only on -# localhost which is more compatible and is not less secure. -bind-address = 127.0.0.1 -# -# * Fine Tuning -# -key_buffer = 16M -max_allowed_packet = 16M -thread_stack = 128K -thread_cache_size = 8 -# -# * Query Cache Configuration -# -query_cache_limit = 1048576 -query_cache_size = 16777216 -query_cache_type = 1 -# -# * Logging and Replication -# -# Both location gets rotated by the cronjob. -# Be aware that this log type is a performance killer. -#log = /var/log/mysql/mysql.log -# -# Error logging goes to syslog. This is a Debian improvement :) -# -# Here you can see queries with especially long duration -#log_slow_queries = /var/log/mysql/mysql-slow.log -# -# The following can be used as easy to replay backup logs or for replication. -#server-id = 1 -log_bin = /var/log/mysql/mysql-bin.log -# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian! -expire_logs_days = 10 -max_binlog_size = 100M -#binlog_do_db = include_database_name -#binlog_ignore_db = include_database_name -# -# * BerkeleyDB -# -# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12. -skip-bdb -# -# * InnoDB -# -# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. -# Read the manual for more InnoDB related options. There are many! -# You might want to disable InnoDB to shrink the mysqld process by circa 100MB. -#skip-innodb -# -# * Security Features -# -# Read the manual, too, if you want chroot! -# chroot = /var/lib/mysql/ -# -# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". -# -# ssl-ca=/etc/mysql/cacert.pem -# ssl-cert=/etc/mysql/server-cert.pem -# ssl-key=/etc/mysql/server-key.pem - - - -[mysqldump] -quick -quote-names -max_allowed_packet = 16M - -[mysql] -#no-auto-rehash # faster start of mysql but no tab completition - -[isamchk] -key_buffer = 16M - -# -# * NDB Cluster -# -# See /usr/share/doc/mysql-server-*/README.Debian for more information. -# -# The following configuration is read by the NDB Data Nodes (ndbd processes) -# not from the NDB Management Nodes (ndb_mgmd processes). -# -# [MYSQL_CLUSTER] -# ndb-connectstring=127.0.0.1 - - -# -# * IMPORTANT: Additional settings that can override those from this file! -# -!includedir /etc/mysql/conf.d/ - diff --git a/debian/additions/mysql-server.lintian-overrides b/debian/additions/mysql-server.lintian-overrides deleted file mode 100644 index 9d741cf16e9..00000000000 --- a/debian/additions/mysql-server.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -W: mysql-dfsg source: maintainer-script-lacks-debhelper-token debian/mysql-server.postinst -W: mysql-server: possible-bashism-in-maintainer-script postinst:68 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}' diff --git a/debian/additions/ndb_mgmd.cnf b/debian/additions/ndb_mgmd.cnf deleted file mode 100644 index d94a28ff705..00000000000 --- a/debian/additions/ndb_mgmd.cnf +++ /dev/null @@ -1,35 +0,0 @@ -[NDBD DEFAULT] -NoOfReplicas=2 -DataMemory=10MB -IndexMemory=25MB -MaxNoOfTables=256 -MaxNoOfOrderedIndexes=256 -MaxNoOfUniqueHashIndexes=128 - -[MYSQLD DEFAULT] - -[NDB_MGMD DEFAULT] - -[TCP DEFAULT] - -[NDB_MGMD] -Id=1 # the NDB Management Node (this one) -HostName=127.0.0.1 - -[NDBD] -Id=2 # the first NDB Data Node -HostName=127.0.0.1 -DataDir= /var/lib/mysql-cluster - -[NDBD] -Id=3 # the second NDB Data Node -HostName=127.0.0.1 -DataDir=/var/lib/mysql-cluster - -[MYSQLD] -Id=4 # the first SQL node -HostName=127.0.0.1 - -# [MYSQLD] -# Id=5 # the second SQL node -# HostName=127.0.0.10 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 605619b605c..00000000000 --- a/debian/changelog +++ /dev/null @@ -1,3275 +0,0 @@ -mysql-5.0 (5.0.42) UNRELEASED; urgency=low - - * Upgraded to 5.0.42 branch. - - -- Monty Taylor Thu, 19 Apr 2007 22:18:02 +0200 - -mysql-5.0 (5.0.38) UNRELEASED; urgency=low - - * Imported packaging work from Debian. - * Removed debian-start, mysqlreport and echo_stderr to align with official - packages. - - -- Monty Taylor Wed, 7 Mar 2007 07:52:55 +0800 - -mysql-dfsg-5.0 (5.0.32-3etch1) testing-proposed-updates; urgency=high - - * Backported upstream patch for a bug that crashed the server when using - certain join/group/limit combinations. - Users of the Joomla CMS seemed to be affected by this. Closes: #403721 - * The debian-start script that runs on every server start now first upgrades - the system tables (if neccessary) and then check them as it sometimes did - not work the other way around (e.g. for MediaWiki). The script now uses - mysql_update instead of mysql_update_script as recommended. Closes: 409780 - * The old_passwords setting that is set according to a Debconf question is - now written to /etc/mysql/conf.d/old_passwords.cnf instead directly to the - conffile /etc/mysql/my.cnf which would be fobidden by policy (thanks to - Robert Bihlmeyer). Closes: #409750 - * Added bison to build dependencies. - * Synced Debconf translations with 5.0.32-7. - - -- Christian Hammers Sun, 18 Feb 2007 22:33:05 +0100 - -mysql-dfsg-5.0 (5.0.32-3) unstable; urgency=high - - * mysql-server-5.0 pre-depends on adduser now and has --disabled-login - explicitly added to be on the safe side (thanks to the puiparts team). - Closes: #408362 - * Corrections the terminology regarding NDB in the comments of all config - files and init scripts (thanks to Geert Vanderkelen of MySQL). - * Updated Swedish Debconf translation (thanks to Andreas Henriksson). - Closes: #407859 - * Updated Czech Debconf translation (thanks to Miroslav Kure). - Closes: #407809 - - -- Christian Hammers Thu, 11 Jan 2007 11:18:47 +0100 - -mysql-dfsg-5.0 (5.0.32-2) unstable; urgency=high - - * The last upload suffered from a regression that made NDB totally - unusable and caused a dependency to libmysqlclient15-dev in the - mysql-server-5.0 package. The relevant 85_* patch was re-added again. - Closes: #406435 - * Added lintian-overrides for an error that does not affect our packages. - There are now only warnings and not errors left. - - -- Christian Hammers Tue, 9 Jan 2007 23:55:10 +0100 - -mysql-dfsg-5.0 (5.0.32-1) unstable; urgency=high - - * New upstream version. - * SECURITY: mysql_fix_privilege_tables.sql altered the - table_privs.table_priv column to contain too few privileges, causing - loss of the CREATE VIEW and SHOW VIEW privileges. (MySQL Bug#20589) - * SECURITY (DoS): ALTER TABLE statements that performed both RENAME TO - and {ENABLE|DISABLE} KEYS operations caused a server crash. (MySQL - Bug#24089) - * SECURITY (DoS): LAST_DAY('0000-00-00') could cause a server crash. - (MySQL Bug#23653) - * SECURITY (DoS): Using EXPLAIN caused a server crash for queries that - selected from INFORMATION_SCHEMA in a subquery in the FROM clause. - (MySQL Bug#22413) - * SECURITY (DoS): Invalidating the query cache (e.g. when using stored procedures) - caused a server crash for INSERT INTO ... SELECT statements that - selected from a view. (MySQL Bug#20045) - * Using mysql_upgrade with a password crashed the server. Closes: #406229 - * yaSSL crashed on pre-Pentium Intel and Cyrix CPUs. (MySQL Bug#21765) - Closes: #383759 - * Lots of small fixes to the NDB cluster storage engine. - * Updated Japanese Debconf template (thanks to Hideki Yamane). - Closes: #405793 - * Fixed comment regarding "mycheck" in debian-start (thanks to - Enrico Zini). Closes: #405787 - - -- Christian Hammers Sat, 6 Jan 2007 14:26:20 +0100 - -mysql-dfsg-5.0 (5.0.30-3) unstable; urgency=low - - * Updated Brazilian Debconf translation (thanks to Andre Luis Lopes). - Closes: #403821 - * Added Romanian Debconf translation (thanks to Stan Ioan-Eugen). - Closes: #403943 - * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino - Pena). Closes: #404084 - * Updated Galician Debconf translation (thanks to Jacobo Tarrio). - Closes: #404318 - * Updated Dutch Debconf translation (thanks to Vincent Zweije). - Closes: #404566 - * Updated Danish Debconf translation (thanks to Claus Hindsgaul). - Closes: #405018 - - -- Christian Hammers Thu, 21 Dec 2006 21:35:09 +0100 - -mysql-dfsg-5.0 (5.0.30-2) unstable; urgency=high - - * Fixed upstream regression in header files that lead to FTBFS for - mysql-admin, mysql-query-browser and probably other pacakges. - (thanks to Andreas Henriksson). Closes: #403081, #403082 - * Fixed some upstream scripts by replacing /etc by /etc/mysql (thanks to - Julien Antony). Closes: #401083 - * Updated French Debconf translation (thanks to Christian Perrier). - Closes: #401434 - * Added Spanish Debconf translation (thanks to Javier Fernandez-Sanguino - Pena). Closes: #401953 - * Marked a Debconf question that is just a dummy and only internally - used as not-needing-translation. Closes: #403163 - * Fixed mysqlslowdump patch to not remove the usage() function (thanks - to Monty Tailor). - - -- Christian Hammers Sun, 3 Dec 2006 19:20:10 +0100 - -mysql-dfsg-5.0 (5.0.30-1) unstable; urgency=low - - * New upstream version (switch to the MySQL Enterprise branch). - * Upstream bugfix for the Innodb performance bug: - "Very poor performance with multiple queries running - concurrently (Bug#15815)". - * Upstream bugfix for a possible server crash: - "Selecting from a MERGE table could result in a server crash if the - underlying tables had fewer indexes than the MERGE table itself - (Bug#22937)" - * Upstream bugfies for *lot* of NDB problems. - * Upstream bugfix for Innodb optimizer bug. Closes: #397597 - * Updated Italian Debconf translation (thanks to Luca Monducci). - Closes: #401305 - * Updated debian/watch file to MySQL Enterprise branch. - - -- Christian Hammers Sat, 2 Dec 2006 16:36:38 +0100 - -mysql-dfsg-5.0 (5.0.27-2) unstable; urgency=medium - - * Disabled YaSSL x86 assembler as it was reported to crash applications - like pam-mysql or proftpd-mysql which are linked against libmysqlclient - on i486 and Cyrix (i586) CPUs. Closes: #385147 - * Adjusted mysql-server-4.1 priority to extra and section to oldlibs - according to the ftp masters overrides. - * Updated German Debconf translation (thanks to Alwin Meschede). - Closes: #400809 - - -- Christian Hammers Wed, 22 Nov 2006 13:36:31 +0100 - -mysql-dfsg-5.0 (5.0.27-1) unstable; urgency=medium - - * New upstream version (but no codechange, the only difference to 5.0.26 - was a patch to the ABI change which Debian already included. - * When dist-upgrading from mysql-server-4.1/sarge dpkg does not longer - ask unnecessary "config file has changed" questions regarding - /etc/init.d/mysql, /etc/logrotate.d/mysql-server and - /etc/mysql/debian-start just because these files previously belonged - to mysql-server-4.1 and not to mysql-server-5.0. - To archive this mysql-server-5.0 now pre-depends on mysql-common which - provides current versions of those files. - * The automatic run mysql_upgrade now works with non-standard datadir - settings, too (thanks to Benjami Villoslada). Closes: #394607 - * Debconf now asks if the old_passwords option is really needed. - * Improved explanations of the old_passwords variable in my.cnf. - * Removed possibly leftover cron script from MySQL-4.1 (thanks to - Mario Oyorzabal Salgado). Closes: #390889 - * Postrm ignores failed "userdel mysql". - * Updated Danish Debconf translation (thanks to Claus Hindsgaul). - Closes: #398784 - * Added Euskarian Debconf translation (thanks to Piarres Beobide). - Closes: #399045 - * Updated Japanese Debconf translation (thanks to Hideki Yamane). - Closes: #399074 - * Updated German Debconf translation (thanks to Alwin Meschede). - Closes: #399087 - * New Portuguese debconf translations from Miguel Figueiredo. - Closes: #398186 - - -- Christian Hammers Tue, 7 Nov 2006 21:26:25 +0100 - -mysql-dfsg-5.0 (5.0.26-3) unstable; urgency=high - - [sean finney] - * Fix for the deadly ISAM trap. Now during upgrades we will do our - very best to convert pre-existing ISAM format tables using the - binaries from the previous package. Success is not guaranteed, but - this is probably as good as it gets. Note that this also necessitates - re-introducing an (empty transitional) mysql-server-4.1 package. - Closes: #354544, #354850 - * Remove a couple spurious and wrongly placed WARNING statements from - 45_warn-CLI-passwords.dpatch. thanks to Dan Jacobsen for pointing these - out. Closes: #394262 - - -- sean finney Fri, 03 Nov 2006 18:34:46 +0100 - -mysql-dfsg-5.0 (5.0.26-2) unstable; urgency=high - - * Fixed FTBFS for Alpha by applying an upstream patch (thanks to Falk - Hueffner). Closes: #395921 - - -- Christian Hammers Sat, 28 Oct 2006 20:13:46 +0200 - -mysql-dfsg-5.0 (5.0.26-1) unstable; urgency=high - - * SECURITY: - This combined release of 5.0.25 and 5.0.26 fixes lot of possible server - crashs so it should get into Etch. Quoting the changelog (bug numbers are - bugs.mysql.com ones): - - character_set_results can be NULL to signify no conversion, but some - code did not check for NULL, resulting in a server crash. (Bug#21913) - - Using cursors with READ COMMITTED isolation level could cause InnoDB to - crash. (Bug#19834) - - Some prepared statements caused a server crash when executed a second - time. (Bug#21166) - - When DROP DATABASE or SHOW OPEN TABLES was issued while concurrently - issuing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE or any other - statement that required a name lock) in another connection, the server - crashed. (Bug#21216) - - Use of zero-length variable names caused a server crash. (Bug#20908) - - For InnoDB tables, the server could crash when executing NOT IN () - subqueries. (Bug#21077) - - Repeated DROP TABLE statements in a stored procedure could sometimes - cause the server to crash. (Bug#19399) - - Performing an INSERT on a view that was defined using a SELECT that - specified a collation and a column alias caused the server to crash - (Bug#21086). - - A query of the form shown here caused the server to crash. (Bug#21007) - - NDB Cluster: Some queries involving joins on very large NDB tables could - crash the MySQL server. (Bug#21059) - - The character set was not being properly initialized for CAST() with a - type like CHAR(2) BINARY, which resulted in incorrect results or even a - server crash. (Bug#17903) - - For certain queries, the server incorrectly resolved a reference to an - aggregate function and crashed. (Bug#20868) - - The server crashed when using the range access method to execut a - subquery with a ORDER BY DESC clause. (Bug#20869) - - Triggers on tables in the mysql database caused a server crash. Triggers - for tables in this database now are disallowed. (Bug#18361) - - Using SELECT on a corrupt MyISAM table using the dynamic record format - could cause a server crash. (Bug#19835) - - Use of MIN() or MAX() with GROUP BY on a ucs2 column could cause a - server crash. (Bug#20076) - - Selecting from a MERGE table could result in a server crash if the - underlying tables had fewer indexes than the MERGE table itself. - (Bug#21617, Bug#22937) - - * New upstream release. - - This bug would cause trouble for Sarge->Etch upgrades, it was supposed to - have been fixed in 5.0.16 but that apparently did not fix the whole - problem: - Using tables from MySQL 4.x in MySQL 5.x, in particular those with VARCHAR - fields and using INSERT DELAYED to update data in the table would result in - either data corruption or a server crash. (Bug#16611, Bug#16218, Bug#17294) - Closes: #386337 - - Fixes data corruption as an automatic client reconnect used to set - the wrong character set. Closes: #365050 - - Fixes an undefined ulong type in an include file. Closes: #389102 - - Fixes wrong output format when using Unicode characters. Closes: #355302 - - Fixes mysql_upgrade when using a password. Closes: #371841 - - [Christian Hammers] - * Removed --sysconfdir from debian/rules as it puts /etc/mysql/ at the - end of the my.cnf search patch thus overriding $HOME/my.cnf - (thanks to Christoph Biedl). Closes: #394992 - * The provided patch from bug #385947 was wrong, the variable is called - BLOCKSIZE not BLOCK_SIZE according to "strings `which df`" (thanks to - Bruno Muller). Closes: #385947 - - [sean finney] - * new dutch debconf translations from Vincent Zweije (closes: #392809). - * new japanese debconf translations from Hideki Yamane (closes: #391625). - * new italian debconf translations from Luca Monducci (closes: #391741). - * new french debconf translations from Christian Perrier (closes: #393334). - * ran debconf-updatepo to merge the fuzzies into svn. - * massage the following patches so they continue to apply cleanly: - - 44_scripts__mysql_config__libs.dpatch to cleanly apply. - - 45_warn-CLI-passwords.dpatch - - 96_TEMP__libmysqlclient_ssl_symbols.dpatch (note, this patch might - no longer be needed, but is retained "just in case" after massaging it) - * the following patches have been incorporated upstream: - - 70_kfreebsd.dpatch - - 80_hurd_mach.dpatch - - 87_ps_Hurd.dpatch - - 90_TEMP__client__mysql_upgrade__O_EXEC.dpatch - - 91_TEMP__client__mysql_upgrade__password.dpatch - - 92_TEMP__client__mysql_upgrade__defaultgroups.dpatch - - 94_TEMP__CVE-2006-4227.dpatch - - 95_TEMP__CVE-2006-4226.dpatch - * the udf_example.cc has disappeared from the source code, but there's - a udf_example.c which seems to be a good example to use instead :) - * update documentation in the configuration to no longer reference - using my.cnf in the DATADIR, as it's never been the recommended - method for debian systems and hasn't worked since 5.0 was released - anyway (closes: #393868). - - -- Christian Hammers Wed, 25 Oct 2006 19:54:04 +0200 - -mysql-dfsg-5.0 (5.0.24a-9) unstable; urgency=medium - - * Having expire_logs_days enabled but log-bin not crashes the server. Using - both or none of those options is safe. To prevent this happening during the - nightly log rotation via /etc/logrotate.d/mysql the initscript checks for - malicious combination of options. See: #368547 - * The Sarge package "mysql-server" which used to include the mysqld daemon - may still be in unselected-configured state (i.e. after a remove but not - purge) in which case its now obsolete cronscript has to be moved away - (thanks to Charles Lepple). Closes: #385669 - * Updated Danish Debconf translation (thanks to Claus Hindsgaul). - Closes: #390315 - * Updated Frensh Debconf translation (thanks to Christian Perrier). - Closes: #390980 - - -- Christian Hammers Tue, 3 Oct 2006 14:55:31 +0200 - -mysql-dfsg-5.0 (5.0.24a-8) unstable; urgency=low - - * (broken upload) - - -- Christian Hammers Tue, 3 Oct 2006 14:55:31 +0200 - -mysql-dfsg-5.0 (5.0.24a-7) unstable; urgency=low - - * Stopped mysql_config from announcing unnecessary library dependencies - which until now cause "NEEDED" dependencies in the "readelf -d" output - of libraries who only depend on libmysqlclient.so (thanks to Michal - Cihar). Closes: #390692 - - -- Christian Hammers Sun, 1 Oct 2006 23:59:43 +0200 - -mysql-dfsg-5.0 (5.0.24a-6) unstable; urgency=low - - [sean finney] - * finally add support for setting a root password at install. - while this is not a random password as requested in one bug - report, we believe it is the best solution and provides a - means to set a random password via preseeding if it's really - desired (Closes: #316127, #298295). - - -- sean finney Sun, 01 Oct 2006 23:34:30 +0200 - -mysql-dfsg-5.0 (5.0.24a-5) unstable; urgency=low - - * Added ${shlibs:Depends} to debian/control section libmysqlclient-dev as it - contains the experimental /usr/lib/mysql/libndbclient.so.0.0.0. - * Bumped standards version to 3.7.2. - * Added LSB info section to init scripts. - * Rephrased Debconf templates as suggested by lintian. - * Added benchmark suite in /usr/share/mysql/sql-bench/. - * The mysql.timezone* tables are now filled by the postinst script (thanks - to Mark Sheppard). Closes: #388491 - * Moved Debconf install notes to README.Debian. Displaying them with - medium priority was a bug anyway. Closes: #388941 - * Replaced /usr/bin/mysql_upgrade by /usr/bin/mysql_upgrade_shell in - /etc/mysql/debian-start.sh as it works without errors (thanks to Javier - Kohen). Closes: #389443 - - -- Christian Hammers Wed, 20 Sep 2006 15:01:42 +0200 - -mysql-dfsg-5.0 (5.0.24a-4) unstable; urgency=high - - * libmysqlclient.so.15 from 5.0.24 accidentaly exports some symbols that are - historically exported by OpenSSL's libcrypto.so. This bug was supposed to - be fixed in 5.0.24a bug according to the mysql bug tracking system will - only be fixed in 5.0.25 so I backported the patch. People already reported - crashing apps due to this (thanks to Duncan Simpson). See also: #385348 - Closes: #388262 - * Fixed BLOCKSIZE to BLOCK_SIZE in initscript (thanks to Bruno Muller). - Closes: #385947 - * Added hint to "--extended-insert=0" to mysqldump manpage (thanks to Martin - Schulze). - * Documented the meaning of "NDB" in README.Debian (thanks to Dan Jacobson). - Closes: #386274 - * Added patch to build on hurd-i386 (thanks to Cyril Brulebois). Closes: #387369 - * Fixed debian-start script to work together with the recend LSB modifications in - the initscript (thanks to wens). Closes: #387481 - * Reverted tmpdir change in my.cnf back to /tmp to comply with FHS (thanks - to Alessandro Valente). Closes: #382778 - * Added logcheck filter rule (thanks to Paul Wise). Closes: #381043 - * I will definetly not disable InnoDB but added a note to the default my.cnf - that disabling it saves about 100MB virtual memory (thanks to Olivier - Berger). Closes: #384399 - * Added thread_cache_size=8 to default my.cnf as this variable seems to have - a negligible memory footprint but can improve performance when lots of - threads connect simultaneously as often seen on web servers. - - -- Christian Hammers Mon, 4 Sep 2006 00:21:50 +0200 - -mysql-dfsg-5.0 (5.0.24a-3) unstable; urgency=low - - * Fixed potential tempfile problem in the newly added mysqlreport script. - - -- Christian Hammers Sun, 3 Sep 2006 23:17:24 +0200 - -mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low - - * Added "mysqlreport" (GPL'ed) from hackmysql.com. - * Temporarily disabled expire_days option as it causes the server - to crash. See #368547 - * Made output of init scripts LSB compliant (thanks to David Haerdeman). - Closes: #385874 - - -- Christian Hammers Sun, 3 Sep 2006 19:06:53 +0200 - -mysql-dfsg-5.0 (5.0.24a-1) unstable; urgency=high - - * New upstream version. - * The shared library in the 5.0.24 upstream release accidently exported - some symbols that are also exported by the OpenSSL libraries (notably - BN_bin2bn) causing unexpected behaviour in applications using these - functions (thanks to Peter Cernak). Closes: #385348 - * Added note about possible crash on certain i486 clone CPUs. - * Made recipient address of startup mysqlcheck output configurable - (thanks to Mattias Guns). Closes: #385119 - - -- Christian Hammers Mon, 28 Aug 2006 01:22:12 +0200 - -mysql-dfsg-5.0 (5.0.24-3) unstable; urgency=high - - * SECURITY: - CVE-2006-4226: - When run on case-sensitive filesystems, MySQL allows remote - authenticated users to create or access a database when the database - name differs only in case from a database for which they have - permissions. - CVE-2006-4227: - MySQL evaluates arguments of suid routines in the security context of - the routine's definer instead of the routine's caller, which allows - remote authenticated users to gain privileges through a routine that - has been made available using GRANT EXECUTE. - Thanks to Stefan Fritsch for reporting. Closes: #384798 - - -- Christian Hammers Sat, 26 Aug 2006 04:55:17 +0200 - -mysql-dfsg-5.0 (5.0.24-2) unstable; urgency=high - - * 5.0.24-1 introduced an ABI incompatibility, which this patch reverts. - Programs compiled against 5.0.24-1 are not compatible with any other - version and needs a rebuild. - This bug already caused a lot of segfaults and crashes in various - programs. Thanks to Chad MILLER from MySQL for quickly providing a patch. - The shlibdeps version has been increased to 5.0.24-2. - Closes: #384047, #384221, #383700 - - -- Christian Hammers Fri, 25 Aug 2006 21:47:35 +0200 - -mysql-dfsg-5.0 (5.0.24-1) unstable; urgency=high - - * SECURITY: Upstream fixes a security bug which allows a user to continue - accessing a table using a MERGE TABLE after the right to direct access to - the database has been revoked (CVE-2006-4031, MySQL bug #15195). - (Well they did not exactly fixed it, they documented the behaviour and - allow the admin to disable merge table alltogether...). Closes: #380271 - * SECURITY: Applied patch that fixes a possibly insecure filehandling - in the recently added mysql_upgrade binary file (MySQL bug #10320). - * New upstream version. - - Fixes nasty MySQL bug #19618 that leads to crashes when using - "SELECT ... WHERE ... not in (1, -1)" (e.g. vbulletin was affected). - - Fixes upstream bug #16803 so that linking ~/.mysql_history to /dev/null - now has the desired effect of having no history. - * Really fixed the runlevels. Closes: #377651 - * Added patch for broken upstream handling of "host=" to mysql_upgrade.c. - * Adjusted /etc/mysql/debian-start to new mysql_upgrade.c - - -- Christian Hammers Tue, 8 Aug 2006 00:44:13 +0200 - -mysql-dfsg-5.0 (5.0.22-5) unstable; urgency=low - - * Added further line to the logcheck ignore files (thanks to Paul Wise). - Closes: #381038 - - -- Christian Hammers Wed, 2 Aug 2006 00:28:50 +0200 - -mysql-dfsg-5.0 (5.0.22-4) unstable; urgency=low - - * Upstream fixes a bug in the (never released) version 5.0.23 which could - maybe used to crash the server if the mysqlmanager daemon is in use - which is not yet the default in Debian. (CVE-2006-3486 *DISPUTED*) - * Changed runlevel priority of mysqld from 20 to 19 so that it gets started - before apache and proftpd etc. which might depend on an already running - database server (thanks to Martin Gruner). Closes: #377651 - * Added patch which sets PATH_MAX in ndb (thanks to Cyril Brulebois). - Closes: #378949 - * Activated YaSSL as licence issues are settled according to: - http://bugs.mysql.com/?id=16755. This also closes the FTBFS bug - regarding OpenSSL as it is discouraged to use now. Closes: #368639 - * Removed SSL-MINI-HOWTO as the official documentation is good enough now. - * mysql_upgrade no longer gives --password on the commandline which would - be insecure (thanks to Dean Gaudet). Closes: #379199 - * Adjusted debian/patches/45* to make consecutive builds in the same source - tree possible (thanks to Bob Tanner). Closes: #368661 - * mysql-server-5.0 is now suggesting tinyca as yaSSL is enabled and tinyca - was found to be really cool :) - * Moved tempdir from /tmp to /var/tmp as it will more likely have enough - free space as /tmp is often on the root partition and /var or at least - /var/tmp is on a bigger one. - - -- Christian Hammers Mon, 10 Jul 2006 23:30:26 +0200 - -mysql-dfsg-5.0 (5.0.22-3) unstable; urgency=low - - * Added patch for MySQL bug #19618: "select x from x - where x not in(1,-1)" may crash the server" (thanks to - Ruben Puettmann). - - -- Christian Hammers Fri, 9 Jun 2006 01:41:44 +0200 - -mysql-dfsg-5.0 (5.0.22-2) unstable; urgency=high - - * Fixed debian-sys-maint related bug in postinst (thanks to - Jean-Christophe Dubacq). Closes: #369970 - * The last upload was a security patch (which I did not know as I - uploaded before the announcement came). I now added the CVE id for - reference and set urgency to high as the last entry did not. - - -- Christian Hammers Wed, 31 May 2006 01:04:11 +0200 - -mysql-dfsg-5.0 (5.0.22-1) unstable; urgency=low - - * SECURITY: This upstream release fixes an SQL-injection with multibyte - encoding problem. (CVE-2006-2753) - * New upstream release. - * Upstream fixes REPAIR TABLE problem. Closes: #354300 - * Upstream fixes problem that empty strings in varchar and text columns - are displayed as NULL. Closes: #368663 - - -- Christian Hammers Tue, 30 May 2006 23:43:24 +0200 - -mysql-dfsg-5.0 (5.0.21-4) unstable; urgency=low - - * Added "BLOCKSIZE=" to the diskfree check (thanks to Farzad FARID). - Closes: #367027, #367083 - * Further fixed mysql_upgrade upstream script (thanks to Andreas Pakulat) - Closes: #366155 - * Adjusted the /proc test in debian/rules from /proc/1 to /proc/self - to make building on grsec systems possible (thanks to K. Rosenegger). - Closes: #366824 - * Updated Russion Debconf translation (thanks to Yuriy Talakan). - Closes: #367141 - * Updated Czech Debconf translation (thanks to Kiroslav Kure). - Closes: #367160 - * Updated Galician Debconf translation (thanks to Jacobo Tarrio). - Closes: #367384 - * Updated Swedish Debconf translation (thanks to Daniel Nylander). - Closes: #368186 - - -- Christian Hammers Wed, 10 May 2006 08:45:42 +0200 - -mysql-dfsg-5.0 (5.0.21-3) unstable; urgency=low - - * Fixed FTBFS problem which was caused by a patch that modifies Makefile.am - as well as Makefile.in and was not deteced because my desktop was fast - enough to patch both files within the same second and so fooled automake. - (thanks to Blars Blarson for notifying me). Closes: #366534 - - -- Christian Hammers Sat, 6 May 2006 19:03:58 +0200 - -mysql-dfsg-5.0 (5.0.21-2) unstable; urgency=low - - * Fixed bug in postinst that did not correctly rewrite - /etc/mysql/debian.cnf (thanks to Daniel Leidert). - Closes: #365433, #366155 - - -- Christian Hammers Thu, 4 May 2006 02:37:03 +0200 - -mysql-dfsg-5.0 (5.0.21-1) unstable; urgency=high - - * SECURITY: New upstream release with some security relevant bugfixes: - * "Buffer over-read in check_connection with usernames lacking a - trailing null byte" (CVE-2006-1516) - * "Anonymous Login Handshake - Information Leakage" (CVE-2006-1517) - * "COM_TABLE_DUMP Information Leakage and Arbitrary command execution" - (CVE-2006-1518) - Closes: #365938, #365939 - * Added diskfree check to the init script (thanks to Tim Baverstock). - Closes: #365460 - * First amd64 upload! - - -- Christian Hammers Sat, 29 Apr 2006 04:31:27 +0200 - -mysql-dfsg-5.0 (5.0.20a-2) unstable; urgency=low - - * The new mysql-upgrade which is started from /etc/mysql/debian-start - does now use the debian-sys-maint user for authentication (thanks to - Philipp). Closes: #364991 - * Wrote patch debian/patches/43* which adds a password option to - mysql_update. See MySQL bug #19400. - * Added "Provides: libmysqlclient-dev" to libmysqlclient15-dev as I saw no - obvious reasons against it (problems should be documented in - debian/README.Maintainer!) (thanks to Olaf van der Spek). Closes: #364899 - * Updated Netherlands debconf translation (thanks to Vincent Zweije) - Closes: #364464 - * Updated French debconf translation (thanks to Christian Perrier) - Closes: #364401 - * Updated Danish debconf translation (thanks to Claus Hindsgaul) - Closes: #365135 - - -- Christian Hammers Wed, 26 Apr 2006 01:14:53 +0200 - -mysql-dfsg-5.0 (5.0.20a-1) unstable; urgency=low - - * New upstream release. - * Added the new mysql_upgrade script and added it to - /etc/mysql/debian-start (thanks to Alessandro Polverini). - The script is currently very noise that is a known bug and will be - fixed in the next release! - Closes: #363458 - * No longer creates the "test" database. This actuallay had been tried - to archive before (at least patches) exists but apparently was not the - case in the last versions (thanks to Olaf van der Spek). Closes: #362126 - * Reformatted libmysqlclient15off.NEWS.Debian to changelog format - (thanks to Peter Palfrader). Closes: #363062 - - -- Christian Hammers Sat, 15 Apr 2006 13:05:22 +0200 - -mysql-dfsg-5.0 (5.0.20-1) unstable; urgency=high - - * Upstream contains a fix for a nasty bug (MySQL#18153) that users - already experienced and that caused corrupted triggers after - REPAIR/OPTIMIZE/ALTER TABLE statements. - (thanks to Jerome Despatis for pointing out) - * Added patch for the "updates on multiple tables is buggy after - upgrading from 4.1 to 5.0" problem which MySQL has been committed - for the upcoming 5.0.21 release. Closes #352704 - * Added Netherlands debconf translation (thanks to Vincent Zweije). - Closes: #360443 - * Added Galician debconf translation (thanks to Jacobo Tarrio). - Closes: #361257 - - -- Christian Hammers Fri, 7 Apr 2006 00:00:43 +0200 - -mysql-dfsg-5.0 (5.0.19-3) unstable; urgency=high - - [ Christian Hammers ] - * Fixed libmysqlclient15.README.Debian regarding package name changes - (thanks to Leppo). - * Moved libheap.a etc. back to /usr/lib/mysql/ as their names are just - too generic. Closes: #353924 - [ Sean Finney ] - * updated danish debconf translation, thanks to Claus Hindsgaul - (closes: #357424). - [ Adam Conrad ] - * Send stderr from 'find' in preinst to /dev/null to tidy up chatter. - * Backport patch for CVE-2006-0903 from the upcoming release to resolve - a log bypass vulnerability when using non-binary logs (closes: #359701) - - -- Adam Conrad Tue, 4 Apr 2006 15:23:18 +1000 - -mysql-dfsg-5.0 (5.0.19-2) unstable; urgency=medium - - * New upstream release. - * Renamed package libmysqlclient15 to libmysqlclient15off due to - binary incompatible changes. - See /usr/share/doc/libmysqlclient15off/README.Debian - * Updated Czech debconf translation (thanks to Miroslav Kure). - Closes: #356503 - * Updated French debconf translation (thanks to Christian Perrier). - Closes: #356332 - * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702 - * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian - file is (thanks to Ross Boylan). Closes: #355978 - - -- Christian Hammers Fri, 17 Mar 2006 02:32:19 +0100 - -mysql-dfsg-5.0 (5.0.19-1) experimental; urgency=medium - - * New upstream release. - * SECURITY: CVE-2006-3081: A bug where str_to_date(1,NULL) lead to a - server crash has been fixed. - (this note has been added subsequently for reference) - * Renamed package libmysqlclient15 to libmysqlclient15off. - See /usr/share/doc/libmysqlclient15off/NEWS.Debian - * Updated Czech debconf translation (thanks to Miroslav Kure). - Closes: #356503 - * Updated French debconf translation (thanks to Christian Perrier). - Closes: #356332 - * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702 - * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian - file is (thanks to Ross Boylan). Closes: #355978 - - -- Christian Hammers Tue, 14 Mar 2006 22:56:13 +0100 - -mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=medium - - [ Christian Hammers ] - * When using apt-get the check for left-over ISAM tables can abort the - installation of mysql-server-5.0 but not prevent the mysql-server-4.1 - package from getting removed. The only thing I can do is reflect this - in the Debconf notice that is shown and suggest to reinstall - mysql-server-4.1 for converting. See: #354850 - * Suggests removing of /etc/cron.daily/mysql-server in last NEWS message - (thanks to Mourad De Clerck). Closes: #354111 - * Added versioned symbols for kfreebsd and Hurd, too (thanks to Aurelien - Jarno and Michael Bank). Closes: #353971 - * Added versioned symbols for kfreebsd, too (thanks to Aurelien Jarno). - Closes: #353971 - [ Adam Conrad ] - * Add 39_scripts__mysqld_safe.sh__port_dir.dpatch to ensure that the - permissions on /var/run/mysqld are always correct, even on a tmpfs. - - -- Christian Hammers Mon, 6 Mar 2006 21:42:13 +0100 - -mysql-dfsg-5.0 (5.0.18-8) unstable; urgency=low - - * The rotation of the binary logs is now configured via - expire-logs-days in /etc/mysql/my.cnf and handled completely - by the server and no longer in configured in debian-log-rotate.conf - and handled by a cron job. Thanks to David Johnson. - See /usr/share/doc/mysql-server-5.0/NEWS.Debian - * Ran aspell over some files in debian/ and learned a lot :) - * debian/rules: Added check if versioned symbols are really there. - * Updated SSL-MINI-HOWTO. - * Updated copyright (removed the parts regarding the now removed - BerkeleyDB table handler and mysql-doc package). - * Relocated a variable in preinst (thanks to Michael Heldebrant). - Closes: #349258, #352587, #351216 - * Updated Danish debconf translation (thanks to Claus Hindsgaul). - Closes: #349013 - * Updated Swedish debconf translation (thanks to Daniel Nylander). - Closes: #349522 - * Updated French debconf translation (thanks to Christian Perrier). - Closes: #349592 - * Fixed typo in README.Debian (thanks to Vincent Ricard). - * Prolonged waiting time for mysqld in the init script. Closes: #352070 - - -- Christian Hammers Mon, 23 Jan 2006 23:13:46 +0100 - -mysql-dfsg-5.0 (5.0.18-7) unstable; urgency=low - - * Made mailx in debian-start.inc.sh optional and changed the dependency on it - on it to a mere recommendation. Closes: #316297 - * the previous FTBFS patches for GNU/Hurd inadvertently led to configure - being regenerating, losing a couple trivial things like our versioned - symbols patch, causing many nasty problems (closes: #348854). - - -- sean finney Fri, 20 Jan 2006 20:59:27 +0100 - -mysql-dfsg-5.0 (5.0.18-6) unstable; urgency=low - - * Added version comment (thanks to Daniel van Eeden). - * Added two patches to build on GNU/Hurd (thanks to Michael Bank). - Closes: #348182 - * Abort upgrade if old and now unsupported ISAM tables are present - (thanks to David Coe). Closes: #345895 - - -- Christian Hammers Tue, 17 Jan 2006 19:25:59 +0100 - -mysql-dfsg-5.0 (5.0.18-5) unstable; urgency=low - - * Bump shlibdeps for libmysqlclient15 to (>= 5.0.15-1), which was - the first non-beta release from upstream, as well as being shortly - after we broke the ABI in Debian by introducing versioned symbols. - - -- Adam Conrad Fri, 13 Jan 2006 13:18:03 +1100 - -mysql-dfsg-5.0 (5.0.18-4) unstable; urgency=low - - * Munge our dependencies further to smooth upgrades even more, noting - that we really need 5.0 to conflict with 4.1, and stealing a page from - the book of mysql-common, it doesn't hurt to hint package managers in - the direction of "hey, this stuff is a complete replacement for 4.1" - * Change the description of mysql-server and mysql-client to remove the - references to it being "transition", and instead point out that it's - the way to get the "current best version" of each package installed. - - -- Adam Conrad Wed, 11 Jan 2006 11:39:45 +1100 - -mysql-dfsg-5.0 (5.0.18-3) unstable; urgency=low - - * Make the mysql-{client,server}-5.0 conflict against mysql-{client,server} - versioned, so they can be installed side-by-side and upgrade properly. - * Add myself to Uploaders; since I have access to the alioth repository. - - -- Adam Conrad Tue, 10 Jan 2006 19:15:48 +1100 - -mysql-dfsg-5.0 (5.0.18-2) unstable; urgency=low - - * Removed the transitional package that forced an upgrade from - mysql-server-4.1 to mysql-server-5.0 as I was convinced that - having a general "mysql-server" package with adjusted dependencies - is enough (thanks to Adam Conrad). - * Updated logcheck.ignore files (thanks to Jamie McCarthy). Closes: #340193 - - -- Christian Hammers Mon, 9 Jan 2006 21:54:53 +0100 - -mysql-dfsg-5.0 (5.0.18-1) unstable; urgency=low - - * New upstream version. - * Added empty transitional packages that force an upgrade from the - server and client packages that have been present in Sarge. - * Fixed SSL-MINI-HOWTO (thanks to Jonas Smedegaard). Closes: #340589 - - -- Christian Hammers Mon, 2 Jan 2006 21:17:51 +0100 - -mysql-dfsg-5.0 (5.0.17-1) unstable; urgency=low - - * Never released as Debian package. - - -- Christian Hammers Thu, 22 Dec 2005 07:49:52 +0100 - -mysql-dfsg-5.0 (5.0.16-1) unstable; urgency=low - - * New upstream version. - * Removed the error logs from the logrotate script as Debian does - not use them anymore. Closes: #339628 - - -- Christian Hammers Tue, 22 Nov 2005 01:19:11 +0100 - -mysql-dfsg-5.0 (5.0.15-2) unstable; urgency=medium - - * Added 14_configure__gcc-atomic.h.diff to fix FTBFS on m68k - (thanks to Stephen R Marenka). Closes: #337082 - * Removed dynamic linking against libstdc++ as it was not really - needed (thanks to Adam Conrad). Closes: #328613 - * Fixed the "/var/lib/mysql is a symlink" workaround that accidently - left a stalled symlink (thanks to Thomas Lamy). Closes: #336759 - * As the init script cannot distinguish between a broken startup and - one that just takes very long the "failed" message now says - "or took more than 6s" (thanks to Olaf van der Spek). Closes: #335547 - - -- Christian Hammers Thu, 3 Nov 2005 22:00:15 +0100 - -mysql-dfsg-5.0 (5.0.15-1) unstable; urgency=low - - * New upstream version. 5.0 has finally been declared STABLE! - * Added small patch to debian/rules that fixed sporadic build errors - where stdout and stderr were piped together, got mixed up and broke - * Added --with-big-tables to ./configure (thanks to tj.trevelyan). - Closes: #333090 - * Added capability to parse "-rc" to debian/watch. - * Fixed cronscript (thanks to Andrew Deason). Closes: #335244 - * Added Swedish debconf translation (thanks to Daniel Nylander). - Closes: #333670 - * Added comment to README.Debian regarding applications that manually - set new-style passwords... Closes: #334444 - * Sean Finney: - - Fix duplicate reference to [-e|--extended-insert]. Closes: #334957 - - Fix default behavior for mysqldumpslow. Closes: #334517 - - Reference documentation issue in mysql manpage. Closes: #335219 - - -- Christian Hammers Fri, 30 Sep 2005 00:10:39 +0200 - -mysql-dfsg-5.0 (5.0.13rc-1) unstable; urgency=low - - * New upstream release. Now "release-candidate"! - * Removed any dynamic link dependencies to libndbclient.so.0 which - is due to its version only distributed as a static library. - * Sean Finney: - - FTBFS fix related to stripping rpath in debian/rules - - -- Christian Hammers Mon, 26 Sep 2005 22:09:26 +0200 - -mysql-dfsg-5.0 (5.0.12beta-5) unstable; urgency=low - - * The recent FTBFS were probably result of a timing bug in the - debian/patches/75_*.dpatch file where Makefile.in got patched just - before the Makefile.shared which it depended on. For that reason - only some of the autobuilders failed. Closes: #330149 - * Fixed chrpath removal (option -k had to be added). - * Corrected debconf dependency as requested by Joey Hess. - - -- Christian Hammers Mon, 26 Sep 2005 18:37:07 +0200 - -mysql-dfsg-5.0 (5.0.12beta-4) unstable; urgency=low - - * Removed experimental shared library libndbclient.so.0.0.0 as it - is doomed to cause trouble as long as it is present in both MySQL 4.1 - and 5.0 without real soname and its own package. We still have - libndbclient.a for developers. (thanks to Adam Conrad and - mediaforest.net). Closes: #329772 - - -- Christian Hammers Fri, 23 Sep 2005 12:36:48 +0200 - -mysql-dfsg-5.0 (5.0.12beta-3) unstable; urgency=medium - - * Symbol versioning support! wooooohoooooo! - (thanks to Steve Langasek) Closes: #236288 - * Moved libndbcclient.so.0 to the -dev package as it is provided by - libmysqlclient14 and -15 which must be installable simultaneously. - * Removed mysql-*-doc suggestions. - - -- Christian Hammers Tue, 20 Sep 2005 00:07:03 +0200 - -mysql-dfsg-5.0 (5.0.12beta-2) unstable; urgency=low - - * Added patch to build on GNU/kFreeBSD (thanks to Aurelien Jarno). - Closes: #327702 - * Added patch that was already been present on the 4.1 branch which - makes the "status" command of the init script more sensible - (thanks to Stephen Gildea). Closes: #311836 - * Added Vietnamese Debconf translation (thanks to Clytie Siddal). - Closes: #313006 - * Updated German Debconf translation (thanks to Jens Seidel). - Closes: #313957 - * Corrected commends in example debian-log-rotate.conf. The default is - unlike the mysql-sever-4.1 package which needed to stay backwards - compatible now 2 to avoid filling up the disk endlessly. - * Fixed watch file to be "-beta" aware. - - -- Christian Hammers Thu, 15 Sep 2005 20:50:19 +0200 - -mysql-dfsg-5.0 (5.0.12beta-1) unstable; urgency=medium - - * Christian Hammers: - - New upstream release. - - Changed build-dep to libreadline5-dev as requested by Matthias Klose. - Closes: #326316 - - Applied fix for changed output format of SHOW MASTER LOGS for - binary log rotation (thanks to Martin Krueger). Closes: #326427, #326427 - - Removed explicit setting of $PATH as I saw no sense in it and - it introduced a bug (thanks to Quim Calpe). Closes: #326769 - - Removed PID file creation from /etc/init.d/mysql-ndb as it does - not work with this daemon (thanks to Quim Calpe). - - Updated French Debconf translation (thanks to Christian Perrier). - Closes: #324805 - - Moved conflicts line in debian/control from libmysqlclient15 to - libmysqlclient15-dev and removed some pre-sarge conflicts as - suggested by Adam Majer. Closes: #324623 - * Sean Finney: - - For posterity, CAN-2005-2558 has been fixed since 5.0.7beta. - - -- Christian Hammers Thu, 15 Sep 2005 19:58:22 +0200 - -mysql-dfsg-5.0 (5.0.11beta-3) unstable; urgency=low - - * Temporarily build only with -O2 to circumvent gcc internal errors - (thanks to Matthias Klose). Related to: #321165 - - -- Christian Hammers Thu, 18 Aug 2005 15:44:04 +0200 - -mysql-dfsg-5.0 (5.0.11beta-2) unstable; urgency=low - - * Fixed README.Debian regarding the status of mysql-doc. - * Added "set +e" around chgrp in mysql-server-5.0.preinst to - not fail on .journal files (thanks to Christophe Nowicki). - Closes: #318435 - - -- Christian Hammers Sun, 14 Aug 2005 18:02:08 +0200 - -mysql-dfsg-5.0 (5.0.11beta-1) unstable; urgency=low - - * New upstream version. - * Added Danish Debconf translations (thanks to Claus Hindsgaul). - Closes: #322384 - * Updated Czech Debconf translations (thanks to Miroslav Kure). - Closes: #321765 - - -- Christian Hammers Sat, 13 Aug 2005 11:56:15 +0000 - -mysql-dfsg-5.0 (5.0.10beta-1) unstable; urgency=low - - * New upstream release. - * Christian Hammers: - - Added check for mounted /proc to debian/rules. - * Sean Finney: - - fix for fix_mysql_privilege_tables/mysql_fix_privilege_tables typo - in mysql-server-5.0's README.Debian (see #319838). - - -- Christian Hammers Sun, 31 Jul 2005 00:30:45 +0200 - -mysql-dfsg-5.0 (5.0.7beta-1) unstable; urgency=low - - * Second try for new upstream release. - * Renamed mysql-common-5.0 to mysql-common as future libmysqlclient16 - from e.g. MySQL-5.1 would else introduce mysql-common-5.1 which makes - a simultanous installation of libmysqlclient14 impossible as that - depends on either mysql-common or mysql-common-5.0 but not on future - versions. Thus we decided to always let the newest MySQL version - provide mysql-common. - * Added ${misc:Depends} as suggested by debhelper manpage. - * Raised standard in control file to 3.6.2. - * Removed DH_COMPAT from rules in faviour of debian/compat. - * Checkes for presence of init script before executing it in preinst. - Referres: 315959 - * Added 60_includes_mysys.h__gcc40.dpatch for GCC-4.0 compatibility. - - -- Christian Hammers Wed, 29 Jun 2005 00:39:05 +0200 - -mysql-dfsg-5.0 (5.0.5beta-1) unstable; urgency=low - - * New major release! Still beta so be carefull... - * Added federated storage engine. - - -- Christian Hammers Wed, 8 Jun 2005 19:29:45 +0200 - -mysql-dfsg-4.1 (4.1.12-1) unstable; urgency=low - - * Christian Hammers: - - New upstream release. - - Disabled BerkeleyDB finally. It has been obsoleted by InnoDB. - * Sean Finney: - - Updated French translation from Christian Perrier (Closes: #310526). - - Updated Japanese translation from Hideki Yamane (Closes: #310263). - - Updated Russian translation from Yuriy Talakan (Closes: #310197). - - -- Christian Hammers Sat, 4 Jun 2005 05:49:11 +0200 - -mysql-dfsg-4.1 (4.1.11a-4) unstable; urgency=high - - * Fixed FTBFS problem which was caused due to the fact that last uploads - BerkeleyDB patch was tried to applied on all architectures and not only - on those where BerkeleyDB is actually beeing built. Closes: #310296 - - -- Christian Hammers Mon, 23 May 2005 00:54:51 +0200 - -mysql-dfsg-4.1 (4.1.11a-3) unstable; urgency=high - - * Added patch from Piotr Roszatycki to compile the bundled db3 library - that is needed for the BerkeleyDB support with versioned symbols so - that mysqld no longer crashes when it gets linked together with the - Debian db3 version which happens when e.g. using libnss-db. - Closes: #308966 - - -- Christian Hammers Thu, 19 May 2005 01:41:14 +0200 - -mysql-dfsg-4.1 (4.1.11a-2) unstable; urgency=high - - * Okay, the hackery with /var/lib/dpkg/info/mysql-server.list will not - stand and is removed from the preinst of mysql-server. - * New workaround for the symlink problem that does not involve mucking - with dpkg's file lists is storing the symlinks in a temporary location - across upgrades. - As this sometimes fails since apt-get does not always call new.preinst - before old.postrm, some remarks were added to README.Debian and the - Debconf installation notes to minimize the inconvinience this causes. - - -- sean finney Sun, 15 May 2005 10:25:31 -0400 - -mysql-dfsg-4.1 (4.1.11a-1) unstable; urgency=high - - * Added the "a" to the version number to be able to upload a new - .orig.tar.gz file which now has the non-free Docs/ directory removed - as this has been forgotten in the 4.1.11 release (thanks to Goeran - Weinholt). Closes: #308691 - * The Woody package listed /var/lib/mysql and /var/log/mysql in its - /var/lib/dpkg/info/mysql-server.list. These directories are often - replaced by symlinks to data partitions which triggers a dpkg bug - that causes these symlinks to be removed on upgrades. The new preinst - prevents this by removing the two lines from the .list file - (thanks to Andreas Barth and Jamin W. Collins). See dpkg bug #287978. - * Updated French Debconf translation (thanks to Christian Perrier). - Closes: #308353 - - -- Christian Hammers Thu, 12 May 2005 21:52:46 +0200 - -mysql-dfsg-4.1 (4.1.11-3) unstable; urgency=high - - * The "do you want to remove /var/lib/mysql when purging the package" flag - from old versions is removed once this package is beeing installed so - that purging an old Woody mysql-server package while having a - mysql-server-4.1 package installed can no longer lead to the removal of - all databases. Additionaly clarified the wording of this versions Debconf - template and added a check that skips this purge in the postrm script - if another mysql-server* package has /usr/sbin/mysqld installed. - (thanks to Adrian Bunk for spotting that problem) Closes: #307473 - * Cronfile was not beeing installed as the filename was not in the - correct format for "dh_installcron --name" (thanks to Tomislav - Gountchev). Closes: #302712 - - -- Christian Hammers Sat, 23 Apr 2005 22:55:15 +0200 - -mysql-dfsg-4.1 (4.1.11-2) unstable; urgency=low - - * Sean Finney: - - don't freak out if we can't remove /etc/mysql during purge. - - debian/rules clean works again. - * Christian Hammers: - - Fixed typo in README.Debian (thanks to Joerg Rieger). Closes: #304897 - - Completely removed the passwordless test user as it was not only - insecure but also lead to irritations as MySQL checks first the - permissions of this user and then those of a password having one. - See bug report from Hilko Bengen for details. Closes: #301741 - - -- Christian Hammers Sat, 16 Apr 2005 15:55:00 +0200 - -mysql-dfsg-4.1 (4.1.11-1) unstable; urgency=low - - * New upstream version. - * Upstream fix for charset/collation problem. Closes: #282256 - * Upstream fix for subselect crash. Closes: #297687 - * Corrected minor issue in Debconf template regarding skip-networking - (thanks to Isaac Clerencia). Closes: #303417 - * Made dependency to gawk unnecessary (thanks to Zoran Dzelajlija). - Closes: #302284 - * Removed obsolete 50_innodb_mixlen.dpatch. - * Removed obsolete 51_CAN-2004-0957_db_grant_underscore.dpatch. - - -- Christian Hammers Fri, 8 Apr 2005 00:23:53 +0200 - -mysql-dfsg-4.1 (4.1.10a-7) unstable; urgency=low - - * Sean Finney: - - fix for the mysteriously disappeared cronjob. thanks to - Peter Palfrader for pointing out this omission. - (closes: #302712). - - -- sean finney Sat, 02 Apr 2005 16:54:13 -0500 - -mysql-dfsg-4.1 (4.1.10a-6) unstable; urgency=high - - * Sean Finney: - - the previous upload did not completely address the issue. this one - should do so. d'oh. - - -- sean finney Thu, 31 Mar 2005 03:35:50 +0000 - -mysql-dfsg-4.1 (4.1.10a-5) unstable; urgency=high - - * Sean Finney: - - the following security issue is addressed in this upload: - CAN-2004-0957 (grant privilege escalation on tables with underscores) - thanks to sergei at mysql for all his help with this. - - -- sean finney Wed, 30 Mar 2005 21:19:26 -0500 - -mysql-dfsg-4.1 (4.1.10a-4) unstable; urgency=low - - * Sean Finney: - - FTBFS fix for amd64/gcc-4.0. Thanks to Andreas Jochens - for reporting this (closes: #301807). - - ANSI-compatible quoting fix in daily cron job. thanks to - Karl Hammar for pointing out the problem in - the 4.0 branch. - - Added myself as a co-maintainer in the control file (closes: #295312). - - -- sean finney Tue, 29 Mar 2005 18:54:42 -0500 - -mysql-dfsg-4.1 (4.1.10a-3) unstable; urgency=low - - * BerkeleyDB is now disabled by default as its use is discouraged by MySQL. - * Added embedded server libraries as they finally do compile. - They are currently in libmysqlclient-dev as they are still - experimental and only available as .a library (thanks to Keith Packard). - Closes: #297062 - * Fixed obsolete "tail" syntax (thanks to Sven Mueller). Closes: #301413 - * Added CAN numbers for the latest security bugfix upload. - * Updated manpage of mysqlmanager (thanks to Justin Pryzby). Closes: #299844 - * Added comments to default configuration. - - -- Christian Hammers Sun, 20 Mar 2005 17:40:18 +0100 - -mysql-dfsg-4.1 (4.1.10a-2) unstable; urgency=low - - * Disabled "--with-mysqld-ldflags=-all-static" as it causes sig11 crashes - if LDAP is used for groups in /etc/nsswitch.conf. Confirmed by Sean Finney - and Daniel Dehennin. Closes: #299382 - - -- Christian Hammers Mon, 14 Mar 2005 03:01:03 +0100 - -mysql-dfsg-4.1 (4.1.10a-1) unstable; urgency=high - - * SECURITY: - - The following security related updates are addressed: - CAN-2005-0711 (temporary file creation with "CREATE TEMPORARY TABLE") - CAN-2005-0709 (arbitrary library injection in udf_init()) - CAN-2005-0710 (arbitrary code execution via "CREATE FUNCTION") - Closes: #299029, #299031, #299065 - * New Upstream Release. - - Fixes some server crash conditions. - - Upstream includes fix for TMPDIR overriding my.cnf tmpdir setting - Closes: #294347 - - Fixes InnoDB error message. Closes: #298875 - - Fixes resouce limiting. Closes: #285044 - * Improved checking whether or not the server is alive in the init script - which should make it possible to run several mysqld instances in - different chroot environments. Closes: #297772 - * Fixed cron script name as dots are not allowed (thanks to Michel - v/d Ven). Closes: #298447 - * Added -O3 and --with-mysqld-ldflags=-all-static as MySQL recommends to - build the server binary statically in order to gain about 13% more - performance (thanks to Marcin Kowalski). - * Added patch to let mysqld_safe react to signals (thanks to Erich - Schubert). Closes: #208364 - * (Thanks to Sean Finney for doing a great share of work for this release!) - - -- Christian Hammers Thu, 3 Mar 2005 02:36:39 +0100 - -mysql-dfsg-4.1 (4.1.10-4) unstable; urgency=medium - - * Fixed bug that prevented MySQL from starting after upgrades. - Closes: #297198, #296403 - * Added comment about logging to syslog to the default my.cnf - and the logrotate script (thanks to Ryszard Lach). Closes: #295507 - - -- Christian Hammers Thu, 3 Mar 2005 00:28:02 +0100 - -mysql-dfsg-4.1 (4.1.10-3) unstable; urgency=low - - * Sean Finney: Cronjobs now exit silently when the server package - has been removed but not purged (thanks to Vineet Kumar). - Closes: #297404 - * Fixed comments of /etc/mysql/debian-log-rotate.conf (thanks to - Philip Ross). Closes: #297467 - * Made mysqld_safe reacting sane on signals (thanks to Erich Schubert). - Closes: #208364 - - -- Christian Hammers Tue, 1 Mar 2005 19:44:34 +0100 - -mysql-dfsg-4.1 (4.1.10-2) unstable; urgency=low - - * Converted to dpatch. - * debian/ is now maintained via Subversion on svn.debian.org. - - -- Christian Hammers Tue, 1 Mar 2005 02:16:36 +0100 - -mysql-dfsg-4.1 (4.1.10-1) unstable; urgency=low - - * New upstream version. - * Upstream fixed memleak bug. Closes: #205587 - * Added debian/copyright.more for personal reference. - * Lowered default query cache size as suggested by Arjen from MySQL. - * Switched from log to log-bin as suggested by Arjen from MySQL. - * Fixed typo in my.cnf (thanks to Sebastian Feltel). Closes: #295247 - * Replaced --defaults-extra-file by --defaults-file in Debian scripts - as former lets password/host etc be overwriteable by /root/.my.cnf. - Added socket to /etc/mysql/debian.cnf to let it work. (thanks to - SATOH Fumiyasu). Closes: #295170 - - -- Christian Hammers Tue, 15 Feb 2005 23:47:02 +0100 - -mysql-dfsg-4.1 (4.1.9-4) unstable; urgency=low - - * Improved the way mysqld is started and registered with update-rc.d - in cases where the admin modifies the runlevel configuration. - Most notably removed the debconf question whether or not mysql should - start on when booting. Closes: #274264 - * Renamed configuration option old-passwords to the more preferred - naming convention old_passwords. Same for some others (thanks to - Patrice Pawlak). Closes: #293983 - - -- Christian Hammers Tue, 8 Feb 2005 02:21:18 +0100 - -mysql-dfsg-4.1 (4.1.9-3) unstable; urgency=low - - * Renamed ca_ES.po to ca.po to reach a broader audience (thanks to - Christian Perrier). Closes: #293786 - * Expicitly disabled mysqlfs support as it has never been enabled by - configure during the autodetection but fails due to broken upstream - code when users try to build the package theirselves while having - liborbit-dev installed which triggers the mysqlfs autodetection - (thanks to Max Kellermann). Closes: #293431 - * Added dependencies to gawk as one script does not work with original-awk - (thanks to Petr Ferschmann). Closes: #291634 - - -- Christian Hammers Sun, 6 Feb 2005 23:33:11 +0100 - -mysql-dfsg-4.1 (4.1.9-2) unstable; urgency=high - - * SECURITY: - For historical reasons /usr/share/mysql/ was owned and writable by - the user "mysql". This is a security problem as some scripts that - are run by root are in this directory and could be modified and used - by a malicious user who already has mysql privileges to gain full root - rights (thanks to Matt Brubeck). Closes: #293345 - * Changed "skip-networking" to "bind-address 127.0.0.1" which is more - compatible and not less secure but maybe even more, as less people enable - networking for all interfaces (thanks to Arjen Lentz). - * Enabled InnoDB by default as recommended by Arjen Lentz from MySQL. - * Added remarks about hosts.allow to README.Debian (thanks to David - Chappell). Closes: #291300 - * mysql-server-4.1 now provides mysql-server (thanks to Paul van den Berg). - Closes: #287735 - - -- Christian Hammers Wed, 2 Feb 2005 23:31:55 +0100 - -mysql-dfsg-4.1 (4.1.9-1) unstable; urgency=low - - * New upstream version. - * mysql-client-4.1 now provides "mysql-client" so that packages depending - on mysql-client (ca. 40) can now be used with MySQL-4.1, too. - - -- Christian Hammers Sun, 23 Jan 2005 22:52:48 +0100 - -mysql-dfsg-4.1 (4.1.8a-6) unstable; urgency=high - - * SECURITY: - Javier Fernandez-Sanguino Pena from the Debian Security Audit Project - discovered a temporary file vulnerability in the mysqlaccess script of - MySQL that could allow an unprivileged user to let root overwrite - arbitrary files via a symlink attack and could also could unveil the - contents of a temporary file which might contain sensitive information. - (CAN-2005-0004, http://lists.mysql.com/internals/20600) Closes: #291122 - - -- Christian Hammers Tue, 18 Jan 2005 23:11:48 +0100 - -mysql-dfsg-4.1 (4.1.8a-5) unstable; urgency=medium - - * Fixed important upstream bug that causes from_unixtime(0) to return - NULL instead of "1970-01-01 00:00:00" which fails on NOT NULL columns. - Closes: #287792 - * Fixes upstream bug in mysql_list_fields() . Closes: #282486 - * Fixes bug that lead to double rotated logfiles when mysql-server 4.0 - was previously installed (thanks to Olaf van der Spek). Closes: #289851 - * Fixed typo in README.Debian (thanks to Mark Nipper). Closes: #289131 - * Changed max_allowed_packet in my.cnf to 16M as in 4.0.x (thanks to - Olaf van der Spek). Closes: #289840 - * Updated French debconf translation (thanks to Christian Perrier). - Closes: #287955 - - -- Christian Hammers Thu, 13 Jan 2005 01:29:05 +0100 - -mysql-dfsg-4.1 (4.1.8a-4) unstable; urgency=low - - * Broken patch again :-( - - -- Christian Hammers Sun, 9 Jan 2005 23:47:55 +0100 - -mysql-dfsg-4.1 (4.1.8a-3) unstable; urgency=low - - * The mutex patch was a bit too x86 centric. This broke the alpha build. - - -- Christian Hammers Sun, 9 Jan 2005 14:18:49 +0100 - -mysql-dfsg-4.1 (4.1.8a-2) unstable; urgency=medium - - * Some Makefiles that were patched by me got overwritten by the GNU - autotools, probably because I also patched ./configure. Fixed now, - the critical mutex patch is now back in again. Closes: #286961 - * Added patch to make MySQL compile on ARM (thanks to Adam Majer). - Closes: #285071 - - -- Christian Hammers Thu, 6 Jan 2005 09:30:13 +0100 - -mysql-dfsg-4.1 (4.1.8a-1) unstable; urgency=medium - - * Upstream 4.1.8 had some problems in their GNU Autotools files so they - released 4.1.8a. Debian's 4.1.8 was fixed by running autoreconf but this - again overwrote MySQL changes to ltmain.sh which are supposed to fix some - problems on uncommon architectures (maybe the FTBFS on alpha, arm, m68k - and sparc?). - * libmysqlclient_r.so.14 from 4.1.8-3 also missed a link dependency to - libz which lead to unresolved symbols visible with "ldd -r" (thanks - to Laurent Bonnaud). Closes: #287573 - - -- Christian Hammers Wed, 29 Dec 2004 14:26:33 +0100 - -mysql-dfsg-4.1 (4.1.8-3) unstable; urgency=low - - * Fixed checking for error messages by forcing english language - output by adding LC_ALL=C to debian-start (thanks to Rene - Konasz) Closes: #285709 - * Fixed bashisms in Debian scripts. Closes: #286863 - * Updated Japanese Debconf translation (thanks to Hideki Yamane). - Closes: #287003 - * Improved 4.0 to 4.1 upgrade if /var/lib/mysql is a symlink - (thanks to Thomas Lamy). Closes: #286560 - * Added patch for FTBFS problem where no LinuxThreads can be found. - I don't know if this still applies but it should not hurt. - The patch is debian/patches/configure__AMD64-LinuxThreads-vs-NPTL.diff - - -- Christian Hammers Sun, 26 Dec 2004 14:04:20 +0100 - -mysql-dfsg-4.1 (4.1.8-2) unstable; urgency=low - - * If /var/lib/mysql is a symlink then it is kept as such. - * Added the old-passwords option to the default my.cnf to stay - compatible to clients that are still compiled to libmysqlclient10 - and libmysqlclient12 for licence reasons. - * Adjusted tetex build-deps to ease backporting (thanks to Norbert - Tretkowski from backports.org). - - -- Christian Hammers Tue, 21 Dec 2004 01:00:27 +0100 - -mysql-dfsg-4.1 (4.1.8-1) unstable; urgency=medium - - * New upstream version. Closes: #286175 - * Added conflict to libmysqlclient-dev (thanks to Adam Majer). - Closes: #286538 - * Added debconf-updatepo to debian/rules:clean. - * Updated Japanese Debconf translation (thanks to Hideki Yamane). - Closes: #285107 - * Updated French Debconf translation (thanks to Christian Perrier). - Closes: #285977 - * Renamed cz.po to cs.po (thanks to Miroslav Kure). Closes: #285438 - * Aplied patch for changed server notice to debian-start (thanks to - Adam Majer). Closes: #286035 - * Changed nice value in default my.cnf as nohup changed its behaviour - (thanks to Dariush Pietrzak). Closes: #285446 - * Increased verbosity of preinst script in cases where it cannot stop - a running server (thanks to Jan Minar). Closes: #285982 - * Splitted the code parts of /etc/mysql/debian-start to - /usr/share/mysql/debian-start.inc.sh (thanks to Jan Minar). - Closes: #285988 - - -- Christian Hammers Mon, 20 Dec 2004 00:33:21 +0100 - -mysql-dfsg-4.1 (4.1.7-4) unstable; urgency=medium - - * Removed OpenSSL support. - After a short discussion with MySQL, I decided to drop OpenSSL support as - 1. MySQL started shipping their binaries without it, too and do not - seem to support it in favour of using a different library somewhen. - 2. MySQL did not adjust their licence to grant permission to link - against OpenSSL. - 3. Even if they did, third parties who use libmysqlclient.so often - do not realise licencing problems or even do not want OpenSSL. - (thanks to Jordi Mallach and the responders to MySQL bug #6924) - Closes: #283786 - * debian/control: Improved depends and conflicts to mysql-4.0. - - -- Christian Hammers Thu, 2 Dec 2004 22:02:28 +0100 - -mysql-dfsg-4.1 (4.1.7-3) unstable; urgency=low - - * Raised version to make it higher as the one in experimental. - - -- Christian Hammers Wed, 1 Dec 2004 21:09:20 +0100 - -mysql-dfsg-4.1 (4.1.7-2) unstable; urgency=low - - * Patched scripts/mysql_install_db so that it no longer creates a - passwordless test database during installation (thanks to Patrick - Schnorbus). Closes: #281158 - * Added Czech debconf translation (thanks to Miroslav Kure). - Closes: #283222 - - -- Christian Hammers Wed, 1 Dec 2004 01:29:31 +0100 - -mysql-dfsg-4.1 (4.1.7-1) unstable; urgency=low - - * New upstream branch! - * Adjusted debian/control to make this package suitable to get parallel - to version 4.0.x into unstable and sarge. The package names are - different so that "mysql-server" still defaults to the rock-stable - 4.0 instead to this announced-to-be-stable 4.1. - * Added --with-mutex=i86/gcc-assemler to the Berkeley-DB configure - to prevent the use of NPLT threads when compiling under kernel 2.6 - because the binaries are else not runable on kernel 2.4 hosts. - Closes: #278638, #274598 - - -- Christian Hammers Sun, 31 Oct 2004 20:15:03 +0100 - -mysql-dfsg (4.1.6-1) experimental; urgency=low - - * New upstream version. - * Fixed symlinks in libmysqlclient-dev package. Closes: #277028 - * This time I did not update the libtool files as they were pretty - up to date and I want to have a shorter diff file. - - -- Christian Hammers Wed, 20 Oct 2004 00:07:58 +0200 - -mysql-dfsg (4.1.5-3) experimental; urgency=low - - * debian/postinst: mysql_install_db changed parameter from --IN-RPM - to --rpm which caused problems during installs. Closes: #276320 - - -- Christian Hammers Sat, 16 Oct 2004 20:36:46 +0200 - -mysql-dfsg (4.1.5-2) experimental; urgency=low - - * Activated support for ndb clustering (thanks to Kevin M. Rosenberg). - Closes: #275109 - - -- Christian Hammers Wed, 6 Oct 2004 01:58:00 +0200 - -mysql-dfsg (4.1.5-1) experimental; urgency=low - - * WARNING: - The upstream branch 4.1 is still considered BETA. - The Debian packages for 4.1 were done without big testing. If you miss - a new functionality or binary, contact me and I check add the relevant - configure option or include the program. - * New MAJOR upstream version. - Thanks to the great demand here's now the first MySQL 4.1 experimental - release. FEEDBACK IS WELCOME. - * 4.0->4.1 notes: - - debian/patches/alpha.diff could not be applied, I fix that later - - debian/patches/scripts__mysql_install_db.sh.diff was obsolete - - debian/patches/scripts__Makefile.in was neccessary due to a dependency - to the removed non-free Docs/ directory. Upstream has been contacted. - - Build-Deps: += automake1.7 - - debian/rules: embedded servers examples did not compile, removed - - -- Christian Hammers Sun, 26 Sep 2004 19:46:47 +0200 - -mysql-dfsg (4.0.21-3) unstable; urgency=low - - * Upstream tried to fix a security bug in mysqlhotcopy and broke it :-) - Applied a patch (see debian/patches) from Martin Pitt. Closes: #271632 - * Between 4.0.20 and 4.0.21 the Debian specific changes in - /usr/bin/mysqld_safe that piped the error log to syslog got lost - and are now back again. - * Fixed capitalization in debconf headings. - * Changed wording of the initscript status message to make heartbeat - happier. Closes: #271591 - - -- Christian Hammers Fri, 17 Sep 2004 18:42:25 +0200 - -mysql-dfsg (4.0.21-2) unstable; urgency=medium - - * The dependencies between mysql-client and libmysqlclient12 were - too loose, when upgrading only the client this can lead to non working - binaries due to relocation errors (thanks to Dominic Cleal). - Closes: #271803 - * Fixed typo in mysqldump.1 manpage (thanks to Nicolas Francois). - Closes: #271334 - - -- Christian Hammers Wed, 15 Sep 2004 15:38:11 +0200 - -mysql-dfsg (4.0.21-1) unstable; urgency=high - - * SECURITY: - This upstream version fixes some security problems that might at least - allow a DoS attack on the server. - * Fixed an old bug in concurrent accesses to `MERGE' tables (even - one `MERGE' table and `MyISAM' tables), that could've resulted in - a crash or hang of the server. (Bug #2408) - * Fixed bug in privilege checking where, under some conditions, one - was able to grant privileges on the database, he has no privileges - on. (Bug #3933) - * Fixed crash in `MATCH ... AGAINST()' on a phrase search operator - with a missing closing double quote. (Bug #3870) - * Fixed potential memory overrun in `mysql_real_connect()' (which - required a compromised DNS server and certain operating systems). - (Bug #4017) - * New upstream version. - * Fixes bug that made x="foo" in WHERE sometimes the same as x="foo ". - Closes: #211618 - * Updated Japanese Debconf translation (thanks to Hideki Yamane). - Closes: #271097 - - -- Christian Hammers Sat, 11 Sep 2004 23:15:44 +0200 - -mysql-dfsg (4.0.20-14) unstable; urgency=low - - * Dave Rolsky spottet that -DBIG_JOINS was not properly enabled. - It allowes joining 64 instead of an 32 tables to join. - - -- Christian Hammers Thu, 9 Sep 2004 20:24:02 +0200 - -mysql-dfsg (4.0.20-13) unstable; urgency=medium - - * Fixed a bug in the initscript which caused the check for not properly - closed i.e. corrupt tables that is executed when the server starts - not to run in background as supposed. - Although the check does not repair anything on servers with several - thousand tables the script was reported to take some minutes which - is quite annoying. (Thanks to Jakob Goldbach). Closes: #270800 - - -- Christian Hammers Thu, 9 Sep 2004 17:11:05 +0200 - -mysql-dfsg (4.0.20-12) unstable; urgency=medium - - * Filter messages regarding table handles that do not support CHECK TABLE - in the script that checks for corrupted tables on every start which lead - to unnecessary mails (thanks to David Everly). Closes: #269811 - * Added a note to the corrupt-table-check mail which notes that a - false-positive is reported in the case that immediately after starting - the server a client starts using a table (thanks to Uwe Kappe). - Closes: #269985 - * Added "quote-names" as default to the [mysqldump] section in - /etc/mysql/my.cnf as too many users stumble over dump files that - could not be read in again due to the valid use of reserved words - as table names. This has also be done by upstream in 4.1.1 and has - no known drawbacks. Closes: #269865 - * Binary logs can now be rotated as well. Defaults to off, though, for - compatibilty reasons (thanks to Mark Ferlatte). Closes: #94230, #269110 - * The mysql user "debian-sys-maint" now gets all possible rights which - makes binary logging possible and helps other package maintainer who - wants to use it to create package specific databases and users. - * Added example how to change daemon nice level via /etc/mysql/my.cnf - * Updated French debconf translations (thanks to Christian Perrier). - Closes: #265811 - * Renamed options in the default config file that still had old names - (thanks to Yves Kreis). Closes: #266445 - * Fixed spelling in debconf note. - * Added -l and -L to dh_shlibdeps. - - -- Christian Hammers Fri, 3 Sep 2004 20:10:46 +0200 - -mysql-dfsg (4.0.20-11) unstable; urgency=high - - * SECURITY - This version fixes a security flaw in mysqlhotcopy which created - temporary files in /tmp which had predictable filenames and such - could be used for a tempfile run attack. - The issue has been recorded as CAN-2004-0457. - - -- Christian Hammers Sat, 14 Aug 2004 18:27:19 +0200 - -mysql-dfsg (4.0.20-10) unstable; urgency=low - - * MySQL finally updated their copyright page and installed v1.5 of - the "Free/Libre and Open Source Software License (FLOSS) - Exception" - which will hopefully end the license hell they created by putting the - client libraries under GPL instead of LGPL which conflicts with PHP and - other software that used to link against MySQL. - The license text is not yet in any release MySQL version but visible - on their web site and copied into the debian/copyright file. - Special thanks to Zak Greant and the debian-legal list - for helping to solve this release critical problem. - Closes: #242449 - * Updated Brazil debconf translation (thanks to Andre Luis Lopes). - Closes: #264233 - * Updated Japanese debconf translation (thanks to Hideki Yamane). - Closes: #264620 - * Fixed minor typo in debconf description (thanks to TROJETTE Mohammed - Adnene). Closes: #264840 - * Improved init and preinst script which now detects stalled servers which - do no longer communicate but are present in the process list (thanks to - Henrik Johansson). Closes: #263215 - - -- Christian Hammers Mon, 9 Aug 2004 19:44:28 +0200 - -mysql-dfsg (4.0.20-9) unstable; urgency=medium - - * Partly reverted the last patch which gave the mysql-user - "debian-sys-maint" more rights as there are old versions of MySQL which - have fewer privlige columns. Now only those are set (thanks to Alan Tam). - Closes: #263111 - - -- Christian Hammers Tue, 3 Aug 2004 13:03:02 +0200 - -mysql-dfsg (4.0.20-8) unstable; urgency=low - - * The mysqlcheck that is started from the initscript will now be - backgrounded because it might else prevent the boot process to continue. - It also now notifies root by mail and syslog if a table is corrupt. - * The "debian-sys-maint" MySQL user now has almost full rights so that other - packages might use this account to create databases and user (thanks to - Andreas Barth). Closes: #262541 - * Added paranoid rules for logcheck. - - -- Christian Hammers Sun, 1 Aug 2004 21:00:55 +0200 - -mysql-dfsg (4.0.20-8) unstable; urgency=low - - * Upload stalled. Not released. - - -- Christian Hammers Sun, 1 Aug 2004 20:27:55 +0200 - -mysql-dfsg (4.0.20-7) unstable; urgency=medium - - * Solved the upstream bug that error messages of the server are written - in a file that is then rotated away leaving mysqld logging effectively - to /dev/null. It now logs to a /usr/bin/logger process which puts the - messages into the syslog. - Modified files: /etc/init.d/mysql, /usr/bin/mysqld_safe and the - logchecker files. Closes: #254070 - * The initscript does no longer call mysqlcheck directly but via - /etc/mysql/debian-start which is a user customizable config script. - * Splitted the debconf "install and update notes" and only show them - when it is appropriate (thanks to Steve Langasek). Closes: #240515 - * Added NEWS.Debian. - * Added hint to -DBIG_ROWS, which is currently not used, to README.Debian. - * Corrected typo in myisampack manpage (thanks to Marc Lehmann). - Closes: #207090 - * Added Catalan debconf translation (thanks to Aleix Badia i Bosch). - Closes: #236651 - - -- Christian Hammers Wed, 28 Jul 2004 01:41:51 +0200 - -mysql-dfsg (4.0.20-6) unstable; urgency=low - - * The build arch detected by configure was "pc-linux-gnu (i686)" - instead of "pc-linux-gnu (i386)". Was no problem AFAIK but - Adam Majer asked me to explicitly change it to i386. Closes: #261382 - * Removed some unused shell scripts from /usr/share/mysql. - * Added lintian overrides. - * Removed rpath by using chrpath. - - -- Christian Hammers Mon, 26 Jul 2004 00:17:12 +0200 - -mysql-dfsg (4.0.20-5) unstable; urgency=medium - - * The mysqlcheck in the init script is only called when the server - is really alive. Also, the mysql-user 'debian-sys-maint' now has - global select rights (thanks to Nathan Poznick). Closes: #261130 - * Moved the debconf question whether to remove the databases or not - from mysql-server.config to mysql-server.postrm so that it shows - up on purge time and not months earlier (thanks to Wouter Verhelst). - Closes: #251838 - - -- Christian Hammers Fri, 23 Jul 2004 22:41:13 +0200 - -mysql-dfsg (4.0.20-4) unstable; urgency=low - - * Added a "mysqlcheck -A --fast" to the 'start' section of the - init script to help admins detect corrupt tables after a server crash. - Currently it exists with an error message but leaves the server - running. Feedback appreciated! - * Made postinst script more robust by calling db_stop earlier and - so prevent pipe-deadlocks. - * Fixed minor typos in initscript (thanks to "C.Y.M."). Closes: 259518 - * Added the undocumented "-DBIG_JOINS" that MySQL apparently uses in - their MAX binaries. It enables 62 instead of 30 tables in a "join". - (thanks to Dave Rolsky). Closes: #260843 - * Added a "df --portability /var/lib/mysql/." check to the preinst - script as users experienced hard to kill hanging mysqlds in such - a situation (thanks to Vaidas Pilkauskas). Closes: #260306 - - -- Christian Hammers Fri, 23 Jul 2004 00:51:32 +0200 - -mysql-dfsg (4.0.20-3) unstable; urgency=low - - * Improved tolerance if the init script has been deleted (thanks to - Leonid Shulov for spotting the problem). - * Minor wording changes to README.Debian generalizing /root/ by $HOME - (thanks to Santiago Vila). Closes: #257725 - * Added Japanese debconf translation (thanks to Hideki Yamane). - Closes: #256485 - * Fixed commend in my.cnf regarding logfile directory (thanks to Jayen - Ashar). Closes: #253434 - * Correted "ease to" by "ease of" in package description (thanks to - Johannes Berg). Closes: #253510 - - -- Christian Hammers Fri, 9 Jul 2004 00:57:42 +0200 - -mysql-dfsg (4.0.20-2) unstable; urgency=low - - * Removed RPM .spec file from the included documentation as it is pretty - useless (thanks to Loic Minier). - * Added turkish debconf translation (thanks to Recai Oktas). Closes: #252802 - - -- Christian Hammers Sun, 6 Jun 2004 14:48:26 +0200 - -mysql-dfsg (4.0.20-1) unstable; urgency=low - - * New upstream version. - - -- Christian Hammers Mon, 31 May 2004 23:36:39 +0200 - -mysql-dfsg (4.0.18-8) unstable; urgency=low - - * Updated french translation (thanks to Christian Perrier). Closes: #246789 - - -- Christian Hammers Tue, 4 May 2004 23:26:54 +0200 - -mysql-dfsg (4.0.18-7) unstable; urgency=low - - * Added CVE ids for the recent security fixes. - 4.0.18-4 is CAN-2004-0381 (mysqlbug) and - 4.0.18-6 is CAN-2004-0388 (mysql_multi) - - -- Christian Hammers Mon, 19 Apr 2004 18:32:03 +0200 - -mysql-dfsg (4.0.18-6) unstable; urgency=medium - - * SECURITY: - Fixed minor tempfile-run security problem in mysqld_multi. - Unprivileged users could create symlinks to files which were then - unknowingly overwritten by run when this script gets executed. - Upstream informed. Thanks to Martin Schulze for finding this. - - -- Christian Hammers Wed, 7 Apr 2004 01:28:22 +0200 - -mysql-dfsg (4.0.18-5) unstable; urgency=low - - * Little improvements in debian scripts for last upload. - * Added check to logrotate script for the case that a mysql - server is running but not be accessible with the username and - password from /etc/mysql/debian.conf (thanks to Jeffrey W. Baker). - Closes: 239421 - - -- Christian Hammers Sun, 4 Apr 2004 15:27:40 +0200 - -mysql-dfsg (4.0.18-4) unstable; urgency=medium - - * SECURITY: - Aplied fix for unprobable tempfile-symlink security problem in - mysqlbug reported by Shaun Colley on bugtraq on 2004-03-24. - * Updated french debconf translation (thanks to Christian Perrier). - Closes: #236878 - * Updated portugesian debconf translation (thanks to Nuno Senica). - Closes: #239168 - * Updated german debconf translation (thanks to Alwin Meschede). - Closes: #241749 - * Improved debconf template regarding fix_privileges_tables (thanks - to Matt Zimmermann for suggestions). Closes: #219400 - * Improved README.Debian regarding to password settings (thanks to - Yann Dirson). Closes: #241328 - - -- Christian Hammers Sat, 3 Apr 2004 19:52:15 +0200 - -mysql-dfsg (4.0.18-3) unstable; urgency=medium - - * Added Build-Depend to po-debconf to let it build everywhere. - - -- Christian Hammers Wed, 31 Mar 2004 23:43:33 +0200 - -mysql-dfsg (4.0.18-2) unstable; urgency=low - - * Added a "2>/dev/null" to a "which" command as there are two - "which" versions in Debian of which one needs it. Closes: #235363 - - -- Christian Hammers Tue, 2 Mar 2004 23:31:28 +0100 - -mysql-dfsg (4.0.18-1) unstable; urgency=low - - * New upstream version. - * Should now compile and run on ia64 (thanks to Thorsten Werner and - David Mosberger-Tang). Closes: #226863 #228834 - * Converted init scripts to invoce-rc.d (thanks to Erich Schubert). - Closes: 232118 - * Secondlast upload changed logfile location. Closes: #182655 - * Updated Brasilian translation (thanks to Andre Luis Lopes). Closes: - #219847 - - -- Christian Hammers Tue, 17 Feb 2004 23:44:58 +0100 - -mysql-dfsg (4.0.17-2) unstable; urgency=low - - * Improved manpage for mysqldumpslow.1 (thanks to Anthony DeRobertis). - Closes: #231039 - * Improved stopping of crashed daemons in init script (thanks to - Matthias Urlichs). Closes: #230327 - - -- Christian Hammers Mon, 9 Feb 2004 21:54:29 +0100 - -mysql-dfsg (4.0.17-1) unstable; urgency=low - - * Made logging into /var/log/mysql/ the default. Closes: #225206 - - * New upstream version. Closes: #225028 - * Turned on a 25MB query cache by default (thanks to Cyril Bouthors). - Closes: #226789 - * Updated russian translation (thanks to Ilgiz Kalmetev). Closes: #219263 - * Upstream fixes the problem that AND was not commutative (thanks for - Iain D Broadfoot for mentioning). Closes: #227927 - * Fixed minor typo in my.cnf comments (thanks to James Renken). - Closes: #221496 - * Better documents regex. Closes: #214952 - * Fixed minor germanism in debconf template (thanks to Marc Haber). - Closes: #224148 - * Added explaining comment to my.cnf regarding quoted passwords - (Thanks to Patrick von der Hagen). Closes: #224906 - * Changed "find -exec" to "find -print0 | xargs -0" in preinst to - speed it up. Thanks to Cyril Bouthors. Closes: #220229 - - -- Christian Hammers Sun, 18 Jan 2004 16:16:25 +0100 - -mysql-dfsg (4.0.16-2) unstable; urgency=low - - * Tried to repair undefined weak symbols by adding a little Makefile - patch. Closes: #215973 - - -- Christian Hammers Mon, 27 Oct 2003 22:52:10 +0100 - -mysql-dfsg (4.0.16-1) unstable; urgency=low - - * New upstream release. - (Mostly little memory problems and other bugfixes it seems) - * Replaced "." by ":" in chown calls to comply with the env setting - "_POSIX2_VERSION=2000112" (thanks to Robert Luberda). Closes: #217399 - * Adjusted syntax in my.cnf to 4.x standard (thanks to Guillaume Plessis). - Closes: #217273 - * Improved README.Debian password instructions (thanks to Levi Waldron). - Closes: #215046 - * Improved NIS warning debconf-template (thanks to Jeff Breidenbach). - Closes: #215791 - * Explicitly added libssl-dev to the libmysqlclient-dev package as it - is needed for mysql_config and the libmysqlclient package only depends - on libssl which has no unnumbered .so version (thanks to Simon Peter - and Davor Ocelic). Closes: #214436, #216162 - * Added "-lwrap" to "mysql_config --libmysqld-libs" and filed it as - upstream bug #1650 (thanks to Noah Levitt). Closes: #214636 - - -- Christian Hammers Sat, 25 Oct 2003 01:09:27 +0200 - -mysql-dfsg (4.0.15a-1) unstable; urgency=low - - * Same package as 4.0.15-2 but I could not convince the Debian - installer to move the packages out of incoming. - - -- Christian Hammers Tue, 7 Oct 2003 15:10:26 +0200 - -mysql-dfsg (4.0.15-2) unstable; urgency=low - - * Updated package description (thanks to Adrian Bunk). Closes: #210988 - * Fixed small typos in manpages (thanks to Nicolas Francois). - Closes: #211983 - * More updates to package description (thanks to Matthias Lutz/ddtp). - Closes: #213456 - * Updated standards to 3.6.1. - * Closes "new 4.0.15 available" bug. Closes: #213349 - * Updated README.Debian with notes regarding the MySQL manual section - "2.4 Post-installation Setup and Testing" (thanks to Daniel B.). - Closes: #210841 - - -- Christian Hammers Fri, 3 Oct 2003 15:59:39 +0200 - -mysql-dfsg (4.0.15-1) unstable; urgency=high - - * SECURITY: - Users who are able to use the "ALTER TABLE" command on the "mysql" - database may be able to exploit this vulnerability to gain a shell with - the privileges of the mysql server (usually running as the 'mysql' user). - Closes: #210403 - * Fixes small description typos (thanks to Oscar Jarkvik). - * Updated Brazilian Portuguese debconf translation. (thanks to Andre Luis - Lopes). Closes: 208030 - * Replaced depricated '.' by ':' in chown (thanks to Matt Zimmerman). - * Fixed manpage typo (thanks to Marc Lehmann). Closes: #207090 - - -- Christian Hammers Fri, 3 Oct 2003 15:59:35 +0200 - -mysql-dfsg (4.0.14-1) unstable; urgency=low - - * New upstream version. - - -- Christian Hammers Sun, 24 Aug 2003 16:40:36 +0200 - -mysql-dfsg (4.0.13-3) unstable; urgency=low - - * Now start mysqld as default unless you choose not when configurig - with debconf priority low. So packages depending on the server when - installing can access it. Thanks Matt Zimmermann (Closes: #200277) - * Made mysql-server de-installable if the config and database files were - removed by hand before. Thanks to Ard van Breemen (Closes: #200304) - - -- Christian Hammers Tue, 8 Jul 2003 22:30:40 +0200 - -mysql-dfsg (4.0.13-2) unstable; urgency=low - - * Added "nice" option for mysqld_safe to give mysqld a different priority. - Submitted to upstream as MySQL Bug #627. Closes: #192087 - * Fixed possible unbound variable in init script. Closes: #194621 - * Fixed french debconf translation (thx Christian Perrier) Closes: #194739 - * Get rid of automake1.5 (for Eric Dorland). - - -- Christian Hammers Wed, 11 Jun 2003 18:58:32 +0200 - -mysql-dfsg (4.0.13-1) unstable; urgency=medium - - * New upstream version. - !!! Fixes a very bad natural join bug which justifies the urgency=medium. - !!! http://bugs.mysql.com/bug.php?id=291 - * Fixed mysql_fix_privileges manpage (Frederic Briere) Closes: #191776 - * preinst: "which" is more chatty normal executable than as builtin. - (Thanks to David B Harris). Closes: #188659 - - -- Christian Hammers Tue, 6 May 2003 22:03:45 +0200 - -mysql-dfsg (4.0.12-3) unstable; urgency=medium - - * Reincluded new way of creating my debian-sys-maint user from - an old release from experimental. Now works again with old - and new privilege table format. (Thanks to Vincent Danjean - for spotting the problem) Closes: #188201 - * Reincluded hurd build dependency fix from 3.23 branch. - (Thanks to Robert Millan). Closes: #185929 - * Fixed soname in libmysqlclient-dev. Closes: #188160 - * Remove /var/log/mysql/ when purging the package. Closes: #188064 - * Removed /usr/share/doc/mysql/ from mysql-server. Closes: #188066 - * Let group "adm" be able to read logfiles. Closes: #188067 - * Do not call usermod on every upgrade. Closes: #188248 - (Thanks to Philippe Troin for the last three) - * Fixed mysql-server.preinst so that it works on shells where - which is a builtin, too. (Thanks to Erich Schubert) Closes: #181525 - - -- Christian Hammers Fri, 11 Apr 2003 11:32:45 +0200 - -mysql-dfsg (4.0.12-2) unstable; urgency=low - - * - * NEW MAJOR UPSTREAM RELEASE: - * - MySQL 4 has finally been declared as 'stable'. Hurray! Read changelogs. - Thanks to all testers, esp. Jose Luis Tallon, of the versions - that were in the "experimental" section before. - * Modified postinst script to run mysql_fix_privileges on every update. - IMPORTANT: Please report if this breaks anything, it is not supposed to. - * Wrote a SSL-MINI-HOWTO.txt! - * Added zlib1g-dev to libmysqlclient12-dev. Closes: 186656 - * Changed section of libmysqlclient12-dev to libdevel. - * Added even more selfwritten manpages. - * Fixed typos. - - -- Christian Hammers Sun, 6 Apr 2003 13:47:32 +0200 - -mysql-dfsg (4.0.10.gamma-1) experimental; urgency=low - - * New upstream version. - * They merged some of my patches from debian/patches. Whoa! - * This release should fix the error-logfile problem where mysqld - keeps the error.log open while logrotate removes it. - - -- Christian Hammers Wed, 12 Feb 2003 22:39:48 +0100 - -mysql-dfsg (4.0.9.gamma-1) experimental; urgency=low - - * New upstream version. - * Updated the GNU autoconf files to make building on MIPS work. - See bug #176829. - - -- Christian Hammers Wed, 29 Jan 2003 22:07:44 +0100 - -mysql-dfsg (4.0.8.gamma-1) experimental; urgency=low - - * New upstream release. - * Improved logging of init script. Closes: #174790 - * We have now libmysqlclient.so.12 instead of .11. - - -- Christian Hammers Thu, 9 Jan 2003 20:14:11 +0100 - -mysql-dfsg (4.0.7.gamma-1) experimental; urgency=high - - * SECURITY: This version fixes an upstream security release that is only - present in the 4.x branch which is currently only in the - experimental distribution and therefore will not get a DSA. - * New upstream release. - - -- Christian Hammers Sat, 28 Dec 2002 15:51:39 +0100 - -mysql-dfsg (4.0.6.gamma-2) experimental; urgency=low - - * Added --system to addgroup. Closes: #173866 - - -- Christian Hammers Sat, 21 Dec 2002 15:28:26 +0100 - -mysql-dfsg (4.0.6.gamma-1) experimental; urgency=low - - * New upstream version. Now Gamma! - * There are no longer changes to the .orig.tar.gz neccessary to make diff - happy. docs/ has still to be deleted, although, as it is non-free. - * Incorporated patches from unstable. - * Added mysqlmanager and a couple of other new scripts. - * Enabled libmysqld embedded server library. - * Enabled SSL and Virtual-IO support. - (CORBA based MySQL-FS seems to be not existing..) - - -- Christian Hammers Fri, 20 Dec 2002 22:30:51 +0100 - -mysql-dfsg (4.0.5a.beta-3) experimental; urgency=low - - * Modified postinst to work with old and new mysql.user table format - and fixed spelling typo in postinst. Thanks to Roger Aich. - * Updated config.{guess,sub} to make the mipsel porters happy. - Thanks to Ryan Murray. Closes: #173553 - - -- Christian Hammers Wed, 18 Dec 2002 15:56:34 +0100 - -mysql-dfsg (4.0.5a.beta-2) experimental; urgency=low - - * Upstream removed option "--skip-gemini". So did I. Closes: 173142 - - -- Christian Hammers Tue, 17 Dec 2002 10:35:49 +0100 - -mysql-dfsg (4.0.5a.beta-1) experimental; urgency=low - - * First 4.x experimental package due to continuous user requests :-) - Please test and report! - * upstream: safe_mysqld has been renamed to mysqld_safe - * upstream: new library soname version libmysqlclient.so.11 - * Renamed libmysqlclientXX-dev to libmysqlclient-dev as I don't plan to - support more than one development environment and this makes the - dependencies easier. - * FIXME: Skipped parts of the debian/patches/alpha patch as the global.h - is not existing. - * FIXME: How to get rid this? Old ltconfig patch already applied. - "lintian: binary-or-shlib-defines-rpath ./usr/bin/mysql /usr/lib/mysql" - - -- Christian Hammers Sun, 1 Dec 2002 18:32:32 +0100 - -mysql-dfsg (3.23.53-4) unstable; urgency=medium - - * Fixed errno.h problem. Closes: #168533, #168535 - - -- Christian Hammers Sun, 10 Nov 2002 18:32:08 +0100 - -mysql-dfsg (3.23.53-3) unstable; urgency=medium - - * Changed automake build-dep to unversioned automake1.4. Closes: #166391 - * Fixed description. Closes: #167270 - (Thanks to Soren Boll Overgaard) - - -- Christian Hammers Tue, 5 Nov 2002 01:25:01 +0100 - -mysql-dfsg (3.23.53-2) unstable; urgency=low - - * Reverted user creation in init scripts. Closes: #166432 - (Thanks to Birzan George Cristian) - - -- Christian Hammers Thu, 31 Oct 2002 15:36:25 +0100 - -mysql-dfsg (3.23.53-1) unstable; urgency=low - - * New upstream release. - - -- Christian Hammers Thu, 24 Oct 2002 23:04:16 +0200 - -mysql-dfsg (3.23.52-3) unstable; urgency=low - - * Substituted the first-install 'debian-sys-maint' user creation by - something ANSI SQL compliant. Closes: #163497 - (Thanks to Karl Hammar) - * Tightend dependency to debhelper (>= 4.0.12) to be sure that - debconf-utils gets installed, too, as I use dh_installdebconf. - * Fixed upstream manpage bug in mysqldump.1. Closes: #159779 - (Thanks to Colin Watson) - * Added comment about MIN_WORD_LEN to mysql-server.README.Debian - (Thanks to Philipp Dreimann) - * Added a dependency for zlib1g-dev to libmysqlclient10-dev. - (Thanks to Jordi Mallach) - - -- Christian Hammers Sun, 15 Sep 2002 17:14:44 +0200 - -mysql-dfsg (3.23.52-2) unstable; urgency=low - - * Fixed typo in preinst scripts. - * Removed bashism in init script. - * Fixed ambiguous debconf example. Closes: #158884 - - -- Christian Hammers Fri, 30 Aug 2002 00:51:29 +0200 - -mysql-dfsg (3.23.52-1) unstable; urgency=low - - * New upstream version. Closes: #157731 - * Clearified the meaning of the debian-sys-maint special user in the - README.Debian file. Closes: #153702 - * Wrote some words regarding the skip-networking in README.Debian. - Closes: #157038 - * Added dependency to passwd. - * Fixes typo and unnecessarily complication in is_mysql_alive(). - * Added check for /etc/mysql/my.cnf in init script. - - -- Christian Hammers Tue, 27 Aug 2002 01:53:32 +0200 - -mysql-dfsg (3.23.51-4) unstable; urgency=low - - * Added a compressed "nm mysqld" output to allow people to trace - core dumps with /usr/bin/resolve_stack_dump as suggested in the - INSTALL-SOURCE file. Thanks to atudor@labs.agilent.com for the hint. - - -- Christian Hammers Wed, 24 Jul 2002 20:44:55 +0200 - -mysql-dfsg (3.23.51-3) unstable; urgency=low - - * Corrected copyright file: the MySQL client library is licenced under - the LGPL-2 not the GPL. From version 4.x it actually will be GPL this - is why parts of http://www.mysql.com/ already say so. Closes: #153591 - * Corrected german translation. - Thanks to Roland Rosenfeld . Closes: #151903 - - -- Christian Hammers Thu, 11 Jul 2002 20:32:28 +0200 - -mysql-dfsg (3.23.51-2) unstable; urgency=low - - * Improved NIS tolerance in preinst script. - - -- Christian Hammers Sun, 7 Jul 2002 04:43:28 +0200 - -mysql-dfsg (3.23.51-1) unstable; urgency=medium - - * New upstream version. - * I applied a patch that fixes a binary imcompatibility in - the shared libary libmysqlclient.so.10 between 3.23.50 and - some versions earlier. Upstream has been contacted and asked - for clarification. Closes: #149952 - * Added support for NIS i.e. it shows a warning and fails if the - needed 'mysql' user does not exists but works if it does. - Closes: #143282, #147869 - * Substituted $0 in init scripts by something really weird so that - "./S20mysql restart" works now, too. (BTW: S20? install file-rc!!!) - Closes: #148658 - * Now postinst works even if /etc/init.d/mysql is removed. Closes: #151021 - * Decided to leave "set +x" in postinst but wrote comment. Closes: #151022 - - -- Christian Hammers Sun, 7 Jul 2002 04:43:25 +0200 - -mysql-dfsg (3.23.50-1) unstable; urgency=medium - - * New upstream version. - Fixes a very annoying and important bug that lets all mysql programs - including perl scripts etc. segfault when using the read_default_group() - function. 3.23.50 is currently a pre-release and expected to be released - next week. I plan to propose it for woody as soon as its stability has - been proven. The following bug reports are all regarding this issue. - Closes: #144960, #145322, #136798, #138143, - - -- Christian Hammers Sat, 18 May 2002 21:14:01 +0200 - -mysql-dfsg (3.23.49x-1) unstable; urgency=low - - * I had to split the package to seperate the manual as it is not GPL - like the rest of the software and docs but under a license that - e.g. forbids selling printed versions. - . - The upstream authors were contacted a while ago but did not like to - change the situation. - . - The names of the resulting packages have not changed as the manual - already was in a seperate mysql-doc package due to it's size. - The source packages are now splitted from one "mysql" to - "mysql-dfsg" in main and "mysql-nonfree" in non-free. - * No code change! - The "x" at the end of the version number ist just to be able to - upload a new source package. ("a" was already taken by upstream - for their binary upload correction) - - -- Christian Hammers Wed, 8 May 2002 02:01:41 +0200 - -mysql (3.23.49-8) unstable; urgency=low - - * Substituted $0 in init script to let e.g. "/etc# ./init.d/mysql restart" - works, too. Closes: #141555 - - -- Christian Hammers Sun, 7 Apr 2002 15:00:44 +0200 - -mysql (3.23.49-7) unstable; urgency=low - - * The Makefiles are totally broken for the --enable-local-infile - option. I now patched libmysql/libmysql.c#mysql_init() manually. - Closes: #138347 - - -- Christian Hammers Fri, 29 Mar 2002 23:55:15 +0100 - -mysql (3.23.49-6) unstable; urgency=low - - * Moved mysqlcheck from server to client package. Closes: #139799 - * Added manpage for mysqlhotcopy. Regarding: #87097 - * Added 'sharedscripts' directive to the logrotate script. - * Replaced grep by /usr/bin/getent to let the group/user checking work - on NIS/LDAP systems, too. Closes: #115677, #101529 - - -- Christian Hammers Fri, 22 Mar 2002 22:40:51 +0100 - -mysql (3.23.49-5) unstable; urgency=low - - * Added skip-innodb to default my.cnf. - * Enabled --enable-local-infile, it seems to be a new option that - defaults to disable a formerly enabled feaure. Closes: #137115 - - -- Christian Hammers Sat, 16 Mar 2002 00:29:10 +0100 - -mysql (3.23.49-4) unstable; urgency=medium - - * Recompiled against fixed libz. - - * Enabled --enable-local-infile, it seems to be a new option that - defaults to disable a formerly enabled feaure. Closes: #137115 - * Fixed README.compile_on_potato. Closes: #136529 - * Now a ext3 .jounal file in /var/lib/mysql does not prevent the - installation (happens when creating a jounal on an already mounted - partition). Closes: #137146 - - -- Christian Hammers Wed, 13 Mar 2002 13:34:24 +0100 - -mysql (3.23.49-3) unstable; urgency=low - - * Added Russian translation. Closes: #135846 - * Fixed installation of .info documents. Closes: #135030 - - -- Christian Hammers Wed, 27 Feb 2002 23:36:35 +0100 - -mysql (3.23.49-2) unstable; urgency=low - - * Updated french translation and split template files. Closes: #134754 - * Fixed a small debian.cnf related bug in mysql-server.postinst. - - -- Christian Hammers Tue, 19 Feb 2002 23:13:58 +0100 - -mysql (3.23.49-1) unstable; urgency=low - - * New upstream release. - (Mainly InnoDB related fixes) - * Exported a $HOME variable in the scripts so that /root/.my.cnf - is not read anymore. This will avoid problems when admins put - only passwords but no usernames in this file. Closes: #132048 - * New debian-sys-maint password algorithm (now ~96bit :-)) Closes: #133863 - * Recreating debian-sys-main pwd on every install to help people who - accidently delete user or password files... - * Added /var/log/mysql so that user can put the binary logs in there as - mysql cannot write the .001 etc files itself in /var/log which is - owned by root. - - -- Christian Hammers Thu, 14 Feb 2002 22:17:45 +0100 - -mysql (3.23.47-6) unstable; urgency=low - - * Dropped a sentence about the new debian-sys-maint user in the - debconf note and updated the README.Debian. Related: #132048 - * Added more french translation. Closes: #132390 - - -- Christian Hammers Wed, 6 Feb 2002 09:41:29 +0100 - -mysql (3.23.47-5) unstable; urgency=low - - * Fixed grammar error in template. Closes: #132238 - * Really fixed typo in logrotate script. Closes: #131711 - - -- Christian Hammers Tue, 5 Feb 2002 14:20:08 +0100 - -mysql (3.23.47-4) unstable; urgency=medium - - * Fixes typo in postinst that let init script fail. Closes: #131743 - * Fixed bashism bug that failed on ash. Closes: #131697 - * Fixed typo in logrotate script. Closes: #131711 - - -- Christian Hammers Thu, 31 Jan 2002 23:58:46 +0100 - -mysql (3.23.47-3) unstable; urgency=low - - * Added new Debian specific mysql user called 'debian-sys-maint' which - is used for pinging the server status, flushing the logs or shutting - down the server in maintenance scripts. The credentials of this user - are stored in the UID0-only readable file /etc/mysql/debian.cnf. - Closes: #129887, #130326, #99274 - * Fixed unintended server startup at boottime. Closes: #122676, #130105 - * New upstream fixes command line parsing bug: Closes: #128473 - * Fixed manpage headers to let apropos work: Closes: #119122 - * Added "status" options for /etc/init.d/mysql. Closes: #129020 - - -- Christian Hammers Sun, 27 Jan 2002 19:46:11 +0100 - -mysql (3.23.47-2) unstable; urgency=low - - * Enhanced init scripts by using mysqladmin instead of kill $pid. - Thanks to Aaron Brick. - - -- Christian Hammers Fri, 18 Jan 2002 01:42:23 +0100 - -mysql (3.23.47-1) unstable; urgency=low - - * New upstream release. - * Updated brazilian translation of debconf descriptions. Closes: #123332 - - -- Christian Hammers Sun, 6 Jan 2002 21:11:17 +0100 - -mysql (3.23.46-3) unstable; urgency=low - - * Fixed bug in postinst where a script was accidently called with - "bash -c